@iveri/contracts 0.31.0 → 0.32.0

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.
@@ -1,4 +1,5 @@
1
1
  import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
2
3
  import type { UUID } from '../../type/uuid.type.js';
3
4
  import type { MobilityDispatchStatus } from './mobility-dispatch-status.enum.js';
4
5
  import type { MobilityServiceType } from './mobility-service-type.enum.js';
@@ -13,15 +14,36 @@ export interface MobilityDispatch {
13
14
  serviceType: MobilityServiceType;
14
15
  subjectId: UUID;
15
16
  status: MobilityDispatchStatus;
16
- pickupLatitude: number;
17
- pickupLongitude: number;
17
+ /**
18
+ * `null` once the dispatch is past Mobility's location retention window.
19
+ *
20
+ * **Nullable because it is redacted, not because it is optional** —
21
+ * `CreateMobilityDispatchBody` below still requires both, and a dispatch cannot exist without
22
+ * them. Mobility strips them from a terminal dispatch and keeps the row, because the
23
+ * assignment hanging off it is a worker's evidence of a job they did.
24
+ *
25
+ * This is the half of the products' own retention promise that lives here: Taxi and Delivery
26
+ * expire a ride's and a job's coordinates, and **the pickup survived in this table keyed by
27
+ * the same `subjectId`** until this window existed. A reader that holds this value past a
28
+ * product's window is holding what that product has already deleted.
29
+ *
30
+ * Both move together, so a consumer that can render one can render both.
31
+ */
32
+ pickupLatitude: Nullable<number>;
33
+ pickupLongitude: Nullable<number>;
18
34
  expiresAt: IsoDateTime;
19
35
  /** Version of the dispatch state machine, not a worker or location version. */
20
36
  version: number;
21
37
  createdAt: IsoDateTime;
22
38
  updatedAt: IsoDateTime;
23
39
  }
24
- /** `POST /api/v1/dispatches`; retry safety is supplied by the `Idempotency-Key` header. */
40
+ /**
41
+ * `POST /api/v1/dispatches`; retry safety is supplied by the `Idempotency-Key` header.
42
+ *
43
+ * The two coordinates are **required here and nullable on `MobilityDispatch`**, deliberately: the
44
+ * request and the response are the same fields with opposite nullability, and widening this one so
45
+ * the two could share a type would let a caller submit a dispatch with nowhere to search from.
46
+ */
25
47
  export interface CreateMobilityDispatchBody {
26
48
  serviceType: MobilityServiceType;
27
49
  subjectId: UUID;
@@ -1 +1 @@
1
- {"version":3,"file":"mobility-dispatch.type.d.ts","sourceRoot":"","sources":["../../../../src/api/mobility/mobility-dispatch.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,IAAI,CAAC;IACT,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE,WAAW,CAAC;CAC1B;AAED,2FAA2F;AAC3F,MAAM,WAAW,0BAA0B;IACvC,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACxB"}
1
+ {"version":3,"file":"mobility-dispatch.type.d.ts","sourceRoot":"","sources":["../../../../src/api/mobility/mobility-dispatch.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,IAAI,CAAC;IACT,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,sBAAsB,CAAC;IAC/B;;;;;;;;;;;;;;OAcG;IACH,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE,WAAW,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACvC,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACxB"}
@@ -1,4 +1,5 @@
1
1
  import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
2
3
  import type { UUID } from '../../type/uuid.type.js';
3
4
  import type { MobilityDispatchStatus } from './mobility-dispatch-status.enum.js';
4
5
  import type { MobilityServiceType } from './mobility-service-type.enum.js';
@@ -13,15 +14,36 @@ export interface MobilityDispatch {
13
14
  serviceType: MobilityServiceType;
14
15
  subjectId: UUID;
15
16
  status: MobilityDispatchStatus;
16
- pickupLatitude: number;
17
- pickupLongitude: number;
17
+ /**
18
+ * `null` once the dispatch is past Mobility's location retention window.
19
+ *
20
+ * **Nullable because it is redacted, not because it is optional** —
21
+ * `CreateMobilityDispatchBody` below still requires both, and a dispatch cannot exist without
22
+ * them. Mobility strips them from a terminal dispatch and keeps the row, because the
23
+ * assignment hanging off it is a worker's evidence of a job they did.
24
+ *
25
+ * This is the half of the products' own retention promise that lives here: Taxi and Delivery
26
+ * expire a ride's and a job's coordinates, and **the pickup survived in this table keyed by
27
+ * the same `subjectId`** until this window existed. A reader that holds this value past a
28
+ * product's window is holding what that product has already deleted.
29
+ *
30
+ * Both move together, so a consumer that can render one can render both.
31
+ */
32
+ pickupLatitude: Nullable<number>;
33
+ pickupLongitude: Nullable<number>;
18
34
  expiresAt: IsoDateTime;
19
35
  /** Version of the dispatch state machine, not a worker or location version. */
20
36
  version: number;
21
37
  createdAt: IsoDateTime;
22
38
  updatedAt: IsoDateTime;
23
39
  }
24
- /** `POST /api/v1/dispatches`; retry safety is supplied by the `Idempotency-Key` header. */
40
+ /**
41
+ * `POST /api/v1/dispatches`; retry safety is supplied by the `Idempotency-Key` header.
42
+ *
43
+ * The two coordinates are **required here and nullable on `MobilityDispatch`**, deliberately: the
44
+ * request and the response are the same fields with opposite nullability, and widening this one so
45
+ * the two could share a type would let a caller submit a dispatch with nowhere to search from.
46
+ */
25
47
  export interface CreateMobilityDispatchBody {
26
48
  serviceType: MobilityServiceType;
27
49
  subjectId: UUID;
@@ -1 +1 @@
1
- {"version":3,"file":"mobility-dispatch.type.d.ts","sourceRoot":"","sources":["../../../../src/api/mobility/mobility-dispatch.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,sBAAsB,EA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EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,sBAAsB,CAAC;IAC/B;;;;;;;;;;;;;;OAcG;IACH,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE,WAAW,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACvC,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;CACxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {