You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.2 KiB
76 lines
2.2 KiB
import 'package:equatable/equatable.dart'; |
|
import 'package:problem_check_system/app/core/models/sync_status.dart'; |
|
|
|
/// `Enterprise` 实体,代表一个企业的核心业务对象。 |
|
/// 这是一个纯粹的、不可变的类,不包含任何与数据持久化相关的代码。 |
|
class Enterprise extends Equatable implements SyncableEntity { |
|
@override |
|
final String id; |
|
@override |
|
final SyncStatus syncStatus; |
|
@override |
|
final DateTime lastModifiedTime; |
|
@override |
|
final String lastModifierId; |
|
final String name; |
|
final String type; |
|
final String? address; |
|
final String? scale; |
|
final String? contactPerson; |
|
final String? contactPhone; |
|
final String? majorHazardsDescription; |
|
final String creatorId; |
|
final DateTime creationTime; |
|
|
|
const Enterprise({ |
|
required this.id, |
|
required this.name, |
|
required this.type, |
|
this.address, |
|
this.scale, |
|
this.contactPerson, |
|
this.contactPhone, |
|
this.majorHazardsDescription, |
|
required this.lastModifiedTime, |
|
required this.lastModifierId, |
|
required this.creationTime, |
|
required this.creatorId, |
|
required this.syncStatus, |
|
}); |
|
|
|
Enterprise copyWith({ |
|
String? id, |
|
SyncStatus? syncStatus, |
|
DateTime? lastModifiedTime, |
|
String? lastModifierId, |
|
String? name, |
|
String? type, |
|
String? address, |
|
String? scale, |
|
String? contactPerson, |
|
String? contactPhone, |
|
String? majorHazardsDescription, |
|
DateTime? creationTime, |
|
String? creatorId, |
|
}) { |
|
return Enterprise( |
|
id: id ?? this.id, |
|
syncStatus: syncStatus ?? this.syncStatus, |
|
lastModifiedTime: lastModifiedTime ?? this.lastModifiedTime, |
|
lastModifierId: lastModifierId ?? this.lastModifierId, |
|
name: name ?? this.name, |
|
type: type ?? this.type, |
|
address: address ?? this.address, |
|
scale: scale ?? this.scale, |
|
contactPerson: contactPerson ?? this.contactPerson, |
|
contactPhone: contactPhone ?? this.contactPhone, |
|
majorHazardsDescription: |
|
majorHazardsDescription ?? this.majorHazardsDescription, |
|
creationTime: creationTime ?? this.creationTime, |
|
creatorId: creatorId ?? this.creatorId, |
|
); |
|
} |
|
|
|
@override |
|
List<Object?> get props => [id, syncStatus, name, type]; |
|
}
|
|
|