@d19n/youfibre-odin-sdk 2.0.378 → 2.0.379
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.
- package/README.md +2 -1
- package/dist/api-sdk-v2/AccountApi.d.ts +2 -0
- package/dist/api-sdk-v2/AccountApi.js +6 -0
- package/dist/api-sdk-v2/ContractApi.d.ts +52 -0
- package/dist/api-sdk-v2/ContractApi.js +167 -0
- package/dist/api-sdk-v2/OrderApi.d.ts +2 -0
- package/dist/api-sdk-v2/OrderApi.js +6 -0
- package/dist/api-sdk-v2/RecontractApi.d.ts +2 -0
- package/dist/api-sdk-v2/RecontractApi.js +6 -0
- package/dist/db-sdk-v2/AccountDb.d.ts +2 -0
- package/dist/db-sdk-v2/AccountDb.js +6 -0
- package/dist/db-sdk-v2/ContractDb.d.ts +124 -0
- package/dist/db-sdk-v2/ContractDb.js +216 -0
- package/dist/db-sdk-v2/OrderDb.d.ts +2 -0
- package/dist/db-sdk-v2/OrderDb.js +6 -0
- package/dist/db-sdk-v2/RecontractDb.d.ts +2 -0
- package/dist/db-sdk-v2/RecontractDb.js +6 -0
- package/dist/entities-v2/Account.d.ts +3 -0
- package/dist/entities-v2/Contract.d.ts +299 -0
- package/dist/entities-v2/Contract.js +198 -0
- package/dist/entities-v2/DocumentProcessing.d.ts +3 -1
- package/dist/entities-v2/DocumentProcessing.js +2 -0
- package/dist/entities-v2/Lead.d.ts +2 -0
- package/dist/entities-v2/Lead.js +2 -0
- package/dist/entities-v2/Order.d.ts +3 -0
- package/dist/entities-v2/Recontract.d.ts +16 -1
- package/dist/entities-v2/Recontract.js +7 -1
- package/dist/entities-v2/VoiceConfiguration.d.ts +130 -130
- package/dist/entities-v2/VoiceConfiguration.js +46 -46
- package/package.json +1 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContractDb = void 0;
|
|
13
|
+
const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
|
|
14
|
+
const db_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/db.record.link.manager");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use OdinDbClient.
|
|
17
|
+
*
|
|
18
|
+
* Migration:
|
|
19
|
+
* - Old: new ContractApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.contract.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
23
|
+
*
|
|
24
|
+
* Supports separate query options and provider options:
|
|
25
|
+
* - Constructor level: new ContractDb(principal, dbService, { omitPermissionsCheck: true })
|
|
26
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
27
|
+
*/
|
|
28
|
+
class ContractDb extends db_provider_1.DbProvider {
|
|
29
|
+
constructor(principal, dbService, defaultOptions) {
|
|
30
|
+
super(principal, dbService, defaultOptions);
|
|
31
|
+
this.moduleName = 'OrderModule';
|
|
32
|
+
this.entityName = 'Contract';
|
|
33
|
+
this.principal = principal;
|
|
34
|
+
this.dbService = dbService;
|
|
35
|
+
// Link managers are lazy-loaded on first access
|
|
36
|
+
}
|
|
37
|
+
// ============================================
|
|
38
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
39
|
+
// ============================================
|
|
40
|
+
// Usage remains identical: db.address.list(recordId)
|
|
41
|
+
get order() {
|
|
42
|
+
if (!this._order) {
|
|
43
|
+
this._order = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'OrderModule:Contract', 'OrderModule:Order', 'Contract__Order');
|
|
44
|
+
}
|
|
45
|
+
return this._order;
|
|
46
|
+
}
|
|
47
|
+
get account() {
|
|
48
|
+
if (!this._account) {
|
|
49
|
+
this._account = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'OrderModule:Contract', 'CrmModule:Account', 'Contract__Account');
|
|
50
|
+
}
|
|
51
|
+
return this._account;
|
|
52
|
+
}
|
|
53
|
+
get recontract() {
|
|
54
|
+
if (!this._recontract) {
|
|
55
|
+
this._recontract = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'OrderModule:Contract', 'OrderModule:Recontract', 'Recontract__Contract');
|
|
56
|
+
}
|
|
57
|
+
return this._recontract;
|
|
58
|
+
}
|
|
59
|
+
// ============================================
|
|
60
|
+
// STANDARD METHODS
|
|
61
|
+
// ============================================
|
|
62
|
+
// Methods support separate query options and provider options for clean API
|
|
63
|
+
setRecord(sourceRecord) {
|
|
64
|
+
this.sourceRecord = sourceRecord;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Search records with manual pagination control
|
|
68
|
+
* @param params - Search parameters
|
|
69
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
70
|
+
*/
|
|
71
|
+
searchRecords(params, providerOptions) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Search all records with automatic pagination
|
|
78
|
+
* @param params - Search parameters
|
|
79
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
80
|
+
*/
|
|
81
|
+
searchAllRecordsAndPaginate(params, providerOptions) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get a single record by primary key
|
|
88
|
+
* @param contractId - Record ID
|
|
89
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
90
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* // Simple get
|
|
94
|
+
* const record = await db.getByPrimaryKey(id);
|
|
95
|
+
*
|
|
96
|
+
* // With related entities
|
|
97
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
98
|
+
*
|
|
99
|
+
* // With permissions bypass
|
|
100
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
101
|
+
*
|
|
102
|
+
* // Both options
|
|
103
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
104
|
+
*/
|
|
105
|
+
getByPrimaryKey(contractId, queryOptions, providerOptions) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, contractId, queryOptions, providerOptions);
|
|
108
|
+
if (res)
|
|
109
|
+
this.setRecord(res);
|
|
110
|
+
return res;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get multiple records by primary keys
|
|
115
|
+
* @param contractIds - Array of record IDs
|
|
116
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
117
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
118
|
+
*/
|
|
119
|
+
getManyByPrimaryKey(contractIds, queryOptions, providerOptions) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, contractIds, queryOptions, providerOptions);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Upsert a single record
|
|
126
|
+
* @param upsertDto - Record to upsert
|
|
127
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
128
|
+
*/
|
|
129
|
+
upsert(upsertDto, providerOptions) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
|
|
132
|
+
return res[0];
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Upsert multiple records
|
|
137
|
+
* @param upsertDtos - Records to upsert
|
|
138
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
139
|
+
*/
|
|
140
|
+
upsertMany(upsertDtos, providerOptions) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Update a single record
|
|
147
|
+
* @param updateDto - Record to update
|
|
148
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
149
|
+
*/
|
|
150
|
+
update(updateDto, providerOptions) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
|
|
153
|
+
return res[0];
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Update multiple records
|
|
158
|
+
* @param updateDtos - Records to update
|
|
159
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
160
|
+
*/
|
|
161
|
+
updateMany(updateDtos, providerOptions) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Delete one or many records
|
|
168
|
+
* @param contractIds - Record IDs to delete
|
|
169
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
170
|
+
*/
|
|
171
|
+
delete(contractIds, providerOptions) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
return yield this._delete(this.moduleName, this.entityName, contractIds, providerOptions);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Restore one or many deleted records
|
|
178
|
+
* @param contractIds - Record IDs to restore
|
|
179
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
180
|
+
*/
|
|
181
|
+
restore(contractIds, providerOptions) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
return yield this._restore(this.moduleName, this.entityName, contractIds, providerOptions);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Apply an action to a record
|
|
188
|
+
* @param actionName - The action key
|
|
189
|
+
* @param dto - The action DTO
|
|
190
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
191
|
+
*/
|
|
192
|
+
applyAction(actionName, dto, providerOptions) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get version history for the current source record
|
|
199
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
200
|
+
*/
|
|
201
|
+
getVersions(providerOptions) {
|
|
202
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Get revision timeline for the current source record
|
|
208
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
209
|
+
*/
|
|
210
|
+
getRevisionTimeline(providerOptions) {
|
|
211
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
exports.ContractDb = ContractDb;
|
|
@@ -66,6 +66,7 @@ export declare class OrderDb extends DbProvider {
|
|
|
66
66
|
private _commitment?;
|
|
67
67
|
private _homemove__oldorder?;
|
|
68
68
|
private _homemove__neworder?;
|
|
69
|
+
private _contract?;
|
|
69
70
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
70
71
|
get note(): DbRecordLinkManager;
|
|
71
72
|
get lead(): DbRecordLinkManager;
|
|
@@ -112,6 +113,7 @@ export declare class OrderDb extends DbProvider {
|
|
|
112
113
|
get commitment(): DbRecordLinkManager;
|
|
113
114
|
get homemove__oldorder(): DbRecordLinkManager;
|
|
114
115
|
get homemove__neworder(): DbRecordLinkManager;
|
|
116
|
+
get contract(): DbRecordLinkManager;
|
|
115
117
|
setRecord(sourceRecord: any): void;
|
|
116
118
|
/**
|
|
117
119
|
* Search records with manual pagination control
|
|
@@ -308,6 +308,12 @@ class OrderDb extends db_provider_1.DbProvider {
|
|
|
308
308
|
}
|
|
309
309
|
return this._homemove__neworder;
|
|
310
310
|
}
|
|
311
|
+
get contract() {
|
|
312
|
+
if (!this._contract) {
|
|
313
|
+
this._contract = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'OrderModule:Order', 'OrderModule:Contract', 'Contract__Order');
|
|
314
|
+
}
|
|
315
|
+
return this._contract;
|
|
316
|
+
}
|
|
311
317
|
// ============================================
|
|
312
318
|
// STANDARD METHODS
|
|
313
319
|
// ============================================
|
|
@@ -23,9 +23,11 @@ export declare class RecontractDb extends DbProvider {
|
|
|
23
23
|
private sourceRecord;
|
|
24
24
|
private _order?;
|
|
25
25
|
private _modifyservicerequest?;
|
|
26
|
+
private _contract?;
|
|
26
27
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
27
28
|
get order(): DbRecordLinkManager;
|
|
28
29
|
get modifyservicerequest(): DbRecordLinkManager;
|
|
30
|
+
get contract(): DbRecordLinkManager;
|
|
29
31
|
setRecord(sourceRecord: any): void;
|
|
30
32
|
/**
|
|
31
33
|
* Search records with manual pagination control
|
|
@@ -50,6 +50,12 @@ class RecontractDb extends db_provider_1.DbProvider {
|
|
|
50
50
|
}
|
|
51
51
|
return this._modifyservicerequest;
|
|
52
52
|
}
|
|
53
|
+
get contract() {
|
|
54
|
+
if (!this._contract) {
|
|
55
|
+
this._contract = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'OrderModule:Recontract', 'OrderModule:Contract', 'Recontract__Contract');
|
|
56
|
+
}
|
|
57
|
+
return this._contract;
|
|
58
|
+
}
|
|
53
59
|
// ============================================
|
|
54
60
|
// STANDARD METHODS
|
|
55
61
|
// ============================================
|
|
@@ -26,6 +26,7 @@ import { FileProperties } from './File';
|
|
|
26
26
|
import { DataIssueProperties } from './DataIssue';
|
|
27
27
|
import { FrustrationScoreProperties } from './FrustrationScore';
|
|
28
28
|
import { FrustrationEventProperties } from './FrustrationEvent';
|
|
29
|
+
import { ContractProperties } from './Contract';
|
|
29
30
|
/**
|
|
30
31
|
* Available types for Account records
|
|
31
32
|
*/
|
|
@@ -800,6 +801,8 @@ export declare class Account extends OdinRecord<AccountProperties> {
|
|
|
800
801
|
FrustrationScore: OdinLink<LinkedOdinRecord<FrustrationScoreProperties>>;
|
|
801
802
|
/** Linked FrustrationEvent records (FrustrationEvent__Account) */
|
|
802
803
|
FrustrationEvent: OdinLink<LinkedOdinRecord<FrustrationEventProperties>>;
|
|
804
|
+
/** Linked Contract records (Contract__Account) */
|
|
805
|
+
Contract: OdinLink<LinkedOdinRecord<ContractProperties>>;
|
|
803
806
|
}
|
|
804
807
|
/**
|
|
805
808
|
* RabbitMQ routing keys for Account events
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract Entity Definition
|
|
3
|
+
*
|
|
4
|
+
* The contract an order runs on: its number, its terms, and whether it is Active, Superseded (by a recontract) or Ended. Source of truth for the terms; the Order carries a read-only copy. Carried over to the new order on a home move.
|
|
5
|
+
*
|
|
6
|
+
* @module OrderModule
|
|
7
|
+
* @entity Contract
|
|
8
|
+
* @schemaId 7f5e71ff-040d-4e4e-8e1c-577e623c2319
|
|
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
|
+
import { AccountProperties } from './Account';
|
|
16
|
+
import { RecontractProperties } from './Recontract';
|
|
17
|
+
/**
|
|
18
|
+
* Available types for Contract records
|
|
19
|
+
*/
|
|
20
|
+
export declare enum ContractEntityTypes {
|
|
21
|
+
/** This is the default record type */
|
|
22
|
+
DEFAULT = "DEFAULT"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Valid values for Contract.Status
|
|
26
|
+
*
|
|
27
|
+
* Active: the contract the order runs on now. Superseded: replaced by a recontract. Ended: the service ended.
|
|
28
|
+
*
|
|
29
|
+
* @remarks Available options:
|
|
30
|
+
* - `ACTIVE` - Active
|
|
31
|
+
* - `ENDED` - Ended
|
|
32
|
+
* - `SUPERSEDED` - Superseded
|
|
33
|
+
*/
|
|
34
|
+
export declare enum ContractStatus {
|
|
35
|
+
ACTIVE = "ACTIVE",
|
|
36
|
+
ENDED = "ENDED",
|
|
37
|
+
SUPERSEDED = "SUPERSEDED"
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Valid values for Contract.ContractType
|
|
41
|
+
*
|
|
42
|
+
* The minimum term. Same options as Order.ContractType.
|
|
43
|
+
*
|
|
44
|
+
* @remarks Available options:
|
|
45
|
+
* - `MONTHLY` - Monthly rolling
|
|
46
|
+
* - `NONE` - No contract
|
|
47
|
+
* - `ANNUAL_12` - Term 12 months
|
|
48
|
+
* - `ANNUAL_18` - Term 18 months
|
|
49
|
+
* - `ANNUAL_19` - Term 19 months
|
|
50
|
+
* - `ANNUAL_20` - Term 20 months
|
|
51
|
+
* - `ANNUAL_21` - Term 21 months
|
|
52
|
+
* - `ANNUAL_22` - Term 22 months
|
|
53
|
+
* - `ANNUAL_23` - Term 23 months
|
|
54
|
+
* - `ANNUAL_24` - Term 24 months
|
|
55
|
+
* - `ANNUAL_25` - Term 25 months
|
|
56
|
+
* - `ANNUAL_26` - Term 26 months
|
|
57
|
+
* - `ANNUAL_27` - Term 27 months
|
|
58
|
+
* - `ANNUAL_28` - Term 28 months
|
|
59
|
+
* - `ANNUAL_29` - Term 29 months
|
|
60
|
+
* - ... and 14 more
|
|
61
|
+
*/
|
|
62
|
+
export declare enum ContractContractType {
|
|
63
|
+
MONTHLY_ROLLING = "MONTHLY",
|
|
64
|
+
NO_CONTRACT = "NONE",
|
|
65
|
+
TERM_12_MONTHS = "ANNUAL_12",
|
|
66
|
+
TERM_18_MONTHS = "ANNUAL_18",
|
|
67
|
+
TERM_19_MONTHS = "ANNUAL_19",
|
|
68
|
+
TERM_20_MONTHS = "ANNUAL_20",
|
|
69
|
+
TERM_21_MONTHS = "ANNUAL_21",
|
|
70
|
+
TERM_22_MONTHS = "ANNUAL_22",
|
|
71
|
+
TERM_23_MONTHS = "ANNUAL_23",
|
|
72
|
+
TERM_24_MONTHS = "ANNUAL_24",
|
|
73
|
+
TERM_25_MONTHS = "ANNUAL_25",
|
|
74
|
+
TERM_26_MONTHS = "ANNUAL_26",
|
|
75
|
+
TERM_27_MONTHS = "ANNUAL_27",
|
|
76
|
+
TERM_28_MONTHS = "ANNUAL_28",
|
|
77
|
+
TERM_29_MONTHS = "ANNUAL_29",
|
|
78
|
+
TERM_30_MONTHS = "ANNUAL_30",
|
|
79
|
+
TERM_31_MONTHS = "ANNUAL_31",
|
|
80
|
+
TERM_32_MONTHS = "ANNUAL_32",
|
|
81
|
+
TERM_33_MONTHS = "ANNUAL_33",
|
|
82
|
+
TERM_34_MONTHS = "ANNUAL_34",
|
|
83
|
+
TERM_35_MONTHS = "ANNUAL_35",
|
|
84
|
+
TERM_36_MONTHS = "ANNUAL_36",
|
|
85
|
+
TERM_37_MONTHS = "ANNUAL_37",
|
|
86
|
+
TERM_38_MONTHS = "ANNUAL_38",
|
|
87
|
+
TERM_39_MONTHS = "ANNUAL_39",
|
|
88
|
+
TERM_40_MONTHS = "ANNUAL_40",
|
|
89
|
+
TERM_41_MONTHS = "ANNUAL_41",
|
|
90
|
+
TERM_42_MONTHS = "ANNUAL_42",
|
|
91
|
+
TERM_60_MONTHS = "ANNUAL_60"
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Valid values for Contract.BillingTerms
|
|
95
|
+
*
|
|
96
|
+
* Payment terms. Same options as Order.BillingTerms.
|
|
97
|
+
*
|
|
98
|
+
* @remarks Available options:
|
|
99
|
+
* - `NET_0` - NET 0
|
|
100
|
+
* - `NET_10` - NET 10
|
|
101
|
+
* - `NET_120` - NET 120
|
|
102
|
+
* - `NET_15` - NET 15
|
|
103
|
+
* - `NET_3` - NET 3
|
|
104
|
+
* - `NET_30` - NET 30
|
|
105
|
+
* - `NET_60` - NET 60
|
|
106
|
+
* - `NET_90` - NET 90
|
|
107
|
+
*/
|
|
108
|
+
export declare enum ContractBillingTerms {
|
|
109
|
+
NET_0 = "NET_0",
|
|
110
|
+
NET_10 = "NET_10",
|
|
111
|
+
NET_120 = "NET_120",
|
|
112
|
+
NET_15 = "NET_15",
|
|
113
|
+
NET_3 = "NET_3",
|
|
114
|
+
NET_30 = "NET_30",
|
|
115
|
+
NET_60 = "NET_60",
|
|
116
|
+
NET_90 = "NET_90"
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Property keys for Contract
|
|
120
|
+
* Use these constants instead of string literals for type safety
|
|
121
|
+
*/
|
|
122
|
+
export declare enum ContractPropertyKeys {
|
|
123
|
+
/** The order's record number for its first contract; each recontract adds -R<n> (OR1849203-R1). Kept across a home move. Unique. */
|
|
124
|
+
ContractNumber = "ContractNumber",
|
|
125
|
+
/** Active: the contract the order runs on now. Superseded: replaced by a recontract. Ended: the service ended. */
|
|
126
|
+
Status = "Status",
|
|
127
|
+
/** The minimum term. Same options as Order.ContractType. */
|
|
128
|
+
ContractType = "ContractType",
|
|
129
|
+
/** The date the contract starts. */
|
|
130
|
+
ContractStartDate = "ContractStartDate",
|
|
131
|
+
/** The date the minimum term ends. */
|
|
132
|
+
ContractEndDate = "ContractEndDate",
|
|
133
|
+
/** How many times the contract has been renewed (recontracted). */
|
|
134
|
+
ContractRenewalCount = "ContractRenewalCount",
|
|
135
|
+
/** The billing anchor. On a home-moved order the order keeps its own (CORE-1492), so this can differ from the order it now runs on. */
|
|
136
|
+
BillingStartDate = "BillingStartDate",
|
|
137
|
+
/** The day of the month the customer is billed. */
|
|
138
|
+
BillingDay = "BillingDay",
|
|
139
|
+
/** The billing day the customer asked for at checkout. */
|
|
140
|
+
DesiredBillingDay = "DesiredBillingDay",
|
|
141
|
+
/** Payment terms. Same options as Order.BillingTerms. */
|
|
142
|
+
BillingTerms = "BillingTerms",
|
|
143
|
+
/** When the recontract that started this contract was applied. */
|
|
144
|
+
RecontractDate = "RecontractDate",
|
|
145
|
+
/** When the terms were last amended. */
|
|
146
|
+
AmendmentDate = "AmendmentDate",
|
|
147
|
+
/** The contract this one superseded, when it was started by a recontract. */
|
|
148
|
+
PreviousContractId = "PreviousContractId",
|
|
149
|
+
/** The order the contract runs on now. The only order its terms are copied to. */
|
|
150
|
+
NextOrderId = "NextOrderId",
|
|
151
|
+
/** The order the contract came from, when it was carried over a home move. Never written to: the terms go to NextOrderId only. */
|
|
152
|
+
PreviousOrderId = "PreviousOrderId"
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Properties for Contract records
|
|
156
|
+
*
|
|
157
|
+
* @see OrderModule:Contract
|
|
158
|
+
*/
|
|
159
|
+
export interface ContractProperties {
|
|
160
|
+
/** The order's record number for its first contract; each recontract adds -R<n> (OR1849203-R1). Kept across a home move. Unique.
|
|
161
|
+
*
|
|
162
|
+
* @type {TEXT}
|
|
163
|
+
* @default
|
|
164
|
+
*/
|
|
165
|
+
ContractNumber: string;
|
|
166
|
+
/** Active: the contract the order runs on now. Superseded: replaced by a recontract. Ended: the service ended.
|
|
167
|
+
*
|
|
168
|
+
* @type {ENUM}
|
|
169
|
+
* @default
|
|
170
|
+
* @enum {ContractStatus}
|
|
171
|
+
*/
|
|
172
|
+
Status: ContractStatus;
|
|
173
|
+
/** The minimum term. Same options as Order.ContractType.
|
|
174
|
+
*
|
|
175
|
+
* @type {ENUM}
|
|
176
|
+
* @default
|
|
177
|
+
* @enum {ContractContractType}
|
|
178
|
+
*/
|
|
179
|
+
ContractType: ContractContractType;
|
|
180
|
+
/** The date the contract starts.
|
|
181
|
+
*
|
|
182
|
+
* @type {DATE}
|
|
183
|
+
* @default
|
|
184
|
+
*/
|
|
185
|
+
ContractStartDate: string;
|
|
186
|
+
/** The date the minimum term ends.
|
|
187
|
+
*
|
|
188
|
+
* @type {DATE}
|
|
189
|
+
* @default
|
|
190
|
+
*/
|
|
191
|
+
ContractEndDate: string;
|
|
192
|
+
/** How many times the contract has been renewed (recontracted).
|
|
193
|
+
*
|
|
194
|
+
* @type {NUMBER}
|
|
195
|
+
* @default
|
|
196
|
+
*/
|
|
197
|
+
ContractRenewalCount: number;
|
|
198
|
+
/** The billing anchor. On a home-moved order the order keeps its own (CORE-1492), so this can differ from the order it now runs on.
|
|
199
|
+
*
|
|
200
|
+
* @type {DATE}
|
|
201
|
+
* @default
|
|
202
|
+
*/
|
|
203
|
+
BillingStartDate: string;
|
|
204
|
+
/** The day of the month the customer is billed.
|
|
205
|
+
*
|
|
206
|
+
* @type {NUMBER}
|
|
207
|
+
* @default
|
|
208
|
+
*/
|
|
209
|
+
BillingDay: number;
|
|
210
|
+
/** The billing day the customer asked for at checkout.
|
|
211
|
+
*
|
|
212
|
+
* @type {NUMBER}
|
|
213
|
+
* @default
|
|
214
|
+
*/
|
|
215
|
+
DesiredBillingDay: number;
|
|
216
|
+
/** Payment terms. Same options as Order.BillingTerms.
|
|
217
|
+
*
|
|
218
|
+
* @type {ENUM}
|
|
219
|
+
* @default
|
|
220
|
+
* @enum {ContractBillingTerms}
|
|
221
|
+
*/
|
|
222
|
+
BillingTerms: ContractBillingTerms;
|
|
223
|
+
/** When the recontract that started this contract was applied.
|
|
224
|
+
*
|
|
225
|
+
* @type {DATE}
|
|
226
|
+
* @default
|
|
227
|
+
*/
|
|
228
|
+
RecontractDate: string;
|
|
229
|
+
/** When the terms were last amended.
|
|
230
|
+
*
|
|
231
|
+
* @type {DATE}
|
|
232
|
+
* @default
|
|
233
|
+
*/
|
|
234
|
+
AmendmentDate: string;
|
|
235
|
+
/** The contract this one superseded, when it was started by a recontract.
|
|
236
|
+
*
|
|
237
|
+
* @type {UUID}
|
|
238
|
+
* @default
|
|
239
|
+
*/
|
|
240
|
+
PreviousContractId: string;
|
|
241
|
+
/** The order the contract runs on now. The only order its terms are copied to.
|
|
242
|
+
*
|
|
243
|
+
* @type {LOOKUP}
|
|
244
|
+
* @default
|
|
245
|
+
*/
|
|
246
|
+
NextOrderId: string;
|
|
247
|
+
/** The order the contract came from, when it was carried over a home move. Never written to: the terms go to NextOrderId only.
|
|
248
|
+
*
|
|
249
|
+
* @type {LOOKUP}
|
|
250
|
+
* @default
|
|
251
|
+
*/
|
|
252
|
+
PreviousOrderId: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Contract entity from OrderModule
|
|
256
|
+
*
|
|
257
|
+
* The contract an order runs on: its number, its terms, and whether it is Active, Superseded (by a recontract) or Ended. Source of truth for the terms; the Order carries a read-only copy. Carried over to the new order on a home move.
|
|
258
|
+
*
|
|
259
|
+
* @module OrderModule
|
|
260
|
+
* @entity Contract
|
|
261
|
+
* @schemaId 7f5e71ff-040d-4e4e-8e1c-577e623c2319
|
|
262
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
263
|
+
*/
|
|
264
|
+
export declare class Contract extends OdinRecord<ContractProperties> {
|
|
265
|
+
entity: 'OrderModule:Contract';
|
|
266
|
+
type: ContractEntityTypes;
|
|
267
|
+
schemaId: '7f5e71ff-040d-4e4e-8e1c-577e623c2319';
|
|
268
|
+
properties: ContractProperties;
|
|
269
|
+
/** Linked Order records (Contract__Order) */
|
|
270
|
+
Order: OdinLink<LinkedOdinRecord<OrderProperties>>;
|
|
271
|
+
/** Linked Account records (Contract__Account) */
|
|
272
|
+
Account: OdinLink<LinkedOdinRecord<AccountProperties>>;
|
|
273
|
+
/** Linked Recontract records (Recontract__Contract) */
|
|
274
|
+
Recontract: OdinLink<LinkedOdinRecord<RecontractProperties>>;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* RabbitMQ routing keys for Contract events
|
|
278
|
+
*/
|
|
279
|
+
export declare const ROUTING_KEY_CONTRACT_CREATED = "OrderModule.Contract.SubDbRecordCreated";
|
|
280
|
+
export declare const ROUTING_KEY_CONTRACT_UPDATED = "OrderModule.Contract.SubDbRecordUpdated";
|
|
281
|
+
export declare const ROUTING_KEY_CONTRACT_DELETED = "OrderModule.Contract.SubDbRecordDeleted";
|
|
282
|
+
/**
|
|
283
|
+
* Type-specific routing keys for Contract events
|
|
284
|
+
* Subscribe to these for events on specific entity types only
|
|
285
|
+
*/
|
|
286
|
+
/** This is the default record type created */
|
|
287
|
+
export declare const ROUTING_KEY_CONTRACT_DEFAULT_CREATED = "OrderModule.Contract.DEFAULT.SubDbRecordCreated";
|
|
288
|
+
/** This is the default record type updated */
|
|
289
|
+
export declare const ROUTING_KEY_CONTRACT_DEFAULT_UPDATED = "OrderModule.Contract.DEFAULT.SubDbRecordUpdated";
|
|
290
|
+
/** This is the default record type deleted */
|
|
291
|
+
export declare const ROUTING_KEY_CONTRACT_DEFAULT_DELETED = "OrderModule.Contract.DEFAULT.SubDbRecordDeleted";
|
|
292
|
+
/** Event: Contract__Order link created */
|
|
293
|
+
export declare const ROUTING_KEY_LINK_CONTRACT_ORDER_CREATED = "OrderModule.Contract.Order.SubDbRecordAssociationCreated";
|
|
294
|
+
/** Event: Contract__Order link deleted */
|
|
295
|
+
export declare const ROUTING_KEY_LINK_CONTRACT_ORDER_DELETED = "OrderModule.Contract.Order.SubDbRecordAssociationDeleted";
|
|
296
|
+
/** Event: Contract__Account link created */
|
|
297
|
+
export declare const ROUTING_KEY_LINK_CONTRACT_ACCOUNT_CREATED = "OrderModule.Contract.Account.SubDbRecordAssociationCreated";
|
|
298
|
+
/** Event: Contract__Account link deleted */
|
|
299
|
+
export declare const ROUTING_KEY_LINK_CONTRACT_ACCOUNT_DELETED = "OrderModule.Contract.Account.SubDbRecordAssociationDeleted";
|