@d19n/youfibre-odin-sdk 2.0.103-beta.10 → 2.0.103-beta.12

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.
@@ -99,11 +99,9 @@ export interface SyncWorkOrderToSupplierArgs<TPrincipal = unknown> {
99
99
  };
100
100
  yfServiceAppointment: {
101
101
  id?: string;
102
- properties: {
103
- Date?: string;
104
- TimeBlock?: string;
105
- [extra: string]: unknown;
106
- };
102
+ entity: string;
103
+ type: unknown;
104
+ properties: unknown;
107
105
  };
108
106
  }
109
107
  export interface UpdateOrderExternalRefArgs {
@@ -131,6 +129,11 @@ export interface UpdateOrderExternalRefArgs {
131
129
  * }
132
130
  * ```
133
131
  *
132
+ * `FibreCafeKciDto` is fixed as the inbound KCI envelope — that's the
133
+ * canonical wire shape Netomnia sends (per the FibreCafe Tenant Updates
134
+ * spec). Modules consuming the SDK should consolidate any local KCI type
135
+ * to alias `FibreCafeKciDto` rather than maintain a duplicate.
136
+ *
134
137
  * Default `TPrincipal = unknown` lets the SDK compile standalone without
135
138
  * tenant-specific type imports.
136
139
  */
@@ -50,7 +50,7 @@ import type { OrderRecord } from '../../records-v2/OrderRecord';
50
50
  * }
51
51
  * ```
52
52
  */
53
- export interface NetomniaProviderDeps<TPrincipal = unknown> {
53
+ export interface NetomniaProviderDeps<TPrincipal = unknown, TKci = FibreCafeKciDto> {
54
54
  searchAddress: (uprn: number) => Promise<FibreCafeServiceAvailability200>;
55
55
  listAppointments: (args: ListAppointmentsArgs) => Promise<FibreCafeAvailableAppointments200>;
56
56
  reserveAppointment: (args: ReserveAppointmentArgs) => Promise<FibreCafeReserveAppointment201>;
@@ -296,7 +296,7 @@ function run() {
296
296
  yfOrderId: 'ORD-1',
297
297
  yfWorkOrderId: 'WO-1',
298
298
  yfChangeReason: { externalId: 'CR-1', entity: 'ChangeReason', type: 'CANCEL', properties: {} },
299
- yfServiceAppointment: { properties: {} },
299
+ yfServiceAppointment: { entity: 'ServiceAppointment', type: 'INSTALL', properties: {} },
300
300
  };
301
301
  yield p.syncWorkOrderToSupplier(args);
302
302
  assert('called once', log.length === 1);
@@ -448,7 +448,14 @@ export interface FibreCafeUnsolicitedCeaseServiceOrder {
448
448
  * KCI envelope. Inbound from the Tenant Updates API. The presence of one of
449
449
  * `provideServiceOrder | ceaseServiceOrder | modifyServiceOrder | unsolicitedCeaseServiceOrder`
450
450
  * + the `reasonCode` together discriminate the event.
451
+ *
452
+ * `workOrder` / `serviceAppointment` / `changeReason` carry typed Odin
453
+ * record / partial-record shapes — consumers that handle the KCI need them
454
+ * to update YF WorkOrder stages and log OrderKci on the YF side.
451
455
  */
456
+ import type { OdinRecord } from '@d19n/odin-types/dist/core';
457
+ import type { WorkOrderProperties } from '../../entities-v2/WorkOrder';
458
+ import type { ChangeReasonProperties } from '../../entities-v2/ChangeReason';
452
459
  export interface FibreCafeKciDto {
453
460
  /** Unique identifier for this update (UUID). */
454
461
  id: string;
@@ -464,8 +471,8 @@ export interface FibreCafeKciDto {
464
471
  ceaseServiceOrder?: FibreCafeCeaseServiceOrder;
465
472
  modifyServiceOrder?: FibreCafeModifyServiceOrder;
466
473
  unsolicitedCeaseServiceOrder?: FibreCafeUnsolicitedCeaseServiceOrder;
467
- /** Full Odin WorkOrder record — sent for WO stage/appointment updates. Opaque to SDK. */
468
- workOrder?: unknown;
474
+ /** Full Odin WorkOrder record — sent for WO stage/appointment updates. */
475
+ workOrder?: OdinRecord<WorkOrderProperties>;
469
476
  /** Partial Odin ServiceAppointment record — sent for WO stage/appointment updates. */
470
477
  serviceAppointment?: {
471
478
  id: string;
@@ -474,8 +481,8 @@ export interface FibreCafeKciDto {
474
481
  TimeBlock: string;
475
482
  };
476
483
  };
477
- /** Full Odin ChangeReason record — sent when a change reason is associated. Opaque to SDK. */
478
- changeReason?: unknown;
484
+ /** Full Odin ChangeReason record — sent when a change reason is associated. */
485
+ changeReason?: OdinRecord<ChangeReasonProperties>;
479
486
  }
480
487
  export interface FibreCafeServiceProblemCreateDto {
481
488
  /** Caller-generated id. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.103-beta.10",
3
+ "version": "2.0.103-beta.12",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",