@d19n/youfibre-odin-sdk 2.0.159 → 2.0.161

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.
@@ -84,6 +84,20 @@ export interface CreateOrderKciProperties {
84
84
  * @type {NUMBER}
85
85
  */
86
86
  SequenceNumber?: number | null;
87
+ /**
88
+ * Appointment Date
89
+ *
90
+ * Rebooked appointment date carried by a supplier reschedule KCI (REAPPOINTED / *_RESCHEDULED). Source: dto.appointmentDate.
91
+ * @type {DATE}
92
+ */
93
+ AppointmentDate?: string | null;
94
+ /**
95
+ * Appointment Time Block
96
+ *
97
+ * Rebooked appointment AM/PM block carried by a supplier reschedule KCI. Source: dto.appointmentTimeBlock.
98
+ * @type {ENUM}
99
+ */
100
+ AppointmentTimeBlock?: string | null;
87
101
  }
88
102
  /**
89
103
  * CreateOrderKci
@@ -73,7 +73,11 @@ export declare enum OrderKciPropertyKeys {
73
73
  /** Supplier-emitted KCI sequence number — increments per KCI on the parent order. Used to detect missing or out-of-order events. */
74
74
  SequenceNumber = "SequenceNumber",
75
75
  /** Supplier's reason or problem codes, comma-separated (where applicable) */
76
- SupplierCodes = "SupplierCodes"
76
+ SupplierCodes = "SupplierCodes",
77
+ /** Rebooked appointment date carried by a supplier reschedule KCI (REAPPOINTED / *_RESCHEDULED). */
78
+ AppointmentDate = "AppointmentDate",
79
+ /** Rebooked appointment AM/PM block carried by a supplier reschedule KCI. */
80
+ AppointmentTimeBlock = "AppointmentTimeBlock"
77
81
  }
78
82
  /**
79
83
  * Properties for OrderKci records
@@ -79,6 +79,10 @@ var OrderKciPropertyKeys;
79
79
  OrderKciPropertyKeys["SequenceNumber"] = "SequenceNumber";
80
80
  /** Supplier's reason or problem codes, comma-separated (where applicable) */
81
81
  OrderKciPropertyKeys["SupplierCodes"] = "SupplierCodes";
82
+ /** Rebooked appointment date carried by a supplier reschedule KCI (REAPPOINTED / *_RESCHEDULED). */
83
+ OrderKciPropertyKeys["AppointmentDate"] = "AppointmentDate";
84
+ /** Rebooked appointment AM/PM block carried by a supplier reschedule KCI. */
85
+ OrderKciPropertyKeys["AppointmentTimeBlock"] = "AppointmentTimeBlock";
82
86
  })(OrderKciPropertyKeys = exports.OrderKciPropertyKeys || (exports.OrderKciPropertyKeys = {}));
83
87
  /**
84
88
  * OrderKci entity from OrderModule
@@ -98,9 +98,10 @@ export interface YfKciEffect {
98
98
  *
99
99
  * NOTE: `ChangeReasonRescheduleReason` does NOT map 1:1 to KCI types —
100
100
  * the KCI only tells us *that* the supplier moved the slot, not the
101
- * granular operational reason. We therefore stamp a single neutral
102
- * supplier-owned value (`SCHEDULE_CHANGED`) for every supplier-driven
103
- * KCI reschedule rather than inventing a per-KCI mapping.
101
+ * granular operational reason. We therefore stamp a single dedicated,
102
+ * cause-agnostic value (`SUPPLIER_RESCHEDULED_APPOINTMENT`) for every
103
+ * supplier-driven KCI reschedule rather than inventing a per-KCI mapping
104
+ * or borrowing a member that implies a specific cause.
104
105
  */
105
106
  readonly rescheduleReason?: string;
106
107
  };
@@ -198,7 +198,7 @@ exports.KCI_EFFECT_ROWS = [
198
198
  supplierReferenceFrom: 'provideServiceOrder.appointmentReservationReference',
199
199
  // REAPPOINTED is a supplier reschedule → update existing SA in place
200
200
  // + record the SA_RESCHEDULE ChangeReason.
201
- rescheduleReason: 'SCHEDULE_CHANGED',
201
+ rescheduleReason: 'SUPPLIER_RESCHEDULED_APPOINTMENT',
202
202
  },
203
203
  // Co-effect: REAPPOINTED's dto also carries an updated
204
204
  // `provideServiceOrder.committedDate` for the rebooked appointment.
@@ -343,7 +343,7 @@ exports.KCI_EFFECT_ROWS = [
343
343
  dateFrom: 'appointmentDate',
344
344
  timeBlockFrom: 'appointmentTimeBlock',
345
345
  supplierReferenceFrom: 'provideServiceOrder.appointmentReservationReference',
346
- rescheduleReason: 'SCHEDULE_CHANGED',
346
+ rescheduleReason: 'SUPPLIER_RESCHEDULED_APPOINTMENT',
347
347
  },
348
348
  notes: 'Supplier-confirmed REMEDIATION reschedule. Update the WO ' +
349
349
  'ServiceAppointment Date/TimeBlock in place, land the WO in Scheduled, ' +
@@ -412,7 +412,7 @@ exports.KCI_EFFECT_ROWS = [
412
412
  dateFrom: 'appointmentDate',
413
413
  timeBlockFrom: 'appointmentTimeBlock',
414
414
  supplierReferenceFrom: 'provideServiceOrder.appointmentReservationReference',
415
- rescheduleReason: 'SCHEDULE_CHANGED',
415
+ rescheduleReason: 'SUPPLIER_RESCHEDULED_APPOINTMENT',
416
416
  },
417
417
  notes: 'Supplier-confirmed SERVICE reschedule. Update the WO ServiceAppointment ' +
418
418
  'Date/TimeBlock in place, land the WO in Scheduled, and record the ' +
@@ -147,7 +147,7 @@ function run() {
147
147
  if (decision.kind === 'WO_SCHEDULE_APPOINTMENT') {
148
148
  assert('dateFrom=appointmentDate', decision.dateFrom === 'appointmentDate');
149
149
  assert('timeBlockFrom=appointmentTimeBlock', decision.timeBlockFrom === 'appointmentTimeBlock');
150
- assert('rescheduleReason=SCHEDULE_CHANGED', decision.rescheduleReason === 'SCHEDULE_CHANGED');
150
+ assert('rescheduleReason=SUPPLIER_RESCHEDULED_APPOINTMENT', decision.rescheduleReason === 'SUPPLIER_RESCHEDULED_APPOINTMENT');
151
151
  }
152
152
  }
153
153
  console.log('Test: SERVICE WORK_ORDER_RESCHEDULED → WO_SCHEDULE_APPOINTMENT (REPAIR reschedule)');
@@ -159,7 +159,7 @@ function run() {
159
159
  assert('kind=WO_SCHEDULE_APPOINTMENT', decision.kind === 'WO_SCHEDULE_APPOINTMENT');
160
160
  if (decision.kind === 'WO_SCHEDULE_APPOINTMENT') {
161
161
  assert('row=repair-update-service-rescheduled', decision.row.id === 'repair-update-service-rescheduled');
162
- assert('rescheduleReason=SCHEDULE_CHANGED', decision.rescheduleReason === 'SCHEDULE_CHANGED');
162
+ assert('rescheduleReason=SUPPLIER_RESCHEDULED_APPOINTMENT', decision.rescheduleReason === 'SUPPLIER_RESCHEDULED_APPOINTMENT');
163
163
  }
164
164
  }
165
165
  console.log('Test: REMEDIATION WORK_ORDER_RESCHEDULED → WO_SCHEDULE_APPOINTMENT (PROVIDE reschedule)');
@@ -171,7 +171,7 @@ function run() {
171
171
  assert('kind=WO_SCHEDULE_APPOINTMENT', decision.kind === 'WO_SCHEDULE_APPOINTMENT');
172
172
  if (decision.kind === 'WO_SCHEDULE_APPOINTMENT') {
173
173
  assert('row=provide-update-remediation-rescheduled', decision.row.id === 'provide-update-remediation-rescheduled');
174
- assert('rescheduleReason=SCHEDULE_CHANGED', decision.rescheduleReason === 'SCHEDULE_CHANGED');
174
+ assert('rescheduleReason=SUPPLIER_RESCHEDULED_APPOINTMENT', decision.rescheduleReason === 'SUPPLIER_RESCHEDULED_APPOINTMENT');
175
175
  }
176
176
  }
177
177
  console.log('Test: WARNING → LOG_KCI_ONLY');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.159",
3
+ "version": "2.0.161",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",