@d19n/youfibre-odin-sdk 2.0.342 → 2.0.344

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.
Files changed (98) hide show
  1. package/README.md +26 -2
  2. package/dist/EntityRegistry.d.ts +4 -0
  3. package/dist/EntityRegistry.js +4 -0
  4. package/dist/OdinApiClient.d.ts +8 -0
  5. package/dist/OdinApiClient.js +16 -0
  6. package/dist/OdinDbClient.d.ts +8 -0
  7. package/dist/OdinDbClient.js +16 -0
  8. package/dist/accessors-v2/DocumentAccessor.d.ts +112 -0
  9. package/dist/accessors-v2/DocumentAccessor.js +191 -0
  10. package/dist/accessors-v2/DocumentProcessingAccessor.d.ts +112 -0
  11. package/dist/accessors-v2/DocumentProcessingAccessor.js +191 -0
  12. package/dist/accessors-v2/index.d.ts +2 -0
  13. package/dist/accessors-v2/index.js +7 -3
  14. package/dist/actions-v2/CreateAiRouteRequestDto.d.ts +1 -1
  15. package/dist/actions-v2/CreateChurnRequestDto.d.ts +2 -0
  16. package/dist/actions-v2/CreateChurnRequestDto.js +2 -0
  17. package/dist/actions-v2/CreateDocumentDto.d.ts +235 -0
  18. package/dist/actions-v2/CreateDocumentDto.js +57 -0
  19. package/dist/actions-v2/CreateDocumentProcessingDto.d.ts +192 -0
  20. package/dist/actions-v2/CreateDocumentProcessingDto.js +57 -0
  21. package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +9 -17
  22. package/dist/actions-v2/UpdateDocumentDto.d.ts +236 -0
  23. package/dist/actions-v2/UpdateDocumentDto.js +59 -0
  24. package/dist/actions-v2/UpdateMessageReadByCustomerDto.d.ts +72 -0
  25. package/dist/actions-v2/UpdateMessageReadByCustomerDto.js +56 -0
  26. package/dist/api-sdk-v2/CommitmentApi.d.ts +48 -0
  27. package/dist/api-sdk-v2/CommitmentApi.js +155 -0
  28. package/dist/api-sdk-v2/ContractBuyOutApi.d.ts +2 -0
  29. package/dist/api-sdk-v2/ContractBuyOutApi.js +6 -0
  30. package/dist/api-sdk-v2/DocumentApi.d.ts +52 -0
  31. package/dist/api-sdk-v2/DocumentApi.js +167 -0
  32. package/dist/api-sdk-v2/DocumentProcessingApi.d.ts +50 -0
  33. package/dist/api-sdk-v2/DocumentProcessingApi.js +161 -0
  34. package/dist/api-sdk-v2/EquipmentReturnApi.d.ts +45 -0
  35. package/dist/api-sdk-v2/EquipmentReturnApi.js +151 -0
  36. package/dist/api-sdk-v2/EquipmentReturnItemApi.d.ts +45 -0
  37. package/dist/api-sdk-v2/EquipmentReturnItemApi.js +151 -0
  38. package/dist/api-sdk-v2/FileApi.d.ts +4 -0
  39. package/dist/api-sdk-v2/FileApi.js +12 -0
  40. package/dist/api-sdk-v2/OrderApi.d.ts +2 -0
  41. package/dist/api-sdk-v2/OrderApi.js +6 -0
  42. package/dist/db-accessors-v2/DocumentDbAccessor.d.ts +180 -0
  43. package/dist/db-accessors-v2/DocumentDbAccessor.js +265 -0
  44. package/dist/db-accessors-v2/DocumentProcessingDbAccessor.d.ts +180 -0
  45. package/dist/db-accessors-v2/DocumentProcessingDbAccessor.js +265 -0
  46. package/dist/db-accessors-v2/index.d.ts +2 -0
  47. package/dist/db-accessors-v2/index.js +7 -3
  48. package/dist/db-sdk-v2/CommitmentDb.d.ts +120 -0
  49. package/dist/db-sdk-v2/CommitmentDb.js +204 -0
  50. package/dist/db-sdk-v2/ContractBuyOutDb.d.ts +2 -0
  51. package/dist/db-sdk-v2/ContractBuyOutDb.js +6 -0
  52. package/dist/db-sdk-v2/DocumentDb.d.ts +124 -0
  53. package/dist/db-sdk-v2/DocumentDb.js +216 -0
  54. package/dist/db-sdk-v2/DocumentProcessingDb.d.ts +122 -0
  55. package/dist/db-sdk-v2/DocumentProcessingDb.js +210 -0
  56. package/dist/db-sdk-v2/EquipmentReturnDb.d.ts +117 -0
  57. package/dist/db-sdk-v2/EquipmentReturnDb.js +200 -0
  58. package/dist/db-sdk-v2/EquipmentReturnItemDb.d.ts +117 -0
  59. package/dist/db-sdk-v2/EquipmentReturnItemDb.js +200 -0
  60. package/dist/db-sdk-v2/FileDb.d.ts +4 -0
  61. package/dist/db-sdk-v2/FileDb.js +12 -0
  62. package/dist/db-sdk-v2/OrderDb.d.ts +2 -0
  63. package/dist/db-sdk-v2/OrderDb.js +6 -0
  64. package/dist/entities-v2/AiRouteRequest.d.ts +23 -11
  65. package/dist/entities-v2/AiRouteRequest.js +15 -3
  66. package/dist/entities-v2/Commitment.d.ts +154 -0
  67. package/dist/entities-v2/Commitment.js +115 -0
  68. package/dist/entities-v2/ContractBuyOut.d.ts +7 -0
  69. package/dist/entities-v2/ContractBuyOut.js +5 -1
  70. package/dist/entities-v2/Document.d.ts +1145 -0
  71. package/dist/entities-v2/Document.js +220 -0
  72. package/dist/entities-v2/DocumentProcessing.d.ts +272 -0
  73. package/dist/entities-v2/DocumentProcessing.js +156 -0
  74. package/dist/entities-v2/EquipmentReturn.d.ts +66 -0
  75. package/dist/entities-v2/EquipmentReturn.js +64 -0
  76. package/dist/entities-v2/EquipmentReturnItem.d.ts +66 -0
  77. package/dist/entities-v2/EquipmentReturnItem.js +64 -0
  78. package/dist/entities-v2/File.d.ts +81 -1
  79. package/dist/entities-v2/File.js +9 -1
  80. package/dist/entities-v2/Message.d.ts +27 -1
  81. package/dist/entities-v2/Message.js +2 -0
  82. package/dist/entities-v2/Order.d.ts +49 -8
  83. package/dist/entities-v2/Order.js +24 -4
  84. package/dist/entities-v2/YfStockCount.d.ts +197 -1
  85. package/dist/entities-v2/YfStockCount.js +28 -0
  86. package/dist/records-v2/ContractBuyOutRecord.d.ts +20 -0
  87. package/dist/records-v2/ContractBuyOutRecord.js +33 -0
  88. package/dist/records-v2/DocumentProcessingRecord.d.ts +227 -0
  89. package/dist/records-v2/DocumentProcessingRecord.js +315 -0
  90. package/dist/records-v2/DocumentRecord.d.ts +355 -0
  91. package/dist/records-v2/DocumentRecord.js +468 -0
  92. package/dist/records-v2/FileRecord.d.ts +59 -3
  93. package/dist/records-v2/FileRecord.js +83 -1
  94. package/dist/records-v2/MessageRecord.d.ts +28 -0
  95. package/dist/records-v2/MessageRecord.js +37 -0
  96. package/dist/records-v2/index.d.ts +2 -0
  97. package/dist/records-v2/index.js +10 -4
  98. package/package.json +1 -1
@@ -63,6 +63,7 @@ export declare class OrderDb extends DbProvider {
63
63
  private _dataissue?;
64
64
  private _workorder?;
65
65
  private _email?;
66
+ private _commitment?;
66
67
  constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
67
68
  get note(): DbRecordLinkManager;
68
69
  get lead(): DbRecordLinkManager;
@@ -106,6 +107,7 @@ export declare class OrderDb extends DbProvider {
106
107
  get dataissue(): DbRecordLinkManager;
107
108
  get workorder(): DbRecordLinkManager;
108
109
  get email(): DbRecordLinkManager;
110
+ get commitment(): DbRecordLinkManager;
109
111
  setRecord(sourceRecord: any): void;
110
112
  /**
111
113
  * Search records with manual pagination control
@@ -290,6 +290,12 @@ class OrderDb extends db_provider_1.DbProvider {
290
290
  }
291
291
  return this._email;
292
292
  }
293
+ get commitment() {
294
+ if (!this._commitment) {
295
+ this._commitment = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'OrderModule:Order', 'OrderModule:Commitment', 'Commitment__Order');
296
+ }
297
+ return this._commitment;
298
+ }
293
299
  // ============================================
294
300
  // STANDARD METHODS
295
301
  // ============================================
@@ -26,16 +26,24 @@ export declare enum AiRouteRequestEntityTypes {
26
26
  * @remarks Available options:
27
27
  * - `CASE_SENTIMENT`
28
28
  * - `CASE_TAGGING`
29
+ * - `CBO_FINAL_BILL_CHECK`
29
30
  * - `CHAT_SUMMARY`
30
31
  * - `CUSTOMER_CONTEXT_SUMMARY`
32
+ * - `DOCUMENT_DESCRIBE`
33
+ * - `EDGAR_CHAT`
34
+ * - `INSTALL_FORM_REVIEW`
31
35
  * - `MAGRATHEA_PORTING`
32
36
  * - `QA_REPORT`
33
37
  */
34
38
  export declare enum AiRouteRequestFeature {
35
39
  CASE_SENTIMENT = "CASE_SENTIMENT",
36
40
  CASE_TAGGING = "CASE_TAGGING",
41
+ CBO_FINAL_BILL_CHECK = "CBO_FINAL_BILL_CHECK",
37
42
  CHAT_SUMMARY = "CHAT_SUMMARY",
38
43
  CUSTOMER_CONTEXT_SUMMARY = "CUSTOMER_CONTEXT_SUMMARY",
44
+ DOCUMENT_DESCRIBE = "DOCUMENT_DESCRIBE",
45
+ EDGAR_CHAT = "EDGAR_CHAT",
46
+ INSTALL_FORM_REVIEW = "INSTALL_FORM_REVIEW",
39
47
  MAGRATHEA_PORTING = "MAGRATHEA_PORTING",
40
48
  QA_REPORT = "QA_REPORT"
41
49
  }
@@ -68,19 +76,23 @@ export declare enum AiRouteRequestOutcome {
68
76
  /**
69
77
  * Valid values for AiRouteRequest.Reason
70
78
  *
71
- * split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard).
79
+ * split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). single-provider: the feature has one provider, no split. edgar-reply: a message Edgar AI posted, no call of ours to time.
72
80
  *
73
81
  * @remarks Available options:
74
82
  * - `config-off`
75
83
  * - `config-unreadable`
84
+ * - `edgar-reply`
76
85
  * - `redis-unavailable`
86
+ * - `single-provider`
77
87
  * - `split`
78
88
  * - `too-large`
79
89
  */
80
90
  export declare enum AiRouteRequestReason {
81
91
  CONFIG_OFF = "config-off",
82
92
  CONFIG_UNREADABLE = "config-unreadable",
93
+ EDGAR_REPLY = "edgar-reply",
83
94
  REDIS_UNAVAILABLE = "redis-unavailable",
95
+ SINGLE_PROVIDER = "single-provider",
84
96
  SPLIT = "split",
85
97
  TOO_LARGE = "too-large"
86
98
  }
@@ -95,8 +107,6 @@ export declare enum AiRouteRequestPropertyKeys {
95
107
  Provider = "Provider",
96
108
  /** ok when the provider answered and the reply passed its check; failed after the last try. */
97
109
  Outcome = "Outcome",
98
- /** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). */
99
- Reason = "Reason",
100
110
  /** The per-feature counter value this request drew (odd = qwen, even = databricks). Empty when the split was skipped. */
101
111
  Count = "Count",
102
112
  /** 1 for Databricks; 1 to 6 for Qwen (one try plus up to five retries). */
@@ -116,7 +126,9 @@ export declare enum AiRouteRequestPropertyKeys {
116
126
  /** Id of the case or conversation the request was for. Links the row back to the record. */
117
127
  JourneyId = "JourneyId",
118
128
  /** When the router started the request. The record is written a few hundred milliseconds later. */
119
- StartedAt = "StartedAt"
129
+ StartedAt = "StartedAt",
130
+ /** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). single-provider: the feature has one provider, no split. edgar-reply: a message Edgar AI posted, no call of ours to time. */
131
+ Reason = "Reason"
120
132
  }
121
133
  /**
122
134
  * Properties for AiRouteRequest records
@@ -145,13 +157,6 @@ export interface AiRouteRequestProperties {
145
157
  * @enum {AiRouteRequestOutcome}
146
158
  */
147
159
  Outcome: AiRouteRequestOutcome;
148
- /** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard).
149
- *
150
- * @type {ENUM}
151
- * @default
152
- * @enum {AiRouteRequestReason}
153
- */
154
- Reason: AiRouteRequestReason;
155
160
  /** The per-feature counter value this request drew (odd = qwen, even = databricks). Empty when the split was skipped.
156
161
  *
157
162
  * @type {NUMBER}
@@ -212,6 +217,13 @@ export interface AiRouteRequestProperties {
212
217
  * @default
213
218
  */
214
219
  StartedAt: string;
220
+ /** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). single-provider: the feature has one provider, no split. edgar-reply: a message Edgar AI posted, no call of ours to time.
221
+ *
222
+ * @type {ENUM}
223
+ * @default
224
+ * @enum {AiRouteRequestReason}
225
+ */
226
+ Reason: AiRouteRequestReason;
215
227
  }
216
228
  /**
217
229
  * AiRouteRequest entity from SupportModule
@@ -30,8 +30,12 @@ var AiRouteRequestEntityTypes;
30
30
  * @remarks Available options:
31
31
  * - `CASE_SENTIMENT`
32
32
  * - `CASE_TAGGING`
33
+ * - `CBO_FINAL_BILL_CHECK`
33
34
  * - `CHAT_SUMMARY`
34
35
  * - `CUSTOMER_CONTEXT_SUMMARY`
36
+ * - `DOCUMENT_DESCRIBE`
37
+ * - `EDGAR_CHAT`
38
+ * - `INSTALL_FORM_REVIEW`
35
39
  * - `MAGRATHEA_PORTING`
36
40
  * - `QA_REPORT`
37
41
  */
@@ -39,8 +43,12 @@ var AiRouteRequestFeature;
39
43
  (function (AiRouteRequestFeature) {
40
44
  AiRouteRequestFeature["CASE_SENTIMENT"] = "CASE_SENTIMENT";
41
45
  AiRouteRequestFeature["CASE_TAGGING"] = "CASE_TAGGING";
46
+ AiRouteRequestFeature["CBO_FINAL_BILL_CHECK"] = "CBO_FINAL_BILL_CHECK";
42
47
  AiRouteRequestFeature["CHAT_SUMMARY"] = "CHAT_SUMMARY";
43
48
  AiRouteRequestFeature["CUSTOMER_CONTEXT_SUMMARY"] = "CUSTOMER_CONTEXT_SUMMARY";
49
+ AiRouteRequestFeature["DOCUMENT_DESCRIBE"] = "DOCUMENT_DESCRIBE";
50
+ AiRouteRequestFeature["EDGAR_CHAT"] = "EDGAR_CHAT";
51
+ AiRouteRequestFeature["INSTALL_FORM_REVIEW"] = "INSTALL_FORM_REVIEW";
44
52
  AiRouteRequestFeature["MAGRATHEA_PORTING"] = "MAGRATHEA_PORTING";
45
53
  AiRouteRequestFeature["QA_REPORT"] = "QA_REPORT";
46
54
  })(AiRouteRequestFeature = exports.AiRouteRequestFeature || (exports.AiRouteRequestFeature = {}));
@@ -75,12 +83,14 @@ var AiRouteRequestOutcome;
75
83
  /**
76
84
  * Valid values for AiRouteRequest.Reason
77
85
  *
78
- * split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard).
86
+ * split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). single-provider: the feature has one provider, no split. edgar-reply: a message Edgar AI posted, no call of ours to time.
79
87
  *
80
88
  * @remarks Available options:
81
89
  * - `config-off`
82
90
  * - `config-unreadable`
91
+ * - `edgar-reply`
83
92
  * - `redis-unavailable`
93
+ * - `single-provider`
84
94
  * - `split`
85
95
  * - `too-large`
86
96
  */
@@ -88,7 +98,9 @@ var AiRouteRequestReason;
88
98
  (function (AiRouteRequestReason) {
89
99
  AiRouteRequestReason["CONFIG_OFF"] = "config-off";
90
100
  AiRouteRequestReason["CONFIG_UNREADABLE"] = "config-unreadable";
101
+ AiRouteRequestReason["EDGAR_REPLY"] = "edgar-reply";
91
102
  AiRouteRequestReason["REDIS_UNAVAILABLE"] = "redis-unavailable";
103
+ AiRouteRequestReason["SINGLE_PROVIDER"] = "single-provider";
92
104
  AiRouteRequestReason["SPLIT"] = "split";
93
105
  AiRouteRequestReason["TOO_LARGE"] = "too-large";
94
106
  })(AiRouteRequestReason = exports.AiRouteRequestReason || (exports.AiRouteRequestReason = {}));
@@ -104,8 +116,6 @@ var AiRouteRequestPropertyKeys;
104
116
  AiRouteRequestPropertyKeys["Provider"] = "Provider";
105
117
  /** ok when the provider answered and the reply passed its check; failed after the last try. */
106
118
  AiRouteRequestPropertyKeys["Outcome"] = "Outcome";
107
- /** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). */
108
- AiRouteRequestPropertyKeys["Reason"] = "Reason";
109
119
  /** The per-feature counter value this request drew (odd = qwen, even = databricks). Empty when the split was skipped. */
110
120
  AiRouteRequestPropertyKeys["Count"] = "Count";
111
121
  /** 1 for Databricks; 1 to 6 for Qwen (one try plus up to five retries). */
@@ -126,6 +136,8 @@ var AiRouteRequestPropertyKeys;
126
136
  AiRouteRequestPropertyKeys["JourneyId"] = "JourneyId";
127
137
  /** When the router started the request. The record is written a few hundred milliseconds later. */
128
138
  AiRouteRequestPropertyKeys["StartedAt"] = "StartedAt";
139
+ /** split: the 50/50 counter chose. Otherwise why the split was skipped and Databricks answered: config-off, config-unreadable, redis-unavailable, too-large (prompt over the Qwen size guard). single-provider: the feature has one provider, no split. edgar-reply: a message Edgar AI posted, no call of ours to time. */
140
+ AiRouteRequestPropertyKeys["Reason"] = "Reason";
129
141
  })(AiRouteRequestPropertyKeys = exports.AiRouteRequestPropertyKeys || (exports.AiRouteRequestPropertyKeys = {}));
130
142
  /**
131
143
  * AiRouteRequest entity from SupportModule
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Commitment Entity Definition
3
+ *
4
+ * One thing an order still owes, and when it falls due: the type, the deadline, what discharged it, and where it stands (Not Yet Due / Pending / Breached / Discharged / Not Required). An order is finished when it has no open commitments.
5
+ *
6
+ * @module OrderModule
7
+ * @entity Commitment
8
+ * @schemaId 6961f6fc-9d4b-4913-9677-065e0b67a1ce
9
+ *
10
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
11
+ * Generated from Odin schema definition
12
+ */
13
+ import { OdinRecord, OdinLink, LinkedOdinRecord } from '@d19n/odin-types/dist/core';
14
+ import { OrderProperties } from './Order';
15
+ /**
16
+ * Available types for Commitment records
17
+ */
18
+ export declare enum CommitmentEntityTypes {
19
+ /** This is the default record type */
20
+ DEFAULT = "DEFAULT"
21
+ }
22
+ /**
23
+ * Pipeline stage names for DEFAULT Commitment
24
+ * Pipeline: Commitment
25
+ * What an order owes, from not-yet-owed through to settled.
26
+ */
27
+ export declare enum DefaultCommitmentStageNames {
28
+ /** The precondition has not happened, so there is no clock — not a clock still running. A Supply order before its CommittedDate sits here. (default) */
29
+ NotYetDue = "Not Yet Due",
30
+ /** Owed, and the clock is running — ExpectedBy is in the future. */
31
+ Pending = "Pending",
32
+ /** Owed, ExpectedBy has passed, nothing discharged it. Still open work — it ages. Can still be discharged late, which is how lateness gets measured. */
33
+ Breached = "Breached",
34
+ /** The thing that was owed happened. CompletedBy names the record that did it — a COMPLETED OrderKci, a switch at TRIGGER_CONFIRMED. */
35
+ Complete = "Complete",
36
+ /** Resolved as never owed, with the reason — an order with no switch to trigger. A distinct terminal state from Discharged: nothing happened, rather than the thing happening. */
37
+ NotRequired = "Not Required"
38
+ }
39
+ /**
40
+ * Pipeline stage keys for DEFAULT Commitment
41
+ * Use these keys when transitioning between stages
42
+ */
43
+ export declare enum DefaultCommitmentStageKeys {
44
+ /** The precondition has not happened, so there is no clock — not a clock still running. A Supply order before its CommittedDate sits here. */
45
+ CommitmentStageNotYetDue = "CommitmentStageNotYetDue",
46
+ /** Owed, and the clock is running — ExpectedBy is in the future. */
47
+ CommitmentStagePending = "CommitmentStagePending",
48
+ /** Owed, ExpectedBy has passed, nothing discharged it. Still open work — it ages. Can still be discharged late, which is how lateness gets measured. */
49
+ CommitmentStageBreached = "CommitmentStageBreached",
50
+ /** The thing that was owed happened. CompletedBy names the record that did it — a COMPLETED OrderKci, a switch at TRIGGER_CONFIRMED. */
51
+ CommitmentStageComplete = "CommitmentStageComplete",
52
+ /** Resolved as never owed, with the reason — an order with no switch to trigger. A distinct terminal state from Discharged: nothing happened, rather than the thing happening. */
53
+ CommitmentStageNotRequired = "CommitmentStageNotRequired"
54
+ }
55
+ /**
56
+ * Property keys for Commitment
57
+ * Use these constants instead of string literals for type safety
58
+ */
59
+ export declare enum CommitmentPropertyKeys {
60
+ /** orderId::type — the natural key. UNIQUE, and what upsertOnCreate hashes, so the reconciler cannot create a second commitment for something already owed. */
61
+ Fingerprint = "Fingerprint",
62
+ /** The invariant's stableId, e.g. yf/ORDER/OrderStageSupply/supply-completed-kci-must-arrive-by-committed-date. Generated into COMMITMENT-CATALOG.json from the BP, so this is an address the rest of the estate already uses rather than a new vocabulary. */
63
+ Type = "Type",
64
+ /** When it falls due. Empty only while NOT_YET_DUE — a BREACHED commitment without one would be past a deadline that does not exist, which is a fault in whatever created it. */
65
+ ExpectedBy = "ExpectedBy",
66
+ /** The record that settled it, as entity and id — e.g. OrderModule:OrderKci/<id>. Text rather than a typed association per dischargeable entity, so a new commitment type needs no schema change. */
67
+ CompletedBy = "CompletedBy",
68
+ /** When it was settled. Together with ExpectedBy this says whether it was late. */
69
+ CompletedAt = "CompletedAt",
70
+ /** Why it was never owed, when it resolves that way — e.g. NO_CURRENT_PROVIDER for an order with no switch to trigger. Without this, "not required" is indistinguishable from "nobody looked". */
71
+ NotRequiredReason = "NotRequiredReason"
72
+ }
73
+ /**
74
+ * Properties for Commitment records
75
+ *
76
+ * @see OrderModule:Commitment
77
+ */
78
+ export interface CommitmentProperties {
79
+ /** orderId::type — the natural key. UNIQUE, and what upsertOnCreate hashes, so the reconciler cannot create a second commitment for something already owed.
80
+ *
81
+ * @type {TEXT}
82
+ * @default
83
+ */
84
+ Fingerprint: string;
85
+ /** The invariant's stableId, e.g. yf/ORDER/OrderStageSupply/supply-completed-kci-must-arrive-by-committed-date. Generated into COMMITMENT-CATALOG.json from the BP, so this is an address the rest of the estate already uses rather than a new vocabulary.
86
+ *
87
+ * @type {TEXT}
88
+ * @default
89
+ */
90
+ Type: string;
91
+ /** When it falls due. Empty only while NOT_YET_DUE — a BREACHED commitment without one would be past a deadline that does not exist, which is a fault in whatever created it.
92
+ *
93
+ * @type {DATE_TIME}
94
+ * @default
95
+ */
96
+ ExpectedBy: string;
97
+ /** The record that settled it, as entity and id — e.g. OrderModule:OrderKci/<id>. Text rather than a typed association per dischargeable entity, so a new commitment type needs no schema change.
98
+ *
99
+ * @type {TEXT}
100
+ * @default
101
+ */
102
+ CompletedBy: string;
103
+ /** When it was settled. Together with ExpectedBy this says whether it was late.
104
+ *
105
+ * @type {DATE_TIME}
106
+ * @default
107
+ */
108
+ CompletedAt: string;
109
+ /** Why it was never owed, when it resolves that way — e.g. NO_CURRENT_PROVIDER for an order with no switch to trigger. Without this, "not required" is indistinguishable from "nobody looked".
110
+ *
111
+ * @type {TEXT}
112
+ * @default
113
+ */
114
+ NotRequiredReason: string;
115
+ }
116
+ /**
117
+ * Commitment entity from OrderModule
118
+ *
119
+ * One thing an order still owes, and when it falls due: the type, the deadline, what discharged it, and where it stands (Not Yet Due / Pending / Breached / Discharged / Not Required). An order is finished when it has no open commitments.
120
+ *
121
+ * @module OrderModule
122
+ * @entity Commitment
123
+ * @schemaId 6961f6fc-9d4b-4913-9677-065e0b67a1ce
124
+ * @recordPrefix CMT
125
+ * @capabilities searchable, updateable, undeletable, triggerable
126
+ */
127
+ export declare class Commitment extends OdinRecord<CommitmentProperties> {
128
+ entity: 'OrderModule:Commitment';
129
+ type: CommitmentEntityTypes;
130
+ schemaId: '6961f6fc-9d4b-4913-9677-065e0b67a1ce';
131
+ properties: CommitmentProperties;
132
+ /** Linked Order records (Commitment__Order) */
133
+ Order: OdinLink<LinkedOdinRecord<OrderProperties>>;
134
+ }
135
+ /**
136
+ * RabbitMQ routing keys for Commitment events
137
+ */
138
+ export declare const ROUTING_KEY_COMMITMENT_CREATED = "OrderModule.Commitment.SubDbRecordCreated";
139
+ export declare const ROUTING_KEY_COMMITMENT_UPDATED = "OrderModule.Commitment.SubDbRecordUpdated";
140
+ export declare const ROUTING_KEY_COMMITMENT_DELETED = "OrderModule.Commitment.SubDbRecordDeleted";
141
+ /**
142
+ * Type-specific routing keys for Commitment events
143
+ * Subscribe to these for events on specific entity types only
144
+ */
145
+ /** This is the default record type created */
146
+ export declare const ROUTING_KEY_COMMITMENT_DEFAULT_CREATED = "OrderModule.Commitment.DEFAULT.SubDbRecordCreated";
147
+ /** This is the default record type updated */
148
+ export declare const ROUTING_KEY_COMMITMENT_DEFAULT_UPDATED = "OrderModule.Commitment.DEFAULT.SubDbRecordUpdated";
149
+ /** This is the default record type deleted */
150
+ export declare const ROUTING_KEY_COMMITMENT_DEFAULT_DELETED = "OrderModule.Commitment.DEFAULT.SubDbRecordDeleted";
151
+ /** Event: Commitment__Order link created */
152
+ export declare const ROUTING_KEY_LINK_COMMITMENT_ORDER_CREATED = "OrderModule.Commitment.Order.SubDbRecordAssociationCreated";
153
+ /** Event: Commitment__Order link deleted */
154
+ export declare const ROUTING_KEY_LINK_COMMITMENT_ORDER_DELETED = "OrderModule.Commitment.Order.SubDbRecordAssociationDeleted";
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ /**
3
+ * Commitment Entity Definition
4
+ *
5
+ * One thing an order still owes, and when it falls due: the type, the deadline, what discharged it, and where it stands (Not Yet Due / Pending / Breached / Discharged / Not Required). An order is finished when it has no open commitments.
6
+ *
7
+ * @module OrderModule
8
+ * @entity Commitment
9
+ * @schemaId 6961f6fc-9d4b-4913-9677-065e0b67a1ce
10
+ *
11
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
12
+ * Generated from Odin schema definition
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ROUTING_KEY_LINK_COMMITMENT_ORDER_DELETED = exports.ROUTING_KEY_LINK_COMMITMENT_ORDER_CREATED = exports.ROUTING_KEY_COMMITMENT_DEFAULT_DELETED = exports.ROUTING_KEY_COMMITMENT_DEFAULT_UPDATED = exports.ROUTING_KEY_COMMITMENT_DEFAULT_CREATED = exports.ROUTING_KEY_COMMITMENT_DELETED = exports.ROUTING_KEY_COMMITMENT_UPDATED = exports.ROUTING_KEY_COMMITMENT_CREATED = exports.Commitment = exports.CommitmentPropertyKeys = exports.DefaultCommitmentStageKeys = exports.DefaultCommitmentStageNames = exports.CommitmentEntityTypes = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * Available types for Commitment records
19
+ */
20
+ var CommitmentEntityTypes;
21
+ (function (CommitmentEntityTypes) {
22
+ /** This is the default record type */
23
+ CommitmentEntityTypes["DEFAULT"] = "DEFAULT";
24
+ })(CommitmentEntityTypes = exports.CommitmentEntityTypes || (exports.CommitmentEntityTypes = {}));
25
+ /**
26
+ * Pipeline stage names for DEFAULT Commitment
27
+ * Pipeline: Commitment
28
+ * What an order owes, from not-yet-owed through to settled.
29
+ */
30
+ var DefaultCommitmentStageNames;
31
+ (function (DefaultCommitmentStageNames) {
32
+ /** The precondition has not happened, so there is no clock — not a clock still running. A Supply order before its CommittedDate sits here. (default) */
33
+ DefaultCommitmentStageNames["NotYetDue"] = "Not Yet Due";
34
+ /** Owed, and the clock is running — ExpectedBy is in the future. */
35
+ DefaultCommitmentStageNames["Pending"] = "Pending";
36
+ /** Owed, ExpectedBy has passed, nothing discharged it. Still open work — it ages. Can still be discharged late, which is how lateness gets measured. */
37
+ DefaultCommitmentStageNames["Breached"] = "Breached";
38
+ /** The thing that was owed happened. CompletedBy names the record that did it — a COMPLETED OrderKci, a switch at TRIGGER_CONFIRMED. */
39
+ DefaultCommitmentStageNames["Complete"] = "Complete";
40
+ /** Resolved as never owed, with the reason — an order with no switch to trigger. A distinct terminal state from Discharged: nothing happened, rather than the thing happening. */
41
+ DefaultCommitmentStageNames["NotRequired"] = "Not Required";
42
+ })(DefaultCommitmentStageNames = exports.DefaultCommitmentStageNames || (exports.DefaultCommitmentStageNames = {}));
43
+ /**
44
+ * Pipeline stage keys for DEFAULT Commitment
45
+ * Use these keys when transitioning between stages
46
+ */
47
+ var DefaultCommitmentStageKeys;
48
+ (function (DefaultCommitmentStageKeys) {
49
+ /** The precondition has not happened, so there is no clock — not a clock still running. A Supply order before its CommittedDate sits here. */
50
+ DefaultCommitmentStageKeys["CommitmentStageNotYetDue"] = "CommitmentStageNotYetDue";
51
+ /** Owed, and the clock is running — ExpectedBy is in the future. */
52
+ DefaultCommitmentStageKeys["CommitmentStagePending"] = "CommitmentStagePending";
53
+ /** Owed, ExpectedBy has passed, nothing discharged it. Still open work — it ages. Can still be discharged late, which is how lateness gets measured. */
54
+ DefaultCommitmentStageKeys["CommitmentStageBreached"] = "CommitmentStageBreached";
55
+ /** The thing that was owed happened. CompletedBy names the record that did it — a COMPLETED OrderKci, a switch at TRIGGER_CONFIRMED. */
56
+ DefaultCommitmentStageKeys["CommitmentStageComplete"] = "CommitmentStageComplete";
57
+ /** Resolved as never owed, with the reason — an order with no switch to trigger. A distinct terminal state from Discharged: nothing happened, rather than the thing happening. */
58
+ DefaultCommitmentStageKeys["CommitmentStageNotRequired"] = "CommitmentStageNotRequired";
59
+ })(DefaultCommitmentStageKeys = exports.DefaultCommitmentStageKeys || (exports.DefaultCommitmentStageKeys = {}));
60
+ /**
61
+ * Property keys for Commitment
62
+ * Use these constants instead of string literals for type safety
63
+ */
64
+ var CommitmentPropertyKeys;
65
+ (function (CommitmentPropertyKeys) {
66
+ /** orderId::type — the natural key. UNIQUE, and what upsertOnCreate hashes, so the reconciler cannot create a second commitment for something already owed. */
67
+ CommitmentPropertyKeys["Fingerprint"] = "Fingerprint";
68
+ /** The invariant's stableId, e.g. yf/ORDER/OrderStageSupply/supply-completed-kci-must-arrive-by-committed-date. Generated into COMMITMENT-CATALOG.json from the BP, so this is an address the rest of the estate already uses rather than a new vocabulary. */
69
+ CommitmentPropertyKeys["Type"] = "Type";
70
+ /** When it falls due. Empty only while NOT_YET_DUE — a BREACHED commitment without one would be past a deadline that does not exist, which is a fault in whatever created it. */
71
+ CommitmentPropertyKeys["ExpectedBy"] = "ExpectedBy";
72
+ /** The record that settled it, as entity and id — e.g. OrderModule:OrderKci/<id>. Text rather than a typed association per dischargeable entity, so a new commitment type needs no schema change. */
73
+ CommitmentPropertyKeys["CompletedBy"] = "CompletedBy";
74
+ /** When it was settled. Together with ExpectedBy this says whether it was late. */
75
+ CommitmentPropertyKeys["CompletedAt"] = "CompletedAt";
76
+ /** Why it was never owed, when it resolves that way — e.g. NO_CURRENT_PROVIDER for an order with no switch to trigger. Without this, "not required" is indistinguishable from "nobody looked". */
77
+ CommitmentPropertyKeys["NotRequiredReason"] = "NotRequiredReason";
78
+ })(CommitmentPropertyKeys = exports.CommitmentPropertyKeys || (exports.CommitmentPropertyKeys = {}));
79
+ /**
80
+ * Commitment entity from OrderModule
81
+ *
82
+ * One thing an order still owes, and when it falls due: the type, the deadline, what discharged it, and where it stands (Not Yet Due / Pending / Breached / Discharged / Not Required). An order is finished when it has no open commitments.
83
+ *
84
+ * @module OrderModule
85
+ * @entity Commitment
86
+ * @schemaId 6961f6fc-9d4b-4913-9677-065e0b67a1ce
87
+ * @recordPrefix CMT
88
+ * @capabilities searchable, updateable, undeletable, triggerable
89
+ */
90
+ class Commitment extends core_1.OdinRecord {
91
+ }
92
+ exports.Commitment = Commitment;
93
+ // ============================================
94
+ // RABBITMQ EVENT ROUTING KEYS
95
+ // ============================================
96
+ /**
97
+ * RabbitMQ routing keys for Commitment events
98
+ */
99
+ exports.ROUTING_KEY_COMMITMENT_CREATED = 'OrderModule.Commitment.SubDbRecordCreated';
100
+ exports.ROUTING_KEY_COMMITMENT_UPDATED = 'OrderModule.Commitment.SubDbRecordUpdated';
101
+ exports.ROUTING_KEY_COMMITMENT_DELETED = 'OrderModule.Commitment.SubDbRecordDeleted';
102
+ /**
103
+ * Type-specific routing keys for Commitment events
104
+ * Subscribe to these for events on specific entity types only
105
+ */
106
+ /** This is the default record type created */
107
+ exports.ROUTING_KEY_COMMITMENT_DEFAULT_CREATED = 'OrderModule.Commitment.DEFAULT.SubDbRecordCreated';
108
+ /** This is the default record type updated */
109
+ exports.ROUTING_KEY_COMMITMENT_DEFAULT_UPDATED = 'OrderModule.Commitment.DEFAULT.SubDbRecordUpdated';
110
+ /** This is the default record type deleted */
111
+ exports.ROUTING_KEY_COMMITMENT_DEFAULT_DELETED = 'OrderModule.Commitment.DEFAULT.SubDbRecordDeleted';
112
+ /** Event: Commitment__Order link created */
113
+ exports.ROUTING_KEY_LINK_COMMITMENT_ORDER_CREATED = 'OrderModule.Commitment.Order.SubDbRecordAssociationCreated';
114
+ /** Event: Commitment__Order link deleted */
115
+ exports.ROUTING_KEY_LINK_COMMITMENT_ORDER_DELETED = 'OrderModule.Commitment.Order.SubDbRecordAssociationDeleted';
@@ -19,6 +19,7 @@ import { CaseProperties } from './Case';
19
19
  import { UserProperties } from './User';
20
20
  import { PaymentMethodRefundProperties } from './PaymentMethodRefund';
21
21
  import { ContactProperties } from './Contact';
22
+ import { DocumentProperties } from './Document';
22
23
  /**
23
24
  * Available types for ContractBuyOut records
24
25
  */
@@ -296,6 +297,8 @@ export declare class ContractBuyOut extends OdinRecord<ContractBuyOutProperties>
296
297
  PaymentMethodRefund: OdinLink<LinkedOdinRecord<PaymentMethodRefundProperties>>;
297
298
  /** Linked Contact records (Contact__ContractBuyOut) */
298
299
  Contact: OdinLink<LinkedOdinRecord<ContactProperties>>;
300
+ /** Linked Document records (ContractBuyOut__Document) */
301
+ Document: OdinLink<LinkedOdinRecord<DocumentProperties>>;
299
302
  }
300
303
  /**
301
304
  * RabbitMQ routing keys for ContractBuyOut events
@@ -333,3 +336,7 @@ export declare const ROUTING_KEY_LINK_CONTRACT_BUY_OUT_USER_DELETED = "OrderModu
333
336
  export declare const ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_CREATED = "OrderModule.ContractBuyOut.PaymentMethodRefund.SubDbRecordAssociationCreated";
334
337
  /** Event: ContractBuyOut__PaymentMethodRefund link deleted */
335
338
  export declare const ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_DELETED = "OrderModule.ContractBuyOut.PaymentMethodRefund.SubDbRecordAssociationDeleted";
339
+ /** Event: ContractBuyOut__Document link created */
340
+ export declare const ROUTING_KEY_LINK_CONTRACT_BUY_OUT_DOCUMENT_CREATED = "OrderModule.ContractBuyOut.Document.SubDbRecordAssociationCreated";
341
+ /** Event: ContractBuyOut__Document link deleted */
342
+ export declare const ROUTING_KEY_LINK_CONTRACT_BUY_OUT_DOCUMENT_DELETED = "OrderModule.ContractBuyOut.Document.SubDbRecordAssociationDeleted";
@@ -12,7 +12,7 @@
12
12
  * Generated from Odin schema definition
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_USER_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_USER_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_FILE_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_FILE_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_NOTE_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_NOTE_CREATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DEFAULT_DELETED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DEFAULT_UPDATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DEFAULT_CREATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DELETED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_UPDATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_CREATED = exports.ContractBuyOut = exports.ContractBuyOutPropertyKeys = exports.ContractBuyOutUploadedFrom = exports.ContractBuyOutPreviousProvider = exports.DefaultContractBuyOutStageKeys = exports.DefaultContractBuyOutStageNames = exports.ContractBuyOutEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_DOCUMENT_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_DOCUMENT_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_USER_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_USER_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_FILE_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_FILE_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_CREATED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_NOTE_DELETED = exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_NOTE_CREATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DEFAULT_DELETED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DEFAULT_UPDATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DEFAULT_CREATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_DELETED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_UPDATED = exports.ROUTING_KEY_CONTRACT_BUY_OUT_CREATED = exports.ContractBuyOut = exports.ContractBuyOutPropertyKeys = exports.ContractBuyOutUploadedFrom = exports.ContractBuyOutPreviousProvider = exports.DefaultContractBuyOutStageKeys = exports.DefaultContractBuyOutStageNames = exports.ContractBuyOutEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for ContractBuyOut records
@@ -223,3 +223,7 @@ exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_USER_DELETED = 'OrderModule.ContractBu
223
223
  exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_CREATED = 'OrderModule.ContractBuyOut.PaymentMethodRefund.SubDbRecordAssociationCreated';
224
224
  /** Event: ContractBuyOut__PaymentMethodRefund link deleted */
225
225
  exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_PAYMENT_METHOD_REFUND_DELETED = 'OrderModule.ContractBuyOut.PaymentMethodRefund.SubDbRecordAssociationDeleted';
226
+ /** Event: ContractBuyOut__Document link created */
227
+ exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_DOCUMENT_CREATED = 'OrderModule.ContractBuyOut.Document.SubDbRecordAssociationCreated';
228
+ /** Event: ContractBuyOut__Document link deleted */
229
+ exports.ROUTING_KEY_LINK_CONTRACT_BUY_OUT_DOCUMENT_DELETED = 'OrderModule.ContractBuyOut.Document.SubDbRecordAssociationDeleted';