api_classes library
Client-Server API
Input API
Classes like:
are used to convert server responses from Json strings to dart classes. Mostly freezed.
First httpProvider get data from server and store it into hive then it is converted to Json. Then it is converted to classes and assigned to providers of Worker.
Detailed API online at https://alexqwesa.fvds.ru:48080/docs
(usually it online from 02:00 to 16:00 GMT - didn't send it to cloud yet...) ,
test api-key is 3.015679841875732e17ef73dc17-7af8-11ec-b7f8-04d9f5c97b0c
Output API
The methods for output are:
- Journal.post is used to send /add requests to server(AddClientServiceRequest),
- Journal.delete is used to send /delete requests to server(DeleteClientServiceRequest),
- Journal.exportToFile is used to save list of ServiceOfJournal to a file .ais_json .
These methods use json format.
Http headers
{
"Content-type": "application/json",
"Accept": "application/json",
"api-key": "your real key will be here"
}
Storage API
Most data is stored in Hive Boxes. Http responses are stored as strings.
The settings and WorkerKeys are stored in SharedPreferences.
The ServiceOfJournals are stored in Hive as objects.
The ProofLists store files in filesystem.
Classes
- AddClientServiceRequest Client-Server API
- Create Json request to add a service.
- ClientEntry Client-Server API
- Immutable class to create ClientEntry from JSON strings.
- ClientPlan Client-Server API
- Immutable class to create ClientPlan from JSON strings.
- DeleteClientServiceRequest Client-Server API
- Create Json request to delete a service.
- ServiceEntry Client-Server API
- Immutable class to create ServiceEntry from JSON strings.
- ServiceOfJournal Client-Server API Journal
- This class is used to store one entry of Journal (one input service).
- ServiceOfJournalAdapter
- WorkerKey Client-Server API
- A class to import and store information about Worker, can import/export as JSON strings.
Functions
-
autoServiceOfJournal(
{required int servId, required int contractId, required int workerId, DateTime? provDate, ServiceState? state}) → ServiceOfJournal - Helper for ServiceOfJournal constructor.