ServiceOfJournal class Client-Server API Journal

This class is used to store one entry of Journal (one input service).

It should be initialized with state ServiceState.added, and with current date and unique uuid.

Journal send services in state ServiceState.added to DB, then move them (copyWith state ServiceState.finished or ServiceState.rejected ).

Services in state ServiceState.finished or ServiceState.outDated send to Hive Box HiveRepository.archiveHiveName on next day.

Usual life of ServiceOfJournal and it's states are:

Created Sent to DB Next day Deleted
added finished outDated and archived when archive is full
added rejected never archived deleted by user

ServiceOfJournal.toJson is used to export services into file .ais_json .

Inheritance
Annotations

Constructors

ServiceOfJournal({@HiveField(0) required int servId, @HiveField(1) required int contractId, @HiveField(2) required int workerId, @HiveField(3) required DateTime provDate, @HiveField(4) required String uid, @HiveField(5) @Default(ServiceState.added) ServiceState state, @HiveField(6) @Default('') String error})
Raw constructor, use convenient autoServiceOfJournal constructor.
factory
ServiceOfJournal.fromJson(Map<String, dynamic> json)
factory

Properties

box BoxBase?
Get the box in which this object is stored. Returns null if object has not been added to a box yet.
read-onlyinherited
contractId int
read-onlyinherited
copyWith → $ServiceOfJournalCopyWith<ServiceOfJournal>
read-onlyinherited
error String
read-onlyinherited
hashCode int
The hash code for this object.
read-onlyinherited
isInBox bool
Returns whether this object is currently stored in a box.
read-onlyinherited
key → dynamic
Get the key associated with this object. Returns null if object has not been added to a box yet.
read-onlyinherited
provDate DateTime
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
servId int
read-onlyinherited
state ServiceState
read-onlyinherited
uid String
read-onlyinherited
workerId int
read-onlyinherited

Methods

delete() Future<void>
Deletes this object from the box it is stored in.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save() Future<void>
Persists this object.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited