Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
api_endpoints.dart
Go to the documentation of this file.
1abstract class ApiEndpoints {
2 // static const hostname = "https://dev-api.aidra.tech";
3 static const hostname = "https://api-test.aidra.tech";
4 //static const hostname = "https://demo-api.aidra.tech";
5 static const pathAlias = "/driver";
6 static const loginurl = '$hostname/authentification/auth/login';
7 static String userInfo({required int userId}) => '$hostname/authentification/userDetails/$userId';
8 static const videoUrl = '$hostname/collection/videoUrl';
9 static const sendGeoLocation = '$hostname/operation/createDriverLocalisation';
10 static const createRouting = '$hostname/operation/createRoutingDriver';
11 static const validateSchedulerDriver = '$hostname/operation/validateSchedulerDriver';
12 static String getScheduleStatus({required int driverId, required String date}) => '$hostname/operation/statusScheduleForDriver?driverId=$driverId&date=$date';
13 static const updateCollectionStatus = 'updateCollectionStatus';
14 static const getCollectionCancelationReasons = 'listCancelationReason';
15
16 static String getCollections({
17 required int userId,
18 required bool notForToday,
19 required String? type,
20 }) => 'readCollection?userId=$userId&notForToday=$notForToday&type=$type';
21
22 static String getWeeklyCollectionsUrl({
23 required int userId,
24 }) => '$hostname/partner/listCollectionPointsByDriver?driverId=$userId';
25
26 static String getHistoryCollections({
27 required int userId,
29 DateTime? dateStart,
30 DateTime? dateEnd,
31 }) {
32 if (dateStart != null && dateEnd != null) {
33 return 'historyCollection?userId=$userId&dateDebut=${_formatDateTime(dateStart)}&dateFin=${_formatDateTime(dateEnd)}';
34 }
35 return 'historyCollection?userId=$userId${period != null ? '&period=$period' : ''}';
36 }
37
38 static const sendCollectionsInformation = 'confirmCollection';
39 static const validateCollection = 'validateCollection';
40 static const sendCollectionConfirmation = "paymentCollection";
41 static const sendCollectionPayment = "doneCollection";
42 static const sendCollectionRating = "collectionNotation";
43 static const ratingReasons = 'listCollectionReason';
44 static const sendUnloading = 'deliveryCollection';
45
46 static String _formatDateTime(DateTime date) {
47 return '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}T00:00:00';
48 }
49
50 static String getNotifications({required String userId}) => 'notification/$userId';
51 static String getCollectionContactList({required int restaurentId}) => 'listContact/$restaurentId';
52 static String getCollectionPaymentModeList({required int restaurentId}) => 'listMeanOfPayment/$restaurentId';
53 static String buildUrl(String path) => '$hostname$pathAlias/$path';
54 static String getCollectionStatistics({required int userId, required String period}) => '/dashboardDriver?userId=$userId&period=$period';
55
56 static String getPendingUnloading({required int userId}) => 'listUnloadedCollection/$userId';
57 static String getHistoryUnloading({required int userId}) => 'listDeliveryCollection/$userId';
58 static String getWarehouseResponsible({required int userId}) => 'listWarehouseResponsible/$userId';
59
60 static String getAvailableVehicles({required int userId}) => 'listAvailableVehicles/$userId';
61 static const sendVehicleCheck = 'fleetAssignmentVehicle';
62 static String getCheckInStatus({required int userId}) => 'checkVehicleDriver/$userId';
63
64 static String getManifestDocument({required String reference}) => '$hostname/document/EManifestDocument/$reference';
65 static String getCollectionVoucherDocument({required String reference}) => '$hostname/document/collectionDocument/$reference';
66
67 static const createDriverCollection = '$hostname/collection/createDriverCollection';
68 static String getCollectionsToSchedule({
69 required String startDate,
70 required String endDate,
71 required int driverId,
72 }) => '$hostname/collection/listCollectionToSchedule?startDate=$startDate&endDate=$endDate&driverId=$driverId';
73}
sealed class CheckInOutEvent extends Equatable userId
final String type
final bool notForToday
class GetCollectionContactListEvent extends CollectionsInformationEvent restaurentId
final String startDate
final String endDate
final String path
class Partner String
final String date
abstract class PeriodEvent extends Equatable period