@d19n/youfibre-odin-sdk 2.0.345 → 2.0.347

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 (32) hide show
  1. package/README.md +3 -1
  2. package/dist/api-sdk-v2/AccountApi.d.ts +4 -0
  3. package/dist/api-sdk-v2/AccountApi.js +12 -0
  4. package/dist/api-sdk-v2/CaseApi.d.ts +2 -0
  5. package/dist/api-sdk-v2/CaseApi.js +6 -0
  6. package/dist/api-sdk-v2/ContactApi.d.ts +2 -0
  7. package/dist/api-sdk-v2/ContactApi.js +6 -0
  8. package/dist/api-sdk-v2/FrustrationEventApi.d.ts +50 -0
  9. package/dist/api-sdk-v2/FrustrationEventApi.js +161 -0
  10. package/dist/api-sdk-v2/FrustrationScoreApi.d.ts +54 -0
  11. package/dist/api-sdk-v2/FrustrationScoreApi.js +173 -0
  12. package/dist/db-sdk-v2/AccountDb.d.ts +4 -0
  13. package/dist/db-sdk-v2/AccountDb.js +12 -0
  14. package/dist/db-sdk-v2/CaseDb.d.ts +2 -0
  15. package/dist/db-sdk-v2/CaseDb.js +6 -0
  16. package/dist/db-sdk-v2/ContactDb.d.ts +2 -0
  17. package/dist/db-sdk-v2/ContactDb.js +6 -0
  18. package/dist/db-sdk-v2/FrustrationEventDb.d.ts +122 -0
  19. package/dist/db-sdk-v2/FrustrationEventDb.js +210 -0
  20. package/dist/db-sdk-v2/FrustrationScoreDb.d.ts +126 -0
  21. package/dist/db-sdk-v2/FrustrationScoreDb.js +222 -0
  22. package/dist/entities-v2/Account.d.ts +6 -0
  23. package/dist/entities-v2/Case.d.ts +87 -4
  24. package/dist/entities-v2/Case.js +47 -5
  25. package/dist/entities-v2/Contact.d.ts +3 -0
  26. package/dist/entities-v2/Conversation.d.ts +6 -0
  27. package/dist/entities-v2/Conversation.js +6 -0
  28. package/dist/entities-v2/FrustrationEvent.d.ts +222 -0
  29. package/dist/entities-v2/FrustrationEvent.js +160 -0
  30. package/dist/entities-v2/FrustrationScore.d.ts +171 -0
  31. package/dist/entities-v2/FrustrationScore.js +123 -0
  32. package/package.json +1 -1
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ /**
3
+ * FrustrationEvent Entity Definition
4
+ *
5
+ * One row per Odin change that scored an Account: event type, when, weight and weight version, plus a pointer at the source record. Append-only; the timeline and audit trail behind a FrustrationScore. No free text, no personal data.
6
+ *
7
+ * @module SupportModule
8
+ * @entity FrustrationEvent
9
+ * @schemaId 1ee547d3-e74a-4b6b-9a11-a087cc2d1ce9
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_FRUSTRATION_EVENT_FRUSTRATION_SCORE_DELETED = exports.ROUTING_KEY_LINK_FRUSTRATION_EVENT_FRUSTRATION_SCORE_CREATED = exports.ROUTING_KEY_LINK_FRUSTRATION_EVENT_ACCOUNT_DELETED = exports.ROUTING_KEY_LINK_FRUSTRATION_EVENT_ACCOUNT_CREATED = exports.ROUTING_KEY_FRUSTRATION_EVENT_DEFAULT_DELETED = exports.ROUTING_KEY_FRUSTRATION_EVENT_DEFAULT_UPDATED = exports.ROUTING_KEY_FRUSTRATION_EVENT_DEFAULT_CREATED = exports.ROUTING_KEY_FRUSTRATION_EVENT_DELETED = exports.ROUTING_KEY_FRUSTRATION_EVENT_UPDATED = exports.ROUTING_KEY_FRUSTRATION_EVENT_CREATED = exports.FrustrationEvent = exports.FrustrationEventPropertyKeys = exports.FrustrationEventOrigin = exports.FrustrationEventEventType = exports.FrustrationEventEntityTypes = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * Available types for FrustrationEvent records
19
+ */
20
+ var FrustrationEventEntityTypes;
21
+ (function (FrustrationEventEntityTypes) {
22
+ /** This is the default record type */
23
+ FrustrationEventEntityTypes["DEFAULT"] = "DEFAULT";
24
+ })(FrustrationEventEntityTypes = exports.FrustrationEventEntityTypes || (exports.FrustrationEventEntityTypes = {}));
25
+ /**
26
+ * Valid values for FrustrationEvent.EventType
27
+ *
28
+ * Which catalogue event this is, E01-E30 (business-processes/frustration-score/04-odin-event-mapping.md).
29
+ *
30
+ * @remarks Available options:
31
+ * - `E01` - E01 Customer opened live chat
32
+ * - `E02` - E02 Second chat within 48h
33
+ * - `E03` - E03 Complaint created
34
+ * - `E04` - E04 Complaint escalated
35
+ * - `E05` - E05 Engineer visit booked
36
+ * - `E06` - E06 Engineer visit cancelled
37
+ * - `E07` - E07 Engineer visit missed
38
+ * - `E08` - E08 Engineer arrived late
39
+ * - `E09` - E09 Engineer revisit required
40
+ * - `E10` - E10 Network outage started
41
+ * - `E11` - E11 Network outage resolved
42
+ * - `E12` - E12 Router offline over 24h
43
+ * - `E13` - E13 ONT offline
44
+ * - `E14` - E14 Payment failed
45
+ * - `E15` - E15 Payment overdue
46
+ * - ... and 15 more
47
+ */
48
+ var FrustrationEventEventType;
49
+ (function (FrustrationEventEventType) {
50
+ FrustrationEventEventType["E01_CUSTOMER_OPENED_LIVE_CHAT"] = "E01";
51
+ FrustrationEventEventType["E02_SECOND_CHAT_WITHIN_48H"] = "E02";
52
+ FrustrationEventEventType["E03_COMPLAINT_CREATED"] = "E03";
53
+ FrustrationEventEventType["E04_COMPLAINT_ESCALATED"] = "E04";
54
+ FrustrationEventEventType["E05_ENGINEER_VISIT_BOOKED"] = "E05";
55
+ FrustrationEventEventType["E06_ENGINEER_VISIT_CANCELLED"] = "E06";
56
+ FrustrationEventEventType["E07_ENGINEER_VISIT_MISSED"] = "E07";
57
+ FrustrationEventEventType["E08_ENGINEER_ARRIVED_LATE"] = "E08";
58
+ FrustrationEventEventType["E09_ENGINEER_REVISIT_REQUIRED"] = "E09";
59
+ FrustrationEventEventType["E10_NETWORK_OUTAGE_STARTED"] = "E10";
60
+ FrustrationEventEventType["E11_NETWORK_OUTAGE_RESOLVED"] = "E11";
61
+ FrustrationEventEventType["E12_ROUTER_OFFLINE_OVER_24H"] = "E12";
62
+ FrustrationEventEventType["E13_ONT_OFFLINE"] = "E13";
63
+ FrustrationEventEventType["E14_PAYMENT_FAILED"] = "E14";
64
+ FrustrationEventEventType["E15_PAYMENT_OVERDUE"] = "E15";
65
+ FrustrationEventEventType["E16_DIRECT_DEBIT_FAILED"] = "E16";
66
+ FrustrationEventEventType["E17_SPEED_TEST_BELOW_EXPECTED"] = "E17";
67
+ FrustrationEventEventType["E18_PACKAGE_DOWNGRADED"] = "E18";
68
+ FrustrationEventEventType["E19_PACKAGE_UPGRADED"] = "E19";
69
+ FrustrationEventEventType["E20_NEGATIVE_CSAT_SURVEY"] = "E20";
70
+ FrustrationEventEventType["E21_POSITIVE_CSAT_SURVEY"] = "E21";
71
+ FrustrationEventEventType["E22_TRUSTPILOT_REVIEW"] = "E22";
72
+ FrustrationEventEventType["E23_BILLING_ADJUSTMENT"] = "E23";
73
+ FrustrationEventEventType["E24_REFUND_ISSUED"] = "E24";
74
+ FrustrationEventEventType["E25_REFERRAL_COMPLETED"] = "E25";
75
+ FrustrationEventEventType["E26_COMPLAINT_RESOLVED"] = "E26";
76
+ FrustrationEventEventType["E27_SUPPORT_TICKET_CLOSED"] = "E27";
77
+ FrustrationEventEventType["E28_CUSTOMER_INACTIVE"] = "E28";
78
+ FrustrationEventEventType["E29_CUSTOMER_USING_APP_REGULARLY"] = "E29";
79
+ FrustrationEventEventType["E30_NO_ISSUES_FOR_30_DAYS"] = "E30";
80
+ })(FrustrationEventEventType = exports.FrustrationEventEventType || (exports.FrustrationEventEventType = {}));
81
+ /**
82
+ * Valid values for FrustrationEvent.Origin
83
+ *
84
+ * SYSTEM when an RMQ consumer mapped an Odin change; MANUAL when a Team Leader recorded it (AddFrustrationEvent).
85
+ *
86
+ * @remarks Available options:
87
+ * - `MANUAL` - Manual
88
+ * - `SYSTEM` - System
89
+ */
90
+ var FrustrationEventOrigin;
91
+ (function (FrustrationEventOrigin) {
92
+ FrustrationEventOrigin["MANUAL"] = "MANUAL";
93
+ FrustrationEventOrigin["SYSTEM"] = "SYSTEM";
94
+ })(FrustrationEventOrigin = exports.FrustrationEventOrigin || (exports.FrustrationEventOrigin = {}));
95
+ /**
96
+ * Property keys for FrustrationEvent
97
+ * Use these constants instead of string literals for type safety
98
+ */
99
+ var FrustrationEventPropertyKeys;
100
+ (function (FrustrationEventPropertyKeys) {
101
+ /** Which catalogue event this is, E01-E30 (business-processes/frustration-score/04-odin-event-mapping.md). */
102
+ FrustrationEventPropertyKeys["EventType"] = "EventType";
103
+ /** When the source change happened, from the source record, not when the event was ingested. Decay is measured from here; older than 60 days contributes nothing. */
104
+ FrustrationEventPropertyKeys["OccurredAt"] = "OccurredAt";
105
+ /** The points applied when this event was scored, before decay. Negative for positive events. Kept on the row so a later weight change does not rewrite history. */
106
+ FrustrationEventPropertyKeys["Weight"] = "Weight";
107
+ /** The Config version the Weight came from. */
108
+ FrustrationEventPropertyKeys["WeightVersion"] = "WeightVersion";
109
+ /** The source record type as Module:Entity, e.g. SupportModule:Case. Text so a new source needs no schema change. */
110
+ FrustrationEventPropertyKeys["SourceEntity"] = "SourceEntity";
111
+ /** The source record uuid. */
112
+ FrustrationEventPropertyKeys["SourceRecordId"] = "SourceRecordId";
113
+ /** The source record number an agent can open, e.g. CS123456 or WO98765. */
114
+ FrustrationEventPropertyKeys["SourceRecordNumber"] = "SourceRecordNumber";
115
+ /** Source record id + the transition or field that changed. UNIQUE, so the same Odin change redelivered by RabbitMQ or replayed by a backfill cannot score twice. */
116
+ FrustrationEventPropertyKeys["IdempotencyKey"] = "IdempotencyKey";
117
+ /** SYSTEM when an RMQ consumer mapped an Odin change; MANUAL when a Team Leader recorded it (AddFrustrationEvent). */
118
+ FrustrationEventPropertyKeys["Origin"] = "Origin";
119
+ })(FrustrationEventPropertyKeys = exports.FrustrationEventPropertyKeys || (exports.FrustrationEventPropertyKeys = {}));
120
+ /**
121
+ * FrustrationEvent entity from SupportModule
122
+ *
123
+ * One row per Odin change that scored an Account: event type, when, weight and weight version, plus a pointer at the source record. Append-only; the timeline and audit trail behind a FrustrationScore. No free text, no personal data.
124
+ *
125
+ * @module SupportModule
126
+ * @entity FrustrationEvent
127
+ * @schemaId 1ee547d3-e74a-4b6b-9a11-a087cc2d1ce9
128
+ * @recordPrefix CFE
129
+ * @capabilities searchable, updateable, undeletable, triggerable
130
+ */
131
+ class FrustrationEvent extends core_1.OdinRecord {
132
+ }
133
+ exports.FrustrationEvent = FrustrationEvent;
134
+ // ============================================
135
+ // RABBITMQ EVENT ROUTING KEYS
136
+ // ============================================
137
+ /**
138
+ * RabbitMQ routing keys for FrustrationEvent events
139
+ */
140
+ exports.ROUTING_KEY_FRUSTRATION_EVENT_CREATED = 'SupportModule.FrustrationEvent.SubDbRecordCreated';
141
+ exports.ROUTING_KEY_FRUSTRATION_EVENT_UPDATED = 'SupportModule.FrustrationEvent.SubDbRecordUpdated';
142
+ exports.ROUTING_KEY_FRUSTRATION_EVENT_DELETED = 'SupportModule.FrustrationEvent.SubDbRecordDeleted';
143
+ /**
144
+ * Type-specific routing keys for FrustrationEvent events
145
+ * Subscribe to these for events on specific entity types only
146
+ */
147
+ /** This is the default record type created */
148
+ exports.ROUTING_KEY_FRUSTRATION_EVENT_DEFAULT_CREATED = 'SupportModule.FrustrationEvent.DEFAULT.SubDbRecordCreated';
149
+ /** This is the default record type updated */
150
+ exports.ROUTING_KEY_FRUSTRATION_EVENT_DEFAULT_UPDATED = 'SupportModule.FrustrationEvent.DEFAULT.SubDbRecordUpdated';
151
+ /** This is the default record type deleted */
152
+ exports.ROUTING_KEY_FRUSTRATION_EVENT_DEFAULT_DELETED = 'SupportModule.FrustrationEvent.DEFAULT.SubDbRecordDeleted';
153
+ /** Event: FrustrationEvent__Account link created */
154
+ exports.ROUTING_KEY_LINK_FRUSTRATION_EVENT_ACCOUNT_CREATED = 'SupportModule.FrustrationEvent.Account.SubDbRecordAssociationCreated';
155
+ /** Event: FrustrationEvent__Account link deleted */
156
+ exports.ROUTING_KEY_LINK_FRUSTRATION_EVENT_ACCOUNT_DELETED = 'SupportModule.FrustrationEvent.Account.SubDbRecordAssociationDeleted';
157
+ /** Event: FrustrationEvent__FrustrationScore link created */
158
+ exports.ROUTING_KEY_LINK_FRUSTRATION_EVENT_FRUSTRATION_SCORE_CREATED = 'SupportModule.FrustrationEvent.FrustrationScore.SubDbRecordAssociationCreated';
159
+ /** Event: FrustrationEvent__FrustrationScore link deleted */
160
+ exports.ROUTING_KEY_LINK_FRUSTRATION_EVENT_FRUSTRATION_SCORE_DELETED = 'SupportModule.FrustrationEvent.FrustrationScore.SubDbRecordAssociationDeleted';
@@ -0,0 +1,171 @@
1
+ /**
2
+ * FrustrationScore Entity Definition
3
+ *
4
+ * One frustration score (0-100) per Account, recalculated from FrustrationEvents. The pipeline stage is the risk band (Green to Critical). Create upserts on AccountId. Holds Odin identifiers and numbers only, never personal data.
5
+ *
6
+ * @module SupportModule
7
+ * @entity FrustrationScore
8
+ * @schemaId 26ffc771-d268-48c8-b6eb-1231c418ad4f
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 { AccountProperties } from './Account';
15
+ import { ContactProperties } from './Contact';
16
+ import { CaseProperties } from './Case';
17
+ import { FrustrationEventProperties } from './FrustrationEvent';
18
+ /**
19
+ * Available types for FrustrationScore records
20
+ */
21
+ export declare enum FrustrationScoreEntityTypes {
22
+ /** This is the default record type */
23
+ DEFAULT = "DEFAULT"
24
+ }
25
+ /**
26
+ * Pipeline stage names for DEFAULT FrustrationScore
27
+ * Pipeline: FrustrationScore
28
+ * The risk band the score maps to, Green through Critical. Entering Red or Critical raises outreach.
29
+ */
30
+ export declare enum DefaultFrustrationScoreStageNames {
31
+ /** Score 0-25. The resting state; a new record starts here at 0. No action. (default) */
32
+ Green = "Green",
33
+ /** Score 26-50. Something has gone wrong recently. Dashboard and Case column only; no Case. */
34
+ Yellow = "Yellow",
35
+ /** Score 51-75. Repeated or serious problems. Team Leader visibility; delivery is an open decision. */
36
+ Orange = "Orange",
37
+ /** Score 76-90. Likely to complain, review badly or leave. Entry raises a proactive-outreach Case, Sla HIGH. */
38
+ Red = "Red",
39
+ /** Score 91-100. Immediate proactive contact. Same outreach Case as Red with Sla URGENT. */
40
+ Critical = "Critical"
41
+ }
42
+ /**
43
+ * Pipeline stage keys for DEFAULT FrustrationScore
44
+ * Use these keys when transitioning between stages
45
+ */
46
+ export declare enum DefaultFrustrationScoreStageKeys {
47
+ /** Score 0-25. The resting state; a new record starts here at 0. No action. */
48
+ FrustrationScoreStageGreen = "FrustrationScoreStageGreen",
49
+ /** Score 26-50. Something has gone wrong recently. Dashboard and Case column only; no Case. */
50
+ FrustrationScoreStageYellow = "FrustrationScoreStageYellow",
51
+ /** Score 51-75. Repeated or serious problems. Team Leader visibility; delivery is an open decision. */
52
+ FrustrationScoreStageOrange = "FrustrationScoreStageOrange",
53
+ /** Score 76-90. Likely to complain, review badly or leave. Entry raises a proactive-outreach Case, Sla HIGH. */
54
+ FrustrationScoreStageRed = "FrustrationScoreStageRed",
55
+ /** Score 91-100. Immediate proactive contact. Same outreach Case as Red with Sla URGENT. */
56
+ FrustrationScoreStageCritical = "FrustrationScoreStageCritical"
57
+ }
58
+ /**
59
+ * Property keys for FrustrationScore
60
+ * Use these constants instead of string literals for type safety
61
+ */
62
+ export declare enum FrustrationScorePropertyKeys {
63
+ /** The Account this score belongs to. UNIQUE, and what upsertOnCreate hashes, so a second create for the same Account updates the existing record instead of adding one. */
64
+ AccountId = "AccountId",
65
+ /** 0-100, the sum of decayed event contributions floored at 0 and clamped to 100. Kept to two decimals; the band is decided on the half-up rounded value with 3 points of hysteresis. */
66
+ Score = "Score",
67
+ /** The CustomerFrustrationScore Config version the last recalculation used. Weights are tuned in the first months; without this a score from last month cannot be explained against this month's weights. */
68
+ WeightVersion = "WeightVersion",
69
+ /** JSON: { weightVersion, lines: [{ eventType, sourceRecordNumber, occurredAt, weight, decay, contribution }] }. The explanation an agent reads out; contributions sum to Score. Record numbers only, never free text. Size-capped by the platform, see the spec header. */
70
+ Breakdown = "Breakdown",
71
+ /** OccurredAt of the newest FrustrationEvent that contributed. Empty while no event has scored. */
72
+ LastEventAt = "LastEventAt",
73
+ /** When Score and Breakdown were last written, by an event or by the nightly decay run. */
74
+ CalculatedAt = "CalculatedAt"
75
+ }
76
+ /**
77
+ * Properties for FrustrationScore records
78
+ *
79
+ * @see SupportModule:FrustrationScore
80
+ */
81
+ export interface FrustrationScoreProperties {
82
+ /** The Account this score belongs to. UNIQUE, and what upsertOnCreate hashes, so a second create for the same Account updates the existing record instead of adding one.
83
+ *
84
+ * @type {LOOKUP}
85
+ * @default
86
+ */
87
+ AccountId: string;
88
+ /** 0-100, the sum of decayed event contributions floored at 0 and clamped to 100. Kept to two decimals; the band is decided on the half-up rounded value with 3 points of hysteresis.
89
+ *
90
+ * @type {NUMBER}
91
+ * @default
92
+ */
93
+ Score: number;
94
+ /** The CustomerFrustrationScore Config version the last recalculation used. Weights are tuned in the first months; without this a score from last month cannot be explained against this month's weights.
95
+ *
96
+ * @type {TEXT}
97
+ * @default
98
+ */
99
+ WeightVersion: string;
100
+ /** JSON: { weightVersion, lines: [{ eventType, sourceRecordNumber, occurredAt, weight, decay, contribution }] }. The explanation an agent reads out; contributions sum to Score. Record numbers only, never free text. Size-capped by the platform, see the spec header.
101
+ *
102
+ * @type {TEXT_LONG}
103
+ * @default
104
+ */
105
+ Breakdown: string;
106
+ /** OccurredAt of the newest FrustrationEvent that contributed. Empty while no event has scored.
107
+ *
108
+ * @type {DATE_TIME}
109
+ * @default
110
+ */
111
+ LastEventAt: string;
112
+ /** When Score and Breakdown were last written, by an event or by the nightly decay run.
113
+ *
114
+ * @type {DATE_TIME}
115
+ * @default
116
+ */
117
+ CalculatedAt: string;
118
+ }
119
+ /**
120
+ * FrustrationScore entity from SupportModule
121
+ *
122
+ * One frustration score (0-100) per Account, recalculated from FrustrationEvents. The pipeline stage is the risk band (Green to Critical). Create upserts on AccountId. Holds Odin identifiers and numbers only, never personal data.
123
+ *
124
+ * @module SupportModule
125
+ * @entity FrustrationScore
126
+ * @schemaId 26ffc771-d268-48c8-b6eb-1231c418ad4f
127
+ * @recordPrefix CFS
128
+ * @capabilities searchable, updateable, undeletable, triggerable
129
+ */
130
+ export declare class FrustrationScore extends OdinRecord<FrustrationScoreProperties> {
131
+ entity: 'SupportModule:FrustrationScore';
132
+ type: FrustrationScoreEntityTypes;
133
+ schemaId: '26ffc771-d268-48c8-b6eb-1231c418ad4f';
134
+ properties: FrustrationScoreProperties;
135
+ /** Linked Account records (FrustrationScore__Account) */
136
+ Account: OdinLink<LinkedOdinRecord<AccountProperties>>;
137
+ /** Linked Contact records (FrustrationScore__Contact) */
138
+ Contact: OdinLink<LinkedOdinRecord<ContactProperties>>;
139
+ /** Linked Case records (FrustrationScore__Case) */
140
+ Case: OdinLink<LinkedOdinRecord<CaseProperties>>;
141
+ /** Linked FrustrationEvent records (FrustrationEvent__FrustrationScore) */
142
+ FrustrationEvent: OdinLink<LinkedOdinRecord<FrustrationEventProperties>>;
143
+ }
144
+ /**
145
+ * RabbitMQ routing keys for FrustrationScore events
146
+ */
147
+ export declare const ROUTING_KEY_FRUSTRATION_SCORE_CREATED = "SupportModule.FrustrationScore.SubDbRecordCreated";
148
+ export declare const ROUTING_KEY_FRUSTRATION_SCORE_UPDATED = "SupportModule.FrustrationScore.SubDbRecordUpdated";
149
+ export declare const ROUTING_KEY_FRUSTRATION_SCORE_DELETED = "SupportModule.FrustrationScore.SubDbRecordDeleted";
150
+ /**
151
+ * Type-specific routing keys for FrustrationScore events
152
+ * Subscribe to these for events on specific entity types only
153
+ */
154
+ /** This is the default record type created */
155
+ export declare const ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_CREATED = "SupportModule.FrustrationScore.DEFAULT.SubDbRecordCreated";
156
+ /** This is the default record type updated */
157
+ export declare const ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_UPDATED = "SupportModule.FrustrationScore.DEFAULT.SubDbRecordUpdated";
158
+ /** This is the default record type deleted */
159
+ export declare const ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_DELETED = "SupportModule.FrustrationScore.DEFAULT.SubDbRecordDeleted";
160
+ /** Event: FrustrationScore__Account link created */
161
+ export declare const ROUTING_KEY_LINK_FRUSTRATION_SCORE_ACCOUNT_CREATED = "SupportModule.FrustrationScore.Account.SubDbRecordAssociationCreated";
162
+ /** Event: FrustrationScore__Account link deleted */
163
+ export declare const ROUTING_KEY_LINK_FRUSTRATION_SCORE_ACCOUNT_DELETED = "SupportModule.FrustrationScore.Account.SubDbRecordAssociationDeleted";
164
+ /** Event: FrustrationScore__Contact link created */
165
+ export declare const ROUTING_KEY_LINK_FRUSTRATION_SCORE_CONTACT_CREATED = "SupportModule.FrustrationScore.Contact.SubDbRecordAssociationCreated";
166
+ /** Event: FrustrationScore__Contact link deleted */
167
+ export declare const ROUTING_KEY_LINK_FRUSTRATION_SCORE_CONTACT_DELETED = "SupportModule.FrustrationScore.Contact.SubDbRecordAssociationDeleted";
168
+ /** Event: FrustrationScore__Case link created */
169
+ export declare const ROUTING_KEY_LINK_FRUSTRATION_SCORE_CASE_CREATED = "SupportModule.FrustrationScore.Case.SubDbRecordAssociationCreated";
170
+ /** Event: FrustrationScore__Case link deleted */
171
+ export declare const ROUTING_KEY_LINK_FRUSTRATION_SCORE_CASE_DELETED = "SupportModule.FrustrationScore.Case.SubDbRecordAssociationDeleted";
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ /**
3
+ * FrustrationScore Entity Definition
4
+ *
5
+ * One frustration score (0-100) per Account, recalculated from FrustrationEvents. The pipeline stage is the risk band (Green to Critical). Create upserts on AccountId. Holds Odin identifiers and numbers only, never personal data.
6
+ *
7
+ * @module SupportModule
8
+ * @entity FrustrationScore
9
+ * @schemaId 26ffc771-d268-48c8-b6eb-1231c418ad4f
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_FRUSTRATION_SCORE_CASE_DELETED = exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_CASE_CREATED = exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_CONTACT_DELETED = exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_CONTACT_CREATED = exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_ACCOUNT_DELETED = exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_ACCOUNT_CREATED = exports.ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_DELETED = exports.ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_UPDATED = exports.ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_CREATED = exports.ROUTING_KEY_FRUSTRATION_SCORE_DELETED = exports.ROUTING_KEY_FRUSTRATION_SCORE_UPDATED = exports.ROUTING_KEY_FRUSTRATION_SCORE_CREATED = exports.FrustrationScore = exports.FrustrationScorePropertyKeys = exports.DefaultFrustrationScoreStageKeys = exports.DefaultFrustrationScoreStageNames = exports.FrustrationScoreEntityTypes = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * Available types for FrustrationScore records
19
+ */
20
+ var FrustrationScoreEntityTypes;
21
+ (function (FrustrationScoreEntityTypes) {
22
+ /** This is the default record type */
23
+ FrustrationScoreEntityTypes["DEFAULT"] = "DEFAULT";
24
+ })(FrustrationScoreEntityTypes = exports.FrustrationScoreEntityTypes || (exports.FrustrationScoreEntityTypes = {}));
25
+ /**
26
+ * Pipeline stage names for DEFAULT FrustrationScore
27
+ * Pipeline: FrustrationScore
28
+ * The risk band the score maps to, Green through Critical. Entering Red or Critical raises outreach.
29
+ */
30
+ var DefaultFrustrationScoreStageNames;
31
+ (function (DefaultFrustrationScoreStageNames) {
32
+ /** Score 0-25. The resting state; a new record starts here at 0. No action. (default) */
33
+ DefaultFrustrationScoreStageNames["Green"] = "Green";
34
+ /** Score 26-50. Something has gone wrong recently. Dashboard and Case column only; no Case. */
35
+ DefaultFrustrationScoreStageNames["Yellow"] = "Yellow";
36
+ /** Score 51-75. Repeated or serious problems. Team Leader visibility; delivery is an open decision. */
37
+ DefaultFrustrationScoreStageNames["Orange"] = "Orange";
38
+ /** Score 76-90. Likely to complain, review badly or leave. Entry raises a proactive-outreach Case, Sla HIGH. */
39
+ DefaultFrustrationScoreStageNames["Red"] = "Red";
40
+ /** Score 91-100. Immediate proactive contact. Same outreach Case as Red with Sla URGENT. */
41
+ DefaultFrustrationScoreStageNames["Critical"] = "Critical";
42
+ })(DefaultFrustrationScoreStageNames = exports.DefaultFrustrationScoreStageNames || (exports.DefaultFrustrationScoreStageNames = {}));
43
+ /**
44
+ * Pipeline stage keys for DEFAULT FrustrationScore
45
+ * Use these keys when transitioning between stages
46
+ */
47
+ var DefaultFrustrationScoreStageKeys;
48
+ (function (DefaultFrustrationScoreStageKeys) {
49
+ /** Score 0-25. The resting state; a new record starts here at 0. No action. */
50
+ DefaultFrustrationScoreStageKeys["FrustrationScoreStageGreen"] = "FrustrationScoreStageGreen";
51
+ /** Score 26-50. Something has gone wrong recently. Dashboard and Case column only; no Case. */
52
+ DefaultFrustrationScoreStageKeys["FrustrationScoreStageYellow"] = "FrustrationScoreStageYellow";
53
+ /** Score 51-75. Repeated or serious problems. Team Leader visibility; delivery is an open decision. */
54
+ DefaultFrustrationScoreStageKeys["FrustrationScoreStageOrange"] = "FrustrationScoreStageOrange";
55
+ /** Score 76-90. Likely to complain, review badly or leave. Entry raises a proactive-outreach Case, Sla HIGH. */
56
+ DefaultFrustrationScoreStageKeys["FrustrationScoreStageRed"] = "FrustrationScoreStageRed";
57
+ /** Score 91-100. Immediate proactive contact. Same outreach Case as Red with Sla URGENT. */
58
+ DefaultFrustrationScoreStageKeys["FrustrationScoreStageCritical"] = "FrustrationScoreStageCritical";
59
+ })(DefaultFrustrationScoreStageKeys = exports.DefaultFrustrationScoreStageKeys || (exports.DefaultFrustrationScoreStageKeys = {}));
60
+ /**
61
+ * Property keys for FrustrationScore
62
+ * Use these constants instead of string literals for type safety
63
+ */
64
+ var FrustrationScorePropertyKeys;
65
+ (function (FrustrationScorePropertyKeys) {
66
+ /** The Account this score belongs to. UNIQUE, and what upsertOnCreate hashes, so a second create for the same Account updates the existing record instead of adding one. */
67
+ FrustrationScorePropertyKeys["AccountId"] = "AccountId";
68
+ /** 0-100, the sum of decayed event contributions floored at 0 and clamped to 100. Kept to two decimals; the band is decided on the half-up rounded value with 3 points of hysteresis. */
69
+ FrustrationScorePropertyKeys["Score"] = "Score";
70
+ /** The CustomerFrustrationScore Config version the last recalculation used. Weights are tuned in the first months; without this a score from last month cannot be explained against this month's weights. */
71
+ FrustrationScorePropertyKeys["WeightVersion"] = "WeightVersion";
72
+ /** JSON: { weightVersion, lines: [{ eventType, sourceRecordNumber, occurredAt, weight, decay, contribution }] }. The explanation an agent reads out; contributions sum to Score. Record numbers only, never free text. Size-capped by the platform, see the spec header. */
73
+ FrustrationScorePropertyKeys["Breakdown"] = "Breakdown";
74
+ /** OccurredAt of the newest FrustrationEvent that contributed. Empty while no event has scored. */
75
+ FrustrationScorePropertyKeys["LastEventAt"] = "LastEventAt";
76
+ /** When Score and Breakdown were last written, by an event or by the nightly decay run. */
77
+ FrustrationScorePropertyKeys["CalculatedAt"] = "CalculatedAt";
78
+ })(FrustrationScorePropertyKeys = exports.FrustrationScorePropertyKeys || (exports.FrustrationScorePropertyKeys = {}));
79
+ /**
80
+ * FrustrationScore entity from SupportModule
81
+ *
82
+ * One frustration score (0-100) per Account, recalculated from FrustrationEvents. The pipeline stage is the risk band (Green to Critical). Create upserts on AccountId. Holds Odin identifiers and numbers only, never personal data.
83
+ *
84
+ * @module SupportModule
85
+ * @entity FrustrationScore
86
+ * @schemaId 26ffc771-d268-48c8-b6eb-1231c418ad4f
87
+ * @recordPrefix CFS
88
+ * @capabilities searchable, updateable, undeletable, triggerable
89
+ */
90
+ class FrustrationScore extends core_1.OdinRecord {
91
+ }
92
+ exports.FrustrationScore = FrustrationScore;
93
+ // ============================================
94
+ // RABBITMQ EVENT ROUTING KEYS
95
+ // ============================================
96
+ /**
97
+ * RabbitMQ routing keys for FrustrationScore events
98
+ */
99
+ exports.ROUTING_KEY_FRUSTRATION_SCORE_CREATED = 'SupportModule.FrustrationScore.SubDbRecordCreated';
100
+ exports.ROUTING_KEY_FRUSTRATION_SCORE_UPDATED = 'SupportModule.FrustrationScore.SubDbRecordUpdated';
101
+ exports.ROUTING_KEY_FRUSTRATION_SCORE_DELETED = 'SupportModule.FrustrationScore.SubDbRecordDeleted';
102
+ /**
103
+ * Type-specific routing keys for FrustrationScore 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_FRUSTRATION_SCORE_DEFAULT_CREATED = 'SupportModule.FrustrationScore.DEFAULT.SubDbRecordCreated';
108
+ /** This is the default record type updated */
109
+ exports.ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_UPDATED = 'SupportModule.FrustrationScore.DEFAULT.SubDbRecordUpdated';
110
+ /** This is the default record type deleted */
111
+ exports.ROUTING_KEY_FRUSTRATION_SCORE_DEFAULT_DELETED = 'SupportModule.FrustrationScore.DEFAULT.SubDbRecordDeleted';
112
+ /** Event: FrustrationScore__Account link created */
113
+ exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_ACCOUNT_CREATED = 'SupportModule.FrustrationScore.Account.SubDbRecordAssociationCreated';
114
+ /** Event: FrustrationScore__Account link deleted */
115
+ exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_ACCOUNT_DELETED = 'SupportModule.FrustrationScore.Account.SubDbRecordAssociationDeleted';
116
+ /** Event: FrustrationScore__Contact link created */
117
+ exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_CONTACT_CREATED = 'SupportModule.FrustrationScore.Contact.SubDbRecordAssociationCreated';
118
+ /** Event: FrustrationScore__Contact link deleted */
119
+ exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_CONTACT_DELETED = 'SupportModule.FrustrationScore.Contact.SubDbRecordAssociationDeleted';
120
+ /** Event: FrustrationScore__Case link created */
121
+ exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_CASE_CREATED = 'SupportModule.FrustrationScore.Case.SubDbRecordAssociationCreated';
122
+ /** Event: FrustrationScore__Case link deleted */
123
+ exports.ROUTING_KEY_LINK_FRUSTRATION_SCORE_CASE_DELETED = 'SupportModule.FrustrationScore.Case.SubDbRecordAssociationDeleted';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.345",
3
+ "version": "2.0.347",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",