BaseEntity constructor
BaseEntity({})
Implementation
BaseEntity(
{this.id,
required this.dirty,
this.created,
this.lastUpdated,
this.skipDateUpdate = false}) {
this.id = this.id ?? DhisUidGenerator.generate();
this.created = this.created ?? DateTime.now().toIso8601String();
this.lastUpdated = this.lastUpdated ?? this.created;
if (dirty &&
(skipDateUpdate == null || skipDateUpdate == false) &&
lastUpdated == null) {
this.lastUpdated = DateTime.now().toIso8601String();
}
}