@fatehan/tsrp 1.0.8 → 1.0.10

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.
@@ -5,11 +5,12 @@
5
5
  // protoc v3.21.12
6
6
  // source: models/operation.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.OperationDestination_Event = exports.OperationDestination = exports.Operation = exports.Operation_Status = exports.protobufPackage = void 0;
8
+ exports.OperationMileageMemory = exports.Destination_Event = exports.Destination = exports.DestinationList = exports.Operation = exports.Operation_Status = exports.protobufPackage = void 0;
9
9
  exports.operation_StatusFromJSON = operation_StatusFromJSON;
10
10
  exports.operation_StatusToJSON = operation_StatusToJSON;
11
11
  /* eslint-disable */
12
12
  const wire_1 = require("@bufbuild/protobuf/wire");
13
+ const area_1 = require("../areas/area");
13
14
  const timestamp_1 = require("../google/protobuf/timestamp");
14
15
  exports.protobufPackage = "com.fatehan.models";
15
16
  var Operation_Status;
@@ -70,6 +71,7 @@ function createBaseOperation() {
70
71
  geoId: 0,
71
72
  description: undefined,
72
73
  destinations: undefined,
74
+ destinationName: undefined,
73
75
  picture: undefined,
74
76
  passengers: "",
75
77
  passengersName: undefined,
@@ -78,10 +80,6 @@ function createBaseOperation() {
78
80
  extraNightWorkTime: 0,
79
81
  holidayExtraWorkTime: 0,
80
82
  holidayExtraNightWorkTime: 0,
81
- startInternalMileage: undefined,
82
- startExternalMileage: undefined,
83
- endInternalMileage: undefined,
84
- endExternalMileage: undefined,
85
83
  internalMileage: 0,
86
84
  externalMileage: 0,
87
85
  totalNightly: 0,
@@ -89,6 +87,7 @@ function createBaseOperation() {
89
87
  userAcceptedId: undefined,
90
88
  userCreatedId: undefined,
91
89
  userRejectedId: undefined,
90
+ userRequestedId: undefined,
92
91
  requestedAt: undefined,
93
92
  startedAt: undefined,
94
93
  acceptedAt: undefined,
@@ -120,7 +119,10 @@ exports.Operation = {
120
119
  writer.uint32(50).string(message.description);
121
120
  }
122
121
  if (message.destinations !== undefined) {
123
- writer.uint32(82).string(message.destinations);
122
+ exports.DestinationList.encode(message.destinations, writer.uint32(82).fork()).join();
123
+ }
124
+ if (message.destinationName !== undefined) {
125
+ writer.uint32(162).string(message.destinationName);
124
126
  }
125
127
  if (message.picture !== undefined) {
126
128
  writer.uint32(90).string(message.picture);
@@ -146,23 +148,11 @@ exports.Operation = {
146
148
  if (message.holidayExtraNightWorkTime !== 0) {
147
149
  writer.uint32(144).uint32(message.holidayExtraNightWorkTime);
148
150
  }
149
- if (message.startInternalMileage !== undefined) {
150
- writer.uint32(152).uint64(message.startInternalMileage);
151
- }
152
- if (message.startExternalMileage !== undefined) {
153
- writer.uint32(160).uint64(message.startExternalMileage);
154
- }
155
- if (message.endInternalMileage !== undefined) {
156
- writer.uint32(168).uint64(message.endInternalMileage);
157
- }
158
- if (message.endExternalMileage !== undefined) {
159
- writer.uint32(176).uint64(message.endExternalMileage);
160
- }
161
151
  if (message.internalMileage !== 0) {
162
- writer.uint32(184).uint64(message.internalMileage);
152
+ writer.uint32(184).uint32(message.internalMileage);
163
153
  }
164
154
  if (message.externalMileage !== 0) {
165
- writer.uint32(192).uint64(message.externalMileage);
155
+ writer.uint32(192).uint32(message.externalMileage);
166
156
  }
167
157
  if (message.totalNightly !== 0) {
168
158
  writer.uint32(200).uint32(message.totalNightly);
@@ -179,6 +169,9 @@ exports.Operation = {
179
169
  if (message.userRejectedId !== undefined) {
180
170
  writer.uint32(232).uint64(message.userRejectedId);
181
171
  }
172
+ if (message.userRequestedId !== undefined) {
173
+ writer.uint32(152).uint64(message.userRequestedId);
174
+ }
182
175
  if (message.requestedAt !== undefined) {
183
176
  timestamp_1.Timestamp.encode(toTimestamp(message.requestedAt), writer.uint32(242).fork()).join();
184
177
  }
@@ -198,10 +191,10 @@ exports.Operation = {
198
191
  timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(282).fork()).join();
199
192
  }
200
193
  if (message.updatedAt !== undefined) {
201
- timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(290).fork()).join();
194
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(170).fork()).join();
202
195
  }
203
196
  if (message.errorCode !== undefined) {
204
- writer.uint32(296).uint32(message.errorCode);
197
+ writer.uint32(176).uint32(message.errorCode);
205
198
  }
206
199
  return writer;
207
200
  },
@@ -258,7 +251,14 @@ exports.Operation = {
258
251
  if (tag !== 82) {
259
252
  break;
260
253
  }
261
- message.destinations = reader.string();
254
+ message.destinations = exports.DestinationList.decode(reader, reader.uint32());
255
+ continue;
256
+ }
257
+ case 20: {
258
+ if (tag !== 162) {
259
+ break;
260
+ }
261
+ message.destinationName = reader.string();
262
262
  continue;
263
263
  }
264
264
  case 11: {
@@ -317,46 +317,18 @@ exports.Operation = {
317
317
  message.holidayExtraNightWorkTime = reader.uint32();
318
318
  continue;
319
319
  }
320
- case 19: {
321
- if (tag !== 152) {
322
- break;
323
- }
324
- message.startInternalMileage = longToNumber(reader.uint64());
325
- continue;
326
- }
327
- case 20: {
328
- if (tag !== 160) {
329
- break;
330
- }
331
- message.startExternalMileage = longToNumber(reader.uint64());
332
- continue;
333
- }
334
- case 21: {
335
- if (tag !== 168) {
336
- break;
337
- }
338
- message.endInternalMileage = longToNumber(reader.uint64());
339
- continue;
340
- }
341
- case 22: {
342
- if (tag !== 176) {
343
- break;
344
- }
345
- message.endExternalMileage = longToNumber(reader.uint64());
346
- continue;
347
- }
348
320
  case 23: {
349
321
  if (tag !== 184) {
350
322
  break;
351
323
  }
352
- message.internalMileage = longToNumber(reader.uint64());
324
+ message.internalMileage = reader.uint32();
353
325
  continue;
354
326
  }
355
327
  case 24: {
356
328
  if (tag !== 192) {
357
329
  break;
358
330
  }
359
- message.externalMileage = longToNumber(reader.uint64());
331
+ message.externalMileage = reader.uint32();
360
332
  continue;
361
333
  }
362
334
  case 25: {
@@ -394,6 +366,13 @@ exports.Operation = {
394
366
  message.userRejectedId = longToNumber(reader.uint64());
395
367
  continue;
396
368
  }
369
+ case 19: {
370
+ if (tag !== 152) {
371
+ break;
372
+ }
373
+ message.userRequestedId = longToNumber(reader.uint64());
374
+ continue;
375
+ }
397
376
  case 30: {
398
377
  if (tag !== 242) {
399
378
  break;
@@ -436,15 +415,15 @@ exports.Operation = {
436
415
  message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
437
416
  continue;
438
417
  }
439
- case 36: {
440
- if (tag !== 290) {
418
+ case 21: {
419
+ if (tag !== 170) {
441
420
  break;
442
421
  }
443
422
  message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
444
423
  continue;
445
424
  }
446
- case 37: {
447
- if (tag !== 296) {
425
+ case 22: {
426
+ if (tag !== 176) {
448
427
  break;
449
428
  }
450
429
  message.errorCode = reader.uint32();
@@ -461,45 +440,41 @@ exports.Operation = {
461
440
  fromJSON(object) {
462
441
  return {
463
442
  id: isSet(object.id) ? globalThis.Number(object.id) : 0,
464
- deviceId: isSet(object.deviceId) ? globalThis.Number(object.deviceId) : undefined,
443
+ deviceId: isSet(object.device_id) ? globalThis.Number(object.device_id) : undefined,
465
444
  status: isSet(object.status) ? operation_StatusFromJSON(object.status) : 0,
466
- destinationsIndex: isSet(object.destinationsIndex) ? globalThis.Number(object.destinationsIndex) : 0,
467
- geoId: isSet(object.geoId) ? globalThis.Number(object.geoId) : 0,
445
+ destinationsIndex: isSet(object.destinations_index) ? globalThis.Number(object.destinations_index) : 0,
446
+ geoId: isSet(object.geo_id) ? globalThis.Number(object.geo_id) : 0,
468
447
  description: isSet(object.description) ? globalThis.String(object.description) : undefined,
469
- destinations: isSet(object.destinations) ? globalThis.String(object.destinations) : undefined,
448
+ destinations: isSet(object.destinations) ? exports.DestinationList.fromJSON(object.destinations) : undefined,
449
+ destinationName: isSet(object.destination_name) ? globalThis.String(object.destination_name) : undefined,
470
450
  picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
471
451
  passengers: isSet(object.passengers) ? globalThis.String(object.passengers) : "",
472
- passengersName: isSet(object.passengersName) ? globalThis.String(object.passengersName) : undefined,
473
- workTime: isSet(object.workTime) ? globalThis.Number(object.workTime) : 0,
474
- extraWorkTime: isSet(object.extraWorkTime) ? globalThis.Number(object.extraWorkTime) : 0,
475
- extraNightWorkTime: isSet(object.extraNightWorkTime) ? globalThis.Number(object.extraNightWorkTime) : 0,
476
- holidayExtraWorkTime: isSet(object.holidayExtraWorkTime) ? globalThis.Number(object.holidayExtraWorkTime) : 0,
477
- holidayExtraNightWorkTime: isSet(object.holidayExtraNightWorkTime)
478
- ? globalThis.Number(object.holidayExtraNightWorkTime)
452
+ passengersName: isSet(object.passengers_name) ? globalThis.String(object.passengers_name) : undefined,
453
+ workTime: isSet(object.work_time) ? globalThis.Number(object.work_time) : 0,
454
+ extraWorkTime: isSet(object.extra_work_time) ? globalThis.Number(object.extra_work_time) : 0,
455
+ extraNightWorkTime: isSet(object.extra_night_work_time) ? globalThis.Number(object.extra_night_work_time) : 0,
456
+ holidayExtraWorkTime: isSet(object.holiday_extra_work_time)
457
+ ? globalThis.Number(object.holiday_extra_work_time)
479
458
  : 0,
480
- startInternalMileage: isSet(object.startInternalMileage)
481
- ? globalThis.Number(object.startInternalMileage)
482
- : undefined,
483
- startExternalMileage: isSet(object.startExternalMileage)
484
- ? globalThis.Number(object.startExternalMileage)
485
- : undefined,
486
- endInternalMileage: isSet(object.endInternalMileage) ? globalThis.Number(object.endInternalMileage) : undefined,
487
- endExternalMileage: isSet(object.endExternalMileage) ? globalThis.Number(object.endExternalMileage) : undefined,
488
- internalMileage: isSet(object.internalMileage) ? globalThis.Number(object.internalMileage) : 0,
489
- externalMileage: isSet(object.externalMileage) ? globalThis.Number(object.externalMileage) : 0,
490
- totalNightly: isSet(object.totalNightly) ? globalThis.Number(object.totalNightly) : 0,
491
- organizationId: isSet(object.organizationId) ? globalThis.Number(object.organizationId) : undefined,
492
- userAcceptedId: isSet(object.userAcceptedId) ? globalThis.Number(object.userAcceptedId) : undefined,
493
- userCreatedId: isSet(object.userCreatedId) ? globalThis.Number(object.userCreatedId) : undefined,
494
- userRejectedId: isSet(object.userRejectedId) ? globalThis.Number(object.userRejectedId) : undefined,
495
- requestedAt: isSet(object.requestedAt) ? fromJsonTimestamp(object.requestedAt) : undefined,
496
- startedAt: isSet(object.startedAt) ? fromJsonTimestamp(object.startedAt) : undefined,
497
- acceptedAt: isSet(object.acceptedAt) ? fromJsonTimestamp(object.acceptedAt) : undefined,
498
- rejectedAt: isSet(object.rejectedAt) ? fromJsonTimestamp(object.rejectedAt) : undefined,
499
- endedAt: isSet(object.endedAt) ? fromJsonTimestamp(object.endedAt) : undefined,
500
- createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined,
501
- updatedAt: isSet(object.updatedAt) ? fromJsonTimestamp(object.updatedAt) : undefined,
502
- errorCode: isSet(object.errorCode) ? globalThis.Number(object.errorCode) : undefined,
459
+ holidayExtraNightWorkTime: isSet(object.holiday_extra_night_work_time)
460
+ ? globalThis.Number(object.holiday_extra_night_work_time)
461
+ : 0,
462
+ internalMileage: isSet(object.internal_mileage) ? globalThis.Number(object.internal_mileage) : 0,
463
+ externalMileage: isSet(object.external_mileage) ? globalThis.Number(object.external_mileage) : 0,
464
+ totalNightly: isSet(object.total_nightly) ? globalThis.Number(object.total_nightly) : 0,
465
+ organizationId: isSet(object.organization_id) ? globalThis.Number(object.organization_id) : undefined,
466
+ userAcceptedId: isSet(object.user_accepted_id) ? globalThis.Number(object.user_accepted_id) : undefined,
467
+ userCreatedId: isSet(object.user_created_id) ? globalThis.Number(object.user_created_id) : undefined,
468
+ userRejectedId: isSet(object.user_rejected_id) ? globalThis.Number(object.user_rejected_id) : undefined,
469
+ userRequestedId: isSet(object.user_requested_id) ? globalThis.Number(object.user_requested_id) : undefined,
470
+ requestedAt: isSet(object.requested_at) ? fromJsonTimestamp(object.requested_at) : undefined,
471
+ startedAt: isSet(object.started_at) ? fromJsonTimestamp(object.started_at) : undefined,
472
+ acceptedAt: isSet(object.accepted_at) ? fromJsonTimestamp(object.accepted_at) : undefined,
473
+ rejectedAt: isSet(object.rejected_at) ? fromJsonTimestamp(object.rejected_at) : undefined,
474
+ endedAt: isSet(object.ended_at) ? fromJsonTimestamp(object.ended_at) : undefined,
475
+ createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
476
+ updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
477
+ errorCode: isSet(object.error_code) ? globalThis.Number(object.error_code) : undefined,
503
478
  };
504
479
  },
505
480
  toJSON(message) {
@@ -508,22 +483,25 @@ exports.Operation = {
508
483
  obj.id = Math.round(message.id);
509
484
  }
510
485
  if (message.deviceId !== undefined) {
511
- obj.deviceId = Math.round(message.deviceId);
486
+ obj.device_id = Math.round(message.deviceId);
512
487
  }
513
488
  if (message.status !== 0) {
514
489
  obj.status = operation_StatusToJSON(message.status);
515
490
  }
516
491
  if (message.destinationsIndex !== 0) {
517
- obj.destinationsIndex = Math.round(message.destinationsIndex);
492
+ obj.destinations_index = Math.round(message.destinationsIndex);
518
493
  }
519
494
  if (message.geoId !== 0) {
520
- obj.geoId = Math.round(message.geoId);
495
+ obj.geo_id = Math.round(message.geoId);
521
496
  }
522
497
  if (message.description !== undefined) {
523
498
  obj.description = message.description;
524
499
  }
525
500
  if (message.destinations !== undefined) {
526
- obj.destinations = message.destinations;
501
+ obj.destinations = exports.DestinationList.toJSON(message.destinations);
502
+ }
503
+ if (message.destinationName !== undefined) {
504
+ obj.destination_name = message.destinationName;
527
505
  }
528
506
  if (message.picture !== undefined) {
529
507
  obj.picture = message.picture;
@@ -532,79 +510,70 @@ exports.Operation = {
532
510
  obj.passengers = message.passengers;
533
511
  }
534
512
  if (message.passengersName !== undefined) {
535
- obj.passengersName = message.passengersName;
513
+ obj.passengers_name = message.passengersName;
536
514
  }
537
515
  if (message.workTime !== 0) {
538
- obj.workTime = Math.round(message.workTime);
516
+ obj.work_time = Math.round(message.workTime);
539
517
  }
540
518
  if (message.extraWorkTime !== 0) {
541
- obj.extraWorkTime = Math.round(message.extraWorkTime);
519
+ obj.extra_work_time = Math.round(message.extraWorkTime);
542
520
  }
543
521
  if (message.extraNightWorkTime !== 0) {
544
- obj.extraNightWorkTime = Math.round(message.extraNightWorkTime);
522
+ obj.extra_night_work_time = Math.round(message.extraNightWorkTime);
545
523
  }
546
524
  if (message.holidayExtraWorkTime !== 0) {
547
- obj.holidayExtraWorkTime = Math.round(message.holidayExtraWorkTime);
525
+ obj.holiday_extra_work_time = Math.round(message.holidayExtraWorkTime);
548
526
  }
549
527
  if (message.holidayExtraNightWorkTime !== 0) {
550
- obj.holidayExtraNightWorkTime = Math.round(message.holidayExtraNightWorkTime);
551
- }
552
- if (message.startInternalMileage !== undefined) {
553
- obj.startInternalMileage = Math.round(message.startInternalMileage);
554
- }
555
- if (message.startExternalMileage !== undefined) {
556
- obj.startExternalMileage = Math.round(message.startExternalMileage);
557
- }
558
- if (message.endInternalMileage !== undefined) {
559
- obj.endInternalMileage = Math.round(message.endInternalMileage);
560
- }
561
- if (message.endExternalMileage !== undefined) {
562
- obj.endExternalMileage = Math.round(message.endExternalMileage);
528
+ obj.holiday_extra_night_work_time = Math.round(message.holidayExtraNightWorkTime);
563
529
  }
564
530
  if (message.internalMileage !== 0) {
565
- obj.internalMileage = Math.round(message.internalMileage);
531
+ obj.internal_mileage = Math.round(message.internalMileage);
566
532
  }
567
533
  if (message.externalMileage !== 0) {
568
- obj.externalMileage = Math.round(message.externalMileage);
534
+ obj.external_mileage = Math.round(message.externalMileage);
569
535
  }
570
536
  if (message.totalNightly !== 0) {
571
- obj.totalNightly = Math.round(message.totalNightly);
537
+ obj.total_nightly = Math.round(message.totalNightly);
572
538
  }
573
539
  if (message.organizationId !== undefined) {
574
- obj.organizationId = Math.round(message.organizationId);
540
+ obj.organization_id = Math.round(message.organizationId);
575
541
  }
576
542
  if (message.userAcceptedId !== undefined) {
577
- obj.userAcceptedId = Math.round(message.userAcceptedId);
543
+ obj.user_accepted_id = Math.round(message.userAcceptedId);
578
544
  }
579
545
  if (message.userCreatedId !== undefined) {
580
- obj.userCreatedId = Math.round(message.userCreatedId);
546
+ obj.user_created_id = Math.round(message.userCreatedId);
581
547
  }
582
548
  if (message.userRejectedId !== undefined) {
583
- obj.userRejectedId = Math.round(message.userRejectedId);
549
+ obj.user_rejected_id = Math.round(message.userRejectedId);
550
+ }
551
+ if (message.userRequestedId !== undefined) {
552
+ obj.user_requested_id = Math.round(message.userRequestedId);
584
553
  }
585
554
  if (message.requestedAt !== undefined) {
586
- obj.requestedAt = message.requestedAt.toISOString();
555
+ obj.requested_at = message.requestedAt.toISOString();
587
556
  }
588
557
  if (message.startedAt !== undefined) {
589
- obj.startedAt = message.startedAt.toISOString();
558
+ obj.started_at = message.startedAt.toISOString();
590
559
  }
591
560
  if (message.acceptedAt !== undefined) {
592
- obj.acceptedAt = message.acceptedAt.toISOString();
561
+ obj.accepted_at = message.acceptedAt.toISOString();
593
562
  }
594
563
  if (message.rejectedAt !== undefined) {
595
- obj.rejectedAt = message.rejectedAt.toISOString();
564
+ obj.rejected_at = message.rejectedAt.toISOString();
596
565
  }
597
566
  if (message.endedAt !== undefined) {
598
- obj.endedAt = message.endedAt.toISOString();
567
+ obj.ended_at = message.endedAt.toISOString();
599
568
  }
600
569
  if (message.createdAt !== undefined) {
601
- obj.createdAt = message.createdAt.toISOString();
570
+ obj.created_at = message.createdAt.toISOString();
602
571
  }
603
572
  if (message.updatedAt !== undefined) {
604
- obj.updatedAt = message.updatedAt.toISOString();
573
+ obj.updated_at = message.updatedAt.toISOString();
605
574
  }
606
575
  if (message.errorCode !== undefined) {
607
- obj.errorCode = Math.round(message.errorCode);
576
+ obj.error_code = Math.round(message.errorCode);
608
577
  }
609
578
  return obj;
610
579
  },
@@ -612,7 +581,7 @@ exports.Operation = {
612
581
  return exports.Operation.fromPartial(base !== null && base !== void 0 ? base : {});
613
582
  },
614
583
  fromPartial(object) {
615
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
584
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
616
585
  const message = createBaseOperation();
617
586
  message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
618
587
  message.deviceId = (_b = object.deviceId) !== null && _b !== void 0 ? _b : undefined;
@@ -620,7 +589,10 @@ exports.Operation = {
620
589
  message.destinationsIndex = (_d = object.destinationsIndex) !== null && _d !== void 0 ? _d : 0;
621
590
  message.geoId = (_e = object.geoId) !== null && _e !== void 0 ? _e : 0;
622
591
  message.description = (_f = object.description) !== null && _f !== void 0 ? _f : undefined;
623
- message.destinations = (_g = object.destinations) !== null && _g !== void 0 ? _g : undefined;
592
+ message.destinations = (object.destinations !== undefined && object.destinations !== null)
593
+ ? exports.DestinationList.fromPartial(object.destinations)
594
+ : undefined;
595
+ message.destinationName = (_g = object.destinationName) !== null && _g !== void 0 ? _g : undefined;
624
596
  message.picture = (_h = object.picture) !== null && _h !== void 0 ? _h : undefined;
625
597
  message.passengers = (_j = object.passengers) !== null && _j !== void 0 ? _j : "";
626
598
  message.passengersName = (_k = object.passengersName) !== null && _k !== void 0 ? _k : undefined;
@@ -629,70 +601,144 @@ exports.Operation = {
629
601
  message.extraNightWorkTime = (_o = object.extraNightWorkTime) !== null && _o !== void 0 ? _o : 0;
630
602
  message.holidayExtraWorkTime = (_p = object.holidayExtraWorkTime) !== null && _p !== void 0 ? _p : 0;
631
603
  message.holidayExtraNightWorkTime = (_q = object.holidayExtraNightWorkTime) !== null && _q !== void 0 ? _q : 0;
632
- message.startInternalMileage = (_r = object.startInternalMileage) !== null && _r !== void 0 ? _r : undefined;
633
- message.startExternalMileage = (_s = object.startExternalMileage) !== null && _s !== void 0 ? _s : undefined;
634
- message.endInternalMileage = (_t = object.endInternalMileage) !== null && _t !== void 0 ? _t : undefined;
635
- message.endExternalMileage = (_u = object.endExternalMileage) !== null && _u !== void 0 ? _u : undefined;
636
- message.internalMileage = (_v = object.internalMileage) !== null && _v !== void 0 ? _v : 0;
637
- message.externalMileage = (_w = object.externalMileage) !== null && _w !== void 0 ? _w : 0;
638
- message.totalNightly = (_x = object.totalNightly) !== null && _x !== void 0 ? _x : 0;
639
- message.organizationId = (_y = object.organizationId) !== null && _y !== void 0 ? _y : undefined;
640
- message.userAcceptedId = (_z = object.userAcceptedId) !== null && _z !== void 0 ? _z : undefined;
641
- message.userCreatedId = (_0 = object.userCreatedId) !== null && _0 !== void 0 ? _0 : undefined;
642
- message.userRejectedId = (_1 = object.userRejectedId) !== null && _1 !== void 0 ? _1 : undefined;
643
- message.requestedAt = (_2 = object.requestedAt) !== null && _2 !== void 0 ? _2 : undefined;
644
- message.startedAt = (_3 = object.startedAt) !== null && _3 !== void 0 ? _3 : undefined;
645
- message.acceptedAt = (_4 = object.acceptedAt) !== null && _4 !== void 0 ? _4 : undefined;
646
- message.rejectedAt = (_5 = object.rejectedAt) !== null && _5 !== void 0 ? _5 : undefined;
647
- message.endedAt = (_6 = object.endedAt) !== null && _6 !== void 0 ? _6 : undefined;
648
- message.createdAt = (_7 = object.createdAt) !== null && _7 !== void 0 ? _7 : undefined;
649
- message.updatedAt = (_8 = object.updatedAt) !== null && _8 !== void 0 ? _8 : undefined;
650
- message.errorCode = (_9 = object.errorCode) !== null && _9 !== void 0 ? _9 : undefined;
604
+ message.internalMileage = (_r = object.internalMileage) !== null && _r !== void 0 ? _r : 0;
605
+ message.externalMileage = (_s = object.externalMileage) !== null && _s !== void 0 ? _s : 0;
606
+ message.totalNightly = (_t = object.totalNightly) !== null && _t !== void 0 ? _t : 0;
607
+ message.organizationId = (_u = object.organizationId) !== null && _u !== void 0 ? _u : undefined;
608
+ message.userAcceptedId = (_v = object.userAcceptedId) !== null && _v !== void 0 ? _v : undefined;
609
+ message.userCreatedId = (_w = object.userCreatedId) !== null && _w !== void 0 ? _w : undefined;
610
+ message.userRejectedId = (_x = object.userRejectedId) !== null && _x !== void 0 ? _x : undefined;
611
+ message.userRequestedId = (_y = object.userRequestedId) !== null && _y !== void 0 ? _y : undefined;
612
+ message.requestedAt = (_z = object.requestedAt) !== null && _z !== void 0 ? _z : undefined;
613
+ message.startedAt = (_0 = object.startedAt) !== null && _0 !== void 0 ? _0 : undefined;
614
+ message.acceptedAt = (_1 = object.acceptedAt) !== null && _1 !== void 0 ? _1 : undefined;
615
+ message.rejectedAt = (_2 = object.rejectedAt) !== null && _2 !== void 0 ? _2 : undefined;
616
+ message.endedAt = (_3 = object.endedAt) !== null && _3 !== void 0 ? _3 : undefined;
617
+ message.createdAt = (_4 = object.createdAt) !== null && _4 !== void 0 ? _4 : undefined;
618
+ message.updatedAt = (_5 = object.updatedAt) !== null && _5 !== void 0 ? _5 : undefined;
619
+ message.errorCode = (_6 = object.errorCode) !== null && _6 !== void 0 ? _6 : undefined;
620
+ return message;
621
+ },
622
+ };
623
+ function createBaseDestinationList() {
624
+ return { destination: [] };
625
+ }
626
+ exports.DestinationList = {
627
+ encode(message, writer = new wire_1.BinaryWriter()) {
628
+ for (const v of message.destination) {
629
+ exports.Destination.encode(v, writer.uint32(10).fork()).join();
630
+ }
631
+ return writer;
632
+ },
633
+ decode(input, length) {
634
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
635
+ let end = length === undefined ? reader.len : reader.pos + length;
636
+ const message = createBaseDestinationList();
637
+ while (reader.pos < end) {
638
+ const tag = reader.uint32();
639
+ switch (tag >>> 3) {
640
+ case 1: {
641
+ if (tag !== 10) {
642
+ break;
643
+ }
644
+ message.destination.push(exports.Destination.decode(reader, reader.uint32()));
645
+ continue;
646
+ }
647
+ }
648
+ if ((tag & 7) === 4 || tag === 0) {
649
+ break;
650
+ }
651
+ reader.skip(tag & 7);
652
+ }
653
+ return message;
654
+ },
655
+ fromJSON(object) {
656
+ return {
657
+ destination: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.destination)
658
+ ? object.destination.map((e) => exports.Destination.fromJSON(e))
659
+ : [],
660
+ };
661
+ },
662
+ toJSON(message) {
663
+ var _a;
664
+ const obj = {};
665
+ if ((_a = message.destination) === null || _a === void 0 ? void 0 : _a.length) {
666
+ obj.destination = message.destination.map((e) => exports.Destination.toJSON(e));
667
+ }
668
+ return obj;
669
+ },
670
+ create(base) {
671
+ return exports.DestinationList.fromPartial(base !== null && base !== void 0 ? base : {});
672
+ },
673
+ fromPartial(object) {
674
+ var _a;
675
+ const message = createBaseDestinationList();
676
+ message.destination = ((_a = object.destination) === null || _a === void 0 ? void 0 : _a.map((e) => exports.Destination.fromPartial(e))) || [];
651
677
  return message;
652
678
  },
653
679
  };
654
- function createBaseOperationDestination() {
655
- return { start: undefined, end: undefined, geoId: 0 };
680
+ function createBaseDestination() {
681
+ return { areaId: 0, start: undefined, finish: undefined, duration: 0, mileage: undefined };
656
682
  }
657
- exports.OperationDestination = {
683
+ exports.Destination = {
658
684
  encode(message, writer = new wire_1.BinaryWriter()) {
685
+ if (message.areaId !== 0) {
686
+ writer.uint32(8).uint64(message.areaId);
687
+ }
659
688
  if (message.start !== undefined) {
660
- exports.OperationDestination_Event.encode(message.start, writer.uint32(10).fork()).join();
689
+ exports.Destination_Event.encode(message.start, writer.uint32(18).fork()).join();
661
690
  }
662
- if (message.end !== undefined) {
663
- exports.OperationDestination_Event.encode(message.end, writer.uint32(18).fork()).join();
691
+ if (message.finish !== undefined) {
692
+ exports.Destination_Event.encode(message.finish, writer.uint32(26).fork()).join();
664
693
  }
665
- if (message.geoId !== 0) {
666
- writer.uint32(24).uint64(message.geoId);
694
+ if (message.duration !== 0) {
695
+ writer.uint32(32).uint32(message.duration);
696
+ }
697
+ if (message.mileage !== undefined) {
698
+ writer.uint32(40).uint32(message.mileage);
667
699
  }
668
700
  return writer;
669
701
  },
670
702
  decode(input, length) {
671
703
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
672
704
  let end = length === undefined ? reader.len : reader.pos + length;
673
- const message = createBaseOperationDestination();
705
+ const message = createBaseDestination();
674
706
  while (reader.pos < end) {
675
707
  const tag = reader.uint32();
676
708
  switch (tag >>> 3) {
677
709
  case 1: {
678
- if (tag !== 10) {
710
+ if (tag !== 8) {
679
711
  break;
680
712
  }
681
- message.start = exports.OperationDestination_Event.decode(reader, reader.uint32());
713
+ message.areaId = longToNumber(reader.uint64());
682
714
  continue;
683
715
  }
684
716
  case 2: {
685
717
  if (tag !== 18) {
686
718
  break;
687
719
  }
688
- message.end = exports.OperationDestination_Event.decode(reader, reader.uint32());
720
+ message.start = exports.Destination_Event.decode(reader, reader.uint32());
689
721
  continue;
690
722
  }
691
723
  case 3: {
692
- if (tag !== 24) {
724
+ if (tag !== 26) {
693
725
  break;
694
726
  }
695
- message.geoId = longToNumber(reader.uint64());
727
+ message.finish = exports.Destination_Event.decode(reader, reader.uint32());
728
+ continue;
729
+ }
730
+ case 4: {
731
+ if (tag !== 32) {
732
+ break;
733
+ }
734
+ message.duration = reader.uint32();
735
+ continue;
736
+ }
737
+ case 5: {
738
+ if (tag !== 40) {
739
+ break;
740
+ }
741
+ message.mileage = reader.uint32();
696
742
  continue;
697
743
  }
698
744
  }
@@ -705,92 +751,102 @@ exports.OperationDestination = {
705
751
  },
706
752
  fromJSON(object) {
707
753
  return {
708
- start: isSet(object.start) ? exports.OperationDestination_Event.fromJSON(object.start) : undefined,
709
- end: isSet(object.end) ? exports.OperationDestination_Event.fromJSON(object.end) : undefined,
710
- geoId: isSet(object.geoId) ? globalThis.Number(object.geoId) : 0,
754
+ areaId: isSet(object.area_id) ? globalThis.Number(object.area_id) : 0,
755
+ start: isSet(object.start) ? exports.Destination_Event.fromJSON(object.start) : undefined,
756
+ finish: isSet(object.finish) ? exports.Destination_Event.fromJSON(object.finish) : undefined,
757
+ duration: isSet(object.duration) ? globalThis.Number(object.duration) : 0,
758
+ mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : undefined,
711
759
  };
712
760
  },
713
761
  toJSON(message) {
714
762
  const obj = {};
763
+ if (message.areaId !== 0) {
764
+ obj.area_id = Math.round(message.areaId);
765
+ }
715
766
  if (message.start !== undefined) {
716
- obj.start = exports.OperationDestination_Event.toJSON(message.start);
767
+ obj.start = exports.Destination_Event.toJSON(message.start);
717
768
  }
718
- if (message.end !== undefined) {
719
- obj.end = exports.OperationDestination_Event.toJSON(message.end);
769
+ if (message.finish !== undefined) {
770
+ obj.finish = exports.Destination_Event.toJSON(message.finish);
720
771
  }
721
- if (message.geoId !== 0) {
722
- obj.geoId = Math.round(message.geoId);
772
+ if (message.duration !== 0) {
773
+ obj.duration = Math.round(message.duration);
774
+ }
775
+ if (message.mileage !== undefined) {
776
+ obj.mileage = Math.round(message.mileage);
723
777
  }
724
778
  return obj;
725
779
  },
726
780
  create(base) {
727
- return exports.OperationDestination.fromPartial(base !== null && base !== void 0 ? base : {});
781
+ return exports.Destination.fromPartial(base !== null && base !== void 0 ? base : {});
728
782
  },
729
783
  fromPartial(object) {
730
- var _a;
731
- const message = createBaseOperationDestination();
784
+ var _a, _b, _c;
785
+ const message = createBaseDestination();
786
+ message.areaId = (_a = object.areaId) !== null && _a !== void 0 ? _a : 0;
732
787
  message.start = (object.start !== undefined && object.start !== null)
733
- ? exports.OperationDestination_Event.fromPartial(object.start)
788
+ ? exports.Destination_Event.fromPartial(object.start)
734
789
  : undefined;
735
- message.end = (object.end !== undefined && object.end !== null)
736
- ? exports.OperationDestination_Event.fromPartial(object.end)
790
+ message.finish = (object.finish !== undefined && object.finish !== null)
791
+ ? exports.Destination_Event.fromPartial(object.finish)
737
792
  : undefined;
738
- message.geoId = (_a = object.geoId) !== null && _a !== void 0 ? _a : 0;
793
+ message.duration = (_b = object.duration) !== null && _b !== void 0 ? _b : 0;
794
+ message.mileage = (_c = object.mileage) !== null && _c !== void 0 ? _c : undefined;
739
795
  return message;
740
796
  },
741
797
  };
742
- function createBaseOperationDestination_Event() {
743
- return { lat: 0, lng: 0, time: 0, gpsTime: 0 };
798
+ function createBaseDestination_Event() {
799
+ return { point: undefined, datetime: undefined, gpsTime: undefined, mileage: undefined };
744
800
  }
745
- exports.OperationDestination_Event = {
801
+ exports.Destination_Event = {
746
802
  encode(message, writer = new wire_1.BinaryWriter()) {
747
- if (message.lat !== 0) {
748
- writer.uint32(13).float(message.lat);
803
+ if (message.point !== undefined) {
804
+ area_1.Point.encode(message.point, writer.uint32(10).fork()).join();
749
805
  }
750
- if (message.lng !== 0) {
751
- writer.uint32(21).float(message.lng);
806
+ if (message.datetime !== undefined) {
807
+ timestamp_1.Timestamp.encode(toTimestamp(message.datetime), writer.uint32(18).fork()).join();
752
808
  }
753
- if (message.time !== 0) {
754
- writer.uint32(24).int64(message.time);
809
+ if (message.gpsTime !== undefined) {
810
+ timestamp_1.Timestamp.encode(toTimestamp(message.gpsTime), writer.uint32(26).fork()).join();
755
811
  }
756
- if (message.gpsTime !== 0) {
757
- writer.uint32(32).int64(message.gpsTime);
812
+ if (message.mileage !== undefined) {
813
+ writer.uint32(32).uint64(message.mileage);
758
814
  }
759
815
  return writer;
760
816
  },
761
817
  decode(input, length) {
762
818
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
763
819
  let end = length === undefined ? reader.len : reader.pos + length;
764
- const message = createBaseOperationDestination_Event();
820
+ const message = createBaseDestination_Event();
765
821
  while (reader.pos < end) {
766
822
  const tag = reader.uint32();
767
823
  switch (tag >>> 3) {
768
824
  case 1: {
769
- if (tag !== 13) {
825
+ if (tag !== 10) {
770
826
  break;
771
827
  }
772
- message.lat = reader.float();
828
+ message.point = area_1.Point.decode(reader, reader.uint32());
773
829
  continue;
774
830
  }
775
831
  case 2: {
776
- if (tag !== 21) {
832
+ if (tag !== 18) {
777
833
  break;
778
834
  }
779
- message.lng = reader.float();
835
+ message.datetime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
780
836
  continue;
781
837
  }
782
838
  case 3: {
783
- if (tag !== 24) {
839
+ if (tag !== 26) {
784
840
  break;
785
841
  }
786
- message.time = longToNumber(reader.int64());
842
+ message.gpsTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
787
843
  continue;
788
844
  }
789
845
  case 4: {
790
846
  if (tag !== 32) {
791
847
  break;
792
848
  }
793
- message.gpsTime = longToNumber(reader.int64());
849
+ message.mileage = longToNumber(reader.uint64());
794
850
  continue;
795
851
  }
796
852
  }
@@ -803,38 +859,122 @@ exports.OperationDestination_Event = {
803
859
  },
804
860
  fromJSON(object) {
805
861
  return {
806
- lat: isSet(object.lat) ? globalThis.Number(object.lat) : 0,
807
- lng: isSet(object.lng) ? globalThis.Number(object.lng) : 0,
808
- time: isSet(object.time) ? globalThis.Number(object.time) : 0,
809
- gpsTime: isSet(object.gpsTime) ? globalThis.Number(object.gpsTime) : 0,
862
+ point: isSet(object.point) ? area_1.Point.fromJSON(object.point) : undefined,
863
+ datetime: isSet(object.datetime) ? fromJsonTimestamp(object.datetime) : undefined,
864
+ gpsTime: isSet(object.gps_time) ? fromJsonTimestamp(object.gps_time) : undefined,
865
+ mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : undefined,
810
866
  };
811
867
  },
812
868
  toJSON(message) {
813
869
  const obj = {};
814
- if (message.lat !== 0) {
815
- obj.lat = message.lat;
870
+ if (message.point !== undefined) {
871
+ obj.point = area_1.Point.toJSON(message.point);
872
+ }
873
+ if (message.datetime !== undefined) {
874
+ obj.datetime = message.datetime.toISOString();
875
+ }
876
+ if (message.gpsTime !== undefined) {
877
+ obj.gps_time = message.gpsTime.toISOString();
816
878
  }
817
- if (message.lng !== 0) {
818
- obj.lng = message.lng;
879
+ if (message.mileage !== undefined) {
880
+ obj.mileage = Math.round(message.mileage);
881
+ }
882
+ return obj;
883
+ },
884
+ create(base) {
885
+ return exports.Destination_Event.fromPartial(base !== null && base !== void 0 ? base : {});
886
+ },
887
+ fromPartial(object) {
888
+ var _a, _b, _c;
889
+ const message = createBaseDestination_Event();
890
+ message.point = (object.point !== undefined && object.point !== null) ? area_1.Point.fromPartial(object.point) : undefined;
891
+ message.datetime = (_a = object.datetime) !== null && _a !== void 0 ? _a : undefined;
892
+ message.gpsTime = (_b = object.gpsTime) !== null && _b !== void 0 ? _b : undefined;
893
+ message.mileage = (_c = object.mileage) !== null && _c !== void 0 ? _c : undefined;
894
+ return message;
895
+ },
896
+ };
897
+ function createBaseOperationMileageMemory() {
898
+ return { status: false, gpsTime: undefined, mileage: undefined };
899
+ }
900
+ exports.OperationMileageMemory = {
901
+ encode(message, writer = new wire_1.BinaryWriter()) {
902
+ if (message.status !== false) {
903
+ writer.uint32(8).bool(message.status);
904
+ }
905
+ if (message.gpsTime !== undefined) {
906
+ timestamp_1.Timestamp.encode(toTimestamp(message.gpsTime), writer.uint32(18).fork()).join();
907
+ }
908
+ if (message.mileage !== undefined) {
909
+ writer.uint32(24).uint64(message.mileage);
910
+ }
911
+ return writer;
912
+ },
913
+ decode(input, length) {
914
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
915
+ let end = length === undefined ? reader.len : reader.pos + length;
916
+ const message = createBaseOperationMileageMemory();
917
+ while (reader.pos < end) {
918
+ const tag = reader.uint32();
919
+ switch (tag >>> 3) {
920
+ case 1: {
921
+ if (tag !== 8) {
922
+ break;
923
+ }
924
+ message.status = reader.bool();
925
+ continue;
926
+ }
927
+ case 2: {
928
+ if (tag !== 18) {
929
+ break;
930
+ }
931
+ message.gpsTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
932
+ continue;
933
+ }
934
+ case 3: {
935
+ if (tag !== 24) {
936
+ break;
937
+ }
938
+ message.mileage = longToNumber(reader.uint64());
939
+ continue;
940
+ }
941
+ }
942
+ if ((tag & 7) === 4 || tag === 0) {
943
+ break;
944
+ }
945
+ reader.skip(tag & 7);
946
+ }
947
+ return message;
948
+ },
949
+ fromJSON(object) {
950
+ return {
951
+ status: isSet(object.status) ? globalThis.Boolean(object.status) : false,
952
+ gpsTime: isSet(object.gpsTime) ? fromJsonTimestamp(object.gpsTime) : undefined,
953
+ mileage: isSet(object.mileage) ? globalThis.Number(object.mileage) : undefined,
954
+ };
955
+ },
956
+ toJSON(message) {
957
+ const obj = {};
958
+ if (message.status !== false) {
959
+ obj.status = message.status;
819
960
  }
820
- if (message.time !== 0) {
821
- obj.time = Math.round(message.time);
961
+ if (message.gpsTime !== undefined) {
962
+ obj.gpsTime = message.gpsTime.toISOString();
822
963
  }
823
- if (message.gpsTime !== 0) {
824
- obj.gpsTime = Math.round(message.gpsTime);
964
+ if (message.mileage !== undefined) {
965
+ obj.mileage = Math.round(message.mileage);
825
966
  }
826
967
  return obj;
827
968
  },
828
969
  create(base) {
829
- return exports.OperationDestination_Event.fromPartial(base !== null && base !== void 0 ? base : {});
970
+ return exports.OperationMileageMemory.fromPartial(base !== null && base !== void 0 ? base : {});
830
971
  },
831
972
  fromPartial(object) {
832
- var _a, _b, _c, _d;
833
- const message = createBaseOperationDestination_Event();
834
- message.lat = (_a = object.lat) !== null && _a !== void 0 ? _a : 0;
835
- message.lng = (_b = object.lng) !== null && _b !== void 0 ? _b : 0;
836
- message.time = (_c = object.time) !== null && _c !== void 0 ? _c : 0;
837
- message.gpsTime = (_d = object.gpsTime) !== null && _d !== void 0 ? _d : 0;
973
+ var _a, _b, _c;
974
+ const message = createBaseOperationMileageMemory();
975
+ message.status = (_a = object.status) !== null && _a !== void 0 ? _a : false;
976
+ message.gpsTime = (_b = object.gpsTime) !== null && _b !== void 0 ? _b : undefined;
977
+ message.mileage = (_c = object.mileage) !== null && _c !== void 0 ? _c : undefined;
838
978
  return message;
839
979
  },
840
980
  };