@fatehan/tsrp 1.6.76 → 1.6.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4217 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v7.34.1
5
+ // source: devices/fleet.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import Long from "long";
9
+ import { Timestamp } from "../google/protobuf/timestamp";
10
+ export const protobufPackage = "com.fatehan.devices";
11
+ export var FleetDocumentType;
12
+ (function (FleetDocumentType) {
13
+ FleetDocumentType[FleetDocumentType["DOCUMENT_OTHER"] = 0] = "DOCUMENT_OTHER";
14
+ FleetDocumentType[FleetDocumentType["RECEIPT"] = 1] = "RECEIPT";
15
+ FleetDocumentType[FleetDocumentType["PHOTO"] = 2] = "PHOTO";
16
+ FleetDocumentType[FleetDocumentType["INSPECTION_REPORT"] = 3] = "INSPECTION_REPORT";
17
+ FleetDocumentType[FleetDocumentType["SIGNATURE"] = 4] = "SIGNATURE";
18
+ FleetDocumentType[FleetDocumentType["INSURANCE_THIRD_PARTY"] = 5] = "INSURANCE_THIRD_PARTY";
19
+ FleetDocumentType[FleetDocumentType["INSURANCE_BODY"] = 6] = "INSURANCE_BODY";
20
+ FleetDocumentType[FleetDocumentType["VEHICLE_CARD"] = 7] = "VEHICLE_CARD";
21
+ FleetDocumentType[FleetDocumentType["TECHNICAL_INSPECTION"] = 8] = "TECHNICAL_INSPECTION";
22
+ FleetDocumentType[FleetDocumentType["DRIVING_LICENCE"] = 9] = "DRIVING_LICENCE";
23
+ FleetDocumentType[FleetDocumentType["SERVICE_INVOICE"] = 10] = "SERVICE_INVOICE";
24
+ FleetDocumentType[FleetDocumentType["FINE_NOTICE"] = 11] = "FINE_NOTICE";
25
+ FleetDocumentType[FleetDocumentType["OWNERSHIP_DOCUMENT"] = 12] = "OWNERSHIP_DOCUMENT";
26
+ FleetDocumentType[FleetDocumentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
+ })(FleetDocumentType || (FleetDocumentType = {}));
28
+ export var FleetSubjectType;
29
+ (function (FleetSubjectType) {
30
+ FleetSubjectType[FleetSubjectType["SUBJECT_NONE"] = 0] = "SUBJECT_NONE";
31
+ FleetSubjectType[FleetSubjectType["SUBJECT_DEVICE"] = 1] = "SUBJECT_DEVICE";
32
+ FleetSubjectType[FleetSubjectType["SUBJECT_CAR"] = 2] = "SUBJECT_CAR";
33
+ FleetSubjectType[FleetSubjectType["SUBJECT_DRIVER"] = 3] = "SUBJECT_DRIVER";
34
+ FleetSubjectType[FleetSubjectType["SUBJECT_VENDOR"] = 4] = "SUBJECT_VENDOR";
35
+ FleetSubjectType[FleetSubjectType["SUBJECT_EXPENSE"] = 5] = "SUBJECT_EXPENSE";
36
+ FleetSubjectType[FleetSubjectType["SUBJECT_ISSUE"] = 6] = "SUBJECT_ISSUE";
37
+ FleetSubjectType[FleetSubjectType["SUBJECT_MAINTENANCE"] = 7] = "SUBJECT_MAINTENANCE";
38
+ FleetSubjectType[FleetSubjectType["SUBJECT_INSPECTION"] = 8] = "SUBJECT_INSPECTION";
39
+ FleetSubjectType[FleetSubjectType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
40
+ })(FleetSubjectType || (FleetSubjectType = {}));
41
+ export var Expense_Type;
42
+ (function (Expense_Type) {
43
+ Expense_Type[Expense_Type["OTHER"] = 0] = "OTHER";
44
+ Expense_Type[Expense_Type["FUEL"] = 1] = "FUEL";
45
+ Expense_Type[Expense_Type["SERVICE"] = 2] = "SERVICE";
46
+ Expense_Type[Expense_Type["PARTS"] = 3] = "PARTS";
47
+ Expense_Type[Expense_Type["TOLL"] = 4] = "TOLL";
48
+ Expense_Type[Expense_Type["PARKING"] = 5] = "PARKING";
49
+ Expense_Type[Expense_Type["FINE"] = 6] = "FINE";
50
+ Expense_Type[Expense_Type["WASH"] = 7] = "WASH";
51
+ Expense_Type[Expense_Type["INSURANCE"] = 8] = "INSURANCE";
52
+ Expense_Type[Expense_Type["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
53
+ })(Expense_Type || (Expense_Type = {}));
54
+ export var Expense_Status;
55
+ (function (Expense_Status) {
56
+ Expense_Status[Expense_Status["DRAFT"] = 0] = "DRAFT";
57
+ Expense_Status[Expense_Status["SUBMITTED"] = 1] = "SUBMITTED";
58
+ Expense_Status[Expense_Status["RETURNED"] = 2] = "RETURNED";
59
+ Expense_Status[Expense_Status["APPROVED"] = 3] = "APPROVED";
60
+ Expense_Status[Expense_Status["REJECTED"] = 4] = "REJECTED";
61
+ Expense_Status[Expense_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
62
+ })(Expense_Status || (Expense_Status = {}));
63
+ export var Expense_Flag;
64
+ (function (Expense_Flag) {
65
+ Expense_Flag[Expense_Flag["FLAG_NONE"] = 0] = "FLAG_NONE";
66
+ Expense_Flag[Expense_Flag["LITRES_OVER_TANK"] = 1] = "LITRES_OVER_TANK";
67
+ Expense_Flag[Expense_Flag["FUEL_SENSOR_MISMATCH"] = 2] = "FUEL_SENSOR_MISMATCH";
68
+ Expense_Flag[Expense_Flag["UNIT_PRICE_HIGH"] = 3] = "UNIT_PRICE_HIGH";
69
+ Expense_Flag[Expense_Flag["OUTSIDE_VENDOR_RADIUS"] = 4] = "OUTSIDE_VENDOR_RADIUS";
70
+ Expense_Flag[Expense_Flag["POSSIBLE_DUPLICATE"] = 5] = "POSSIBLE_DUPLICATE";
71
+ Expense_Flag[Expense_Flag["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
72
+ })(Expense_Flag || (Expense_Flag = {}));
73
+ export var ExpenseExport_Format;
74
+ (function (ExpenseExport_Format) {
75
+ ExpenseExport_Format[ExpenseExport_Format["EXCEL"] = 0] = "EXCEL";
76
+ ExpenseExport_Format[ExpenseExport_Format["PDF"] = 1] = "PDF";
77
+ ExpenseExport_Format[ExpenseExport_Format["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
78
+ })(ExpenseExport_Format || (ExpenseExport_Format = {}));
79
+ export var ExpenseExport_Status;
80
+ (function (ExpenseExport_Status) {
81
+ ExpenseExport_Status[ExpenseExport_Status["QUEUED"] = 0] = "QUEUED";
82
+ ExpenseExport_Status[ExpenseExport_Status["RUNNING"] = 1] = "RUNNING";
83
+ ExpenseExport_Status[ExpenseExport_Status["READY"] = 2] = "READY";
84
+ ExpenseExport_Status[ExpenseExport_Status["FAILED"] = 3] = "FAILED";
85
+ ExpenseExport_Status[ExpenseExport_Status["EXPIRED"] = 4] = "EXPIRED";
86
+ ExpenseExport_Status[ExpenseExport_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
87
+ })(ExpenseExport_Status || (ExpenseExport_Status = {}));
88
+ export var Issue_Status;
89
+ (function (Issue_Status) {
90
+ Issue_Status[Issue_Status["PENDING"] = 0] = "PENDING";
91
+ Issue_Status[Issue_Status["ACCEPTED"] = 1] = "ACCEPTED";
92
+ Issue_Status[Issue_Status["REJECTED"] = 2] = "REJECTED";
93
+ Issue_Status[Issue_Status["RESOLVED"] = 3] = "RESOLVED";
94
+ Issue_Status[Issue_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
95
+ })(Issue_Status || (Issue_Status = {}));
96
+ export var Issue_Priority;
97
+ (function (Issue_Priority) {
98
+ Issue_Priority[Issue_Priority["LOW"] = 0] = "LOW";
99
+ Issue_Priority[Issue_Priority["MEDIUM"] = 1] = "MEDIUM";
100
+ Issue_Priority[Issue_Priority["HIGH"] = 2] = "HIGH";
101
+ Issue_Priority[Issue_Priority["CRITICAL"] = 3] = "CRITICAL";
102
+ Issue_Priority[Issue_Priority["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
103
+ })(Issue_Priority || (Issue_Priority = {}));
104
+ export var Issue_Source;
105
+ (function (Issue_Source) {
106
+ Issue_Source[Issue_Source["DRIVER"] = 0] = "DRIVER";
107
+ Issue_Source[Issue_Source["ADMIN"] = 1] = "ADMIN";
108
+ Issue_Source[Issue_Source["INSPECTION"] = 2] = "INSPECTION";
109
+ Issue_Source[Issue_Source["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
110
+ })(Issue_Source || (Issue_Source = {}));
111
+ export var InspectionTemplate_Schedule;
112
+ (function (InspectionTemplate_Schedule) {
113
+ InspectionTemplate_Schedule[InspectionTemplate_Schedule["MANUAL"] = 0] = "MANUAL";
114
+ InspectionTemplate_Schedule[InspectionTemplate_Schedule["FIRST_IGNITION_OF_DAY"] = 1] = "FIRST_IGNITION_OF_DAY";
115
+ InspectionTemplate_Schedule[InspectionTemplate_Schedule["EVERY_TRIP"] = 2] = "EVERY_TRIP";
116
+ InspectionTemplate_Schedule[InspectionTemplate_Schedule["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
117
+ })(InspectionTemplate_Schedule || (InspectionTemplate_Schedule = {}));
118
+ export var InspectionTemplate_Item_AnswerType;
119
+ (function (InspectionTemplate_Item_AnswerType) {
120
+ InspectionTemplate_Item_AnswerType[InspectionTemplate_Item_AnswerType["PASS_FAIL"] = 0] = "PASS_FAIL";
121
+ InspectionTemplate_Item_AnswerType[InspectionTemplate_Item_AnswerType["LEVEL"] = 1] = "LEVEL";
122
+ InspectionTemplate_Item_AnswerType[InspectionTemplate_Item_AnswerType["NUMBER"] = 2] = "NUMBER";
123
+ InspectionTemplate_Item_AnswerType[InspectionTemplate_Item_AnswerType["SIGNATURE"] = 3] = "SIGNATURE";
124
+ InspectionTemplate_Item_AnswerType[InspectionTemplate_Item_AnswerType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
125
+ })(InspectionTemplate_Item_AnswerType || (InspectionTemplate_Item_AnswerType = {}));
126
+ export var Inspection_Status;
127
+ (function (Inspection_Status) {
128
+ Inspection_Status[Inspection_Status["SUBMITTED"] = 0] = "SUBMITTED";
129
+ Inspection_Status[Inspection_Status["REVIEWED"] = 1] = "REVIEWED";
130
+ Inspection_Status[Inspection_Status["MISSED"] = 2] = "MISSED";
131
+ Inspection_Status[Inspection_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
132
+ })(Inspection_Status || (Inspection_Status = {}));
133
+ export var Inspection_Answer_Result;
134
+ (function (Inspection_Answer_Result) {
135
+ Inspection_Answer_Result[Inspection_Answer_Result["PASS"] = 0] = "PASS";
136
+ Inspection_Answer_Result[Inspection_Answer_Result["FAIL"] = 1] = "FAIL";
137
+ Inspection_Answer_Result[Inspection_Answer_Result["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
138
+ })(Inspection_Answer_Result || (Inspection_Answer_Result = {}));
139
+ export var OutOfService_Reason;
140
+ (function (OutOfService_Reason) {
141
+ OutOfService_Reason[OutOfService_Reason["MANUAL"] = 0] = "MANUAL";
142
+ OutOfService_Reason[OutOfService_Reason["ISSUE"] = 1] = "ISSUE";
143
+ OutOfService_Reason[OutOfService_Reason["INSPECTION"] = 2] = "INSPECTION";
144
+ OutOfService_Reason[OutOfService_Reason["SERVICE"] = 3] = "SERVICE";
145
+ OutOfService_Reason[OutOfService_Reason["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
146
+ })(OutOfService_Reason || (OutOfService_Reason = {}));
147
+ export var OutOfService_Status;
148
+ (function (OutOfService_Status) {
149
+ OutOfService_Status[OutOfService_Status["ACTIVE"] = 0] = "ACTIVE";
150
+ OutOfService_Status[OutOfService_Status["ENDED"] = 1] = "ENDED";
151
+ OutOfService_Status[OutOfService_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
152
+ })(OutOfService_Status || (OutOfService_Status = {}));
153
+ export var FleetDocument_Status;
154
+ (function (FleetDocument_Status) {
155
+ FleetDocument_Status[FleetDocument_Status["VALID"] = 0] = "VALID";
156
+ FleetDocument_Status[FleetDocument_Status["EXPIRING"] = 1] = "EXPIRING";
157
+ FleetDocument_Status[FleetDocument_Status["EXPIRED"] = 2] = "EXPIRED";
158
+ FleetDocument_Status[FleetDocument_Status["ARCHIVED"] = 3] = "ARCHIVED";
159
+ FleetDocument_Status[FleetDocument_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
160
+ })(FleetDocument_Status || (FleetDocument_Status = {}));
161
+ export var FleetDocument_Review;
162
+ (function (FleetDocument_Review) {
163
+ FleetDocument_Review[FleetDocument_Review["REVIEW_APPROVED"] = 0] = "REVIEW_APPROVED";
164
+ FleetDocument_Review[FleetDocument_Review["REVIEW_PENDING"] = 1] = "REVIEW_PENDING";
165
+ FleetDocument_Review[FleetDocument_Review["REVIEW_REJECTED"] = 2] = "REVIEW_REJECTED";
166
+ FleetDocument_Review[FleetDocument_Review["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
167
+ })(FleetDocument_Review || (FleetDocument_Review = {}));
168
+ export var DocumentRequirement_AppliesTo;
169
+ (function (DocumentRequirement_AppliesTo) {
170
+ DocumentRequirement_AppliesTo[DocumentRequirement_AppliesTo["VEHICLE"] = 0] = "VEHICLE";
171
+ DocumentRequirement_AppliesTo[DocumentRequirement_AppliesTo["DRIVER"] = 1] = "DRIVER";
172
+ DocumentRequirement_AppliesTo[DocumentRequirement_AppliesTo["DEVICE"] = 2] = "DEVICE";
173
+ DocumentRequirement_AppliesTo[DocumentRequirement_AppliesTo["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
174
+ })(DocumentRequirement_AppliesTo || (DocumentRequirement_AppliesTo = {}));
175
+ export var DocumentRequirement_Condition;
176
+ (function (DocumentRequirement_Condition) {
177
+ DocumentRequirement_Condition[DocumentRequirement_Condition["ALL"] = 0] = "ALL";
178
+ DocumentRequirement_Condition[DocumentRequirement_Condition["GROUP"] = 1] = "GROUP";
179
+ DocumentRequirement_Condition[DocumentRequirement_Condition["CAR_TYPE"] = 2] = "CAR_TYPE";
180
+ DocumentRequirement_Condition[DocumentRequirement_Condition["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
181
+ })(DocumentRequirement_Condition || (DocumentRequirement_Condition = {}));
182
+ export var DocumentRequirement_State;
183
+ (function (DocumentRequirement_State) {
184
+ DocumentRequirement_State[DocumentRequirement_State["MET"] = 0] = "MET";
185
+ DocumentRequirement_State[DocumentRequirement_State["MISSING"] = 1] = "MISSING";
186
+ DocumentRequirement_State[DocumentRequirement_State["DUE_SOON"] = 2] = "DUE_SOON";
187
+ DocumentRequirement_State[DocumentRequirement_State["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
188
+ })(DocumentRequirement_State || (DocumentRequirement_State = {}));
189
+ export var FleetInboxItem_Kind;
190
+ (function (FleetInboxItem_Kind) {
191
+ FleetInboxItem_Kind[FleetInboxItem_Kind["KIND_NONE"] = 0] = "KIND_NONE";
192
+ FleetInboxItem_Kind[FleetInboxItem_Kind["REVIEW_EXPENSE"] = 1] = "REVIEW_EXPENSE";
193
+ FleetInboxItem_Kind[FleetInboxItem_Kind["FIX_EXPENSE"] = 2] = "FIX_EXPENSE";
194
+ FleetInboxItem_Kind[FleetInboxItem_Kind["REVIEW_SERVICE"] = 3] = "REVIEW_SERVICE";
195
+ FleetInboxItem_Kind[FleetInboxItem_Kind["REVIEW_ISSUE"] = 4] = "REVIEW_ISSUE";
196
+ FleetInboxItem_Kind[FleetInboxItem_Kind["SERVICE_DUE"] = 5] = "SERVICE_DUE";
197
+ FleetInboxItem_Kind[FleetInboxItem_Kind["INSPECTION_DUE"] = 6] = "INSPECTION_DUE";
198
+ FleetInboxItem_Kind[FleetInboxItem_Kind["RENEW_DOCUMENT"] = 7] = "RENEW_DOCUMENT";
199
+ FleetInboxItem_Kind[FleetInboxItem_Kind["MISSING_DOCUMENT"] = 8] = "MISSING_DOCUMENT";
200
+ FleetInboxItem_Kind[FleetInboxItem_Kind["VEHICLE_OUT"] = 9] = "VEHICLE_OUT";
201
+ FleetInboxItem_Kind[FleetInboxItem_Kind["REVIEW_DOCUMENT"] = 10] = "REVIEW_DOCUMENT";
202
+ FleetInboxItem_Kind[FleetInboxItem_Kind["MISSED_INSPECTION"] = 11] = "MISSED_INSPECTION";
203
+ FleetInboxItem_Kind[FleetInboxItem_Kind["REVIEW_INSPECTION"] = 12] = "REVIEW_INSPECTION";
204
+ FleetInboxItem_Kind[FleetInboxItem_Kind["RECALIBRATE_ODOMETER"] = 13] = "RECALIBRATE_ODOMETER";
205
+ FleetInboxItem_Kind[FleetInboxItem_Kind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
206
+ })(FleetInboxItem_Kind || (FleetInboxItem_Kind = {}));
207
+ function createBaseFleetSettings() {
208
+ return {
209
+ fuelSensorGapPercent: 0,
210
+ unitPriceGapPercent: 0,
211
+ unitPriceWindowDays: 0,
212
+ duplicateWindowMinutes: 0,
213
+ odometerRecalibrationDays: 0,
214
+ visitMinStayMinutes: 0,
215
+ documentRemindDays: 0,
216
+ exportTtlDays: 0,
217
+ annualKmEstimate: 0,
218
+ };
219
+ }
220
+ export const FleetSettings = {
221
+ encode(message, writer = new BinaryWriter()) {
222
+ if (message.fuelSensorGapPercent !== 0) {
223
+ writer.uint32(8).uint32(message.fuelSensorGapPercent);
224
+ }
225
+ if (message.unitPriceGapPercent !== 0) {
226
+ writer.uint32(16).uint32(message.unitPriceGapPercent);
227
+ }
228
+ if (message.unitPriceWindowDays !== 0) {
229
+ writer.uint32(24).uint32(message.unitPriceWindowDays);
230
+ }
231
+ if (message.duplicateWindowMinutes !== 0) {
232
+ writer.uint32(32).uint32(message.duplicateWindowMinutes);
233
+ }
234
+ if (message.odometerRecalibrationDays !== 0) {
235
+ writer.uint32(40).uint32(message.odometerRecalibrationDays);
236
+ }
237
+ if (message.visitMinStayMinutes !== 0) {
238
+ writer.uint32(48).uint32(message.visitMinStayMinutes);
239
+ }
240
+ if (message.documentRemindDays !== 0) {
241
+ writer.uint32(56).uint32(message.documentRemindDays);
242
+ }
243
+ if (message.exportTtlDays !== 0) {
244
+ writer.uint32(64).uint32(message.exportTtlDays);
245
+ }
246
+ if (message.annualKmEstimate !== 0) {
247
+ writer.uint32(72).uint32(message.annualKmEstimate);
248
+ }
249
+ return writer;
250
+ },
251
+ decode(input, length) {
252
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
253
+ const end = length === undefined ? reader.len : reader.pos + length;
254
+ const message = createBaseFleetSettings();
255
+ while (reader.pos < end) {
256
+ const tag = reader.uint32();
257
+ switch (tag >>> 3) {
258
+ case 1: {
259
+ if (tag !== 8) {
260
+ break;
261
+ }
262
+ message.fuelSensorGapPercent = reader.uint32();
263
+ continue;
264
+ }
265
+ case 2: {
266
+ if (tag !== 16) {
267
+ break;
268
+ }
269
+ message.unitPriceGapPercent = reader.uint32();
270
+ continue;
271
+ }
272
+ case 3: {
273
+ if (tag !== 24) {
274
+ break;
275
+ }
276
+ message.unitPriceWindowDays = reader.uint32();
277
+ continue;
278
+ }
279
+ case 4: {
280
+ if (tag !== 32) {
281
+ break;
282
+ }
283
+ message.duplicateWindowMinutes = reader.uint32();
284
+ continue;
285
+ }
286
+ case 5: {
287
+ if (tag !== 40) {
288
+ break;
289
+ }
290
+ message.odometerRecalibrationDays = reader.uint32();
291
+ continue;
292
+ }
293
+ case 6: {
294
+ if (tag !== 48) {
295
+ break;
296
+ }
297
+ message.visitMinStayMinutes = reader.uint32();
298
+ continue;
299
+ }
300
+ case 7: {
301
+ if (tag !== 56) {
302
+ break;
303
+ }
304
+ message.documentRemindDays = reader.uint32();
305
+ continue;
306
+ }
307
+ case 8: {
308
+ if (tag !== 64) {
309
+ break;
310
+ }
311
+ message.exportTtlDays = reader.uint32();
312
+ continue;
313
+ }
314
+ case 9: {
315
+ if (tag !== 72) {
316
+ break;
317
+ }
318
+ message.annualKmEstimate = reader.uint32();
319
+ continue;
320
+ }
321
+ }
322
+ if ((tag & 7) === 4 || tag === 0) {
323
+ break;
324
+ }
325
+ reader.skip(tag & 7);
326
+ }
327
+ return message;
328
+ },
329
+ create(base) {
330
+ return FleetSettings.fromPartial(base ?? {});
331
+ },
332
+ fromPartial(object) {
333
+ const message = createBaseFleetSettings();
334
+ message.fuelSensorGapPercent = object.fuelSensorGapPercent ?? 0;
335
+ message.unitPriceGapPercent = object.unitPriceGapPercent ?? 0;
336
+ message.unitPriceWindowDays = object.unitPriceWindowDays ?? 0;
337
+ message.duplicateWindowMinutes = object.duplicateWindowMinutes ?? 0;
338
+ message.odometerRecalibrationDays = object.odometerRecalibrationDays ?? 0;
339
+ message.visitMinStayMinutes = object.visitMinStayMinutes ?? 0;
340
+ message.documentRemindDays = object.documentRemindDays ?? 0;
341
+ message.exportTtlDays = object.exportTtlDays ?? 0;
342
+ message.annualKmEstimate = object.annualKmEstimate ?? 0;
343
+ return message;
344
+ },
345
+ };
346
+ function createBaseOdometerOffset() {
347
+ return {
348
+ id: Long.UZERO,
349
+ deviceId: Long.UZERO,
350
+ organizationId: Long.UZERO,
351
+ offset: Long.ZERO,
352
+ effectiveFrom: undefined,
353
+ deviceOdometer: undefined,
354
+ realOdometer: undefined,
355
+ note: undefined,
356
+ createdBy: undefined,
357
+ createdAt: undefined,
358
+ updatedAt: undefined,
359
+ };
360
+ }
361
+ export const OdometerOffset = {
362
+ encode(message, writer = new BinaryWriter()) {
363
+ if (!message.id.equals(Long.UZERO)) {
364
+ writer.uint32(8).uint64(message.id.toString());
365
+ }
366
+ if (!message.deviceId.equals(Long.UZERO)) {
367
+ writer.uint32(16).uint64(message.deviceId.toString());
368
+ }
369
+ if (!message.organizationId.equals(Long.UZERO)) {
370
+ writer.uint32(24).uint64(message.organizationId.toString());
371
+ }
372
+ if (!message.offset.equals(Long.ZERO)) {
373
+ writer.uint32(32).int64(message.offset.toString());
374
+ }
375
+ if (message.effectiveFrom !== undefined) {
376
+ Timestamp.encode(toTimestamp(message.effectiveFrom), writer.uint32(42).fork()).join();
377
+ }
378
+ if (message.deviceOdometer !== undefined) {
379
+ writer.uint32(48).uint64(message.deviceOdometer.toString());
380
+ }
381
+ if (message.realOdometer !== undefined) {
382
+ writer.uint32(56).uint64(message.realOdometer.toString());
383
+ }
384
+ if (message.note !== undefined) {
385
+ writer.uint32(66).string(message.note);
386
+ }
387
+ if (message.createdBy !== undefined) {
388
+ writer.uint32(72).uint64(message.createdBy.toString());
389
+ }
390
+ if (message.createdAt !== undefined) {
391
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
392
+ }
393
+ if (message.updatedAt !== undefined) {
394
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
395
+ }
396
+ return writer;
397
+ },
398
+ decode(input, length) {
399
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
400
+ const end = length === undefined ? reader.len : reader.pos + length;
401
+ const message = createBaseOdometerOffset();
402
+ while (reader.pos < end) {
403
+ const tag = reader.uint32();
404
+ switch (tag >>> 3) {
405
+ case 1: {
406
+ if (tag !== 8) {
407
+ break;
408
+ }
409
+ message.id = Long.fromString(reader.uint64().toString(), true);
410
+ continue;
411
+ }
412
+ case 2: {
413
+ if (tag !== 16) {
414
+ break;
415
+ }
416
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
417
+ continue;
418
+ }
419
+ case 3: {
420
+ if (tag !== 24) {
421
+ break;
422
+ }
423
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
424
+ continue;
425
+ }
426
+ case 4: {
427
+ if (tag !== 32) {
428
+ break;
429
+ }
430
+ message.offset = Long.fromString(reader.int64().toString());
431
+ continue;
432
+ }
433
+ case 5: {
434
+ if (tag !== 42) {
435
+ break;
436
+ }
437
+ message.effectiveFrom = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
438
+ continue;
439
+ }
440
+ case 6: {
441
+ if (tag !== 48) {
442
+ break;
443
+ }
444
+ message.deviceOdometer = Long.fromString(reader.uint64().toString(), true);
445
+ continue;
446
+ }
447
+ case 7: {
448
+ if (tag !== 56) {
449
+ break;
450
+ }
451
+ message.realOdometer = Long.fromString(reader.uint64().toString(), true);
452
+ continue;
453
+ }
454
+ case 8: {
455
+ if (tag !== 66) {
456
+ break;
457
+ }
458
+ message.note = reader.string();
459
+ continue;
460
+ }
461
+ case 9: {
462
+ if (tag !== 72) {
463
+ break;
464
+ }
465
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
466
+ continue;
467
+ }
468
+ case 10: {
469
+ if (tag !== 82) {
470
+ break;
471
+ }
472
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
473
+ continue;
474
+ }
475
+ case 11: {
476
+ if (tag !== 90) {
477
+ break;
478
+ }
479
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
480
+ continue;
481
+ }
482
+ }
483
+ if ((tag & 7) === 4 || tag === 0) {
484
+ break;
485
+ }
486
+ reader.skip(tag & 7);
487
+ }
488
+ return message;
489
+ },
490
+ create(base) {
491
+ return OdometerOffset.fromPartial(base ?? {});
492
+ },
493
+ fromPartial(object) {
494
+ const message = createBaseOdometerOffset();
495
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
496
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
497
+ ? Long.fromValue(object.deviceId)
498
+ : Long.UZERO;
499
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
500
+ ? Long.fromValue(object.organizationId)
501
+ : Long.UZERO;
502
+ message.offset = (object.offset !== undefined && object.offset !== null)
503
+ ? Long.fromValue(object.offset)
504
+ : Long.ZERO;
505
+ message.effectiveFrom = object.effectiveFrom ?? undefined;
506
+ message.deviceOdometer = (object.deviceOdometer !== undefined && object.deviceOdometer !== null)
507
+ ? Long.fromValue(object.deviceOdometer)
508
+ : undefined;
509
+ message.realOdometer = (object.realOdometer !== undefined && object.realOdometer !== null)
510
+ ? Long.fromValue(object.realOdometer)
511
+ : undefined;
512
+ message.note = object.note ?? undefined;
513
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
514
+ ? Long.fromValue(object.createdBy)
515
+ : undefined;
516
+ message.createdAt = object.createdAt ?? undefined;
517
+ message.updatedAt = object.updatedAt ?? undefined;
518
+ return message;
519
+ },
520
+ };
521
+ function createBaseVendorCategory() {
522
+ return {
523
+ id: Long.UZERO,
524
+ organizationId: Long.UZERO,
525
+ name: "",
526
+ sort: 0,
527
+ vendorsCount: undefined,
528
+ createdAt: undefined,
529
+ updatedAt: undefined,
530
+ };
531
+ }
532
+ export const VendorCategory = {
533
+ encode(message, writer = new BinaryWriter()) {
534
+ if (!message.id.equals(Long.UZERO)) {
535
+ writer.uint32(8).uint64(message.id.toString());
536
+ }
537
+ if (!message.organizationId.equals(Long.UZERO)) {
538
+ writer.uint32(16).uint64(message.organizationId.toString());
539
+ }
540
+ if (message.name !== "") {
541
+ writer.uint32(26).string(message.name);
542
+ }
543
+ if (message.sort !== 0) {
544
+ writer.uint32(32).int32(message.sort);
545
+ }
546
+ if (message.vendorsCount !== undefined) {
547
+ writer.uint32(40).uint32(message.vendorsCount);
548
+ }
549
+ if (message.createdAt !== undefined) {
550
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).join();
551
+ }
552
+ if (message.updatedAt !== undefined) {
553
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(58).fork()).join();
554
+ }
555
+ return writer;
556
+ },
557
+ decode(input, length) {
558
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
559
+ const end = length === undefined ? reader.len : reader.pos + length;
560
+ const message = createBaseVendorCategory();
561
+ while (reader.pos < end) {
562
+ const tag = reader.uint32();
563
+ switch (tag >>> 3) {
564
+ case 1: {
565
+ if (tag !== 8) {
566
+ break;
567
+ }
568
+ message.id = Long.fromString(reader.uint64().toString(), true);
569
+ continue;
570
+ }
571
+ case 2: {
572
+ if (tag !== 16) {
573
+ break;
574
+ }
575
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
576
+ continue;
577
+ }
578
+ case 3: {
579
+ if (tag !== 26) {
580
+ break;
581
+ }
582
+ message.name = reader.string();
583
+ continue;
584
+ }
585
+ case 4: {
586
+ if (tag !== 32) {
587
+ break;
588
+ }
589
+ message.sort = reader.int32();
590
+ continue;
591
+ }
592
+ case 5: {
593
+ if (tag !== 40) {
594
+ break;
595
+ }
596
+ message.vendorsCount = reader.uint32();
597
+ continue;
598
+ }
599
+ case 6: {
600
+ if (tag !== 50) {
601
+ break;
602
+ }
603
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
604
+ continue;
605
+ }
606
+ case 7: {
607
+ if (tag !== 58) {
608
+ break;
609
+ }
610
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
611
+ continue;
612
+ }
613
+ }
614
+ if ((tag & 7) === 4 || tag === 0) {
615
+ break;
616
+ }
617
+ reader.skip(tag & 7);
618
+ }
619
+ return message;
620
+ },
621
+ create(base) {
622
+ return VendorCategory.fromPartial(base ?? {});
623
+ },
624
+ fromPartial(object) {
625
+ const message = createBaseVendorCategory();
626
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
627
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
628
+ ? Long.fromValue(object.organizationId)
629
+ : Long.UZERO;
630
+ message.name = object.name ?? "";
631
+ message.sort = object.sort ?? 0;
632
+ message.vendorsCount = object.vendorsCount ?? undefined;
633
+ message.createdAt = object.createdAt ?? undefined;
634
+ message.updatedAt = object.updatedAt ?? undefined;
635
+ return message;
636
+ },
637
+ };
638
+ function createBaseVendor() {
639
+ return {
640
+ id: Long.UZERO,
641
+ organizationId: Long.UZERO,
642
+ name: "",
643
+ categoryIds: [],
644
+ contactPerson: undefined,
645
+ phones: [],
646
+ email: undefined,
647
+ website: undefined,
648
+ provinceId: undefined,
649
+ cityId: undefined,
650
+ postalCode: undefined,
651
+ address: undefined,
652
+ latitude: undefined,
653
+ longitude: undefined,
654
+ radiusM: 0,
655
+ notes: undefined,
656
+ isActive: false,
657
+ categories: [],
658
+ createdBy: undefined,
659
+ createdAt: undefined,
660
+ updatedAt: undefined,
661
+ visits: [],
662
+ };
663
+ }
664
+ export const Vendor = {
665
+ encode(message, writer = new BinaryWriter()) {
666
+ if (!message.id.equals(Long.UZERO)) {
667
+ writer.uint32(8).uint64(message.id.toString());
668
+ }
669
+ if (!message.organizationId.equals(Long.UZERO)) {
670
+ writer.uint32(16).uint64(message.organizationId.toString());
671
+ }
672
+ if (message.name !== "") {
673
+ writer.uint32(26).string(message.name);
674
+ }
675
+ writer.uint32(34).fork();
676
+ for (const v of message.categoryIds) {
677
+ writer.uint64(v.toString());
678
+ }
679
+ writer.join();
680
+ if (message.contactPerson !== undefined) {
681
+ writer.uint32(42).string(message.contactPerson);
682
+ }
683
+ for (const v of message.phones) {
684
+ writer.uint32(50).string(v);
685
+ }
686
+ if (message.email !== undefined) {
687
+ writer.uint32(58).string(message.email);
688
+ }
689
+ if (message.website !== undefined) {
690
+ writer.uint32(66).string(message.website);
691
+ }
692
+ if (message.provinceId !== undefined) {
693
+ writer.uint32(72).uint64(message.provinceId.toString());
694
+ }
695
+ if (message.cityId !== undefined) {
696
+ writer.uint32(80).uint64(message.cityId.toString());
697
+ }
698
+ if (message.postalCode !== undefined) {
699
+ writer.uint32(90).string(message.postalCode);
700
+ }
701
+ if (message.address !== undefined) {
702
+ writer.uint32(98).string(message.address);
703
+ }
704
+ if (message.latitude !== undefined) {
705
+ writer.uint32(105).double(message.latitude);
706
+ }
707
+ if (message.longitude !== undefined) {
708
+ writer.uint32(113).double(message.longitude);
709
+ }
710
+ if (message.radiusM !== 0) {
711
+ writer.uint32(120).uint32(message.radiusM);
712
+ }
713
+ if (message.notes !== undefined) {
714
+ writer.uint32(130).string(message.notes);
715
+ }
716
+ if (message.isActive !== false) {
717
+ writer.uint32(136).bool(message.isActive);
718
+ }
719
+ for (const v of message.categories) {
720
+ VendorCategory.encode(v, writer.uint32(146).fork()).join();
721
+ }
722
+ if (message.createdBy !== undefined) {
723
+ writer.uint32(152).uint64(message.createdBy.toString());
724
+ }
725
+ if (message.createdAt !== undefined) {
726
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(162).fork()).join();
727
+ }
728
+ if (message.updatedAt !== undefined) {
729
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(170).fork()).join();
730
+ }
731
+ for (const v of message.visits) {
732
+ VendorVisit.encode(v, writer.uint32(178).fork()).join();
733
+ }
734
+ return writer;
735
+ },
736
+ decode(input, length) {
737
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
738
+ const end = length === undefined ? reader.len : reader.pos + length;
739
+ const message = createBaseVendor();
740
+ while (reader.pos < end) {
741
+ const tag = reader.uint32();
742
+ switch (tag >>> 3) {
743
+ case 1: {
744
+ if (tag !== 8) {
745
+ break;
746
+ }
747
+ message.id = Long.fromString(reader.uint64().toString(), true);
748
+ continue;
749
+ }
750
+ case 2: {
751
+ if (tag !== 16) {
752
+ break;
753
+ }
754
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
755
+ continue;
756
+ }
757
+ case 3: {
758
+ if (tag !== 26) {
759
+ break;
760
+ }
761
+ message.name = reader.string();
762
+ continue;
763
+ }
764
+ case 4: {
765
+ if (tag === 32) {
766
+ message.categoryIds.push(Long.fromString(reader.uint64().toString(), true));
767
+ continue;
768
+ }
769
+ if (tag === 34) {
770
+ const end2 = reader.uint32() + reader.pos;
771
+ while (reader.pos < end2) {
772
+ message.categoryIds.push(Long.fromString(reader.uint64().toString(), true));
773
+ }
774
+ continue;
775
+ }
776
+ break;
777
+ }
778
+ case 5: {
779
+ if (tag !== 42) {
780
+ break;
781
+ }
782
+ message.contactPerson = reader.string();
783
+ continue;
784
+ }
785
+ case 6: {
786
+ if (tag !== 50) {
787
+ break;
788
+ }
789
+ message.phones.push(reader.string());
790
+ continue;
791
+ }
792
+ case 7: {
793
+ if (tag !== 58) {
794
+ break;
795
+ }
796
+ message.email = reader.string();
797
+ continue;
798
+ }
799
+ case 8: {
800
+ if (tag !== 66) {
801
+ break;
802
+ }
803
+ message.website = reader.string();
804
+ continue;
805
+ }
806
+ case 9: {
807
+ if (tag !== 72) {
808
+ break;
809
+ }
810
+ message.provinceId = Long.fromString(reader.uint64().toString(), true);
811
+ continue;
812
+ }
813
+ case 10: {
814
+ if (tag !== 80) {
815
+ break;
816
+ }
817
+ message.cityId = Long.fromString(reader.uint64().toString(), true);
818
+ continue;
819
+ }
820
+ case 11: {
821
+ if (tag !== 90) {
822
+ break;
823
+ }
824
+ message.postalCode = reader.string();
825
+ continue;
826
+ }
827
+ case 12: {
828
+ if (tag !== 98) {
829
+ break;
830
+ }
831
+ message.address = reader.string();
832
+ continue;
833
+ }
834
+ case 13: {
835
+ if (tag !== 105) {
836
+ break;
837
+ }
838
+ message.latitude = reader.double();
839
+ continue;
840
+ }
841
+ case 14: {
842
+ if (tag !== 113) {
843
+ break;
844
+ }
845
+ message.longitude = reader.double();
846
+ continue;
847
+ }
848
+ case 15: {
849
+ if (tag !== 120) {
850
+ break;
851
+ }
852
+ message.radiusM = reader.uint32();
853
+ continue;
854
+ }
855
+ case 16: {
856
+ if (tag !== 130) {
857
+ break;
858
+ }
859
+ message.notes = reader.string();
860
+ continue;
861
+ }
862
+ case 17: {
863
+ if (tag !== 136) {
864
+ break;
865
+ }
866
+ message.isActive = reader.bool();
867
+ continue;
868
+ }
869
+ case 18: {
870
+ if (tag !== 146) {
871
+ break;
872
+ }
873
+ message.categories.push(VendorCategory.decode(reader, reader.uint32()));
874
+ continue;
875
+ }
876
+ case 19: {
877
+ if (tag !== 152) {
878
+ break;
879
+ }
880
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
881
+ continue;
882
+ }
883
+ case 20: {
884
+ if (tag !== 162) {
885
+ break;
886
+ }
887
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
888
+ continue;
889
+ }
890
+ case 21: {
891
+ if (tag !== 170) {
892
+ break;
893
+ }
894
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
895
+ continue;
896
+ }
897
+ case 22: {
898
+ if (tag !== 178) {
899
+ break;
900
+ }
901
+ message.visits.push(VendorVisit.decode(reader, reader.uint32()));
902
+ continue;
903
+ }
904
+ }
905
+ if ((tag & 7) === 4 || tag === 0) {
906
+ break;
907
+ }
908
+ reader.skip(tag & 7);
909
+ }
910
+ return message;
911
+ },
912
+ create(base) {
913
+ return Vendor.fromPartial(base ?? {});
914
+ },
915
+ fromPartial(object) {
916
+ const message = createBaseVendor();
917
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
918
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
919
+ ? Long.fromValue(object.organizationId)
920
+ : Long.UZERO;
921
+ message.name = object.name ?? "";
922
+ message.categoryIds = object.categoryIds?.map((e) => Long.fromValue(e)) || [];
923
+ message.contactPerson = object.contactPerson ?? undefined;
924
+ message.phones = object.phones?.map((e) => e) || [];
925
+ message.email = object.email ?? undefined;
926
+ message.website = object.website ?? undefined;
927
+ message.provinceId = (object.provinceId !== undefined && object.provinceId !== null)
928
+ ? Long.fromValue(object.provinceId)
929
+ : undefined;
930
+ message.cityId = (object.cityId !== undefined && object.cityId !== null)
931
+ ? Long.fromValue(object.cityId)
932
+ : undefined;
933
+ message.postalCode = object.postalCode ?? undefined;
934
+ message.address = object.address ?? undefined;
935
+ message.latitude = object.latitude ?? undefined;
936
+ message.longitude = object.longitude ?? undefined;
937
+ message.radiusM = object.radiusM ?? 0;
938
+ message.notes = object.notes ?? undefined;
939
+ message.isActive = object.isActive ?? false;
940
+ message.categories = object.categories?.map((e) => VendorCategory.fromPartial(e)) || [];
941
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
942
+ ? Long.fromValue(object.createdBy)
943
+ : undefined;
944
+ message.createdAt = object.createdAt ?? undefined;
945
+ message.updatedAt = object.updatedAt ?? undefined;
946
+ message.visits = object.visits?.map((e) => VendorVisit.fromPartial(e)) || [];
947
+ return message;
948
+ },
949
+ };
950
+ function createBaseVendorVisit() {
951
+ return {
952
+ id: Long.UZERO,
953
+ vendorId: Long.UZERO,
954
+ deviceId: Long.UZERO,
955
+ organizationId: Long.UZERO,
956
+ enteredAt: undefined,
957
+ leftAt: undefined,
958
+ distanceM: 0,
959
+ maintenanceId: undefined,
960
+ };
961
+ }
962
+ export const VendorVisit = {
963
+ encode(message, writer = new BinaryWriter()) {
964
+ if (!message.id.equals(Long.UZERO)) {
965
+ writer.uint32(8).uint64(message.id.toString());
966
+ }
967
+ if (!message.vendorId.equals(Long.UZERO)) {
968
+ writer.uint32(16).uint64(message.vendorId.toString());
969
+ }
970
+ if (!message.deviceId.equals(Long.UZERO)) {
971
+ writer.uint32(24).uint64(message.deviceId.toString());
972
+ }
973
+ if (!message.organizationId.equals(Long.UZERO)) {
974
+ writer.uint32(32).uint64(message.organizationId.toString());
975
+ }
976
+ if (message.enteredAt !== undefined) {
977
+ Timestamp.encode(toTimestamp(message.enteredAt), writer.uint32(42).fork()).join();
978
+ }
979
+ if (message.leftAt !== undefined) {
980
+ Timestamp.encode(toTimestamp(message.leftAt), writer.uint32(50).fork()).join();
981
+ }
982
+ if (message.distanceM !== 0) {
983
+ writer.uint32(56).uint32(message.distanceM);
984
+ }
985
+ if (message.maintenanceId !== undefined) {
986
+ writer.uint32(64).uint64(message.maintenanceId.toString());
987
+ }
988
+ return writer;
989
+ },
990
+ decode(input, length) {
991
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
992
+ const end = length === undefined ? reader.len : reader.pos + length;
993
+ const message = createBaseVendorVisit();
994
+ while (reader.pos < end) {
995
+ const tag = reader.uint32();
996
+ switch (tag >>> 3) {
997
+ case 1: {
998
+ if (tag !== 8) {
999
+ break;
1000
+ }
1001
+ message.id = Long.fromString(reader.uint64().toString(), true);
1002
+ continue;
1003
+ }
1004
+ case 2: {
1005
+ if (tag !== 16) {
1006
+ break;
1007
+ }
1008
+ message.vendorId = Long.fromString(reader.uint64().toString(), true);
1009
+ continue;
1010
+ }
1011
+ case 3: {
1012
+ if (tag !== 24) {
1013
+ break;
1014
+ }
1015
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
1016
+ continue;
1017
+ }
1018
+ case 4: {
1019
+ if (tag !== 32) {
1020
+ break;
1021
+ }
1022
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
1023
+ continue;
1024
+ }
1025
+ case 5: {
1026
+ if (tag !== 42) {
1027
+ break;
1028
+ }
1029
+ message.enteredAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1030
+ continue;
1031
+ }
1032
+ case 6: {
1033
+ if (tag !== 50) {
1034
+ break;
1035
+ }
1036
+ message.leftAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1037
+ continue;
1038
+ }
1039
+ case 7: {
1040
+ if (tag !== 56) {
1041
+ break;
1042
+ }
1043
+ message.distanceM = reader.uint32();
1044
+ continue;
1045
+ }
1046
+ case 8: {
1047
+ if (tag !== 64) {
1048
+ break;
1049
+ }
1050
+ message.maintenanceId = Long.fromString(reader.uint64().toString(), true);
1051
+ continue;
1052
+ }
1053
+ }
1054
+ if ((tag & 7) === 4 || tag === 0) {
1055
+ break;
1056
+ }
1057
+ reader.skip(tag & 7);
1058
+ }
1059
+ return message;
1060
+ },
1061
+ create(base) {
1062
+ return VendorVisit.fromPartial(base ?? {});
1063
+ },
1064
+ fromPartial(object) {
1065
+ const message = createBaseVendorVisit();
1066
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1067
+ message.vendorId = (object.vendorId !== undefined && object.vendorId !== null)
1068
+ ? Long.fromValue(object.vendorId)
1069
+ : Long.UZERO;
1070
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
1071
+ ? Long.fromValue(object.deviceId)
1072
+ : Long.UZERO;
1073
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1074
+ ? Long.fromValue(object.organizationId)
1075
+ : Long.UZERO;
1076
+ message.enteredAt = object.enteredAt ?? undefined;
1077
+ message.leftAt = object.leftAt ?? undefined;
1078
+ message.distanceM = object.distanceM ?? 0;
1079
+ message.maintenanceId = (object.maintenanceId !== undefined && object.maintenanceId !== null)
1080
+ ? Long.fromValue(object.maintenanceId)
1081
+ : undefined;
1082
+ return message;
1083
+ },
1084
+ };
1085
+ function createBaseExpense() {
1086
+ return {
1087
+ id: Long.UZERO,
1088
+ organizationId: Long.UZERO,
1089
+ deviceId: Long.UZERO,
1090
+ type: 0,
1091
+ status: 0,
1092
+ vendorId: undefined,
1093
+ amount: 0,
1094
+ currencyId: undefined,
1095
+ occurredAt: undefined,
1096
+ odometer: undefined,
1097
+ litres: undefined,
1098
+ quantity: undefined,
1099
+ unitPrice: undefined,
1100
+ receiptFileId: undefined,
1101
+ latitude: undefined,
1102
+ longitude: undefined,
1103
+ flags: [],
1104
+ maintenanceId: undefined,
1105
+ driverId: undefined,
1106
+ title: undefined,
1107
+ description: undefined,
1108
+ coverageFrom: undefined,
1109
+ coverageTo: undefined,
1110
+ offenceAt: undefined,
1111
+ isPaid: undefined,
1112
+ paymentDeadline: undefined,
1113
+ nextChangeKm: undefined,
1114
+ reviewNote: undefined,
1115
+ reviewedBy: undefined,
1116
+ reviewedAt: undefined,
1117
+ clientUuid: undefined,
1118
+ createdBy: undefined,
1119
+ createdAt: undefined,
1120
+ updatedAt: undefined,
1121
+ vendor: undefined,
1122
+ receipt: undefined,
1123
+ fuelSensorLitres: undefined,
1124
+ };
1125
+ }
1126
+ export const Expense = {
1127
+ encode(message, writer = new BinaryWriter()) {
1128
+ if (!message.id.equals(Long.UZERO)) {
1129
+ writer.uint32(8).uint64(message.id.toString());
1130
+ }
1131
+ if (!message.organizationId.equals(Long.UZERO)) {
1132
+ writer.uint32(16).uint64(message.organizationId.toString());
1133
+ }
1134
+ if (!message.deviceId.equals(Long.UZERO)) {
1135
+ writer.uint32(24).uint64(message.deviceId.toString());
1136
+ }
1137
+ if (message.type !== 0) {
1138
+ writer.uint32(32).int32(message.type);
1139
+ }
1140
+ if (message.status !== 0) {
1141
+ writer.uint32(40).int32(message.status);
1142
+ }
1143
+ if (message.vendorId !== undefined) {
1144
+ writer.uint32(48).uint64(message.vendorId.toString());
1145
+ }
1146
+ if (message.amount !== 0) {
1147
+ writer.uint32(57).double(message.amount);
1148
+ }
1149
+ if (message.currencyId !== undefined) {
1150
+ writer.uint32(64).uint64(message.currencyId.toString());
1151
+ }
1152
+ if (message.occurredAt !== undefined) {
1153
+ Timestamp.encode(toTimestamp(message.occurredAt), writer.uint32(74).fork()).join();
1154
+ }
1155
+ if (message.odometer !== undefined) {
1156
+ writer.uint32(80).uint64(message.odometer.toString());
1157
+ }
1158
+ if (message.litres !== undefined) {
1159
+ writer.uint32(89).double(message.litres);
1160
+ }
1161
+ if (message.quantity !== undefined) {
1162
+ writer.uint32(97).double(message.quantity);
1163
+ }
1164
+ if (message.unitPrice !== undefined) {
1165
+ writer.uint32(105).double(message.unitPrice);
1166
+ }
1167
+ if (message.receiptFileId !== undefined) {
1168
+ writer.uint32(112).uint64(message.receiptFileId.toString());
1169
+ }
1170
+ if (message.latitude !== undefined) {
1171
+ writer.uint32(121).double(message.latitude);
1172
+ }
1173
+ if (message.longitude !== undefined) {
1174
+ writer.uint32(129).double(message.longitude);
1175
+ }
1176
+ writer.uint32(138).fork();
1177
+ for (const v of message.flags) {
1178
+ writer.int32(v);
1179
+ }
1180
+ writer.join();
1181
+ if (message.maintenanceId !== undefined) {
1182
+ writer.uint32(144).uint64(message.maintenanceId.toString());
1183
+ }
1184
+ if (message.driverId !== undefined) {
1185
+ writer.uint32(152).uint64(message.driverId.toString());
1186
+ }
1187
+ if (message.title !== undefined) {
1188
+ writer.uint32(162).string(message.title);
1189
+ }
1190
+ if (message.description !== undefined) {
1191
+ writer.uint32(170).string(message.description);
1192
+ }
1193
+ if (message.coverageFrom !== undefined) {
1194
+ Timestamp.encode(toTimestamp(message.coverageFrom), writer.uint32(178).fork()).join();
1195
+ }
1196
+ if (message.coverageTo !== undefined) {
1197
+ Timestamp.encode(toTimestamp(message.coverageTo), writer.uint32(186).fork()).join();
1198
+ }
1199
+ if (message.offenceAt !== undefined) {
1200
+ Timestamp.encode(toTimestamp(message.offenceAt), writer.uint32(194).fork()).join();
1201
+ }
1202
+ if (message.isPaid !== undefined) {
1203
+ writer.uint32(200).bool(message.isPaid);
1204
+ }
1205
+ if (message.paymentDeadline !== undefined) {
1206
+ Timestamp.encode(toTimestamp(message.paymentDeadline), writer.uint32(210).fork()).join();
1207
+ }
1208
+ if (message.nextChangeKm !== undefined) {
1209
+ writer.uint32(216).uint64(message.nextChangeKm.toString());
1210
+ }
1211
+ if (message.reviewNote !== undefined) {
1212
+ writer.uint32(226).string(message.reviewNote);
1213
+ }
1214
+ if (message.reviewedBy !== undefined) {
1215
+ writer.uint32(232).uint64(message.reviewedBy.toString());
1216
+ }
1217
+ if (message.reviewedAt !== undefined) {
1218
+ Timestamp.encode(toTimestamp(message.reviewedAt), writer.uint32(242).fork()).join();
1219
+ }
1220
+ if (message.clientUuid !== undefined) {
1221
+ writer.uint32(250).string(message.clientUuid);
1222
+ }
1223
+ if (message.createdBy !== undefined) {
1224
+ writer.uint32(256).uint64(message.createdBy.toString());
1225
+ }
1226
+ if (message.createdAt !== undefined) {
1227
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(266).fork()).join();
1228
+ }
1229
+ if (message.updatedAt !== undefined) {
1230
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(274).fork()).join();
1231
+ }
1232
+ if (message.vendor !== undefined) {
1233
+ Vendor.encode(message.vendor, writer.uint32(282).fork()).join();
1234
+ }
1235
+ if (message.receipt !== undefined) {
1236
+ FleetDocument.encode(message.receipt, writer.uint32(290).fork()).join();
1237
+ }
1238
+ if (message.fuelSensorLitres !== undefined) {
1239
+ writer.uint32(296).uint64(message.fuelSensorLitres.toString());
1240
+ }
1241
+ return writer;
1242
+ },
1243
+ decode(input, length) {
1244
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1245
+ const end = length === undefined ? reader.len : reader.pos + length;
1246
+ const message = createBaseExpense();
1247
+ while (reader.pos < end) {
1248
+ const tag = reader.uint32();
1249
+ switch (tag >>> 3) {
1250
+ case 1: {
1251
+ if (tag !== 8) {
1252
+ break;
1253
+ }
1254
+ message.id = Long.fromString(reader.uint64().toString(), true);
1255
+ continue;
1256
+ }
1257
+ case 2: {
1258
+ if (tag !== 16) {
1259
+ break;
1260
+ }
1261
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
1262
+ continue;
1263
+ }
1264
+ case 3: {
1265
+ if (tag !== 24) {
1266
+ break;
1267
+ }
1268
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
1269
+ continue;
1270
+ }
1271
+ case 4: {
1272
+ if (tag !== 32) {
1273
+ break;
1274
+ }
1275
+ message.type = reader.int32();
1276
+ continue;
1277
+ }
1278
+ case 5: {
1279
+ if (tag !== 40) {
1280
+ break;
1281
+ }
1282
+ message.status = reader.int32();
1283
+ continue;
1284
+ }
1285
+ case 6: {
1286
+ if (tag !== 48) {
1287
+ break;
1288
+ }
1289
+ message.vendorId = Long.fromString(reader.uint64().toString(), true);
1290
+ continue;
1291
+ }
1292
+ case 7: {
1293
+ if (tag !== 57) {
1294
+ break;
1295
+ }
1296
+ message.amount = reader.double();
1297
+ continue;
1298
+ }
1299
+ case 8: {
1300
+ if (tag !== 64) {
1301
+ break;
1302
+ }
1303
+ message.currencyId = Long.fromString(reader.uint64().toString(), true);
1304
+ continue;
1305
+ }
1306
+ case 9: {
1307
+ if (tag !== 74) {
1308
+ break;
1309
+ }
1310
+ message.occurredAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1311
+ continue;
1312
+ }
1313
+ case 10: {
1314
+ if (tag !== 80) {
1315
+ break;
1316
+ }
1317
+ message.odometer = Long.fromString(reader.uint64().toString(), true);
1318
+ continue;
1319
+ }
1320
+ case 11: {
1321
+ if (tag !== 89) {
1322
+ break;
1323
+ }
1324
+ message.litres = reader.double();
1325
+ continue;
1326
+ }
1327
+ case 12: {
1328
+ if (tag !== 97) {
1329
+ break;
1330
+ }
1331
+ message.quantity = reader.double();
1332
+ continue;
1333
+ }
1334
+ case 13: {
1335
+ if (tag !== 105) {
1336
+ break;
1337
+ }
1338
+ message.unitPrice = reader.double();
1339
+ continue;
1340
+ }
1341
+ case 14: {
1342
+ if (tag !== 112) {
1343
+ break;
1344
+ }
1345
+ message.receiptFileId = Long.fromString(reader.uint64().toString(), true);
1346
+ continue;
1347
+ }
1348
+ case 15: {
1349
+ if (tag !== 121) {
1350
+ break;
1351
+ }
1352
+ message.latitude = reader.double();
1353
+ continue;
1354
+ }
1355
+ case 16: {
1356
+ if (tag !== 129) {
1357
+ break;
1358
+ }
1359
+ message.longitude = reader.double();
1360
+ continue;
1361
+ }
1362
+ case 17: {
1363
+ if (tag === 136) {
1364
+ message.flags.push(reader.int32());
1365
+ continue;
1366
+ }
1367
+ if (tag === 138) {
1368
+ const end2 = reader.uint32() + reader.pos;
1369
+ while (reader.pos < end2) {
1370
+ message.flags.push(reader.int32());
1371
+ }
1372
+ continue;
1373
+ }
1374
+ break;
1375
+ }
1376
+ case 18: {
1377
+ if (tag !== 144) {
1378
+ break;
1379
+ }
1380
+ message.maintenanceId = Long.fromString(reader.uint64().toString(), true);
1381
+ continue;
1382
+ }
1383
+ case 19: {
1384
+ if (tag !== 152) {
1385
+ break;
1386
+ }
1387
+ message.driverId = Long.fromString(reader.uint64().toString(), true);
1388
+ continue;
1389
+ }
1390
+ case 20: {
1391
+ if (tag !== 162) {
1392
+ break;
1393
+ }
1394
+ message.title = reader.string();
1395
+ continue;
1396
+ }
1397
+ case 21: {
1398
+ if (tag !== 170) {
1399
+ break;
1400
+ }
1401
+ message.description = reader.string();
1402
+ continue;
1403
+ }
1404
+ case 22: {
1405
+ if (tag !== 178) {
1406
+ break;
1407
+ }
1408
+ message.coverageFrom = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1409
+ continue;
1410
+ }
1411
+ case 23: {
1412
+ if (tag !== 186) {
1413
+ break;
1414
+ }
1415
+ message.coverageTo = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1416
+ continue;
1417
+ }
1418
+ case 24: {
1419
+ if (tag !== 194) {
1420
+ break;
1421
+ }
1422
+ message.offenceAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1423
+ continue;
1424
+ }
1425
+ case 25: {
1426
+ if (tag !== 200) {
1427
+ break;
1428
+ }
1429
+ message.isPaid = reader.bool();
1430
+ continue;
1431
+ }
1432
+ case 26: {
1433
+ if (tag !== 210) {
1434
+ break;
1435
+ }
1436
+ message.paymentDeadline = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1437
+ continue;
1438
+ }
1439
+ case 27: {
1440
+ if (tag !== 216) {
1441
+ break;
1442
+ }
1443
+ message.nextChangeKm = Long.fromString(reader.uint64().toString(), true);
1444
+ continue;
1445
+ }
1446
+ case 28: {
1447
+ if (tag !== 226) {
1448
+ break;
1449
+ }
1450
+ message.reviewNote = reader.string();
1451
+ continue;
1452
+ }
1453
+ case 29: {
1454
+ if (tag !== 232) {
1455
+ break;
1456
+ }
1457
+ message.reviewedBy = Long.fromString(reader.uint64().toString(), true);
1458
+ continue;
1459
+ }
1460
+ case 30: {
1461
+ if (tag !== 242) {
1462
+ break;
1463
+ }
1464
+ message.reviewedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1465
+ continue;
1466
+ }
1467
+ case 31: {
1468
+ if (tag !== 250) {
1469
+ break;
1470
+ }
1471
+ message.clientUuid = reader.string();
1472
+ continue;
1473
+ }
1474
+ case 32: {
1475
+ if (tag !== 256) {
1476
+ break;
1477
+ }
1478
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
1479
+ continue;
1480
+ }
1481
+ case 33: {
1482
+ if (tag !== 266) {
1483
+ break;
1484
+ }
1485
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1486
+ continue;
1487
+ }
1488
+ case 34: {
1489
+ if (tag !== 274) {
1490
+ break;
1491
+ }
1492
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1493
+ continue;
1494
+ }
1495
+ case 35: {
1496
+ if (tag !== 282) {
1497
+ break;
1498
+ }
1499
+ message.vendor = Vendor.decode(reader, reader.uint32());
1500
+ continue;
1501
+ }
1502
+ case 36: {
1503
+ if (tag !== 290) {
1504
+ break;
1505
+ }
1506
+ message.receipt = FleetDocument.decode(reader, reader.uint32());
1507
+ continue;
1508
+ }
1509
+ case 37: {
1510
+ if (tag !== 296) {
1511
+ break;
1512
+ }
1513
+ message.fuelSensorLitres = Long.fromString(reader.uint64().toString(), true);
1514
+ continue;
1515
+ }
1516
+ }
1517
+ if ((tag & 7) === 4 || tag === 0) {
1518
+ break;
1519
+ }
1520
+ reader.skip(tag & 7);
1521
+ }
1522
+ return message;
1523
+ },
1524
+ create(base) {
1525
+ return Expense.fromPartial(base ?? {});
1526
+ },
1527
+ fromPartial(object) {
1528
+ const message = createBaseExpense();
1529
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1530
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1531
+ ? Long.fromValue(object.organizationId)
1532
+ : Long.UZERO;
1533
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
1534
+ ? Long.fromValue(object.deviceId)
1535
+ : Long.UZERO;
1536
+ message.type = object.type ?? 0;
1537
+ message.status = object.status ?? 0;
1538
+ message.vendorId = (object.vendorId !== undefined && object.vendorId !== null)
1539
+ ? Long.fromValue(object.vendorId)
1540
+ : undefined;
1541
+ message.amount = object.amount ?? 0;
1542
+ message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
1543
+ ? Long.fromValue(object.currencyId)
1544
+ : undefined;
1545
+ message.occurredAt = object.occurredAt ?? undefined;
1546
+ message.odometer = (object.odometer !== undefined && object.odometer !== null)
1547
+ ? Long.fromValue(object.odometer)
1548
+ : undefined;
1549
+ message.litres = object.litres ?? undefined;
1550
+ message.quantity = object.quantity ?? undefined;
1551
+ message.unitPrice = object.unitPrice ?? undefined;
1552
+ message.receiptFileId = (object.receiptFileId !== undefined && object.receiptFileId !== null)
1553
+ ? Long.fromValue(object.receiptFileId)
1554
+ : undefined;
1555
+ message.latitude = object.latitude ?? undefined;
1556
+ message.longitude = object.longitude ?? undefined;
1557
+ message.flags = object.flags?.map((e) => e) || [];
1558
+ message.maintenanceId = (object.maintenanceId !== undefined && object.maintenanceId !== null)
1559
+ ? Long.fromValue(object.maintenanceId)
1560
+ : undefined;
1561
+ message.driverId = (object.driverId !== undefined && object.driverId !== null)
1562
+ ? Long.fromValue(object.driverId)
1563
+ : undefined;
1564
+ message.title = object.title ?? undefined;
1565
+ message.description = object.description ?? undefined;
1566
+ message.coverageFrom = object.coverageFrom ?? undefined;
1567
+ message.coverageTo = object.coverageTo ?? undefined;
1568
+ message.offenceAt = object.offenceAt ?? undefined;
1569
+ message.isPaid = object.isPaid ?? undefined;
1570
+ message.paymentDeadline = object.paymentDeadline ?? undefined;
1571
+ message.nextChangeKm = (object.nextChangeKm !== undefined && object.nextChangeKm !== null)
1572
+ ? Long.fromValue(object.nextChangeKm)
1573
+ : undefined;
1574
+ message.reviewNote = object.reviewNote ?? undefined;
1575
+ message.reviewedBy = (object.reviewedBy !== undefined && object.reviewedBy !== null)
1576
+ ? Long.fromValue(object.reviewedBy)
1577
+ : undefined;
1578
+ message.reviewedAt = object.reviewedAt ?? undefined;
1579
+ message.clientUuid = object.clientUuid ?? undefined;
1580
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1581
+ ? Long.fromValue(object.createdBy)
1582
+ : undefined;
1583
+ message.createdAt = object.createdAt ?? undefined;
1584
+ message.updatedAt = object.updatedAt ?? undefined;
1585
+ message.vendor = (object.vendor !== undefined && object.vendor !== null)
1586
+ ? Vendor.fromPartial(object.vendor)
1587
+ : undefined;
1588
+ message.receipt = (object.receipt !== undefined && object.receipt !== null)
1589
+ ? FleetDocument.fromPartial(object.receipt)
1590
+ : undefined;
1591
+ message.fuelSensorLitres = (object.fuelSensorLitres !== undefined && object.fuelSensorLitres !== null)
1592
+ ? Long.fromValue(object.fuelSensorLitres)
1593
+ : undefined;
1594
+ return message;
1595
+ },
1596
+ };
1597
+ function createBaseExpenseExport() {
1598
+ return {
1599
+ id: Long.UZERO,
1600
+ organizationId: Long.UZERO,
1601
+ format: 0,
1602
+ status: 0,
1603
+ filters: "",
1604
+ error: undefined,
1605
+ expiresAt: undefined,
1606
+ createdBy: undefined,
1607
+ createdAt: undefined,
1608
+ updatedAt: undefined,
1609
+ };
1610
+ }
1611
+ export const ExpenseExport = {
1612
+ encode(message, writer = new BinaryWriter()) {
1613
+ if (!message.id.equals(Long.UZERO)) {
1614
+ writer.uint32(8).uint64(message.id.toString());
1615
+ }
1616
+ if (!message.organizationId.equals(Long.UZERO)) {
1617
+ writer.uint32(16).uint64(message.organizationId.toString());
1618
+ }
1619
+ if (message.format !== 0) {
1620
+ writer.uint32(24).int32(message.format);
1621
+ }
1622
+ if (message.status !== 0) {
1623
+ writer.uint32(32).int32(message.status);
1624
+ }
1625
+ if (message.filters !== "") {
1626
+ writer.uint32(42).string(message.filters);
1627
+ }
1628
+ if (message.error !== undefined) {
1629
+ writer.uint32(50).string(message.error);
1630
+ }
1631
+ if (message.expiresAt !== undefined) {
1632
+ Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(58).fork()).join();
1633
+ }
1634
+ if (message.createdBy !== undefined) {
1635
+ writer.uint32(64).uint64(message.createdBy.toString());
1636
+ }
1637
+ if (message.createdAt !== undefined) {
1638
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
1639
+ }
1640
+ if (message.updatedAt !== undefined) {
1641
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(82).fork()).join();
1642
+ }
1643
+ return writer;
1644
+ },
1645
+ decode(input, length) {
1646
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1647
+ const end = length === undefined ? reader.len : reader.pos + length;
1648
+ const message = createBaseExpenseExport();
1649
+ while (reader.pos < end) {
1650
+ const tag = reader.uint32();
1651
+ switch (tag >>> 3) {
1652
+ case 1: {
1653
+ if (tag !== 8) {
1654
+ break;
1655
+ }
1656
+ message.id = Long.fromString(reader.uint64().toString(), true);
1657
+ continue;
1658
+ }
1659
+ case 2: {
1660
+ if (tag !== 16) {
1661
+ break;
1662
+ }
1663
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
1664
+ continue;
1665
+ }
1666
+ case 3: {
1667
+ if (tag !== 24) {
1668
+ break;
1669
+ }
1670
+ message.format = reader.int32();
1671
+ continue;
1672
+ }
1673
+ case 4: {
1674
+ if (tag !== 32) {
1675
+ break;
1676
+ }
1677
+ message.status = reader.int32();
1678
+ continue;
1679
+ }
1680
+ case 5: {
1681
+ if (tag !== 42) {
1682
+ break;
1683
+ }
1684
+ message.filters = reader.string();
1685
+ continue;
1686
+ }
1687
+ case 6: {
1688
+ if (tag !== 50) {
1689
+ break;
1690
+ }
1691
+ message.error = reader.string();
1692
+ continue;
1693
+ }
1694
+ case 7: {
1695
+ if (tag !== 58) {
1696
+ break;
1697
+ }
1698
+ message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1699
+ continue;
1700
+ }
1701
+ case 8: {
1702
+ if (tag !== 64) {
1703
+ break;
1704
+ }
1705
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
1706
+ continue;
1707
+ }
1708
+ case 9: {
1709
+ if (tag !== 74) {
1710
+ break;
1711
+ }
1712
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1713
+ continue;
1714
+ }
1715
+ case 10: {
1716
+ if (tag !== 82) {
1717
+ break;
1718
+ }
1719
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1720
+ continue;
1721
+ }
1722
+ }
1723
+ if ((tag & 7) === 4 || tag === 0) {
1724
+ break;
1725
+ }
1726
+ reader.skip(tag & 7);
1727
+ }
1728
+ return message;
1729
+ },
1730
+ create(base) {
1731
+ return ExpenseExport.fromPartial(base ?? {});
1732
+ },
1733
+ fromPartial(object) {
1734
+ const message = createBaseExpenseExport();
1735
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1736
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1737
+ ? Long.fromValue(object.organizationId)
1738
+ : Long.UZERO;
1739
+ message.format = object.format ?? 0;
1740
+ message.status = object.status ?? 0;
1741
+ message.filters = object.filters ?? "";
1742
+ message.error = object.error ?? undefined;
1743
+ message.expiresAt = object.expiresAt ?? undefined;
1744
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1745
+ ? Long.fromValue(object.createdBy)
1746
+ : undefined;
1747
+ message.createdAt = object.createdAt ?? undefined;
1748
+ message.updatedAt = object.updatedAt ?? undefined;
1749
+ return message;
1750
+ },
1751
+ };
1752
+ function createBaseServiceProgram() {
1753
+ return {
1754
+ id: Long.UZERO,
1755
+ organizationId: Long.UZERO,
1756
+ name: "",
1757
+ serviceIds: [],
1758
+ deviceIds: [],
1759
+ isActive: false,
1760
+ description: undefined,
1761
+ createdBy: undefined,
1762
+ createdAt: undefined,
1763
+ updatedAt: undefined,
1764
+ annualEstimate: undefined,
1765
+ };
1766
+ }
1767
+ export const ServiceProgram = {
1768
+ encode(message, writer = new BinaryWriter()) {
1769
+ if (!message.id.equals(Long.UZERO)) {
1770
+ writer.uint32(8).uint64(message.id.toString());
1771
+ }
1772
+ if (!message.organizationId.equals(Long.UZERO)) {
1773
+ writer.uint32(16).uint64(message.organizationId.toString());
1774
+ }
1775
+ if (message.name !== "") {
1776
+ writer.uint32(26).string(message.name);
1777
+ }
1778
+ writer.uint32(34).fork();
1779
+ for (const v of message.serviceIds) {
1780
+ writer.uint64(v.toString());
1781
+ }
1782
+ writer.join();
1783
+ writer.uint32(42).fork();
1784
+ for (const v of message.deviceIds) {
1785
+ writer.uint64(v.toString());
1786
+ }
1787
+ writer.join();
1788
+ if (message.isActive !== false) {
1789
+ writer.uint32(48).bool(message.isActive);
1790
+ }
1791
+ if (message.description !== undefined) {
1792
+ writer.uint32(58).string(message.description);
1793
+ }
1794
+ if (message.createdBy !== undefined) {
1795
+ writer.uint32(64).uint64(message.createdBy.toString());
1796
+ }
1797
+ if (message.createdAt !== undefined) {
1798
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
1799
+ }
1800
+ if (message.updatedAt !== undefined) {
1801
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(82).fork()).join();
1802
+ }
1803
+ if (message.annualEstimate !== undefined) {
1804
+ writer.uint32(89).double(message.annualEstimate);
1805
+ }
1806
+ return writer;
1807
+ },
1808
+ decode(input, length) {
1809
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1810
+ const end = length === undefined ? reader.len : reader.pos + length;
1811
+ const message = createBaseServiceProgram();
1812
+ while (reader.pos < end) {
1813
+ const tag = reader.uint32();
1814
+ switch (tag >>> 3) {
1815
+ case 1: {
1816
+ if (tag !== 8) {
1817
+ break;
1818
+ }
1819
+ message.id = Long.fromString(reader.uint64().toString(), true);
1820
+ continue;
1821
+ }
1822
+ case 2: {
1823
+ if (tag !== 16) {
1824
+ break;
1825
+ }
1826
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
1827
+ continue;
1828
+ }
1829
+ case 3: {
1830
+ if (tag !== 26) {
1831
+ break;
1832
+ }
1833
+ message.name = reader.string();
1834
+ continue;
1835
+ }
1836
+ case 4: {
1837
+ if (tag === 32) {
1838
+ message.serviceIds.push(Long.fromString(reader.uint64().toString(), true));
1839
+ continue;
1840
+ }
1841
+ if (tag === 34) {
1842
+ const end2 = reader.uint32() + reader.pos;
1843
+ while (reader.pos < end2) {
1844
+ message.serviceIds.push(Long.fromString(reader.uint64().toString(), true));
1845
+ }
1846
+ continue;
1847
+ }
1848
+ break;
1849
+ }
1850
+ case 5: {
1851
+ if (tag === 40) {
1852
+ message.deviceIds.push(Long.fromString(reader.uint64().toString(), true));
1853
+ continue;
1854
+ }
1855
+ if (tag === 42) {
1856
+ const end2 = reader.uint32() + reader.pos;
1857
+ while (reader.pos < end2) {
1858
+ message.deviceIds.push(Long.fromString(reader.uint64().toString(), true));
1859
+ }
1860
+ continue;
1861
+ }
1862
+ break;
1863
+ }
1864
+ case 6: {
1865
+ if (tag !== 48) {
1866
+ break;
1867
+ }
1868
+ message.isActive = reader.bool();
1869
+ continue;
1870
+ }
1871
+ case 7: {
1872
+ if (tag !== 58) {
1873
+ break;
1874
+ }
1875
+ message.description = reader.string();
1876
+ continue;
1877
+ }
1878
+ case 8: {
1879
+ if (tag !== 64) {
1880
+ break;
1881
+ }
1882
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
1883
+ continue;
1884
+ }
1885
+ case 9: {
1886
+ if (tag !== 74) {
1887
+ break;
1888
+ }
1889
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1890
+ continue;
1891
+ }
1892
+ case 10: {
1893
+ if (tag !== 82) {
1894
+ break;
1895
+ }
1896
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1897
+ continue;
1898
+ }
1899
+ case 11: {
1900
+ if (tag !== 89) {
1901
+ break;
1902
+ }
1903
+ message.annualEstimate = reader.double();
1904
+ continue;
1905
+ }
1906
+ }
1907
+ if ((tag & 7) === 4 || tag === 0) {
1908
+ break;
1909
+ }
1910
+ reader.skip(tag & 7);
1911
+ }
1912
+ return message;
1913
+ },
1914
+ create(base) {
1915
+ return ServiceProgram.fromPartial(base ?? {});
1916
+ },
1917
+ fromPartial(object) {
1918
+ const message = createBaseServiceProgram();
1919
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1920
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1921
+ ? Long.fromValue(object.organizationId)
1922
+ : Long.UZERO;
1923
+ message.name = object.name ?? "";
1924
+ message.serviceIds = object.serviceIds?.map((e) => Long.fromValue(e)) || [];
1925
+ message.deviceIds = object.deviceIds?.map((e) => Long.fromValue(e)) || [];
1926
+ message.isActive = object.isActive ?? false;
1927
+ message.description = object.description ?? undefined;
1928
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1929
+ ? Long.fromValue(object.createdBy)
1930
+ : undefined;
1931
+ message.createdAt = object.createdAt ?? undefined;
1932
+ message.updatedAt = object.updatedAt ?? undefined;
1933
+ message.annualEstimate = object.annualEstimate ?? undefined;
1934
+ return message;
1935
+ },
1936
+ };
1937
+ function createBaseIssue() {
1938
+ return {
1939
+ id: Long.UZERO,
1940
+ organizationId: Long.UZERO,
1941
+ deviceId: Long.UZERO,
1942
+ title: "",
1943
+ description: undefined,
1944
+ category: undefined,
1945
+ priority: 0,
1946
+ status: 0,
1947
+ source: 0,
1948
+ cantDrive: false,
1949
+ serviceId: undefined,
1950
+ maintenanceId: undefined,
1951
+ inspectionId: undefined,
1952
+ parentId: undefined,
1953
+ rejectionReason: undefined,
1954
+ reviewedBy: undefined,
1955
+ reviewedAt: undefined,
1956
+ resolvedAt: undefined,
1957
+ files: [],
1958
+ clientUuid: undefined,
1959
+ createdBy: undefined,
1960
+ createdAt: undefined,
1961
+ updatedAt: undefined,
1962
+ related: [],
1963
+ };
1964
+ }
1965
+ export const Issue = {
1966
+ encode(message, writer = new BinaryWriter()) {
1967
+ if (!message.id.equals(Long.UZERO)) {
1968
+ writer.uint32(8).uint64(message.id.toString());
1969
+ }
1970
+ if (!message.organizationId.equals(Long.UZERO)) {
1971
+ writer.uint32(16).uint64(message.organizationId.toString());
1972
+ }
1973
+ if (!message.deviceId.equals(Long.UZERO)) {
1974
+ writer.uint32(24).uint64(message.deviceId.toString());
1975
+ }
1976
+ if (message.title !== "") {
1977
+ writer.uint32(34).string(message.title);
1978
+ }
1979
+ if (message.description !== undefined) {
1980
+ writer.uint32(42).string(message.description);
1981
+ }
1982
+ if (message.category !== undefined) {
1983
+ writer.uint32(50).string(message.category);
1984
+ }
1985
+ if (message.priority !== 0) {
1986
+ writer.uint32(56).int32(message.priority);
1987
+ }
1988
+ if (message.status !== 0) {
1989
+ writer.uint32(64).int32(message.status);
1990
+ }
1991
+ if (message.source !== 0) {
1992
+ writer.uint32(72).int32(message.source);
1993
+ }
1994
+ if (message.cantDrive !== false) {
1995
+ writer.uint32(80).bool(message.cantDrive);
1996
+ }
1997
+ if (message.serviceId !== undefined) {
1998
+ writer.uint32(88).uint64(message.serviceId.toString());
1999
+ }
2000
+ if (message.maintenanceId !== undefined) {
2001
+ writer.uint32(96).uint64(message.maintenanceId.toString());
2002
+ }
2003
+ if (message.inspectionId !== undefined) {
2004
+ writer.uint32(104).uint64(message.inspectionId.toString());
2005
+ }
2006
+ if (message.parentId !== undefined) {
2007
+ writer.uint32(112).uint64(message.parentId.toString());
2008
+ }
2009
+ if (message.rejectionReason !== undefined) {
2010
+ writer.uint32(122).string(message.rejectionReason);
2011
+ }
2012
+ if (message.reviewedBy !== undefined) {
2013
+ writer.uint32(128).uint64(message.reviewedBy.toString());
2014
+ }
2015
+ if (message.reviewedAt !== undefined) {
2016
+ Timestamp.encode(toTimestamp(message.reviewedAt), writer.uint32(138).fork()).join();
2017
+ }
2018
+ if (message.resolvedAt !== undefined) {
2019
+ Timestamp.encode(toTimestamp(message.resolvedAt), writer.uint32(146).fork()).join();
2020
+ }
2021
+ for (const v of message.files) {
2022
+ FleetDocument.encode(v, writer.uint32(154).fork()).join();
2023
+ }
2024
+ if (message.clientUuid !== undefined) {
2025
+ writer.uint32(162).string(message.clientUuid);
2026
+ }
2027
+ if (message.createdBy !== undefined) {
2028
+ writer.uint32(168).uint64(message.createdBy.toString());
2029
+ }
2030
+ if (message.createdAt !== undefined) {
2031
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(178).fork()).join();
2032
+ }
2033
+ if (message.updatedAt !== undefined) {
2034
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(186).fork()).join();
2035
+ }
2036
+ for (const v of message.related) {
2037
+ Issue.encode(v, writer.uint32(194).fork()).join();
2038
+ }
2039
+ return writer;
2040
+ },
2041
+ decode(input, length) {
2042
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2043
+ const end = length === undefined ? reader.len : reader.pos + length;
2044
+ const message = createBaseIssue();
2045
+ while (reader.pos < end) {
2046
+ const tag = reader.uint32();
2047
+ switch (tag >>> 3) {
2048
+ case 1: {
2049
+ if (tag !== 8) {
2050
+ break;
2051
+ }
2052
+ message.id = Long.fromString(reader.uint64().toString(), true);
2053
+ continue;
2054
+ }
2055
+ case 2: {
2056
+ if (tag !== 16) {
2057
+ break;
2058
+ }
2059
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
2060
+ continue;
2061
+ }
2062
+ case 3: {
2063
+ if (tag !== 24) {
2064
+ break;
2065
+ }
2066
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
2067
+ continue;
2068
+ }
2069
+ case 4: {
2070
+ if (tag !== 34) {
2071
+ break;
2072
+ }
2073
+ message.title = reader.string();
2074
+ continue;
2075
+ }
2076
+ case 5: {
2077
+ if (tag !== 42) {
2078
+ break;
2079
+ }
2080
+ message.description = reader.string();
2081
+ continue;
2082
+ }
2083
+ case 6: {
2084
+ if (tag !== 50) {
2085
+ break;
2086
+ }
2087
+ message.category = reader.string();
2088
+ continue;
2089
+ }
2090
+ case 7: {
2091
+ if (tag !== 56) {
2092
+ break;
2093
+ }
2094
+ message.priority = reader.int32();
2095
+ continue;
2096
+ }
2097
+ case 8: {
2098
+ if (tag !== 64) {
2099
+ break;
2100
+ }
2101
+ message.status = reader.int32();
2102
+ continue;
2103
+ }
2104
+ case 9: {
2105
+ if (tag !== 72) {
2106
+ break;
2107
+ }
2108
+ message.source = reader.int32();
2109
+ continue;
2110
+ }
2111
+ case 10: {
2112
+ if (tag !== 80) {
2113
+ break;
2114
+ }
2115
+ message.cantDrive = reader.bool();
2116
+ continue;
2117
+ }
2118
+ case 11: {
2119
+ if (tag !== 88) {
2120
+ break;
2121
+ }
2122
+ message.serviceId = Long.fromString(reader.uint64().toString(), true);
2123
+ continue;
2124
+ }
2125
+ case 12: {
2126
+ if (tag !== 96) {
2127
+ break;
2128
+ }
2129
+ message.maintenanceId = Long.fromString(reader.uint64().toString(), true);
2130
+ continue;
2131
+ }
2132
+ case 13: {
2133
+ if (tag !== 104) {
2134
+ break;
2135
+ }
2136
+ message.inspectionId = Long.fromString(reader.uint64().toString(), true);
2137
+ continue;
2138
+ }
2139
+ case 14: {
2140
+ if (tag !== 112) {
2141
+ break;
2142
+ }
2143
+ message.parentId = Long.fromString(reader.uint64().toString(), true);
2144
+ continue;
2145
+ }
2146
+ case 15: {
2147
+ if (tag !== 122) {
2148
+ break;
2149
+ }
2150
+ message.rejectionReason = reader.string();
2151
+ continue;
2152
+ }
2153
+ case 16: {
2154
+ if (tag !== 128) {
2155
+ break;
2156
+ }
2157
+ message.reviewedBy = Long.fromString(reader.uint64().toString(), true);
2158
+ continue;
2159
+ }
2160
+ case 17: {
2161
+ if (tag !== 138) {
2162
+ break;
2163
+ }
2164
+ message.reviewedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2165
+ continue;
2166
+ }
2167
+ case 18: {
2168
+ if (tag !== 146) {
2169
+ break;
2170
+ }
2171
+ message.resolvedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2172
+ continue;
2173
+ }
2174
+ case 19: {
2175
+ if (tag !== 154) {
2176
+ break;
2177
+ }
2178
+ message.files.push(FleetDocument.decode(reader, reader.uint32()));
2179
+ continue;
2180
+ }
2181
+ case 20: {
2182
+ if (tag !== 162) {
2183
+ break;
2184
+ }
2185
+ message.clientUuid = reader.string();
2186
+ continue;
2187
+ }
2188
+ case 21: {
2189
+ if (tag !== 168) {
2190
+ break;
2191
+ }
2192
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
2193
+ continue;
2194
+ }
2195
+ case 22: {
2196
+ if (tag !== 178) {
2197
+ break;
2198
+ }
2199
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2200
+ continue;
2201
+ }
2202
+ case 23: {
2203
+ if (tag !== 186) {
2204
+ break;
2205
+ }
2206
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2207
+ continue;
2208
+ }
2209
+ case 24: {
2210
+ if (tag !== 194) {
2211
+ break;
2212
+ }
2213
+ message.related.push(Issue.decode(reader, reader.uint32()));
2214
+ continue;
2215
+ }
2216
+ }
2217
+ if ((tag & 7) === 4 || tag === 0) {
2218
+ break;
2219
+ }
2220
+ reader.skip(tag & 7);
2221
+ }
2222
+ return message;
2223
+ },
2224
+ create(base) {
2225
+ return Issue.fromPartial(base ?? {});
2226
+ },
2227
+ fromPartial(object) {
2228
+ const message = createBaseIssue();
2229
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
2230
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
2231
+ ? Long.fromValue(object.organizationId)
2232
+ : Long.UZERO;
2233
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
2234
+ ? Long.fromValue(object.deviceId)
2235
+ : Long.UZERO;
2236
+ message.title = object.title ?? "";
2237
+ message.description = object.description ?? undefined;
2238
+ message.category = object.category ?? undefined;
2239
+ message.priority = object.priority ?? 0;
2240
+ message.status = object.status ?? 0;
2241
+ message.source = object.source ?? 0;
2242
+ message.cantDrive = object.cantDrive ?? false;
2243
+ message.serviceId = (object.serviceId !== undefined && object.serviceId !== null)
2244
+ ? Long.fromValue(object.serviceId)
2245
+ : undefined;
2246
+ message.maintenanceId = (object.maintenanceId !== undefined && object.maintenanceId !== null)
2247
+ ? Long.fromValue(object.maintenanceId)
2248
+ : undefined;
2249
+ message.inspectionId = (object.inspectionId !== undefined && object.inspectionId !== null)
2250
+ ? Long.fromValue(object.inspectionId)
2251
+ : undefined;
2252
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
2253
+ ? Long.fromValue(object.parentId)
2254
+ : undefined;
2255
+ message.rejectionReason = object.rejectionReason ?? undefined;
2256
+ message.reviewedBy = (object.reviewedBy !== undefined && object.reviewedBy !== null)
2257
+ ? Long.fromValue(object.reviewedBy)
2258
+ : undefined;
2259
+ message.reviewedAt = object.reviewedAt ?? undefined;
2260
+ message.resolvedAt = object.resolvedAt ?? undefined;
2261
+ message.files = object.files?.map((e) => FleetDocument.fromPartial(e)) || [];
2262
+ message.clientUuid = object.clientUuid ?? undefined;
2263
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2264
+ ? Long.fromValue(object.createdBy)
2265
+ : undefined;
2266
+ message.createdAt = object.createdAt ?? undefined;
2267
+ message.updatedAt = object.updatedAt ?? undefined;
2268
+ message.related = object.related?.map((e) => Issue.fromPartial(e)) || [];
2269
+ return message;
2270
+ },
2271
+ };
2272
+ function createBaseInspectionTemplate() {
2273
+ return {
2274
+ id: Long.UZERO,
2275
+ organizationId: Long.UZERO,
2276
+ name: "",
2277
+ items: [],
2278
+ schedule: 0,
2279
+ carGroupIds: [],
2280
+ version: 0,
2281
+ isActive: false,
2282
+ createdBy: undefined,
2283
+ createdAt: undefined,
2284
+ updatedAt: undefined,
2285
+ doneToday: undefined,
2286
+ };
2287
+ }
2288
+ export const InspectionTemplate = {
2289
+ encode(message, writer = new BinaryWriter()) {
2290
+ if (!message.id.equals(Long.UZERO)) {
2291
+ writer.uint32(8).uint64(message.id.toString());
2292
+ }
2293
+ if (!message.organizationId.equals(Long.UZERO)) {
2294
+ writer.uint32(16).uint64(message.organizationId.toString());
2295
+ }
2296
+ if (message.name !== "") {
2297
+ writer.uint32(26).string(message.name);
2298
+ }
2299
+ for (const v of message.items) {
2300
+ InspectionTemplate_Item.encode(v, writer.uint32(34).fork()).join();
2301
+ }
2302
+ if (message.schedule !== 0) {
2303
+ writer.uint32(40).int32(message.schedule);
2304
+ }
2305
+ writer.uint32(50).fork();
2306
+ for (const v of message.carGroupIds) {
2307
+ writer.uint64(v.toString());
2308
+ }
2309
+ writer.join();
2310
+ if (message.version !== 0) {
2311
+ writer.uint32(56).uint32(message.version);
2312
+ }
2313
+ if (message.isActive !== false) {
2314
+ writer.uint32(64).bool(message.isActive);
2315
+ }
2316
+ if (message.createdBy !== undefined) {
2317
+ writer.uint32(72).uint64(message.createdBy.toString());
2318
+ }
2319
+ if (message.createdAt !== undefined) {
2320
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
2321
+ }
2322
+ if (message.updatedAt !== undefined) {
2323
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
2324
+ }
2325
+ if (message.doneToday !== undefined) {
2326
+ writer.uint32(96).bool(message.doneToday);
2327
+ }
2328
+ return writer;
2329
+ },
2330
+ decode(input, length) {
2331
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2332
+ const end = length === undefined ? reader.len : reader.pos + length;
2333
+ const message = createBaseInspectionTemplate();
2334
+ while (reader.pos < end) {
2335
+ const tag = reader.uint32();
2336
+ switch (tag >>> 3) {
2337
+ case 1: {
2338
+ if (tag !== 8) {
2339
+ break;
2340
+ }
2341
+ message.id = Long.fromString(reader.uint64().toString(), true);
2342
+ continue;
2343
+ }
2344
+ case 2: {
2345
+ if (tag !== 16) {
2346
+ break;
2347
+ }
2348
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
2349
+ continue;
2350
+ }
2351
+ case 3: {
2352
+ if (tag !== 26) {
2353
+ break;
2354
+ }
2355
+ message.name = reader.string();
2356
+ continue;
2357
+ }
2358
+ case 4: {
2359
+ if (tag !== 34) {
2360
+ break;
2361
+ }
2362
+ message.items.push(InspectionTemplate_Item.decode(reader, reader.uint32()));
2363
+ continue;
2364
+ }
2365
+ case 5: {
2366
+ if (tag !== 40) {
2367
+ break;
2368
+ }
2369
+ message.schedule = reader.int32();
2370
+ continue;
2371
+ }
2372
+ case 6: {
2373
+ if (tag === 48) {
2374
+ message.carGroupIds.push(Long.fromString(reader.uint64().toString(), true));
2375
+ continue;
2376
+ }
2377
+ if (tag === 50) {
2378
+ const end2 = reader.uint32() + reader.pos;
2379
+ while (reader.pos < end2) {
2380
+ message.carGroupIds.push(Long.fromString(reader.uint64().toString(), true));
2381
+ }
2382
+ continue;
2383
+ }
2384
+ break;
2385
+ }
2386
+ case 7: {
2387
+ if (tag !== 56) {
2388
+ break;
2389
+ }
2390
+ message.version = reader.uint32();
2391
+ continue;
2392
+ }
2393
+ case 8: {
2394
+ if (tag !== 64) {
2395
+ break;
2396
+ }
2397
+ message.isActive = reader.bool();
2398
+ continue;
2399
+ }
2400
+ case 9: {
2401
+ if (tag !== 72) {
2402
+ break;
2403
+ }
2404
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
2405
+ continue;
2406
+ }
2407
+ case 10: {
2408
+ if (tag !== 82) {
2409
+ break;
2410
+ }
2411
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2412
+ continue;
2413
+ }
2414
+ case 11: {
2415
+ if (tag !== 90) {
2416
+ break;
2417
+ }
2418
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2419
+ continue;
2420
+ }
2421
+ case 12: {
2422
+ if (tag !== 96) {
2423
+ break;
2424
+ }
2425
+ message.doneToday = reader.bool();
2426
+ continue;
2427
+ }
2428
+ }
2429
+ if ((tag & 7) === 4 || tag === 0) {
2430
+ break;
2431
+ }
2432
+ reader.skip(tag & 7);
2433
+ }
2434
+ return message;
2435
+ },
2436
+ create(base) {
2437
+ return InspectionTemplate.fromPartial(base ?? {});
2438
+ },
2439
+ fromPartial(object) {
2440
+ const message = createBaseInspectionTemplate();
2441
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
2442
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
2443
+ ? Long.fromValue(object.organizationId)
2444
+ : Long.UZERO;
2445
+ message.name = object.name ?? "";
2446
+ message.items = object.items?.map((e) => InspectionTemplate_Item.fromPartial(e)) || [];
2447
+ message.schedule = object.schedule ?? 0;
2448
+ message.carGroupIds = object.carGroupIds?.map((e) => Long.fromValue(e)) || [];
2449
+ message.version = object.version ?? 0;
2450
+ message.isActive = object.isActive ?? false;
2451
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2452
+ ? Long.fromValue(object.createdBy)
2453
+ : undefined;
2454
+ message.createdAt = object.createdAt ?? undefined;
2455
+ message.updatedAt = object.updatedAt ?? undefined;
2456
+ message.doneToday = object.doneToday ?? undefined;
2457
+ return message;
2458
+ },
2459
+ };
2460
+ function createBaseInspectionTemplate_Item() {
2461
+ return {
2462
+ key: "",
2463
+ label: "",
2464
+ answerType: 0,
2465
+ critical: false,
2466
+ photoRequired: false,
2467
+ group: undefined,
2468
+ unit: undefined,
2469
+ };
2470
+ }
2471
+ export const InspectionTemplate_Item = {
2472
+ encode(message, writer = new BinaryWriter()) {
2473
+ if (message.key !== "") {
2474
+ writer.uint32(10).string(message.key);
2475
+ }
2476
+ if (message.label !== "") {
2477
+ writer.uint32(18).string(message.label);
2478
+ }
2479
+ if (message.answerType !== 0) {
2480
+ writer.uint32(24).int32(message.answerType);
2481
+ }
2482
+ if (message.critical !== false) {
2483
+ writer.uint32(32).bool(message.critical);
2484
+ }
2485
+ if (message.photoRequired !== false) {
2486
+ writer.uint32(40).bool(message.photoRequired);
2487
+ }
2488
+ if (message.group !== undefined) {
2489
+ writer.uint32(50).string(message.group);
2490
+ }
2491
+ if (message.unit !== undefined) {
2492
+ writer.uint32(58).string(message.unit);
2493
+ }
2494
+ return writer;
2495
+ },
2496
+ decode(input, length) {
2497
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2498
+ const end = length === undefined ? reader.len : reader.pos + length;
2499
+ const message = createBaseInspectionTemplate_Item();
2500
+ while (reader.pos < end) {
2501
+ const tag = reader.uint32();
2502
+ switch (tag >>> 3) {
2503
+ case 1: {
2504
+ if (tag !== 10) {
2505
+ break;
2506
+ }
2507
+ message.key = reader.string();
2508
+ continue;
2509
+ }
2510
+ case 2: {
2511
+ if (tag !== 18) {
2512
+ break;
2513
+ }
2514
+ message.label = reader.string();
2515
+ continue;
2516
+ }
2517
+ case 3: {
2518
+ if (tag !== 24) {
2519
+ break;
2520
+ }
2521
+ message.answerType = reader.int32();
2522
+ continue;
2523
+ }
2524
+ case 4: {
2525
+ if (tag !== 32) {
2526
+ break;
2527
+ }
2528
+ message.critical = reader.bool();
2529
+ continue;
2530
+ }
2531
+ case 5: {
2532
+ if (tag !== 40) {
2533
+ break;
2534
+ }
2535
+ message.photoRequired = reader.bool();
2536
+ continue;
2537
+ }
2538
+ case 6: {
2539
+ if (tag !== 50) {
2540
+ break;
2541
+ }
2542
+ message.group = reader.string();
2543
+ continue;
2544
+ }
2545
+ case 7: {
2546
+ if (tag !== 58) {
2547
+ break;
2548
+ }
2549
+ message.unit = reader.string();
2550
+ continue;
2551
+ }
2552
+ }
2553
+ if ((tag & 7) === 4 || tag === 0) {
2554
+ break;
2555
+ }
2556
+ reader.skip(tag & 7);
2557
+ }
2558
+ return message;
2559
+ },
2560
+ create(base) {
2561
+ return InspectionTemplate_Item.fromPartial(base ?? {});
2562
+ },
2563
+ fromPartial(object) {
2564
+ const message = createBaseInspectionTemplate_Item();
2565
+ message.key = object.key ?? "";
2566
+ message.label = object.label ?? "";
2567
+ message.answerType = object.answerType ?? 0;
2568
+ message.critical = object.critical ?? false;
2569
+ message.photoRequired = object.photoRequired ?? false;
2570
+ message.group = object.group ?? undefined;
2571
+ message.unit = object.unit ?? undefined;
2572
+ return message;
2573
+ },
2574
+ };
2575
+ function createBaseInspection() {
2576
+ return {
2577
+ id: Long.UZERO,
2578
+ organizationId: Long.UZERO,
2579
+ deviceId: Long.UZERO,
2580
+ templateId: undefined,
2581
+ templateVersion: 0,
2582
+ driverId: undefined,
2583
+ status: 0,
2584
+ answers: [],
2585
+ odometer: undefined,
2586
+ latitude: undefined,
2587
+ longitude: undefined,
2588
+ note: undefined,
2589
+ certified: false,
2590
+ signatureFileId: undefined,
2591
+ submittedAt: undefined,
2592
+ vehicleCanMove: undefined,
2593
+ documentId: undefined,
2594
+ verificationCode: undefined,
2595
+ reviewedBy: undefined,
2596
+ reviewedAt: undefined,
2597
+ reviewSignatureId: undefined,
2598
+ reviewNote: undefined,
2599
+ clientUuid: undefined,
2600
+ createdBy: undefined,
2601
+ createdAt: undefined,
2602
+ updatedAt: undefined,
2603
+ template: undefined,
2604
+ document: undefined,
2605
+ };
2606
+ }
2607
+ export const Inspection = {
2608
+ encode(message, writer = new BinaryWriter()) {
2609
+ if (!message.id.equals(Long.UZERO)) {
2610
+ writer.uint32(8).uint64(message.id.toString());
2611
+ }
2612
+ if (!message.organizationId.equals(Long.UZERO)) {
2613
+ writer.uint32(16).uint64(message.organizationId.toString());
2614
+ }
2615
+ if (!message.deviceId.equals(Long.UZERO)) {
2616
+ writer.uint32(24).uint64(message.deviceId.toString());
2617
+ }
2618
+ if (message.templateId !== undefined) {
2619
+ writer.uint32(32).uint64(message.templateId.toString());
2620
+ }
2621
+ if (message.templateVersion !== 0) {
2622
+ writer.uint32(40).uint32(message.templateVersion);
2623
+ }
2624
+ if (message.driverId !== undefined) {
2625
+ writer.uint32(48).uint64(message.driverId.toString());
2626
+ }
2627
+ if (message.status !== 0) {
2628
+ writer.uint32(56).int32(message.status);
2629
+ }
2630
+ for (const v of message.answers) {
2631
+ Inspection_Answer.encode(v, writer.uint32(66).fork()).join();
2632
+ }
2633
+ if (message.odometer !== undefined) {
2634
+ writer.uint32(72).uint64(message.odometer.toString());
2635
+ }
2636
+ if (message.latitude !== undefined) {
2637
+ writer.uint32(81).double(message.latitude);
2638
+ }
2639
+ if (message.longitude !== undefined) {
2640
+ writer.uint32(89).double(message.longitude);
2641
+ }
2642
+ if (message.note !== undefined) {
2643
+ writer.uint32(98).string(message.note);
2644
+ }
2645
+ if (message.certified !== false) {
2646
+ writer.uint32(104).bool(message.certified);
2647
+ }
2648
+ if (message.signatureFileId !== undefined) {
2649
+ writer.uint32(112).uint64(message.signatureFileId.toString());
2650
+ }
2651
+ if (message.submittedAt !== undefined) {
2652
+ Timestamp.encode(toTimestamp(message.submittedAt), writer.uint32(122).fork()).join();
2653
+ }
2654
+ if (message.vehicleCanMove !== undefined) {
2655
+ writer.uint32(128).bool(message.vehicleCanMove);
2656
+ }
2657
+ if (message.documentId !== undefined) {
2658
+ writer.uint32(136).uint64(message.documentId.toString());
2659
+ }
2660
+ if (message.verificationCode !== undefined) {
2661
+ writer.uint32(146).string(message.verificationCode);
2662
+ }
2663
+ if (message.reviewedBy !== undefined) {
2664
+ writer.uint32(152).uint64(message.reviewedBy.toString());
2665
+ }
2666
+ if (message.reviewedAt !== undefined) {
2667
+ Timestamp.encode(toTimestamp(message.reviewedAt), writer.uint32(162).fork()).join();
2668
+ }
2669
+ if (message.reviewSignatureId !== undefined) {
2670
+ writer.uint32(168).uint64(message.reviewSignatureId.toString());
2671
+ }
2672
+ if (message.reviewNote !== undefined) {
2673
+ writer.uint32(178).string(message.reviewNote);
2674
+ }
2675
+ if (message.clientUuid !== undefined) {
2676
+ writer.uint32(186).string(message.clientUuid);
2677
+ }
2678
+ if (message.createdBy !== undefined) {
2679
+ writer.uint32(192).uint64(message.createdBy.toString());
2680
+ }
2681
+ if (message.createdAt !== undefined) {
2682
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(202).fork()).join();
2683
+ }
2684
+ if (message.updatedAt !== undefined) {
2685
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(210).fork()).join();
2686
+ }
2687
+ if (message.template !== undefined) {
2688
+ InspectionTemplate.encode(message.template, writer.uint32(218).fork()).join();
2689
+ }
2690
+ if (message.document !== undefined) {
2691
+ FleetDocument.encode(message.document, writer.uint32(226).fork()).join();
2692
+ }
2693
+ return writer;
2694
+ },
2695
+ decode(input, length) {
2696
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2697
+ const end = length === undefined ? reader.len : reader.pos + length;
2698
+ const message = createBaseInspection();
2699
+ while (reader.pos < end) {
2700
+ const tag = reader.uint32();
2701
+ switch (tag >>> 3) {
2702
+ case 1: {
2703
+ if (tag !== 8) {
2704
+ break;
2705
+ }
2706
+ message.id = Long.fromString(reader.uint64().toString(), true);
2707
+ continue;
2708
+ }
2709
+ case 2: {
2710
+ if (tag !== 16) {
2711
+ break;
2712
+ }
2713
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
2714
+ continue;
2715
+ }
2716
+ case 3: {
2717
+ if (tag !== 24) {
2718
+ break;
2719
+ }
2720
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
2721
+ continue;
2722
+ }
2723
+ case 4: {
2724
+ if (tag !== 32) {
2725
+ break;
2726
+ }
2727
+ message.templateId = Long.fromString(reader.uint64().toString(), true);
2728
+ continue;
2729
+ }
2730
+ case 5: {
2731
+ if (tag !== 40) {
2732
+ break;
2733
+ }
2734
+ message.templateVersion = reader.uint32();
2735
+ continue;
2736
+ }
2737
+ case 6: {
2738
+ if (tag !== 48) {
2739
+ break;
2740
+ }
2741
+ message.driverId = Long.fromString(reader.uint64().toString(), true);
2742
+ continue;
2743
+ }
2744
+ case 7: {
2745
+ if (tag !== 56) {
2746
+ break;
2747
+ }
2748
+ message.status = reader.int32();
2749
+ continue;
2750
+ }
2751
+ case 8: {
2752
+ if (tag !== 66) {
2753
+ break;
2754
+ }
2755
+ message.answers.push(Inspection_Answer.decode(reader, reader.uint32()));
2756
+ continue;
2757
+ }
2758
+ case 9: {
2759
+ if (tag !== 72) {
2760
+ break;
2761
+ }
2762
+ message.odometer = Long.fromString(reader.uint64().toString(), true);
2763
+ continue;
2764
+ }
2765
+ case 10: {
2766
+ if (tag !== 81) {
2767
+ break;
2768
+ }
2769
+ message.latitude = reader.double();
2770
+ continue;
2771
+ }
2772
+ case 11: {
2773
+ if (tag !== 89) {
2774
+ break;
2775
+ }
2776
+ message.longitude = reader.double();
2777
+ continue;
2778
+ }
2779
+ case 12: {
2780
+ if (tag !== 98) {
2781
+ break;
2782
+ }
2783
+ message.note = reader.string();
2784
+ continue;
2785
+ }
2786
+ case 13: {
2787
+ if (tag !== 104) {
2788
+ break;
2789
+ }
2790
+ message.certified = reader.bool();
2791
+ continue;
2792
+ }
2793
+ case 14: {
2794
+ if (tag !== 112) {
2795
+ break;
2796
+ }
2797
+ message.signatureFileId = Long.fromString(reader.uint64().toString(), true);
2798
+ continue;
2799
+ }
2800
+ case 15: {
2801
+ if (tag !== 122) {
2802
+ break;
2803
+ }
2804
+ message.submittedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2805
+ continue;
2806
+ }
2807
+ case 16: {
2808
+ if (tag !== 128) {
2809
+ break;
2810
+ }
2811
+ message.vehicleCanMove = reader.bool();
2812
+ continue;
2813
+ }
2814
+ case 17: {
2815
+ if (tag !== 136) {
2816
+ break;
2817
+ }
2818
+ message.documentId = Long.fromString(reader.uint64().toString(), true);
2819
+ continue;
2820
+ }
2821
+ case 18: {
2822
+ if (tag !== 146) {
2823
+ break;
2824
+ }
2825
+ message.verificationCode = reader.string();
2826
+ continue;
2827
+ }
2828
+ case 19: {
2829
+ if (tag !== 152) {
2830
+ break;
2831
+ }
2832
+ message.reviewedBy = Long.fromString(reader.uint64().toString(), true);
2833
+ continue;
2834
+ }
2835
+ case 20: {
2836
+ if (tag !== 162) {
2837
+ break;
2838
+ }
2839
+ message.reviewedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2840
+ continue;
2841
+ }
2842
+ case 21: {
2843
+ if (tag !== 168) {
2844
+ break;
2845
+ }
2846
+ message.reviewSignatureId = Long.fromString(reader.uint64().toString(), true);
2847
+ continue;
2848
+ }
2849
+ case 22: {
2850
+ if (tag !== 178) {
2851
+ break;
2852
+ }
2853
+ message.reviewNote = reader.string();
2854
+ continue;
2855
+ }
2856
+ case 23: {
2857
+ if (tag !== 186) {
2858
+ break;
2859
+ }
2860
+ message.clientUuid = reader.string();
2861
+ continue;
2862
+ }
2863
+ case 24: {
2864
+ if (tag !== 192) {
2865
+ break;
2866
+ }
2867
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
2868
+ continue;
2869
+ }
2870
+ case 25: {
2871
+ if (tag !== 202) {
2872
+ break;
2873
+ }
2874
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2875
+ continue;
2876
+ }
2877
+ case 26: {
2878
+ if (tag !== 210) {
2879
+ break;
2880
+ }
2881
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2882
+ continue;
2883
+ }
2884
+ case 27: {
2885
+ if (tag !== 218) {
2886
+ break;
2887
+ }
2888
+ message.template = InspectionTemplate.decode(reader, reader.uint32());
2889
+ continue;
2890
+ }
2891
+ case 28: {
2892
+ if (tag !== 226) {
2893
+ break;
2894
+ }
2895
+ message.document = FleetDocument.decode(reader, reader.uint32());
2896
+ continue;
2897
+ }
2898
+ }
2899
+ if ((tag & 7) === 4 || tag === 0) {
2900
+ break;
2901
+ }
2902
+ reader.skip(tag & 7);
2903
+ }
2904
+ return message;
2905
+ },
2906
+ create(base) {
2907
+ return Inspection.fromPartial(base ?? {});
2908
+ },
2909
+ fromPartial(object) {
2910
+ const message = createBaseInspection();
2911
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
2912
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
2913
+ ? Long.fromValue(object.organizationId)
2914
+ : Long.UZERO;
2915
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
2916
+ ? Long.fromValue(object.deviceId)
2917
+ : Long.UZERO;
2918
+ message.templateId = (object.templateId !== undefined && object.templateId !== null)
2919
+ ? Long.fromValue(object.templateId)
2920
+ : undefined;
2921
+ message.templateVersion = object.templateVersion ?? 0;
2922
+ message.driverId = (object.driverId !== undefined && object.driverId !== null)
2923
+ ? Long.fromValue(object.driverId)
2924
+ : undefined;
2925
+ message.status = object.status ?? 0;
2926
+ message.answers = object.answers?.map((e) => Inspection_Answer.fromPartial(e)) || [];
2927
+ message.odometer = (object.odometer !== undefined && object.odometer !== null)
2928
+ ? Long.fromValue(object.odometer)
2929
+ : undefined;
2930
+ message.latitude = object.latitude ?? undefined;
2931
+ message.longitude = object.longitude ?? undefined;
2932
+ message.note = object.note ?? undefined;
2933
+ message.certified = object.certified ?? false;
2934
+ message.signatureFileId = (object.signatureFileId !== undefined && object.signatureFileId !== null)
2935
+ ? Long.fromValue(object.signatureFileId)
2936
+ : undefined;
2937
+ message.submittedAt = object.submittedAt ?? undefined;
2938
+ message.vehicleCanMove = object.vehicleCanMove ?? undefined;
2939
+ message.documentId = (object.documentId !== undefined && object.documentId !== null)
2940
+ ? Long.fromValue(object.documentId)
2941
+ : undefined;
2942
+ message.verificationCode = object.verificationCode ?? undefined;
2943
+ message.reviewedBy = (object.reviewedBy !== undefined && object.reviewedBy !== null)
2944
+ ? Long.fromValue(object.reviewedBy)
2945
+ : undefined;
2946
+ message.reviewedAt = object.reviewedAt ?? undefined;
2947
+ message.reviewSignatureId = (object.reviewSignatureId !== undefined && object.reviewSignatureId !== null)
2948
+ ? Long.fromValue(object.reviewSignatureId)
2949
+ : undefined;
2950
+ message.reviewNote = object.reviewNote ?? undefined;
2951
+ message.clientUuid = object.clientUuid ?? undefined;
2952
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2953
+ ? Long.fromValue(object.createdBy)
2954
+ : undefined;
2955
+ message.createdAt = object.createdAt ?? undefined;
2956
+ message.updatedAt = object.updatedAt ?? undefined;
2957
+ message.template = (object.template !== undefined && object.template !== null)
2958
+ ? InspectionTemplate.fromPartial(object.template)
2959
+ : undefined;
2960
+ message.document = (object.document !== undefined && object.document !== null)
2961
+ ? FleetDocument.fromPartial(object.document)
2962
+ : undefined;
2963
+ return message;
2964
+ },
2965
+ };
2966
+ function createBaseInspection_Answer() {
2967
+ return {
2968
+ itemKey: "",
2969
+ label: "",
2970
+ answerType: 0,
2971
+ critical: false,
2972
+ result: 0,
2973
+ value: undefined,
2974
+ note: undefined,
2975
+ photoFileId: undefined,
2976
+ issueId: undefined,
2977
+ };
2978
+ }
2979
+ export const Inspection_Answer = {
2980
+ encode(message, writer = new BinaryWriter()) {
2981
+ if (message.itemKey !== "") {
2982
+ writer.uint32(10).string(message.itemKey);
2983
+ }
2984
+ if (message.label !== "") {
2985
+ writer.uint32(18).string(message.label);
2986
+ }
2987
+ if (message.answerType !== 0) {
2988
+ writer.uint32(24).int32(message.answerType);
2989
+ }
2990
+ if (message.critical !== false) {
2991
+ writer.uint32(32).bool(message.critical);
2992
+ }
2993
+ if (message.result !== 0) {
2994
+ writer.uint32(40).int32(message.result);
2995
+ }
2996
+ if (message.value !== undefined) {
2997
+ writer.uint32(49).double(message.value);
2998
+ }
2999
+ if (message.note !== undefined) {
3000
+ writer.uint32(58).string(message.note);
3001
+ }
3002
+ if (message.photoFileId !== undefined) {
3003
+ writer.uint32(64).uint64(message.photoFileId.toString());
3004
+ }
3005
+ if (message.issueId !== undefined) {
3006
+ writer.uint32(72).uint64(message.issueId.toString());
3007
+ }
3008
+ return writer;
3009
+ },
3010
+ decode(input, length) {
3011
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3012
+ const end = length === undefined ? reader.len : reader.pos + length;
3013
+ const message = createBaseInspection_Answer();
3014
+ while (reader.pos < end) {
3015
+ const tag = reader.uint32();
3016
+ switch (tag >>> 3) {
3017
+ case 1: {
3018
+ if (tag !== 10) {
3019
+ break;
3020
+ }
3021
+ message.itemKey = reader.string();
3022
+ continue;
3023
+ }
3024
+ case 2: {
3025
+ if (tag !== 18) {
3026
+ break;
3027
+ }
3028
+ message.label = reader.string();
3029
+ continue;
3030
+ }
3031
+ case 3: {
3032
+ if (tag !== 24) {
3033
+ break;
3034
+ }
3035
+ message.answerType = reader.int32();
3036
+ continue;
3037
+ }
3038
+ case 4: {
3039
+ if (tag !== 32) {
3040
+ break;
3041
+ }
3042
+ message.critical = reader.bool();
3043
+ continue;
3044
+ }
3045
+ case 5: {
3046
+ if (tag !== 40) {
3047
+ break;
3048
+ }
3049
+ message.result = reader.int32();
3050
+ continue;
3051
+ }
3052
+ case 6: {
3053
+ if (tag !== 49) {
3054
+ break;
3055
+ }
3056
+ message.value = reader.double();
3057
+ continue;
3058
+ }
3059
+ case 7: {
3060
+ if (tag !== 58) {
3061
+ break;
3062
+ }
3063
+ message.note = reader.string();
3064
+ continue;
3065
+ }
3066
+ case 8: {
3067
+ if (tag !== 64) {
3068
+ break;
3069
+ }
3070
+ message.photoFileId = Long.fromString(reader.uint64().toString(), true);
3071
+ continue;
3072
+ }
3073
+ case 9: {
3074
+ if (tag !== 72) {
3075
+ break;
3076
+ }
3077
+ message.issueId = Long.fromString(reader.uint64().toString(), true);
3078
+ continue;
3079
+ }
3080
+ }
3081
+ if ((tag & 7) === 4 || tag === 0) {
3082
+ break;
3083
+ }
3084
+ reader.skip(tag & 7);
3085
+ }
3086
+ return message;
3087
+ },
3088
+ create(base) {
3089
+ return Inspection_Answer.fromPartial(base ?? {});
3090
+ },
3091
+ fromPartial(object) {
3092
+ const message = createBaseInspection_Answer();
3093
+ message.itemKey = object.itemKey ?? "";
3094
+ message.label = object.label ?? "";
3095
+ message.answerType = object.answerType ?? 0;
3096
+ message.critical = object.critical ?? false;
3097
+ message.result = object.result ?? 0;
3098
+ message.value = object.value ?? undefined;
3099
+ message.note = object.note ?? undefined;
3100
+ message.photoFileId = (object.photoFileId !== undefined && object.photoFileId !== null)
3101
+ ? Long.fromValue(object.photoFileId)
3102
+ : undefined;
3103
+ message.issueId = (object.issueId !== undefined && object.issueId !== null)
3104
+ ? Long.fromValue(object.issueId)
3105
+ : undefined;
3106
+ return message;
3107
+ },
3108
+ };
3109
+ function createBaseOutOfService() {
3110
+ return {
3111
+ id: Long.UZERO,
3112
+ organizationId: Long.UZERO,
3113
+ deviceId: Long.UZERO,
3114
+ reason: 0,
3115
+ status: 0,
3116
+ note: undefined,
3117
+ startedAt: undefined,
3118
+ expectedReturnAt: undefined,
3119
+ endedAt: undefined,
3120
+ issueId: undefined,
3121
+ maintenanceId: undefined,
3122
+ inspectionId: undefined,
3123
+ endedBy: undefined,
3124
+ endNote: undefined,
3125
+ createdBy: undefined,
3126
+ createdAt: undefined,
3127
+ updatedAt: undefined,
3128
+ };
3129
+ }
3130
+ export const OutOfService = {
3131
+ encode(message, writer = new BinaryWriter()) {
3132
+ if (!message.id.equals(Long.UZERO)) {
3133
+ writer.uint32(8).uint64(message.id.toString());
3134
+ }
3135
+ if (!message.organizationId.equals(Long.UZERO)) {
3136
+ writer.uint32(16).uint64(message.organizationId.toString());
3137
+ }
3138
+ if (!message.deviceId.equals(Long.UZERO)) {
3139
+ writer.uint32(24).uint64(message.deviceId.toString());
3140
+ }
3141
+ if (message.reason !== 0) {
3142
+ writer.uint32(32).int32(message.reason);
3143
+ }
3144
+ if (message.status !== 0) {
3145
+ writer.uint32(40).int32(message.status);
3146
+ }
3147
+ if (message.note !== undefined) {
3148
+ writer.uint32(50).string(message.note);
3149
+ }
3150
+ if (message.startedAt !== undefined) {
3151
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(58).fork()).join();
3152
+ }
3153
+ if (message.expectedReturnAt !== undefined) {
3154
+ Timestamp.encode(toTimestamp(message.expectedReturnAt), writer.uint32(66).fork()).join();
3155
+ }
3156
+ if (message.endedAt !== undefined) {
3157
+ Timestamp.encode(toTimestamp(message.endedAt), writer.uint32(74).fork()).join();
3158
+ }
3159
+ if (message.issueId !== undefined) {
3160
+ writer.uint32(80).uint64(message.issueId.toString());
3161
+ }
3162
+ if (message.maintenanceId !== undefined) {
3163
+ writer.uint32(88).uint64(message.maintenanceId.toString());
3164
+ }
3165
+ if (message.inspectionId !== undefined) {
3166
+ writer.uint32(96).uint64(message.inspectionId.toString());
3167
+ }
3168
+ if (message.endedBy !== undefined) {
3169
+ writer.uint32(104).uint64(message.endedBy.toString());
3170
+ }
3171
+ if (message.endNote !== undefined) {
3172
+ writer.uint32(114).string(message.endNote);
3173
+ }
3174
+ if (message.createdBy !== undefined) {
3175
+ writer.uint32(120).uint64(message.createdBy.toString());
3176
+ }
3177
+ if (message.createdAt !== undefined) {
3178
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(130).fork()).join();
3179
+ }
3180
+ if (message.updatedAt !== undefined) {
3181
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(138).fork()).join();
3182
+ }
3183
+ return writer;
3184
+ },
3185
+ decode(input, length) {
3186
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3187
+ const end = length === undefined ? reader.len : reader.pos + length;
3188
+ const message = createBaseOutOfService();
3189
+ while (reader.pos < end) {
3190
+ const tag = reader.uint32();
3191
+ switch (tag >>> 3) {
3192
+ case 1: {
3193
+ if (tag !== 8) {
3194
+ break;
3195
+ }
3196
+ message.id = Long.fromString(reader.uint64().toString(), true);
3197
+ continue;
3198
+ }
3199
+ case 2: {
3200
+ if (tag !== 16) {
3201
+ break;
3202
+ }
3203
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
3204
+ continue;
3205
+ }
3206
+ case 3: {
3207
+ if (tag !== 24) {
3208
+ break;
3209
+ }
3210
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
3211
+ continue;
3212
+ }
3213
+ case 4: {
3214
+ if (tag !== 32) {
3215
+ break;
3216
+ }
3217
+ message.reason = reader.int32();
3218
+ continue;
3219
+ }
3220
+ case 5: {
3221
+ if (tag !== 40) {
3222
+ break;
3223
+ }
3224
+ message.status = reader.int32();
3225
+ continue;
3226
+ }
3227
+ case 6: {
3228
+ if (tag !== 50) {
3229
+ break;
3230
+ }
3231
+ message.note = reader.string();
3232
+ continue;
3233
+ }
3234
+ case 7: {
3235
+ if (tag !== 58) {
3236
+ break;
3237
+ }
3238
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3239
+ continue;
3240
+ }
3241
+ case 8: {
3242
+ if (tag !== 66) {
3243
+ break;
3244
+ }
3245
+ message.expectedReturnAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3246
+ continue;
3247
+ }
3248
+ case 9: {
3249
+ if (tag !== 74) {
3250
+ break;
3251
+ }
3252
+ message.endedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3253
+ continue;
3254
+ }
3255
+ case 10: {
3256
+ if (tag !== 80) {
3257
+ break;
3258
+ }
3259
+ message.issueId = Long.fromString(reader.uint64().toString(), true);
3260
+ continue;
3261
+ }
3262
+ case 11: {
3263
+ if (tag !== 88) {
3264
+ break;
3265
+ }
3266
+ message.maintenanceId = Long.fromString(reader.uint64().toString(), true);
3267
+ continue;
3268
+ }
3269
+ case 12: {
3270
+ if (tag !== 96) {
3271
+ break;
3272
+ }
3273
+ message.inspectionId = Long.fromString(reader.uint64().toString(), true);
3274
+ continue;
3275
+ }
3276
+ case 13: {
3277
+ if (tag !== 104) {
3278
+ break;
3279
+ }
3280
+ message.endedBy = Long.fromString(reader.uint64().toString(), true);
3281
+ continue;
3282
+ }
3283
+ case 14: {
3284
+ if (tag !== 114) {
3285
+ break;
3286
+ }
3287
+ message.endNote = reader.string();
3288
+ continue;
3289
+ }
3290
+ case 15: {
3291
+ if (tag !== 120) {
3292
+ break;
3293
+ }
3294
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
3295
+ continue;
3296
+ }
3297
+ case 16: {
3298
+ if (tag !== 130) {
3299
+ break;
3300
+ }
3301
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3302
+ continue;
3303
+ }
3304
+ case 17: {
3305
+ if (tag !== 138) {
3306
+ break;
3307
+ }
3308
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3309
+ continue;
3310
+ }
3311
+ }
3312
+ if ((tag & 7) === 4 || tag === 0) {
3313
+ break;
3314
+ }
3315
+ reader.skip(tag & 7);
3316
+ }
3317
+ return message;
3318
+ },
3319
+ create(base) {
3320
+ return OutOfService.fromPartial(base ?? {});
3321
+ },
3322
+ fromPartial(object) {
3323
+ const message = createBaseOutOfService();
3324
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
3325
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
3326
+ ? Long.fromValue(object.organizationId)
3327
+ : Long.UZERO;
3328
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
3329
+ ? Long.fromValue(object.deviceId)
3330
+ : Long.UZERO;
3331
+ message.reason = object.reason ?? 0;
3332
+ message.status = object.status ?? 0;
3333
+ message.note = object.note ?? undefined;
3334
+ message.startedAt = object.startedAt ?? undefined;
3335
+ message.expectedReturnAt = object.expectedReturnAt ?? undefined;
3336
+ message.endedAt = object.endedAt ?? undefined;
3337
+ message.issueId = (object.issueId !== undefined && object.issueId !== null)
3338
+ ? Long.fromValue(object.issueId)
3339
+ : undefined;
3340
+ message.maintenanceId = (object.maintenanceId !== undefined && object.maintenanceId !== null)
3341
+ ? Long.fromValue(object.maintenanceId)
3342
+ : undefined;
3343
+ message.inspectionId = (object.inspectionId !== undefined && object.inspectionId !== null)
3344
+ ? Long.fromValue(object.inspectionId)
3345
+ : undefined;
3346
+ message.endedBy = (object.endedBy !== undefined && object.endedBy !== null)
3347
+ ? Long.fromValue(object.endedBy)
3348
+ : undefined;
3349
+ message.endNote = object.endNote ?? undefined;
3350
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
3351
+ ? Long.fromValue(object.createdBy)
3352
+ : undefined;
3353
+ message.createdAt = object.createdAt ?? undefined;
3354
+ message.updatedAt = object.updatedAt ?? undefined;
3355
+ return message;
3356
+ },
3357
+ };
3358
+ function createBaseFleetDocument() {
3359
+ return {
3360
+ id: Long.UZERO,
3361
+ organizationId: Long.UZERO,
3362
+ name: undefined,
3363
+ docType: 0,
3364
+ url: "",
3365
+ objectType: undefined,
3366
+ objectId: undefined,
3367
+ deviceId: undefined,
3368
+ issuedAt: undefined,
3369
+ expiresAt: undefined,
3370
+ remindDaysBefore: undefined,
3371
+ version: 0,
3372
+ replacesId: undefined,
3373
+ status: 0,
3374
+ review: 0,
3375
+ reviewNote: undefined,
3376
+ reviewedBy: undefined,
3377
+ verificationCode: undefined,
3378
+ mime: undefined,
3379
+ size: undefined,
3380
+ createdBy: undefined,
3381
+ createdAt: undefined,
3382
+ updatedAt: undefined,
3383
+ archivedAt: undefined,
3384
+ versions: [],
3385
+ };
3386
+ }
3387
+ export const FleetDocument = {
3388
+ encode(message, writer = new BinaryWriter()) {
3389
+ if (!message.id.equals(Long.UZERO)) {
3390
+ writer.uint32(8).uint64(message.id.toString());
3391
+ }
3392
+ if (!message.organizationId.equals(Long.UZERO)) {
3393
+ writer.uint32(16).uint64(message.organizationId.toString());
3394
+ }
3395
+ if (message.name !== undefined) {
3396
+ writer.uint32(26).string(message.name);
3397
+ }
3398
+ if (message.docType !== 0) {
3399
+ writer.uint32(32).int32(message.docType);
3400
+ }
3401
+ if (message.url !== "") {
3402
+ writer.uint32(42).string(message.url);
3403
+ }
3404
+ if (message.objectType !== undefined) {
3405
+ writer.uint32(50).string(message.objectType);
3406
+ }
3407
+ if (message.objectId !== undefined) {
3408
+ writer.uint32(56).uint64(message.objectId.toString());
3409
+ }
3410
+ if (message.deviceId !== undefined) {
3411
+ writer.uint32(64).uint64(message.deviceId.toString());
3412
+ }
3413
+ if (message.issuedAt !== undefined) {
3414
+ Timestamp.encode(toTimestamp(message.issuedAt), writer.uint32(74).fork()).join();
3415
+ }
3416
+ if (message.expiresAt !== undefined) {
3417
+ Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(82).fork()).join();
3418
+ }
3419
+ if (message.remindDaysBefore !== undefined) {
3420
+ writer.uint32(88).uint32(message.remindDaysBefore);
3421
+ }
3422
+ if (message.version !== 0) {
3423
+ writer.uint32(96).uint32(message.version);
3424
+ }
3425
+ if (message.replacesId !== undefined) {
3426
+ writer.uint32(104).uint64(message.replacesId.toString());
3427
+ }
3428
+ if (message.status !== 0) {
3429
+ writer.uint32(112).int32(message.status);
3430
+ }
3431
+ if (message.review !== 0) {
3432
+ writer.uint32(120).int32(message.review);
3433
+ }
3434
+ if (message.reviewNote !== undefined) {
3435
+ writer.uint32(130).string(message.reviewNote);
3436
+ }
3437
+ if (message.reviewedBy !== undefined) {
3438
+ writer.uint32(136).uint64(message.reviewedBy.toString());
3439
+ }
3440
+ if (message.verificationCode !== undefined) {
3441
+ writer.uint32(146).string(message.verificationCode);
3442
+ }
3443
+ if (message.mime !== undefined) {
3444
+ writer.uint32(154).string(message.mime);
3445
+ }
3446
+ if (message.size !== undefined) {
3447
+ writer.uint32(160).uint64(message.size.toString());
3448
+ }
3449
+ if (message.createdBy !== undefined) {
3450
+ writer.uint32(168).uint64(message.createdBy.toString());
3451
+ }
3452
+ if (message.createdAt !== undefined) {
3453
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(178).fork()).join();
3454
+ }
3455
+ if (message.updatedAt !== undefined) {
3456
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(186).fork()).join();
3457
+ }
3458
+ if (message.archivedAt !== undefined) {
3459
+ Timestamp.encode(toTimestamp(message.archivedAt), writer.uint32(194).fork()).join();
3460
+ }
3461
+ for (const v of message.versions) {
3462
+ FleetDocument.encode(v, writer.uint32(202).fork()).join();
3463
+ }
3464
+ return writer;
3465
+ },
3466
+ decode(input, length) {
3467
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3468
+ const end = length === undefined ? reader.len : reader.pos + length;
3469
+ const message = createBaseFleetDocument();
3470
+ while (reader.pos < end) {
3471
+ const tag = reader.uint32();
3472
+ switch (tag >>> 3) {
3473
+ case 1: {
3474
+ if (tag !== 8) {
3475
+ break;
3476
+ }
3477
+ message.id = Long.fromString(reader.uint64().toString(), true);
3478
+ continue;
3479
+ }
3480
+ case 2: {
3481
+ if (tag !== 16) {
3482
+ break;
3483
+ }
3484
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
3485
+ continue;
3486
+ }
3487
+ case 3: {
3488
+ if (tag !== 26) {
3489
+ break;
3490
+ }
3491
+ message.name = reader.string();
3492
+ continue;
3493
+ }
3494
+ case 4: {
3495
+ if (tag !== 32) {
3496
+ break;
3497
+ }
3498
+ message.docType = reader.int32();
3499
+ continue;
3500
+ }
3501
+ case 5: {
3502
+ if (tag !== 42) {
3503
+ break;
3504
+ }
3505
+ message.url = reader.string();
3506
+ continue;
3507
+ }
3508
+ case 6: {
3509
+ if (tag !== 50) {
3510
+ break;
3511
+ }
3512
+ message.objectType = reader.string();
3513
+ continue;
3514
+ }
3515
+ case 7: {
3516
+ if (tag !== 56) {
3517
+ break;
3518
+ }
3519
+ message.objectId = Long.fromString(reader.uint64().toString(), true);
3520
+ continue;
3521
+ }
3522
+ case 8: {
3523
+ if (tag !== 64) {
3524
+ break;
3525
+ }
3526
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
3527
+ continue;
3528
+ }
3529
+ case 9: {
3530
+ if (tag !== 74) {
3531
+ break;
3532
+ }
3533
+ message.issuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3534
+ continue;
3535
+ }
3536
+ case 10: {
3537
+ if (tag !== 82) {
3538
+ break;
3539
+ }
3540
+ message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3541
+ continue;
3542
+ }
3543
+ case 11: {
3544
+ if (tag !== 88) {
3545
+ break;
3546
+ }
3547
+ message.remindDaysBefore = reader.uint32();
3548
+ continue;
3549
+ }
3550
+ case 12: {
3551
+ if (tag !== 96) {
3552
+ break;
3553
+ }
3554
+ message.version = reader.uint32();
3555
+ continue;
3556
+ }
3557
+ case 13: {
3558
+ if (tag !== 104) {
3559
+ break;
3560
+ }
3561
+ message.replacesId = Long.fromString(reader.uint64().toString(), true);
3562
+ continue;
3563
+ }
3564
+ case 14: {
3565
+ if (tag !== 112) {
3566
+ break;
3567
+ }
3568
+ message.status = reader.int32();
3569
+ continue;
3570
+ }
3571
+ case 15: {
3572
+ if (tag !== 120) {
3573
+ break;
3574
+ }
3575
+ message.review = reader.int32();
3576
+ continue;
3577
+ }
3578
+ case 16: {
3579
+ if (tag !== 130) {
3580
+ break;
3581
+ }
3582
+ message.reviewNote = reader.string();
3583
+ continue;
3584
+ }
3585
+ case 17: {
3586
+ if (tag !== 136) {
3587
+ break;
3588
+ }
3589
+ message.reviewedBy = Long.fromString(reader.uint64().toString(), true);
3590
+ continue;
3591
+ }
3592
+ case 18: {
3593
+ if (tag !== 146) {
3594
+ break;
3595
+ }
3596
+ message.verificationCode = reader.string();
3597
+ continue;
3598
+ }
3599
+ case 19: {
3600
+ if (tag !== 154) {
3601
+ break;
3602
+ }
3603
+ message.mime = reader.string();
3604
+ continue;
3605
+ }
3606
+ case 20: {
3607
+ if (tag !== 160) {
3608
+ break;
3609
+ }
3610
+ message.size = Long.fromString(reader.uint64().toString(), true);
3611
+ continue;
3612
+ }
3613
+ case 21: {
3614
+ if (tag !== 168) {
3615
+ break;
3616
+ }
3617
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
3618
+ continue;
3619
+ }
3620
+ case 22: {
3621
+ if (tag !== 178) {
3622
+ break;
3623
+ }
3624
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3625
+ continue;
3626
+ }
3627
+ case 23: {
3628
+ if (tag !== 186) {
3629
+ break;
3630
+ }
3631
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3632
+ continue;
3633
+ }
3634
+ case 24: {
3635
+ if (tag !== 194) {
3636
+ break;
3637
+ }
3638
+ message.archivedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3639
+ continue;
3640
+ }
3641
+ case 25: {
3642
+ if (tag !== 202) {
3643
+ break;
3644
+ }
3645
+ message.versions.push(FleetDocument.decode(reader, reader.uint32()));
3646
+ continue;
3647
+ }
3648
+ }
3649
+ if ((tag & 7) === 4 || tag === 0) {
3650
+ break;
3651
+ }
3652
+ reader.skip(tag & 7);
3653
+ }
3654
+ return message;
3655
+ },
3656
+ create(base) {
3657
+ return FleetDocument.fromPartial(base ?? {});
3658
+ },
3659
+ fromPartial(object) {
3660
+ const message = createBaseFleetDocument();
3661
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
3662
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
3663
+ ? Long.fromValue(object.organizationId)
3664
+ : Long.UZERO;
3665
+ message.name = object.name ?? undefined;
3666
+ message.docType = object.docType ?? 0;
3667
+ message.url = object.url ?? "";
3668
+ message.objectType = object.objectType ?? undefined;
3669
+ message.objectId = (object.objectId !== undefined && object.objectId !== null)
3670
+ ? Long.fromValue(object.objectId)
3671
+ : undefined;
3672
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
3673
+ ? Long.fromValue(object.deviceId)
3674
+ : undefined;
3675
+ message.issuedAt = object.issuedAt ?? undefined;
3676
+ message.expiresAt = object.expiresAt ?? undefined;
3677
+ message.remindDaysBefore = object.remindDaysBefore ?? undefined;
3678
+ message.version = object.version ?? 0;
3679
+ message.replacesId = (object.replacesId !== undefined && object.replacesId !== null)
3680
+ ? Long.fromValue(object.replacesId)
3681
+ : undefined;
3682
+ message.status = object.status ?? 0;
3683
+ message.review = object.review ?? 0;
3684
+ message.reviewNote = object.reviewNote ?? undefined;
3685
+ message.reviewedBy = (object.reviewedBy !== undefined && object.reviewedBy !== null)
3686
+ ? Long.fromValue(object.reviewedBy)
3687
+ : undefined;
3688
+ message.verificationCode = object.verificationCode ?? undefined;
3689
+ message.mime = object.mime ?? undefined;
3690
+ message.size = (object.size !== undefined && object.size !== null) ? Long.fromValue(object.size) : undefined;
3691
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
3692
+ ? Long.fromValue(object.createdBy)
3693
+ : undefined;
3694
+ message.createdAt = object.createdAt ?? undefined;
3695
+ message.updatedAt = object.updatedAt ?? undefined;
3696
+ message.archivedAt = object.archivedAt ?? undefined;
3697
+ message.versions = object.versions?.map((e) => FleetDocument.fromPartial(e)) || [];
3698
+ return message;
3699
+ },
3700
+ };
3701
+ function createBaseDocumentRequirement() {
3702
+ return {
3703
+ id: Long.UZERO,
3704
+ organizationId: Long.UZERO,
3705
+ docType: 0,
3706
+ appliesTo: 0,
3707
+ condition: 0,
3708
+ conditionIds: [],
3709
+ mandatory: false,
3710
+ isActive: false,
3711
+ metCount: 0,
3712
+ missingCount: 0,
3713
+ dueSoonCount: 0,
3714
+ subjects: [],
3715
+ createdBy: undefined,
3716
+ createdAt: undefined,
3717
+ updatedAt: undefined,
3718
+ };
3719
+ }
3720
+ export const DocumentRequirement = {
3721
+ encode(message, writer = new BinaryWriter()) {
3722
+ if (!message.id.equals(Long.UZERO)) {
3723
+ writer.uint32(8).uint64(message.id.toString());
3724
+ }
3725
+ if (!message.organizationId.equals(Long.UZERO)) {
3726
+ writer.uint32(16).uint64(message.organizationId.toString());
3727
+ }
3728
+ if (message.docType !== 0) {
3729
+ writer.uint32(24).int32(message.docType);
3730
+ }
3731
+ if (message.appliesTo !== 0) {
3732
+ writer.uint32(32).int32(message.appliesTo);
3733
+ }
3734
+ if (message.condition !== 0) {
3735
+ writer.uint32(40).int32(message.condition);
3736
+ }
3737
+ writer.uint32(50).fork();
3738
+ for (const v of message.conditionIds) {
3739
+ writer.uint64(v.toString());
3740
+ }
3741
+ writer.join();
3742
+ if (message.mandatory !== false) {
3743
+ writer.uint32(56).bool(message.mandatory);
3744
+ }
3745
+ if (message.isActive !== false) {
3746
+ writer.uint32(64).bool(message.isActive);
3747
+ }
3748
+ if (message.metCount !== 0) {
3749
+ writer.uint32(72).uint32(message.metCount);
3750
+ }
3751
+ if (message.missingCount !== 0) {
3752
+ writer.uint32(80).uint32(message.missingCount);
3753
+ }
3754
+ if (message.dueSoonCount !== 0) {
3755
+ writer.uint32(88).uint32(message.dueSoonCount);
3756
+ }
3757
+ for (const v of message.subjects) {
3758
+ DocumentRequirement_Subject.encode(v, writer.uint32(98).fork()).join();
3759
+ }
3760
+ if (message.createdBy !== undefined) {
3761
+ writer.uint32(104).uint64(message.createdBy.toString());
3762
+ }
3763
+ if (message.createdAt !== undefined) {
3764
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(114).fork()).join();
3765
+ }
3766
+ if (message.updatedAt !== undefined) {
3767
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(122).fork()).join();
3768
+ }
3769
+ return writer;
3770
+ },
3771
+ decode(input, length) {
3772
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3773
+ const end = length === undefined ? reader.len : reader.pos + length;
3774
+ const message = createBaseDocumentRequirement();
3775
+ while (reader.pos < end) {
3776
+ const tag = reader.uint32();
3777
+ switch (tag >>> 3) {
3778
+ case 1: {
3779
+ if (tag !== 8) {
3780
+ break;
3781
+ }
3782
+ message.id = Long.fromString(reader.uint64().toString(), true);
3783
+ continue;
3784
+ }
3785
+ case 2: {
3786
+ if (tag !== 16) {
3787
+ break;
3788
+ }
3789
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
3790
+ continue;
3791
+ }
3792
+ case 3: {
3793
+ if (tag !== 24) {
3794
+ break;
3795
+ }
3796
+ message.docType = reader.int32();
3797
+ continue;
3798
+ }
3799
+ case 4: {
3800
+ if (tag !== 32) {
3801
+ break;
3802
+ }
3803
+ message.appliesTo = reader.int32();
3804
+ continue;
3805
+ }
3806
+ case 5: {
3807
+ if (tag !== 40) {
3808
+ break;
3809
+ }
3810
+ message.condition = reader.int32();
3811
+ continue;
3812
+ }
3813
+ case 6: {
3814
+ if (tag === 48) {
3815
+ message.conditionIds.push(Long.fromString(reader.uint64().toString(), true));
3816
+ continue;
3817
+ }
3818
+ if (tag === 50) {
3819
+ const end2 = reader.uint32() + reader.pos;
3820
+ while (reader.pos < end2) {
3821
+ message.conditionIds.push(Long.fromString(reader.uint64().toString(), true));
3822
+ }
3823
+ continue;
3824
+ }
3825
+ break;
3826
+ }
3827
+ case 7: {
3828
+ if (tag !== 56) {
3829
+ break;
3830
+ }
3831
+ message.mandatory = reader.bool();
3832
+ continue;
3833
+ }
3834
+ case 8: {
3835
+ if (tag !== 64) {
3836
+ break;
3837
+ }
3838
+ message.isActive = reader.bool();
3839
+ continue;
3840
+ }
3841
+ case 9: {
3842
+ if (tag !== 72) {
3843
+ break;
3844
+ }
3845
+ message.metCount = reader.uint32();
3846
+ continue;
3847
+ }
3848
+ case 10: {
3849
+ if (tag !== 80) {
3850
+ break;
3851
+ }
3852
+ message.missingCount = reader.uint32();
3853
+ continue;
3854
+ }
3855
+ case 11: {
3856
+ if (tag !== 88) {
3857
+ break;
3858
+ }
3859
+ message.dueSoonCount = reader.uint32();
3860
+ continue;
3861
+ }
3862
+ case 12: {
3863
+ if (tag !== 98) {
3864
+ break;
3865
+ }
3866
+ message.subjects.push(DocumentRequirement_Subject.decode(reader, reader.uint32()));
3867
+ continue;
3868
+ }
3869
+ case 13: {
3870
+ if (tag !== 104) {
3871
+ break;
3872
+ }
3873
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
3874
+ continue;
3875
+ }
3876
+ case 14: {
3877
+ if (tag !== 114) {
3878
+ break;
3879
+ }
3880
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3881
+ continue;
3882
+ }
3883
+ case 15: {
3884
+ if (tag !== 122) {
3885
+ break;
3886
+ }
3887
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3888
+ continue;
3889
+ }
3890
+ }
3891
+ if ((tag & 7) === 4 || tag === 0) {
3892
+ break;
3893
+ }
3894
+ reader.skip(tag & 7);
3895
+ }
3896
+ return message;
3897
+ },
3898
+ create(base) {
3899
+ return DocumentRequirement.fromPartial(base ?? {});
3900
+ },
3901
+ fromPartial(object) {
3902
+ const message = createBaseDocumentRequirement();
3903
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
3904
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
3905
+ ? Long.fromValue(object.organizationId)
3906
+ : Long.UZERO;
3907
+ message.docType = object.docType ?? 0;
3908
+ message.appliesTo = object.appliesTo ?? 0;
3909
+ message.condition = object.condition ?? 0;
3910
+ message.conditionIds = object.conditionIds?.map((e) => Long.fromValue(e)) || [];
3911
+ message.mandatory = object.mandatory ?? false;
3912
+ message.isActive = object.isActive ?? false;
3913
+ message.metCount = object.metCount ?? 0;
3914
+ message.missingCount = object.missingCount ?? 0;
3915
+ message.dueSoonCount = object.dueSoonCount ?? 0;
3916
+ message.subjects = object.subjects?.map((e) => DocumentRequirement_Subject.fromPartial(e)) || [];
3917
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
3918
+ ? Long.fromValue(object.createdBy)
3919
+ : undefined;
3920
+ message.createdAt = object.createdAt ?? undefined;
3921
+ message.updatedAt = object.updatedAt ?? undefined;
3922
+ return message;
3923
+ },
3924
+ };
3925
+ function createBaseDocumentRequirement_Subject() {
3926
+ return { subjectType: 0, subjectId: Long.UZERO, name: "", deviceId: undefined, state: 0, document: undefined };
3927
+ }
3928
+ export const DocumentRequirement_Subject = {
3929
+ encode(message, writer = new BinaryWriter()) {
3930
+ if (message.subjectType !== 0) {
3931
+ writer.uint32(8).int32(message.subjectType);
3932
+ }
3933
+ if (!message.subjectId.equals(Long.UZERO)) {
3934
+ writer.uint32(16).uint64(message.subjectId.toString());
3935
+ }
3936
+ if (message.name !== "") {
3937
+ writer.uint32(26).string(message.name);
3938
+ }
3939
+ if (message.deviceId !== undefined) {
3940
+ writer.uint32(32).uint64(message.deviceId.toString());
3941
+ }
3942
+ if (message.state !== 0) {
3943
+ writer.uint32(40).int32(message.state);
3944
+ }
3945
+ if (message.document !== undefined) {
3946
+ FleetDocument.encode(message.document, writer.uint32(50).fork()).join();
3947
+ }
3948
+ return writer;
3949
+ },
3950
+ decode(input, length) {
3951
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3952
+ const end = length === undefined ? reader.len : reader.pos + length;
3953
+ const message = createBaseDocumentRequirement_Subject();
3954
+ while (reader.pos < end) {
3955
+ const tag = reader.uint32();
3956
+ switch (tag >>> 3) {
3957
+ case 1: {
3958
+ if (tag !== 8) {
3959
+ break;
3960
+ }
3961
+ message.subjectType = reader.int32();
3962
+ continue;
3963
+ }
3964
+ case 2: {
3965
+ if (tag !== 16) {
3966
+ break;
3967
+ }
3968
+ message.subjectId = Long.fromString(reader.uint64().toString(), true);
3969
+ continue;
3970
+ }
3971
+ case 3: {
3972
+ if (tag !== 26) {
3973
+ break;
3974
+ }
3975
+ message.name = reader.string();
3976
+ continue;
3977
+ }
3978
+ case 4: {
3979
+ if (tag !== 32) {
3980
+ break;
3981
+ }
3982
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
3983
+ continue;
3984
+ }
3985
+ case 5: {
3986
+ if (tag !== 40) {
3987
+ break;
3988
+ }
3989
+ message.state = reader.int32();
3990
+ continue;
3991
+ }
3992
+ case 6: {
3993
+ if (tag !== 50) {
3994
+ break;
3995
+ }
3996
+ message.document = FleetDocument.decode(reader, reader.uint32());
3997
+ continue;
3998
+ }
3999
+ }
4000
+ if ((tag & 7) === 4 || tag === 0) {
4001
+ break;
4002
+ }
4003
+ reader.skip(tag & 7);
4004
+ }
4005
+ return message;
4006
+ },
4007
+ create(base) {
4008
+ return DocumentRequirement_Subject.fromPartial(base ?? {});
4009
+ },
4010
+ fromPartial(object) {
4011
+ const message = createBaseDocumentRequirement_Subject();
4012
+ message.subjectType = object.subjectType ?? 0;
4013
+ message.subjectId = (object.subjectId !== undefined && object.subjectId !== null)
4014
+ ? Long.fromValue(object.subjectId)
4015
+ : Long.UZERO;
4016
+ message.name = object.name ?? "";
4017
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
4018
+ ? Long.fromValue(object.deviceId)
4019
+ : undefined;
4020
+ message.state = object.state ?? 0;
4021
+ message.document = (object.document !== undefined && object.document !== null)
4022
+ ? FleetDocument.fromPartial(object.document)
4023
+ : undefined;
4024
+ return message;
4025
+ },
4026
+ };
4027
+ function createBaseFleetInboxItem() {
4028
+ return {
4029
+ kind: 0,
4030
+ subjectType: 0,
4031
+ subjectId: Long.UZERO,
4032
+ deviceId: undefined,
4033
+ title: "",
4034
+ subtitle: undefined,
4035
+ amount: undefined,
4036
+ currencyId: undefined,
4037
+ urgent: false,
4038
+ since: undefined,
4039
+ flags: [],
4040
+ };
4041
+ }
4042
+ export const FleetInboxItem = {
4043
+ encode(message, writer = new BinaryWriter()) {
4044
+ if (message.kind !== 0) {
4045
+ writer.uint32(8).int32(message.kind);
4046
+ }
4047
+ if (message.subjectType !== 0) {
4048
+ writer.uint32(16).int32(message.subjectType);
4049
+ }
4050
+ if (!message.subjectId.equals(Long.UZERO)) {
4051
+ writer.uint32(24).uint64(message.subjectId.toString());
4052
+ }
4053
+ if (message.deviceId !== undefined) {
4054
+ writer.uint32(32).uint64(message.deviceId.toString());
4055
+ }
4056
+ if (message.title !== "") {
4057
+ writer.uint32(42).string(message.title);
4058
+ }
4059
+ if (message.subtitle !== undefined) {
4060
+ writer.uint32(50).string(message.subtitle);
4061
+ }
4062
+ if (message.amount !== undefined) {
4063
+ writer.uint32(57).double(message.amount);
4064
+ }
4065
+ if (message.currencyId !== undefined) {
4066
+ writer.uint32(64).uint64(message.currencyId.toString());
4067
+ }
4068
+ if (message.urgent !== false) {
4069
+ writer.uint32(72).bool(message.urgent);
4070
+ }
4071
+ if (message.since !== undefined) {
4072
+ Timestamp.encode(toTimestamp(message.since), writer.uint32(82).fork()).join();
4073
+ }
4074
+ writer.uint32(90).fork();
4075
+ for (const v of message.flags) {
4076
+ writer.int32(v);
4077
+ }
4078
+ writer.join();
4079
+ return writer;
4080
+ },
4081
+ decode(input, length) {
4082
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4083
+ const end = length === undefined ? reader.len : reader.pos + length;
4084
+ const message = createBaseFleetInboxItem();
4085
+ while (reader.pos < end) {
4086
+ const tag = reader.uint32();
4087
+ switch (tag >>> 3) {
4088
+ case 1: {
4089
+ if (tag !== 8) {
4090
+ break;
4091
+ }
4092
+ message.kind = reader.int32();
4093
+ continue;
4094
+ }
4095
+ case 2: {
4096
+ if (tag !== 16) {
4097
+ break;
4098
+ }
4099
+ message.subjectType = reader.int32();
4100
+ continue;
4101
+ }
4102
+ case 3: {
4103
+ if (tag !== 24) {
4104
+ break;
4105
+ }
4106
+ message.subjectId = Long.fromString(reader.uint64().toString(), true);
4107
+ continue;
4108
+ }
4109
+ case 4: {
4110
+ if (tag !== 32) {
4111
+ break;
4112
+ }
4113
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
4114
+ continue;
4115
+ }
4116
+ case 5: {
4117
+ if (tag !== 42) {
4118
+ break;
4119
+ }
4120
+ message.title = reader.string();
4121
+ continue;
4122
+ }
4123
+ case 6: {
4124
+ if (tag !== 50) {
4125
+ break;
4126
+ }
4127
+ message.subtitle = reader.string();
4128
+ continue;
4129
+ }
4130
+ case 7: {
4131
+ if (tag !== 57) {
4132
+ break;
4133
+ }
4134
+ message.amount = reader.double();
4135
+ continue;
4136
+ }
4137
+ case 8: {
4138
+ if (tag !== 64) {
4139
+ break;
4140
+ }
4141
+ message.currencyId = Long.fromString(reader.uint64().toString(), true);
4142
+ continue;
4143
+ }
4144
+ case 9: {
4145
+ if (tag !== 72) {
4146
+ break;
4147
+ }
4148
+ message.urgent = reader.bool();
4149
+ continue;
4150
+ }
4151
+ case 10: {
4152
+ if (tag !== 82) {
4153
+ break;
4154
+ }
4155
+ message.since = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
4156
+ continue;
4157
+ }
4158
+ case 11: {
4159
+ if (tag === 88) {
4160
+ message.flags.push(reader.int32());
4161
+ continue;
4162
+ }
4163
+ if (tag === 90) {
4164
+ const end2 = reader.uint32() + reader.pos;
4165
+ while (reader.pos < end2) {
4166
+ message.flags.push(reader.int32());
4167
+ }
4168
+ continue;
4169
+ }
4170
+ break;
4171
+ }
4172
+ }
4173
+ if ((tag & 7) === 4 || tag === 0) {
4174
+ break;
4175
+ }
4176
+ reader.skip(tag & 7);
4177
+ }
4178
+ return message;
4179
+ },
4180
+ create(base) {
4181
+ return FleetInboxItem.fromPartial(base ?? {});
4182
+ },
4183
+ fromPartial(object) {
4184
+ const message = createBaseFleetInboxItem();
4185
+ message.kind = object.kind ?? 0;
4186
+ message.subjectType = object.subjectType ?? 0;
4187
+ message.subjectId = (object.subjectId !== undefined && object.subjectId !== null)
4188
+ ? Long.fromValue(object.subjectId)
4189
+ : Long.UZERO;
4190
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
4191
+ ? Long.fromValue(object.deviceId)
4192
+ : undefined;
4193
+ message.title = object.title ?? "";
4194
+ message.subtitle = object.subtitle ?? undefined;
4195
+ message.amount = object.amount ?? undefined;
4196
+ message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
4197
+ ? Long.fromValue(object.currencyId)
4198
+ : undefined;
4199
+ message.urgent = object.urgent ?? false;
4200
+ message.since = object.since ?? undefined;
4201
+ message.flags = object.flags?.map((e) => e) || [];
4202
+ return message;
4203
+ },
4204
+ };
4205
+ function toTimestamp(date) {
4206
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
4207
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
4208
+ return { seconds, nanos };
4209
+ }
4210
+ function fromTimestamp(t) {
4211
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
4212
+ millis += (t.nanos || 0) / 1_000_000;
4213
+ return new globalThis.Date(millis);
4214
+ }
4215
+ function numberToLong(number) {
4216
+ return Long.fromNumber(number);
4217
+ }