@d19n/youfibre-odin-sdk 2.0.103-beta.16 → 2.0.103-beta.17

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.
@@ -29,7 +29,7 @@ export declare type KciServiceOrderKind = 'PROVIDE' | 'CEASE' | 'MODIFY' | 'UNSO
29
29
  * `actionKey` in `packages/youfibre-odin-sdk/src/actions-v2/<Name>Dto.ts`.
30
30
  */
31
31
  export declare type YfWoComposedActionKey = 'MoveInstallWorkOrderToScheduled' | 'MoveInstallWorkOrderToEnRoute' | 'MoveInstallWorkOrderFromInProgressToPending' | 'MoveInstallWorkOrderFromPendingToInProgress' | 'MoveInstallWorkOrderToRemediation' | 'MoveInstallWorkOrderFromRemediationToInProgress' | 'CreateInstallRescheduledChangeReasonSupplier' | 'CompleteInstallWorkOrderFlow' | 'CancelInstallWorkOrderFlowSupplier' | 'CreateInstallCancelledChangeReasonSupplier' | 'MoveBusinessInstallToEnRoute' | 'MoveBusinessInstallToInProgress' | 'MoveRemediationWorkOrderToEnRoute' | 'MoveRemediationWorkOrderToInProgress' | 'MoveServiceWorkOrderFromAcceptedToScheduled' | 'MoveServiceWorkOrderToEnRoute' | 'MoveServiceWorkOrderToInProgress';
32
- export declare type YfKciEffectKind = 'LOG_KCI_ONLY' | 'WO_FLOW_ACTION' | 'PROPERTY_WRITE' | 'NO_OP_DOCUMENTED';
32
+ export declare type YfKciEffectKind = 'LOG_KCI_ONLY' | 'WO_FLOW_ACTION' | 'WO_SCHEDULE_APPOINTMENT' | 'PROPERTY_WRITE' | 'NO_OP_DOCUMENTED';
33
33
  export declare type YfKciTargetEntity = 'OrderModule:Order' | 'CrmModule:Address' | 'FieldServiceModule:WorkOrder';
34
34
  export interface YfKciEffect {
35
35
  readonly kind: YfKciEffectKind;
@@ -42,6 +42,21 @@ export interface YfKciEffect {
42
42
  };
43
43
  /** For NO_OP_DOCUMENTED: required reason text. */
44
44
  readonly noOpReason?: string;
45
+ /** For WO_SCHEDULE_APPOINTMENT: bundled stage move + appointment + supplier
46
+ * reference via the field-service scheduleAppointment service. The dispatcher
47
+ * extracts each property's value from the DTO at the JSONPath given by
48
+ * `*From` and POSTs to /FieldServiceModule/.../schedule-appointment with
49
+ * skipSupplierBooking=true (the KCI is the supplier's commit, not a request). */
50
+ readonly scheduleAppointment?: {
51
+ /** Which WO type the appointment lives on. */
52
+ readonly woType: 'INSTALL' | 'INSTALL_BUSINESS' | 'SERVICE';
53
+ /** JSONPath from KCI dto root for the appointment start datetime. */
54
+ readonly dateFrom: string;
55
+ /** JSONPath for the timeslot classification (WEEKDAY_AM / WEEKDAY_PM / etc.). */
56
+ readonly timeBlockFrom: string;
57
+ /** JSONPath for the supplier-side appointment reservation reference. */
58
+ readonly supplierReferenceFrom: string;
59
+ };
45
60
  readonly notes: string;
46
61
  }
47
62
  export interface KciEffectRow {
@@ -71,6 +86,13 @@ export declare type KciDispatchDecision = {
71
86
  kind: 'WO_FLOW_ACTION';
72
87
  row: KciEffectRow;
73
88
  woActionKey: YfWoComposedActionKey;
89
+ } | {
90
+ kind: 'WO_SCHEDULE_APPOINTMENT';
91
+ row: KciEffectRow;
92
+ woType: 'INSTALL' | 'INSTALL_BUSINESS' | 'SERVICE';
93
+ dateFrom: string;
94
+ timeBlockFrom: string;
95
+ supplierReferenceFrom: string;
74
96
  } | {
75
97
  kind: 'PROPERTY_WRITE';
76
98
  row: KciEffectRow;
@@ -148,9 +148,13 @@ exports.KCI_EFFECT_ROWS = [
148
148
  reasonCode: 'RESUMED',
149
149
  serviceOrderKind: 'PROVIDE',
150
150
  yfEffect: {
151
- kind: 'WO_FLOW_ACTION',
152
- woActionKey: 'MoveInstallWorkOrderFromPendingToInProgress',
153
- notes: 'Supplier resumed fulfillment after Pending/Held.',
151
+ kind: 'LOG_KCI_ONLY',
152
+ notes: "RESUMED is NET-side ambiguous (emitted for both Held→InProgress and " +
153
+ "the invalid-in-YF Pending→InProgress). Per Frank: Pending→InProgress " +
154
+ "is never a valid YF transition (Pending exits to Scheduled only). " +
155
+ "RESOLVED already covers the RemediationRequired→InProgress case. " +
156
+ "Log only until T-20260508-011 has NET emit REAPPOINTED for the rebook " +
157
+ "case instead of RESUMED.",
154
158
  },
155
159
  logAgainstOrder: true,
156
160
  },
@@ -183,9 +187,17 @@ exports.KCI_EFFECT_ROWS = [
183
187
  reasonCode: 'REAPPOINTED',
184
188
  serviceOrderKind: 'PROVIDE',
185
189
  yfEffect: {
186
- kind: 'WO_FLOW_ACTION',
187
- woActionKey: 'CreateInstallRescheduledChangeReasonSupplier',
188
- notes: 'Supplier-side reappointment confirmed. Reschedule flow + ChangeReason for audit.',
190
+ kind: 'WO_SCHEDULE_APPOINTMENT',
191
+ scheduleAppointment: {
192
+ woType: 'INSTALL',
193
+ dateFrom: 'provideServiceOrder.appointmentTimeslot.timeslotStartDateTime',
194
+ timeBlockFrom: 'provideServiceOrder.appointmentTimeslot.classification',
195
+ supplierReferenceFrom: 'provideServiceOrder.appointmentReservationReference',
196
+ },
197
+ notes: 'Supplier-confirmed reschedule. Bundled effect: WO Pending→Scheduled + ' +
198
+ 'set appointment date + stamp supplier reservation reference. Single ' +
199
+ 'scheduleAppointment service call handles all three (skipSupplierBooking=true ' +
200
+ 'because KCI is the commit, not a request).',
189
201
  },
190
202
  logAgainstOrder: true,
191
203
  },
@@ -449,6 +461,18 @@ function decideKciDispatch(dto) {
449
461
  throw new Error(`bridge invariant: WO_FLOW_ACTION row ${row.id} missing woActionKey`);
450
462
  }
451
463
  return { kind: 'WO_FLOW_ACTION', row, woActionKey: row.yfEffect.woActionKey };
464
+ case 'WO_SCHEDULE_APPOINTMENT':
465
+ if (!row.yfEffect.scheduleAppointment) {
466
+ throw new Error(`bridge invariant: WO_SCHEDULE_APPOINTMENT row ${row.id} missing scheduleAppointment`);
467
+ }
468
+ return {
469
+ kind: 'WO_SCHEDULE_APPOINTMENT',
470
+ row,
471
+ woType: row.yfEffect.scheduleAppointment.woType,
472
+ dateFrom: row.yfEffect.scheduleAppointment.dateFrom,
473
+ timeBlockFrom: row.yfEffect.scheduleAppointment.timeBlockFrom,
474
+ supplierReferenceFrom: row.yfEffect.scheduleAppointment.supplierReferenceFrom,
475
+ };
452
476
  case 'PROPERTY_WRITE':
453
477
  if (!row.yfEffect.propertyWrite) {
454
478
  throw new Error(`bridge invariant: PROPERTY_WRITE row ${row.id} missing propertyWrite`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.103-beta.16",
3
+ "version": "2.0.103-beta.17",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",