@mj-biz-apps/contracts-entities 0.4.2 → 0.6.0

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.
@@ -0,0 +1,1973 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { BaseEntity, CompositeKey, ValidationErrorInfo, ValidationErrorType } from "@memberjunction/core";
8
+ import { RegisterClass } from "@memberjunction/global";
9
+ import { z } from "zod";
10
+ /**
11
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Template Modifications
12
+ */
13
+ export const mjBizAppsContractsContractTemplateModificationSchema = z.object({
14
+ ID: z.string().describe(`
15
+ * * Field Name: ID
16
+ * * Display Name: ID
17
+ * * SQL Data Type: uniqueidentifier
18
+ * * Default Value: newsequentialid()`),
19
+ ContractID: z.string().describe(`
20
+ * * Field Name: ContractID
21
+ * * Display Name: Contract
22
+ * * SQL Data Type: uniqueidentifier
23
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)`),
24
+ ContractTemplateProvisionID: z.string().describe(`
25
+ * * Field Name: ContractTemplateProvisionID
26
+ * * Display Name: Contract Template Provision
27
+ * * SQL Data Type: uniqueidentifier
28
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Template Provisions (vwContractTemplateProvisions.ID)
29
+ * * Description: The provision being modified — the structured identifier, and the only one. A server rule enforces what this replaces: the provision must belong to a template this contract incorporates.`),
30
+ ModificationText: z.string().describe(`
31
+ * * Field Name: ModificationText
32
+ * * Display Name: Modification Text
33
+ * * SQL Data Type: nvarchar(MAX)
34
+ * * Description: What this contract says INSTEAD of the standard clause. Read as a pair with ContractTemplateProvision.ProvisionText.`),
35
+ Notes: z.string().nullable().describe(`
36
+ * * Field Name: Notes
37
+ * * Display Name: Notes
38
+ * * SQL Data Type: nvarchar(MAX)
39
+ * * Description: Optional working note, e.g. who negotiated it.`),
40
+ __mj_CreatedAt: z.date().describe(`
41
+ * * Field Name: __mj_CreatedAt
42
+ * * Display Name: Created At
43
+ * * SQL Data Type: datetimeoffset
44
+ * * Default Value: getutcdate()`),
45
+ __mj_UpdatedAt: z.date().describe(`
46
+ * * Field Name: __mj_UpdatedAt
47
+ * * Display Name: Updated At
48
+ * * SQL Data Type: datetimeoffset
49
+ * * Default Value: getutcdate()`),
50
+ Contract: z.string().nullable().describe(`
51
+ * * Field Name: Contract
52
+ * * Display Name: Contract
53
+ * * SQL Data Type: nvarchar(50)`),
54
+ ContractTemplateProvision: z.string().describe(`
55
+ * * Field Name: ContractTemplateProvision
56
+ * * Display Name: Contract Template Provision
57
+ * * SQL Data Type: nvarchar(20)`),
58
+ });
59
+ /**
60
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Template Provisions
61
+ */
62
+ export const mjBizAppsContractsContractTemplateProvisionSchema = z.object({
63
+ ID: z.string().describe(`
64
+ * * Field Name: ID
65
+ * * Display Name: ID
66
+ * * SQL Data Type: uniqueidentifier
67
+ * * Default Value: newsequentialid()`),
68
+ ContractTemplateID: z.string().describe(`
69
+ * * Field Name: ContractTemplateID
70
+ * * Display Name: Contract Template
71
+ * * SQL Data Type: uniqueidentifier
72
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Templates (vwContractTemplates.ID)`),
73
+ ProvisionNumber: z.string().describe(`
74
+ * * Field Name: ProvisionNumber
75
+ * * Display Name: Provision Number
76
+ * * SQL Data Type: nvarchar(20)
77
+ * * Description: The clause number as the document writes it, e.g. "3.5(b)". Unique within its template.`),
78
+ Title: z.string().describe(`
79
+ * * Field Name: Title
80
+ * * Display Name: Title
81
+ * * SQL Data Type: nvarchar(200)
82
+ * * Description: The clause heading, e.g. "Limitation of Liability". This plus the number is what a person picks from.`),
83
+ ProvisionText: z.string().describe(`
84
+ * * Field Name: ProvisionText
85
+ * * Display Name: Provision Text
86
+ * * SQL Data Type: nvarchar(MAX)
87
+ * * Description: The STANDARD wording of this clause. Read as a pair with ContractTemplateModification.ModificationText, which holds what a given contract says instead — a dispute needs the comparison, not either half.`),
88
+ Description: z.string().nullable().describe(`
89
+ * * Field Name: Description
90
+ * * Display Name: Description
91
+ * * SQL Data Type: nvarchar(MAX)`),
92
+ ProvisionSortKey: z.string().nullable().describe(`
93
+ * * Field Name: ProvisionSortKey
94
+ * * Display Name: Sort Key
95
+ * * SQL Data Type: nvarchar(200)
96
+ * * Description: Collation key derived from ProvisionNumber: every run of digits zero-padded to six places, everything else upper-cased. Makes a plain SQL ORDER BY produce natural order ('1.9' before '1.10'), which ordering by ProvisionNumber cannot. READ-ONLY -- a persisted computed column; nobody should be able to set a sort key. Replaced the hand-maintained Sequence column, which had already collided in the seeded data.`),
97
+ __mj_CreatedAt: z.date().describe(`
98
+ * * Field Name: __mj_CreatedAt
99
+ * * Display Name: Created At
100
+ * * SQL Data Type: datetimeoffset
101
+ * * Default Value: getutcdate()`),
102
+ __mj_UpdatedAt: z.date().describe(`
103
+ * * Field Name: __mj_UpdatedAt
104
+ * * Display Name: Updated At
105
+ * * SQL Data Type: datetimeoffset
106
+ * * Default Value: getutcdate()`),
107
+ ContractTemplate: z.string().describe(`
108
+ * * Field Name: ContractTemplate
109
+ * * Display Name: Contract Template Name
110
+ * * SQL Data Type: nvarchar(200)`),
111
+ });
112
+ /**
113
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Template Types
114
+ */
115
+ export const mjBizAppsContractsContractTemplateTypeSchema = z.object({
116
+ ID: z.string().describe(`
117
+ * * Field Name: ID
118
+ * * Display Name: ID
119
+ * * SQL Data Type: uniqueidentifier
120
+ * * Default Value: newsequentialid()`),
121
+ Name: z.string().describe(`
122
+ * * Field Name: Name
123
+ * * Display Name: Name
124
+ * * SQL Data Type: nvarchar(100)`),
125
+ Description: z.string().nullable().describe(`
126
+ * * Field Name: Description
127
+ * * Display Name: Description
128
+ * * SQL Data Type: nvarchar(MAX)`),
129
+ Status: z.union([z.literal('Active'), z.literal('Inactive')]).describe(`
130
+ * * Field Name: Status
131
+ * * Display Name: Status
132
+ * * SQL Data Type: nvarchar(10)
133
+ * * Default Value: Active
134
+ * * Value List Type: List
135
+ * * Possible Values
136
+ * * Active
137
+ * * Inactive
138
+ * * Description: Active | Inactive. Retiring a type hides it from pickers without touching the templates that used it.`),
139
+ __mj_CreatedAt: z.date().describe(`
140
+ * * Field Name: __mj_CreatedAt
141
+ * * Display Name: Created At
142
+ * * SQL Data Type: datetimeoffset
143
+ * * Default Value: getutcdate()`),
144
+ __mj_UpdatedAt: z.date().describe(`
145
+ * * Field Name: __mj_UpdatedAt
146
+ * * Display Name: Updated At
147
+ * * SQL Data Type: datetimeoffset
148
+ * * Default Value: getutcdate()`),
149
+ });
150
+ /**
151
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Templates
152
+ */
153
+ export const mjBizAppsContractsContractTemplateSchema = z.object({
154
+ ID: z.string().describe(`
155
+ * * Field Name: ID
156
+ * * Display Name: ID
157
+ * * SQL Data Type: uniqueidentifier
158
+ * * Default Value: newsequentialid()`),
159
+ Name: z.string().describe(`
160
+ * * Field Name: Name
161
+ * * Display Name: Name
162
+ * * SQL Data Type: nvarchar(200)`),
163
+ ContractTemplateTypeID: z.string().describe(`
164
+ * * Field Name: ContractTemplateTypeID
165
+ * * Display Name: Template Type ID
166
+ * * SQL Data Type: uniqueidentifier
167
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Template Types (vwContractTemplateTypes.ID)`),
168
+ VersionLabel: z.string().nullable().describe(`
169
+ * * Field Name: VersionLabel
170
+ * * Display Name: Version Label
171
+ * * SQL Data Type: nvarchar(50)
172
+ * * Description: The version the document names itself, e.g. "v6". Free text, because it is the documents own label rather than something we derive.`),
173
+ IntroducedDate: z.date().nullable().describe(`
174
+ * * Field Name: IntroducedDate
175
+ * * Display Name: Introduced Date
176
+ * * SQL Data Type: date
177
+ * * Description: When this version started being offered. NOT an effective date: a template becomes effective for a customer when THAT customer signs it, never on a calendar date. Naming it EffectiveDate would invite exactly the wrong query.`),
178
+ SourceURL: z.string().nullable().describe(`
179
+ * * Field Name: SourceURL
180
+ * * Display Name: Source URL
181
+ * * SQL Data Type: nvarchar(1000)
182
+ * * Description: The dated public URL a customer can open to read the standard terms. NULLABLE: reachability is enforceable by nothing (a well-formed dead link passes any format check), and the real rule is "a URL OR an attached file" — the file half attaching through __mj.FileEntityRecordLink, which cannot reference a record that does not exist yet, so on CREATE it is unsatisfiable in principle. A template with neither is INCOMPLETE rather than invalid; the derived IsUsable column on vwContractTemplates is what says so.`),
183
+ Description: z.string().nullable().describe(`
184
+ * * Field Name: Description
185
+ * * Display Name: Description
186
+ * * SQL Data Type: nvarchar(MAX)`),
187
+ Status: z.union([z.literal('Draft'), z.literal('Published')]).describe(`
188
+ * * Field Name: Status
189
+ * * Display Name: Status
190
+ * * SQL Data Type: nvarchar(20)
191
+ * * Default Value: Draft
192
+ * * Value List Type: List
193
+ * * Possible Values
194
+ * * Draft
195
+ * * Published
196
+ * * Description: Publication lifecycle. 'Draft' -- freely editable, provisions may be added, changed and removed, and a contract may not NEWLY reference it. 'Published' -- the provisions are frozen against INSERT, UPDATE and DELETE by trg_ContractTemplateProvision_Immutability, and contracts may reference it. Publishing is ONE-WAY (enforced in ContractTemplateEntity): to change published terms, publish a new version -- that is what VersionLabel exists for. Existing references are never invalidated by this column; only new ones are policed, the same way ContractType.Status works.`),
197
+ __mj_CreatedAt: z.date().describe(`
198
+ * * Field Name: __mj_CreatedAt
199
+ * * Display Name: Created At
200
+ * * SQL Data Type: datetimeoffset
201
+ * * Default Value: getutcdate()`),
202
+ __mj_UpdatedAt: z.date().describe(`
203
+ * * Field Name: __mj_UpdatedAt
204
+ * * Display Name: Updated At
205
+ * * SQL Data Type: datetimeoffset
206
+ * * Default Value: getutcdate()`),
207
+ ContractTemplateType: z.string().describe(`
208
+ * * Field Name: ContractTemplateType
209
+ * * Display Name: Template Type
210
+ * * SQL Data Type: nvarchar(100)`),
211
+ IsUsable: z.boolean().nullable().describe(`
212
+ * * Field Name: IsUsable
213
+ * * Display Name: Is Usable
214
+ * * SQL Data Type: bit`),
215
+ });
216
+ /**
217
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Types
218
+ */
219
+ export const mjBizAppsContractsContractTypeSchema = z.object({
220
+ ID: z.string().describe(`
221
+ * * Field Name: ID
222
+ * * Display Name: ID
223
+ * * SQL Data Type: uniqueidentifier
224
+ * * Default Value: newsequentialid()`),
225
+ Name: z.string().describe(`
226
+ * * Field Name: Name
227
+ * * Display Name: Name
228
+ * * SQL Data Type: nvarchar(100)`),
229
+ Description: z.string().nullable().describe(`
230
+ * * Field Name: Description
231
+ * * Display Name: Description
232
+ * * SQL Data Type: nvarchar(MAX)`),
233
+ RequiresExecutedDocument: z.boolean().describe(`
234
+ * * Field Name: RequiresExecutedDocument
235
+ * * Display Name: Requires Executed Document
236
+ * * SQL Data Type: bit
237
+ * * Default Value: 1
238
+ * * Description: Whether paper is ever expected for this kind of contract. No for a Payment Link, which has an implied agreement and no signature. This is what stops such a contract asking forever for a document that will never arrive: "awaiting the document" is DERIVED as requires-it AND no-linked-file, never stored and never a status value.`),
239
+ Status: z.union([z.literal('Active'), z.literal('Inactive')]).describe(`
240
+ * * Field Name: Status
241
+ * * Display Name: Status
242
+ * * SQL Data Type: nvarchar(10)
243
+ * * Default Value: Active
244
+ * * Value List Type: List
245
+ * * Possible Values
246
+ * * Active
247
+ * * Inactive
248
+ * * Description: Active | Inactive.`),
249
+ MustBeRoot: z.boolean().describe(`
250
+ * * Field Name: MustBeRoot
251
+ * * Display Name: Must Be Root
252
+ * * SQL Data Type: bit
253
+ * * Default Value: 0
254
+ * * Description: This type of contract may NOT name a ParentContractID -- it is a root agreement. Enforced in ContractEntityServer.ValidateAsync. Mutually exclusive with MustBeChild (CK_ContractType_RootOrChild); both false means no restriction on where in the tree this type may sit, which is the honest default.`),
255
+ MustBeChild: z.boolean().describe(`
256
+ * * Field Name: MustBeChild
257
+ * * Display Name: Must Be Child
258
+ * * SQL Data Type: bit
259
+ * * Default Value: 0
260
+ * * Description: This type of contract MUST name a ParentContractID -- a Change Order that amends nothing is not a change order, and would never appear in the original agreement's lineage. Enforced in ContractEntityServer.ValidateAsync. Mutually exclusive with MustBeRoot.`),
261
+ TemplateRequired: z.boolean().describe(`
262
+ * * Field Name: TemplateRequired
263
+ * * Display Name: Template Required
264
+ * * SQL Data Type: bit
265
+ * * Default Value: 0
266
+ * * Description: This type of contract must carry its own ContractTemplateID -- the standard terms it incorporates. On the TYPE rather than inferred from the placement flags, because 'where in the tree' and 'does it need its own paper' are different questions and a future type could want any combination.`),
267
+ __mj_CreatedAt: z.date().describe(`
268
+ * * Field Name: __mj_CreatedAt
269
+ * * Display Name: Created At
270
+ * * SQL Data Type: datetimeoffset
271
+ * * Default Value: getutcdate()`),
272
+ __mj_UpdatedAt: z.date().describe(`
273
+ * * Field Name: __mj_UpdatedAt
274
+ * * Display Name: Updated At
275
+ * * SQL Data Type: datetimeoffset
276
+ * * Default Value: getutcdate()`),
277
+ });
278
+ /**
279
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contracts
280
+ */
281
+ export const mjBizAppsContractsContractSchema = z.object({
282
+ ID: z.string().describe(`
283
+ * * Field Name: ID
284
+ * * Display Name: ID
285
+ * * SQL Data Type: uniqueidentifier
286
+ * * Default Value: newsequentialid()`),
287
+ ContractNumber: z.string().nullable().describe(`
288
+ * * Field Name: ContractNumber
289
+ * * Display Name: Contract Number
290
+ * * SQL Data Type: nvarchar(50)
291
+ * * Description: CTR-000001, minted by spAssignNextContractNumber from the seq_ContractNumber database SEQUENCE. Unique. NULLABLE at the schema level because MJ cannot express 'NOT NULL, assigned by the server on insert' -- ContractEntityServer.Save() is what guarantees every contract has one. Gaps are normal and are not to be 'fixed': a save that fails after taking a number leaves one behind, and UQ_Contract_ContractNumber is what guarantees no two contracts share a number.`),
292
+ ContractTypeID: z.string().describe(`
293
+ * * Field Name: ContractTypeID
294
+ * * Display Name: Contract Type
295
+ * * SQL Data Type: uniqueidentifier
296
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Types (vwContractTypes.ID)`),
297
+ CompanyID: z.string().describe(`
298
+ * * Field Name: CompanyID
299
+ * * Display Name: Company
300
+ * * SQL Data Type: uniqueidentifier
301
+ * * Related Entity/Foreign Key: MJ: Companies (vwCompanies.ID)
302
+ * * Description: The SELLING company (__mj.Company) — which of OUR entities holds this agreement. Not the customer. Stored rather than derived because it is not reliably recoverable from the deal.`),
303
+ CustomerOrganizationID: z.string().describe(`
304
+ * * Field Name: CustomerOrganizationID
305
+ * * Display Name: Customer Organization
306
+ * * SQL Data Type: uniqueidentifier
307
+ * * Related Entity/Foreign Key: MJ_BizApps_Common: Organizations (vwOrganizations.ID)
308
+ * * Description: The customer. NOT NULL: contracts are B2B here by definition, and the individual case lives entirely in orders. v1 allowed an organization-or-person XOR; that is gone.`),
309
+ PrimaryContactPersonID: z.string().nullable().describe(`
310
+ * * Field Name: PrimaryContactPersonID
311
+ * * Display Name: Primary Contact Person
312
+ * * SQL Data Type: uniqueidentifier
313
+ * * Related Entity/Foreign Key: MJ_BizApps_Common: People (vwPeople.ID)
314
+ * * Description: Their named contact, optional.`),
315
+ ContractTemplateID: z.string().nullable().describe(`
316
+ * * Field Name: ContractTemplateID
317
+ * * Display Name: Contract Template
318
+ * * SQL Data Type: uniqueidentifier
319
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Templates (vwContractTemplates.ID)
320
+ * * Description: The agreement version this contract incorporates. Nullable because a contract created automatically at Closed Won has none until finance reads the PDF.`),
321
+ CreatingEntityID: z.string().nullable().describe(`
322
+ * * Field Name: CreatingEntityID
323
+ * * Display Name: Creating Entity
324
+ * * SQL Data Type: uniqueidentifier
325
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
326
+ * * Description: Polymorphic reference part 1: the MJ Entity of the record that CREATED this contract, in practice Deals. A real foreign key to __mj.Entity — this is the half that is enforced, and the half that lets MJ resolve the pair generically. Same pattern accounting uses for JournalEntry provenance.`),
327
+ CreatingRecordID: z.string().nullable().describe(`
328
+ * * Field Name: CreatingRecordID
329
+ * * Display Name: Creating Record ID
330
+ * * SQL Data Type: nvarchar(450)
331
+ * * Description: Polymorphic reference part 2: the creating records id. Soft by nature — it points at a record owned by an app this repo has no knowledge of. Set together with CreatingEntityID or not at all.`),
332
+ ParentContractID: z.string().nullable().describe(`
333
+ * * Field Name: ParentContractID
334
+ * * Display Name: Parent Contract
335
+ * * SQL Data Type: uniqueidentifier
336
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
337
+ * * Description: The contract this one amends. How a change order attaches: a change order is signed paper with its own PDF, dates and modifications, so it reuses this entity rather than getting one of its own. The original stays in force.`),
338
+ SupersededByContractID: z.string().nullable().describe(`
339
+ * * Field Name: SupersededByContractID
340
+ * * Display Name: Superseded By
341
+ * * SQL Data Type: uniqueidentifier
342
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
343
+ * * Description: The contract that REPLACED this one, where an agreement was re-papered rather than amended. Also the sole source of the derived Superseded state, which is why the old CHECK tying it to a Status column disappeared with that column.`),
344
+ SigningProviderURL: z.string().nullable().describe(`
345
+ * * Field Name: SigningProviderURL
346
+ * * Display Name: Signing Provider URL
347
+ * * SQL Data Type: nvarchar(1000)
348
+ * * Description: Direct link to the document in the signing provider (PandaDoc). The fallback that works before any integration exists, and when a storage sync has broken.`),
349
+ EffectiveDate: z.date().nullable().describe(`
350
+ * * Field Name: EffectiveDate
351
+ * * Display Name: Effective Date
352
+ * * SQL Data Type: date
353
+ * * Description: When the agreement takes effect.`),
354
+ ExecutedDate: z.date().nullable().describe(`
355
+ * * Field Name: ExecutedDate
356
+ * * Display Name: Executed Date
357
+ * * SQL Data Type: date
358
+ * * Description: When it was signed. May legitimately PRECEDE EffectiveDate — sign in December for a January start is the ordinary case. There is deliberately no constraint ordering the two; v1 had one and it rejected exactly the data a correct contract produces.`),
359
+ EndDate: z.date().nullable().describe(`
360
+ * * Field Name: EndDate
361
+ * * Display Name: End Date
362
+ * * SQL Data Type: date
363
+ * * Description: When the current term ends. This is what drives the renewal watchlist and every expiry projection.`),
364
+ TerminatedDate: z.date().nullable().describe(`
365
+ * * Field Name: TerminatedDate
366
+ * * Display Name: Terminated Date
367
+ * * SQL Data Type: date
368
+ * * Description: When the agreement ended early. Stored rather than derived: it is only recoverable from a successors effective date, and a contract can end with no successor at all when a customer simply leaves.`),
369
+ AutoRenew: z.boolean().describe(`
370
+ * * Field Name: AutoRenew
371
+ * * Display Name: Auto Renew
372
+ * * SQL Data Type: bit
373
+ * * Default Value: 0
374
+ * * Description: Whether the agreement auto-renews, AS THE PAPER STATES IT. True or false, no third state. Distinct from the subscriptions operational setting in orders, which someone can change later; when the two disagree that is a finding, not a bug.`),
375
+ RenewalNoticeDays: z.number().nullable().describe(`
376
+ * * Field Name: RenewalNoticeDays
377
+ * * Display Name: Renewal Notice (Days)
378
+ * * SQL Data Type: int
379
+ * * Description: Days of written notice we owe before a renewal price change, as stated in the agreement. NOT the same field as CancellationWindowDays even though many agreements set them equal — conflating them silently is how a notice obligation gets missed.`),
380
+ CancellationWindowDays: z.number().nullable().describe(`
381
+ * * Field Name: CancellationWindowDays
382
+ * * Display Name: Cancellation Window Days
383
+ * * SQL Data Type: int
384
+ * * Description: Days of notice the customer owes to cancel without renewing.`),
385
+ AnnualIncreasePercent: z.number().nullable().describe(`
386
+ * * Field Name: AnnualIncreasePercent
387
+ * * Display Name: Annual Increase Percent
388
+ * * SQL Data Type: decimal(7, 4)
389
+ * * Description: The negotiated year-over-year uplift. Exists here because it exists nowhere else: the orders schema has no escalation concept of any kind, which is why a two-year agreement stepping up 10% in year two is recorded in no other system.`),
390
+ HasModifications: z.boolean().describe(`
391
+ * * Field Name: HasModifications
392
+ * * Display Name: Has Modifications
393
+ * * SQL Data Type: bit
394
+ * * Default Value: 0
395
+ * * Description: Whether the standard agreement was changed for this customer. ASSERTED by a person, not derived — its job is to say "go read the PDF" BEFORE anyone has recorded the modifications, and a derived flag would read false for every contract nobody has processed yet. One direction IS enforced server-side: if modification rows exist this must be true. It is never cleared automatically.`),
396
+ Description: z.string().nullable().describe(`
397
+ * * Field Name: Description
398
+ * * Display Name: Description
399
+ * * SQL Data Type: nvarchar(MAX)`),
400
+ Notes: z.string().nullable().describe(`
401
+ * * Field Name: Notes
402
+ * * Display Name: Notes
403
+ * * SQL Data Type: nvarchar(MAX)
404
+ * * Description: Free-text working notes for whoever is processing the contract.`),
405
+ __mj_CreatedAt: z.date().describe(`
406
+ * * Field Name: __mj_CreatedAt
407
+ * * Display Name: Created At
408
+ * * SQL Data Type: datetimeoffset
409
+ * * Default Value: getutcdate()`),
410
+ __mj_UpdatedAt: z.date().describe(`
411
+ * * Field Name: __mj_UpdatedAt
412
+ * * Display Name: Updated At
413
+ * * SQL Data Type: datetimeoffset
414
+ * * Default Value: getutcdate()`),
415
+ PredictedNonRenewalRisk: z.number().nullable().describe(`
416
+ * * Field Name: PredictedNonRenewalRisk
417
+ * * Display Name: Predicted Non Renewal Risk
418
+ * * SQL Data Type: decimal(5, 4)
419
+ * * Description: Predicted probability (0.0000 to 1.0000) that this commercial agreement will fail to renew prior to the required notice deadline.`),
420
+ PredictedRenewalRiskBand: z.union([z.literal('Critical'), z.literal('High'), z.literal('Low'), z.literal('Medium')]).nullable().describe(`
421
+ * * Field Name: PredictedRenewalRiskBand
422
+ * * Display Name: Predicted Renewal Risk Band
423
+ * * SQL Data Type: nvarchar(20)
424
+ * * Value List Type: List
425
+ * * Possible Values
426
+ * * Critical
427
+ * * High
428
+ * * Low
429
+ * * Medium
430
+ * * Description: Derived operational risk band classifying renewal risk: Low (<20%), Medium (20-50%), High (50-80%), Critical (>=80%).`),
431
+ PredictedRenewalScoredAt: z.date().nullable().describe(`
432
+ * * Field Name: PredictedRenewalScoredAt
433
+ * * Display Name: Predicted Renewal Scored At
434
+ * * SQL Data Type: datetimeoffset
435
+ * * Description: Timestamp of the most recent predictive model scoring execution for this contract.`),
436
+ ContractType: z.string().describe(`
437
+ * * Field Name: ContractType
438
+ * * Display Name: Contract Type Name
439
+ * * SQL Data Type: nvarchar(100)`),
440
+ Company: z.string().describe(`
441
+ * * Field Name: Company
442
+ * * Display Name: Company Name
443
+ * * SQL Data Type: nvarchar(50)`),
444
+ CustomerOrganization: z.string().describe(`
445
+ * * Field Name: CustomerOrganization
446
+ * * Display Name: Customer Organization Name
447
+ * * SQL Data Type: nvarchar(255)`),
448
+ PrimaryContactPerson: z.string().nullable().describe(`
449
+ * * Field Name: PrimaryContactPerson
450
+ * * Display Name: Primary Contact Name
451
+ * * SQL Data Type: nvarchar(100)`),
452
+ ContractTemplate: z.string().nullable().describe(`
453
+ * * Field Name: ContractTemplate
454
+ * * Display Name: Contract Template Name
455
+ * * SQL Data Type: nvarchar(200)`),
456
+ CreatingEntity: z.string().nullable().describe(`
457
+ * * Field Name: CreatingEntity
458
+ * * Display Name: Creating Entity Name
459
+ * * SQL Data Type: nvarchar(255)`),
460
+ ParentContract: z.string().nullable().describe(`
461
+ * * Field Name: ParentContract
462
+ * * Display Name: Parent Contract
463
+ * * SQL Data Type: nvarchar(50)`),
464
+ SupersededByContract: z.string().nullable().describe(`
465
+ * * Field Name: SupersededByContract
466
+ * * Display Name: Superseded By Contract
467
+ * * SQL Data Type: nvarchar(50)`),
468
+ State: z.string().describe(`
469
+ * * Field Name: State
470
+ * * Display Name: State
471
+ * * SQL Data Type: varchar(10)`),
472
+ IsAwaitingDocument: z.boolean().nullable().describe(`
473
+ * * Field Name: IsAwaitingDocument
474
+ * * Display Name: Is Awaiting Document
475
+ * * SQL Data Type: bit`),
476
+ DaysToEnd: z.number().nullable().describe(`
477
+ * * Field Name: DaysToEnd
478
+ * * Display Name: Days To End
479
+ * * SQL Data Type: int`),
480
+ RenewalNoticeDeadline: z.date().nullable().describe(`
481
+ * * Field Name: RenewalNoticeDeadline
482
+ * * Display Name: Renewal Notice Deadline
483
+ * * SQL Data Type: date`),
484
+ IsInCancellationWindow: z.boolean().nullable().describe(`
485
+ * * Field Name: IsInCancellationWindow
486
+ * * Display Name: Is In Cancellation Window
487
+ * * SQL Data Type: bit`),
488
+ NonRenewalOutcome: z.number().nullable().describe(`
489
+ * * Field Name: NonRenewalOutcome
490
+ * * Display Name: Non Renewal Outcome
491
+ * * SQL Data Type: int`),
492
+ TermLengthDays: z.number().nullable().describe(`
493
+ * * Field Name: TermLengthDays
494
+ * * Display Name: Term Length Days
495
+ * * SQL Data Type: int`),
496
+ DaysUntilNoticeDeadline: z.number().nullable().describe(`
497
+ * * Field Name: DaysUntilNoticeDeadline
498
+ * * Display Name: Days Until Notice Deadline
499
+ * * SQL Data Type: int`),
500
+ HasModificationsFlag: z.number().describe(`
501
+ * * Field Name: HasModificationsFlag
502
+ * * Display Name: Has Modifications Flag
503
+ * * SQL Data Type: int`),
504
+ AutoRenewFlag: z.number().describe(`
505
+ * * Field Name: AutoRenewFlag
506
+ * * Display Name: Auto Renew Flag
507
+ * * SQL Data Type: int`),
508
+ HasParentContract: z.number().describe(`
509
+ * * Field Name: HasParentContract
510
+ * * Display Name: Has Parent Contract
511
+ * * SQL Data Type: int`),
512
+ HasCancellationWindow: z.number().describe(`
513
+ * * Field Name: HasCancellationWindow
514
+ * * Display Name: Has Cancellation Window
515
+ * * SQL Data Type: int`),
516
+ HasAnnualIncrease: z.number().describe(`
517
+ * * Field Name: HasAnnualIncrease
518
+ * * Display Name: Has Annual Increase
519
+ * * SQL Data Type: int`),
520
+ });
521
+ /**
522
+ * MJ_BizApps_Contracts: Contract Template Modifications - strongly typed entity sub-class
523
+ * * Schema: __mj_BizAppsContracts
524
+ * * Base Table: ContractTemplateModification
525
+ * * Base View: vwContractTemplateModifications
526
+ * * @description What THIS contract changed about the standard agreement. Deliberately lean: it names a provision and carries what the contract says instead. Carries no ContractTemplateID — the provision belongs to exactly one template in every future, so the template derives through the provision, and a stored copy of a derivation can only agree or lie.
527
+ * * Primary Key: ID
528
+ * @extends {BaseEntity}
529
+ * @class
530
+ * @public
531
+ */
532
+ let mjBizAppsContractsContractTemplateModificationEntity = class mjBizAppsContractsContractTemplateModificationEntity extends BaseEntity {
533
+ /**
534
+ * Loads the MJ_BizApps_Contracts: Contract Template Modifications record from the database
535
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Template Modifications record.
536
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
537
+ * @returns {Promise<boolean>} - true if successful, false otherwise
538
+ * @public
539
+ * @async
540
+ * @memberof mjBizAppsContractsContractTemplateModificationEntity
541
+ * @method
542
+ * @override
543
+ */
544
+ async Load(ID, EntityRelationshipsToLoad) {
545
+ const compositeKey = new CompositeKey();
546
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
547
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
548
+ }
549
+ /**
550
+ * Validate() method override for MJ_BizApps_Contracts: Contract Template Modifications entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
551
+ * * ModificationText: The modification text must contain actual text and cannot be empty or consist only of spaces.
552
+ * @public
553
+ * @method
554
+ * @override
555
+ */
556
+ Validate() {
557
+ const result = super.Validate();
558
+ this.ValidateModificationTextNotEmpty(result);
559
+ result.Success = result.Success && (result.Errors.length === 0);
560
+ return result;
561
+ }
562
+ /**
563
+ * The modification text must contain actual text and cannot be empty or consist only of spaces.
564
+ * @param result - the ValidationResult object to add any errors or warnings to
565
+ * @public
566
+ * @method
567
+ */
568
+ ValidateModificationTextNotEmpty(result) {
569
+ if (this.ModificationText == null || this.ModificationText.trim().length === 0) {
570
+ result.Errors.push(new ValidationErrorInfo("ModificationText", "Modification text cannot be empty or contain only whitespace.", this.ModificationText, ValidationErrorType.Failure));
571
+ }
572
+ }
573
+ /**
574
+ * * Field Name: ID
575
+ * * Display Name: ID
576
+ * * SQL Data Type: uniqueidentifier
577
+ * * Default Value: newsequentialid()
578
+ */
579
+ get ID() {
580
+ return this.Get('ID');
581
+ }
582
+ set ID(value) {
583
+ this.Set('ID', value);
584
+ }
585
+ /**
586
+ * * Field Name: ContractID
587
+ * * Display Name: Contract
588
+ * * SQL Data Type: uniqueidentifier
589
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
590
+ */
591
+ get ContractID() {
592
+ return this.Get('ContractID');
593
+ }
594
+ set ContractID(value) {
595
+ this.Set('ContractID', value);
596
+ }
597
+ /**
598
+ * * Field Name: ContractTemplateProvisionID
599
+ * * Display Name: Contract Template Provision
600
+ * * SQL Data Type: uniqueidentifier
601
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Template Provisions (vwContractTemplateProvisions.ID)
602
+ * * Description: The provision being modified — the structured identifier, and the only one. A server rule enforces what this replaces: the provision must belong to a template this contract incorporates.
603
+ */
604
+ get ContractTemplateProvisionID() {
605
+ return this.Get('ContractTemplateProvisionID');
606
+ }
607
+ set ContractTemplateProvisionID(value) {
608
+ this.Set('ContractTemplateProvisionID', value);
609
+ }
610
+ /**
611
+ * * Field Name: ModificationText
612
+ * * Display Name: Modification Text
613
+ * * SQL Data Type: nvarchar(MAX)
614
+ * * Description: What this contract says INSTEAD of the standard clause. Read as a pair with ContractTemplateProvision.ProvisionText.
615
+ */
616
+ get ModificationText() {
617
+ return this.Get('ModificationText');
618
+ }
619
+ set ModificationText(value) {
620
+ this.Set('ModificationText', value);
621
+ }
622
+ /**
623
+ * * Field Name: Notes
624
+ * * Display Name: Notes
625
+ * * SQL Data Type: nvarchar(MAX)
626
+ * * Description: Optional working note, e.g. who negotiated it.
627
+ */
628
+ get Notes() {
629
+ return this.Get('Notes');
630
+ }
631
+ set Notes(value) {
632
+ this.Set('Notes', value);
633
+ }
634
+ /**
635
+ * * Field Name: __mj_CreatedAt
636
+ * * Display Name: Created At
637
+ * * SQL Data Type: datetimeoffset
638
+ * * Default Value: getutcdate()
639
+ */
640
+ get __mj_CreatedAt() {
641
+ return this.Get('__mj_CreatedAt');
642
+ }
643
+ /**
644
+ * * Field Name: __mj_UpdatedAt
645
+ * * Display Name: Updated At
646
+ * * SQL Data Type: datetimeoffset
647
+ * * Default Value: getutcdate()
648
+ */
649
+ get __mj_UpdatedAt() {
650
+ return this.Get('__mj_UpdatedAt');
651
+ }
652
+ /**
653
+ * * Field Name: Contract
654
+ * * Display Name: Contract
655
+ * * SQL Data Type: nvarchar(50)
656
+ */
657
+ get Contract() {
658
+ return this.Get('Contract');
659
+ }
660
+ /**
661
+ * * Field Name: ContractTemplateProvision
662
+ * * Display Name: Contract Template Provision
663
+ * * SQL Data Type: nvarchar(20)
664
+ */
665
+ get ContractTemplateProvision() {
666
+ return this.Get('ContractTemplateProvision');
667
+ }
668
+ };
669
+ mjBizAppsContractsContractTemplateModificationEntity = __decorate([
670
+ RegisterClass(BaseEntity, 'MJ_BizApps_Contracts: Contract Template Modifications')
671
+ ], mjBizAppsContractsContractTemplateModificationEntity);
672
+ export { mjBizAppsContractsContractTemplateModificationEntity };
673
+ /**
674
+ * MJ_BizApps_Contracts: Contract Template Provisions - strongly typed entity sub-class
675
+ * * Schema: __mj_BizAppsContracts
676
+ * * Base Table: ContractTemplateProvision
677
+ * * Base View: vwContractTemplateProvisions
678
+ * * @description The numbered clause list of a template version, and the home of all standard contract text. Hangs off ContractTemplate rather than standing alone because provision numbering belongs to a VERSION — the moment a new version renumbers, a single global list is wrong.
679
+ * * Primary Key: ID
680
+ * @extends {BaseEntity}
681
+ * @class
682
+ * @public
683
+ */
684
+ let mjBizAppsContractsContractTemplateProvisionEntity = class mjBizAppsContractsContractTemplateProvisionEntity extends BaseEntity {
685
+ /**
686
+ * Loads the MJ_BizApps_Contracts: Contract Template Provisions record from the database
687
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Template Provisions record.
688
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
689
+ * @returns {Promise<boolean>} - true if successful, false otherwise
690
+ * @public
691
+ * @async
692
+ * @memberof mjBizAppsContractsContractTemplateProvisionEntity
693
+ * @method
694
+ * @override
695
+ */
696
+ async Load(ID, EntityRelationshipsToLoad) {
697
+ const compositeKey = new CompositeKey();
698
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
699
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
700
+ }
701
+ /**
702
+ * Validate() method override for MJ_BizApps_Contracts: Contract Template Provisions entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
703
+ * * ProvisionText: The provision text cannot be empty or consist only of spaces. It must contain actual text content.
704
+ * @public
705
+ * @method
706
+ * @override
707
+ */
708
+ Validate() {
709
+ const result = super.Validate();
710
+ this.ValidateProvisionTextNotEmpty(result);
711
+ result.Success = result.Success && (result.Errors.length === 0);
712
+ return result;
713
+ }
714
+ /**
715
+ * The provision text cannot be empty or consist only of spaces. It must contain actual text content.
716
+ * @param result - the ValidationResult object to add any errors or warnings to
717
+ * @public
718
+ * @method
719
+ */
720
+ ValidateProvisionTextNotEmpty(result) {
721
+ if (this.ProvisionText === undefined || this.ProvisionText === null || this.ProvisionText.trim().length === 0) {
722
+ result.Errors.push(new ValidationErrorInfo("ProvisionText", "Provision text cannot be empty or consist only of spaces.", this.ProvisionText, ValidationErrorType.Failure));
723
+ }
724
+ }
725
+ /**
726
+ * * Field Name: ID
727
+ * * Display Name: ID
728
+ * * SQL Data Type: uniqueidentifier
729
+ * * Default Value: newsequentialid()
730
+ */
731
+ get ID() {
732
+ return this.Get('ID');
733
+ }
734
+ set ID(value) {
735
+ this.Set('ID', value);
736
+ }
737
+ /**
738
+ * * Field Name: ContractTemplateID
739
+ * * Display Name: Contract Template
740
+ * * SQL Data Type: uniqueidentifier
741
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Templates (vwContractTemplates.ID)
742
+ */
743
+ get ContractTemplateID() {
744
+ return this.Get('ContractTemplateID');
745
+ }
746
+ set ContractTemplateID(value) {
747
+ this.Set('ContractTemplateID', value);
748
+ }
749
+ /**
750
+ * * Field Name: ProvisionNumber
751
+ * * Display Name: Provision Number
752
+ * * SQL Data Type: nvarchar(20)
753
+ * * Description: The clause number as the document writes it, e.g. "3.5(b)". Unique within its template.
754
+ */
755
+ get ProvisionNumber() {
756
+ return this.Get('ProvisionNumber');
757
+ }
758
+ set ProvisionNumber(value) {
759
+ this.Set('ProvisionNumber', value);
760
+ }
761
+ /**
762
+ * * Field Name: Title
763
+ * * Display Name: Title
764
+ * * SQL Data Type: nvarchar(200)
765
+ * * Description: The clause heading, e.g. "Limitation of Liability". This plus the number is what a person picks from.
766
+ */
767
+ get Title() {
768
+ return this.Get('Title');
769
+ }
770
+ set Title(value) {
771
+ this.Set('Title', value);
772
+ }
773
+ /**
774
+ * * Field Name: ProvisionText
775
+ * * Display Name: Provision Text
776
+ * * SQL Data Type: nvarchar(MAX)
777
+ * * Description: The STANDARD wording of this clause. Read as a pair with ContractTemplateModification.ModificationText, which holds what a given contract says instead — a dispute needs the comparison, not either half.
778
+ */
779
+ get ProvisionText() {
780
+ return this.Get('ProvisionText');
781
+ }
782
+ set ProvisionText(value) {
783
+ this.Set('ProvisionText', value);
784
+ }
785
+ /**
786
+ * * Field Name: Description
787
+ * * Display Name: Description
788
+ * * SQL Data Type: nvarchar(MAX)
789
+ */
790
+ get Description() {
791
+ return this.Get('Description');
792
+ }
793
+ set Description(value) {
794
+ this.Set('Description', value);
795
+ }
796
+ /**
797
+ * * Field Name: ProvisionSortKey
798
+ * * Display Name: Sort Key
799
+ * * SQL Data Type: nvarchar(200)
800
+ * * Description: Collation key derived from ProvisionNumber: every run of digits zero-padded to six places, everything else upper-cased. Makes a plain SQL ORDER BY produce natural order ('1.9' before '1.10'), which ordering by ProvisionNumber cannot. READ-ONLY -- a persisted computed column; nobody should be able to set a sort key. Replaced the hand-maintained Sequence column, which had already collided in the seeded data.
801
+ */
802
+ get ProvisionSortKey() {
803
+ return this.Get('ProvisionSortKey');
804
+ }
805
+ /**
806
+ * * Field Name: __mj_CreatedAt
807
+ * * Display Name: Created At
808
+ * * SQL Data Type: datetimeoffset
809
+ * * Default Value: getutcdate()
810
+ */
811
+ get __mj_CreatedAt() {
812
+ return this.Get('__mj_CreatedAt');
813
+ }
814
+ /**
815
+ * * Field Name: __mj_UpdatedAt
816
+ * * Display Name: Updated At
817
+ * * SQL Data Type: datetimeoffset
818
+ * * Default Value: getutcdate()
819
+ */
820
+ get __mj_UpdatedAt() {
821
+ return this.Get('__mj_UpdatedAt');
822
+ }
823
+ /**
824
+ * * Field Name: ContractTemplate
825
+ * * Display Name: Contract Template Name
826
+ * * SQL Data Type: nvarchar(200)
827
+ */
828
+ get ContractTemplate() {
829
+ return this.Get('ContractTemplate');
830
+ }
831
+ };
832
+ mjBizAppsContractsContractTemplateProvisionEntity = __decorate([
833
+ RegisterClass(BaseEntity, 'MJ_BizApps_Contracts: Contract Template Provisions')
834
+ ], mjBizAppsContractsContractTemplateProvisionEntity);
835
+ export { mjBizAppsContractsContractTemplateProvisionEntity };
836
+ /**
837
+ * MJ_BizApps_Contracts: Contract Template Types - strongly typed entity sub-class
838
+ * * Schema: __mj_BizAppsContracts
839
+ * * Base Table: ContractTemplateType
840
+ * * Base View: vwContractTemplateTypes
841
+ * * @description The kind of standard agreement (Master Agreement, Statement of Work). A lookup TABLE rather than a CHECK because the list is additive at runtime and a business user should be able to add one without a migration. Carries no behaviour.
842
+ * * Primary Key: ID
843
+ * @extends {BaseEntity}
844
+ * @class
845
+ * @public
846
+ */
847
+ let mjBizAppsContractsContractTemplateTypeEntity = class mjBizAppsContractsContractTemplateTypeEntity extends BaseEntity {
848
+ /**
849
+ * Loads the MJ_BizApps_Contracts: Contract Template Types record from the database
850
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Template Types record.
851
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
852
+ * @returns {Promise<boolean>} - true if successful, false otherwise
853
+ * @public
854
+ * @async
855
+ * @memberof mjBizAppsContractsContractTemplateTypeEntity
856
+ * @method
857
+ * @override
858
+ */
859
+ async Load(ID, EntityRelationshipsToLoad) {
860
+ const compositeKey = new CompositeKey();
861
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
862
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
863
+ }
864
+ /**
865
+ * * Field Name: ID
866
+ * * Display Name: ID
867
+ * * SQL Data Type: uniqueidentifier
868
+ * * Default Value: newsequentialid()
869
+ */
870
+ get ID() {
871
+ return this.Get('ID');
872
+ }
873
+ set ID(value) {
874
+ this.Set('ID', value);
875
+ }
876
+ /**
877
+ * * Field Name: Name
878
+ * * Display Name: Name
879
+ * * SQL Data Type: nvarchar(100)
880
+ */
881
+ get Name() {
882
+ return this.Get('Name');
883
+ }
884
+ set Name(value) {
885
+ this.Set('Name', value);
886
+ }
887
+ /**
888
+ * * Field Name: Description
889
+ * * Display Name: Description
890
+ * * SQL Data Type: nvarchar(MAX)
891
+ */
892
+ get Description() {
893
+ return this.Get('Description');
894
+ }
895
+ set Description(value) {
896
+ this.Set('Description', value);
897
+ }
898
+ /**
899
+ * * Field Name: Status
900
+ * * Display Name: Status
901
+ * * SQL Data Type: nvarchar(10)
902
+ * * Default Value: Active
903
+ * * Value List Type: List
904
+ * * Possible Values
905
+ * * Active
906
+ * * Inactive
907
+ * * Description: Active | Inactive. Retiring a type hides it from pickers without touching the templates that used it.
908
+ */
909
+ get Status() {
910
+ return this.Get('Status');
911
+ }
912
+ set Status(value) {
913
+ this.Set('Status', value);
914
+ }
915
+ /**
916
+ * * Field Name: __mj_CreatedAt
917
+ * * Display Name: Created At
918
+ * * SQL Data Type: datetimeoffset
919
+ * * Default Value: getutcdate()
920
+ */
921
+ get __mj_CreatedAt() {
922
+ return this.Get('__mj_CreatedAt');
923
+ }
924
+ /**
925
+ * * Field Name: __mj_UpdatedAt
926
+ * * Display Name: Updated At
927
+ * * SQL Data Type: datetimeoffset
928
+ * * Default Value: getutcdate()
929
+ */
930
+ get __mj_UpdatedAt() {
931
+ return this.Get('__mj_UpdatedAt');
932
+ }
933
+ };
934
+ mjBizAppsContractsContractTemplateTypeEntity = __decorate([
935
+ RegisterClass(BaseEntity, 'MJ_BizApps_Contracts: Contract Template Types')
936
+ ], mjBizAppsContractsContractTemplateTypeEntity);
937
+ export { mjBizAppsContractsContractTemplateTypeEntity };
938
+ /**
939
+ * MJ_BizApps_Contracts: Contract Templates - strongly typed entity sub-class
940
+ * * Schema: __mj_BizAppsContracts
941
+ * * Base Table: ContractTemplate
942
+ * * Base View: vwContractTemplates
943
+ * * @description One VERSION of a standard agreement — in practice the Master Agreement. Versions matter because each is published at its own dated URL that never goes away, so a customer stays bound to the text they signed. Carries no prose of its own: every clauses standard wording lives on its ContractTemplateProvision row.
944
+ * * Primary Key: ID
945
+ * @extends {BaseEntity}
946
+ * @class
947
+ * @public
948
+ */
949
+ let mjBizAppsContractsContractTemplateEntity = class mjBizAppsContractsContractTemplateEntity extends BaseEntity {
950
+ constructor() {
951
+ super(...arguments);
952
+ /**
953
+ * Related records: MJ_BizApps_Contracts: Contract Template Provisions
954
+ *
955
+ * Loads, validates and persists as one unit with this MJ_BizApps_Contracts: Contract Templates record — see
956
+ * guides/TRANSACTIONS_AND_BATCHING_GUIDE.md. Declared by the RelatedRecordCollection metadata on
957
+ * the 'MJ_BizApps_Contracts: Contract Templates → MJ_BizApps_Contracts: Contract Template Provisions' relationship; edit that row, not this file.
958
+ *
959
+ */
960
+ this.Provisions = this.DeclareRelatedRecords({
961
+ Name: 'Provisions',
962
+ RelatedEntity: 'MJ_BizApps_Contracts: Contract Template Provisions',
963
+ RelatedEntityJoinField: 'ContractTemplateID',
964
+ OrderBy: 'ProvisionSortKey ASC',
965
+ Load: 'explicit',
966
+ OnRemove: 'delete',
967
+ Source: 'database',
968
+ });
969
+ }
970
+ /**
971
+ * Loads the MJ_BizApps_Contracts: Contract Templates record from the database
972
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Templates record.
973
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
974
+ * @returns {Promise<boolean>} - true if successful, false otherwise
975
+ * @public
976
+ * @async
977
+ * @memberof mjBizAppsContractsContractTemplateEntity
978
+ * @method
979
+ * @override
980
+ */
981
+ async Load(ID, EntityRelationshipsToLoad) {
982
+ const compositeKey = new CompositeKey();
983
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
984
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
985
+ }
986
+ /**
987
+ * * Field Name: ID
988
+ * * Display Name: ID
989
+ * * SQL Data Type: uniqueidentifier
990
+ * * Default Value: newsequentialid()
991
+ */
992
+ get ID() {
993
+ return this.Get('ID');
994
+ }
995
+ set ID(value) {
996
+ this.Set('ID', value);
997
+ }
998
+ /**
999
+ * * Field Name: Name
1000
+ * * Display Name: Name
1001
+ * * SQL Data Type: nvarchar(200)
1002
+ */
1003
+ get Name() {
1004
+ return this.Get('Name');
1005
+ }
1006
+ set Name(value) {
1007
+ this.Set('Name', value);
1008
+ }
1009
+ /**
1010
+ * * Field Name: ContractTemplateTypeID
1011
+ * * Display Name: Template Type ID
1012
+ * * SQL Data Type: uniqueidentifier
1013
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Template Types (vwContractTemplateTypes.ID)
1014
+ */
1015
+ get ContractTemplateTypeID() {
1016
+ return this.Get('ContractTemplateTypeID');
1017
+ }
1018
+ set ContractTemplateTypeID(value) {
1019
+ this.Set('ContractTemplateTypeID', value);
1020
+ }
1021
+ /**
1022
+ * * Field Name: VersionLabel
1023
+ * * Display Name: Version Label
1024
+ * * SQL Data Type: nvarchar(50)
1025
+ * * Description: The version the document names itself, e.g. "v6". Free text, because it is the documents own label rather than something we derive.
1026
+ */
1027
+ get VersionLabel() {
1028
+ return this.Get('VersionLabel');
1029
+ }
1030
+ set VersionLabel(value) {
1031
+ this.Set('VersionLabel', value);
1032
+ }
1033
+ /**
1034
+ * * Field Name: IntroducedDate
1035
+ * * Display Name: Introduced Date
1036
+ * * SQL Data Type: date
1037
+ * * Description: When this version started being offered. NOT an effective date: a template becomes effective for a customer when THAT customer signs it, never on a calendar date. Naming it EffectiveDate would invite exactly the wrong query.
1038
+ */
1039
+ get IntroducedDate() {
1040
+ return this.Get('IntroducedDate');
1041
+ }
1042
+ set IntroducedDate(value) {
1043
+ this.Set('IntroducedDate', value);
1044
+ }
1045
+ /**
1046
+ * * Field Name: SourceURL
1047
+ * * Display Name: Source URL
1048
+ * * SQL Data Type: nvarchar(1000)
1049
+ * * Description: The dated public URL a customer can open to read the standard terms. NULLABLE: reachability is enforceable by nothing (a well-formed dead link passes any format check), and the real rule is "a URL OR an attached file" — the file half attaching through __mj.FileEntityRecordLink, which cannot reference a record that does not exist yet, so on CREATE it is unsatisfiable in principle. A template with neither is INCOMPLETE rather than invalid; the derived IsUsable column on vwContractTemplates is what says so.
1050
+ */
1051
+ get SourceURL() {
1052
+ return this.Get('SourceURL');
1053
+ }
1054
+ set SourceURL(value) {
1055
+ this.Set('SourceURL', value);
1056
+ }
1057
+ /**
1058
+ * * Field Name: Description
1059
+ * * Display Name: Description
1060
+ * * SQL Data Type: nvarchar(MAX)
1061
+ */
1062
+ get Description() {
1063
+ return this.Get('Description');
1064
+ }
1065
+ set Description(value) {
1066
+ this.Set('Description', value);
1067
+ }
1068
+ /**
1069
+ * * Field Name: Status
1070
+ * * Display Name: Status
1071
+ * * SQL Data Type: nvarchar(20)
1072
+ * * Default Value: Draft
1073
+ * * Value List Type: List
1074
+ * * Possible Values
1075
+ * * Draft
1076
+ * * Published
1077
+ * * Description: Publication lifecycle. 'Draft' -- freely editable, provisions may be added, changed and removed, and a contract may not NEWLY reference it. 'Published' -- the provisions are frozen against INSERT, UPDATE and DELETE by trg_ContractTemplateProvision_Immutability, and contracts may reference it. Publishing is ONE-WAY (enforced in ContractTemplateEntity): to change published terms, publish a new version -- that is what VersionLabel exists for. Existing references are never invalidated by this column; only new ones are policed, the same way ContractType.Status works.
1078
+ */
1079
+ get Status() {
1080
+ return this.Get('Status');
1081
+ }
1082
+ set Status(value) {
1083
+ this.Set('Status', value);
1084
+ }
1085
+ /**
1086
+ * * Field Name: __mj_CreatedAt
1087
+ * * Display Name: Created At
1088
+ * * SQL Data Type: datetimeoffset
1089
+ * * Default Value: getutcdate()
1090
+ */
1091
+ get __mj_CreatedAt() {
1092
+ return this.Get('__mj_CreatedAt');
1093
+ }
1094
+ /**
1095
+ * * Field Name: __mj_UpdatedAt
1096
+ * * Display Name: Updated At
1097
+ * * SQL Data Type: datetimeoffset
1098
+ * * Default Value: getutcdate()
1099
+ */
1100
+ get __mj_UpdatedAt() {
1101
+ return this.Get('__mj_UpdatedAt');
1102
+ }
1103
+ /**
1104
+ * * Field Name: ContractTemplateType
1105
+ * * Display Name: Template Type
1106
+ * * SQL Data Type: nvarchar(100)
1107
+ */
1108
+ get ContractTemplateType() {
1109
+ return this.Get('ContractTemplateType');
1110
+ }
1111
+ /**
1112
+ * * Field Name: IsUsable
1113
+ * * Display Name: Is Usable
1114
+ * * SQL Data Type: bit
1115
+ */
1116
+ get IsUsable() {
1117
+ return this.Get('IsUsable');
1118
+ }
1119
+ };
1120
+ mjBizAppsContractsContractTemplateEntity = __decorate([
1121
+ RegisterClass(BaseEntity, 'MJ_BizApps_Contracts: Contract Templates')
1122
+ ], mjBizAppsContractsContractTemplateEntity);
1123
+ export { mjBizAppsContractsContractTemplateEntity };
1124
+ /**
1125
+ * MJ_BizApps_Contracts: Contract Types - strongly typed entity sub-class
1126
+ * * Schema: __mj_BizAppsContracts
1127
+ * * Base Table: ContractType
1128
+ * * Base View: vwContractTypes
1129
+ * * @description The kind of paper: Order Form, Statement of Work, Payment Link, Change Order. A lookup TABLE for the same reason as ContractTemplateType.
1130
+ * * Primary Key: ID
1131
+ * @extends {BaseEntity}
1132
+ * @class
1133
+ * @public
1134
+ */
1135
+ let mjBizAppsContractsContractTypeEntity = class mjBizAppsContractsContractTypeEntity extends BaseEntity {
1136
+ /**
1137
+ * Loads the MJ_BizApps_Contracts: Contract Types record from the database
1138
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Types record.
1139
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
1140
+ * @returns {Promise<boolean>} - true if successful, false otherwise
1141
+ * @public
1142
+ * @async
1143
+ * @memberof mjBizAppsContractsContractTypeEntity
1144
+ * @method
1145
+ * @override
1146
+ */
1147
+ async Load(ID, EntityRelationshipsToLoad) {
1148
+ const compositeKey = new CompositeKey();
1149
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
1150
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
1151
+ }
1152
+ /**
1153
+ * Validate() method override for MJ_BizApps_Contracts: Contract Types entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
1154
+ * * Table-Level: An entity cannot be designated as both a root and a child at the same time.
1155
+ * @public
1156
+ * @method
1157
+ * @override
1158
+ */
1159
+ Validate() {
1160
+ const result = super.Validate();
1161
+ this.ValidateRootAndChildExclusivity(result);
1162
+ result.Success = result.Success && (result.Errors.length === 0);
1163
+ return result;
1164
+ }
1165
+ /**
1166
+ * An entity cannot be designated as both a root and a child at the same time.
1167
+ * @param result - the ValidationResult object to add any errors or warnings to
1168
+ * @public
1169
+ * @method
1170
+ */
1171
+ ValidateRootAndChildExclusivity(result) {
1172
+ if (this.MustBeRoot && this.MustBeChild) {
1173
+ result.Errors.push(new ValidationErrorInfo("MustBeRoot", "An entity cannot be designated as both a root and a child at the same time.", this.MustBeRoot, ValidationErrorType.Failure));
1174
+ }
1175
+ }
1176
+ /**
1177
+ * * Field Name: ID
1178
+ * * Display Name: ID
1179
+ * * SQL Data Type: uniqueidentifier
1180
+ * * Default Value: newsequentialid()
1181
+ */
1182
+ get ID() {
1183
+ return this.Get('ID');
1184
+ }
1185
+ set ID(value) {
1186
+ this.Set('ID', value);
1187
+ }
1188
+ /**
1189
+ * * Field Name: Name
1190
+ * * Display Name: Name
1191
+ * * SQL Data Type: nvarchar(100)
1192
+ */
1193
+ get Name() {
1194
+ return this.Get('Name');
1195
+ }
1196
+ set Name(value) {
1197
+ this.Set('Name', value);
1198
+ }
1199
+ /**
1200
+ * * Field Name: Description
1201
+ * * Display Name: Description
1202
+ * * SQL Data Type: nvarchar(MAX)
1203
+ */
1204
+ get Description() {
1205
+ return this.Get('Description');
1206
+ }
1207
+ set Description(value) {
1208
+ this.Set('Description', value);
1209
+ }
1210
+ /**
1211
+ * * Field Name: RequiresExecutedDocument
1212
+ * * Display Name: Requires Executed Document
1213
+ * * SQL Data Type: bit
1214
+ * * Default Value: 1
1215
+ * * Description: Whether paper is ever expected for this kind of contract. No for a Payment Link, which has an implied agreement and no signature. This is what stops such a contract asking forever for a document that will never arrive: "awaiting the document" is DERIVED as requires-it AND no-linked-file, never stored and never a status value.
1216
+ */
1217
+ get RequiresExecutedDocument() {
1218
+ return this.Get('RequiresExecutedDocument');
1219
+ }
1220
+ set RequiresExecutedDocument(value) {
1221
+ this.Set('RequiresExecutedDocument', value);
1222
+ }
1223
+ /**
1224
+ * * Field Name: Status
1225
+ * * Display Name: Status
1226
+ * * SQL Data Type: nvarchar(10)
1227
+ * * Default Value: Active
1228
+ * * Value List Type: List
1229
+ * * Possible Values
1230
+ * * Active
1231
+ * * Inactive
1232
+ * * Description: Active | Inactive.
1233
+ */
1234
+ get Status() {
1235
+ return this.Get('Status');
1236
+ }
1237
+ set Status(value) {
1238
+ this.Set('Status', value);
1239
+ }
1240
+ /**
1241
+ * * Field Name: MustBeRoot
1242
+ * * Display Name: Must Be Root
1243
+ * * SQL Data Type: bit
1244
+ * * Default Value: 0
1245
+ * * Description: This type of contract may NOT name a ParentContractID -- it is a root agreement. Enforced in ContractEntityServer.ValidateAsync. Mutually exclusive with MustBeChild (CK_ContractType_RootOrChild); both false means no restriction on where in the tree this type may sit, which is the honest default.
1246
+ */
1247
+ get MustBeRoot() {
1248
+ return this.Get('MustBeRoot');
1249
+ }
1250
+ set MustBeRoot(value) {
1251
+ this.Set('MustBeRoot', value);
1252
+ }
1253
+ /**
1254
+ * * Field Name: MustBeChild
1255
+ * * Display Name: Must Be Child
1256
+ * * SQL Data Type: bit
1257
+ * * Default Value: 0
1258
+ * * Description: This type of contract MUST name a ParentContractID -- a Change Order that amends nothing is not a change order, and would never appear in the original agreement's lineage. Enforced in ContractEntityServer.ValidateAsync. Mutually exclusive with MustBeRoot.
1259
+ */
1260
+ get MustBeChild() {
1261
+ return this.Get('MustBeChild');
1262
+ }
1263
+ set MustBeChild(value) {
1264
+ this.Set('MustBeChild', value);
1265
+ }
1266
+ /**
1267
+ * * Field Name: TemplateRequired
1268
+ * * Display Name: Template Required
1269
+ * * SQL Data Type: bit
1270
+ * * Default Value: 0
1271
+ * * Description: This type of contract must carry its own ContractTemplateID -- the standard terms it incorporates. On the TYPE rather than inferred from the placement flags, because 'where in the tree' and 'does it need its own paper' are different questions and a future type could want any combination.
1272
+ */
1273
+ get TemplateRequired() {
1274
+ return this.Get('TemplateRequired');
1275
+ }
1276
+ set TemplateRequired(value) {
1277
+ this.Set('TemplateRequired', value);
1278
+ }
1279
+ /**
1280
+ * * Field Name: __mj_CreatedAt
1281
+ * * Display Name: Created At
1282
+ * * SQL Data Type: datetimeoffset
1283
+ * * Default Value: getutcdate()
1284
+ */
1285
+ get __mj_CreatedAt() {
1286
+ return this.Get('__mj_CreatedAt');
1287
+ }
1288
+ /**
1289
+ * * Field Name: __mj_UpdatedAt
1290
+ * * Display Name: Updated At
1291
+ * * SQL Data Type: datetimeoffset
1292
+ * * Default Value: getutcdate()
1293
+ */
1294
+ get __mj_UpdatedAt() {
1295
+ return this.Get('__mj_UpdatedAt');
1296
+ }
1297
+ };
1298
+ mjBizAppsContractsContractTypeEntity = __decorate([
1299
+ RegisterClass(BaseEntity, 'MJ_BizApps_Contracts: Contract Types')
1300
+ ], mjBizAppsContractsContractTypeEntity);
1301
+ export { mjBizAppsContractsContractTypeEntity };
1302
+ /**
1303
+ * MJ_BizApps_Contracts: Contracts - strongly typed entity sub-class
1304
+ * * Schema: __mj_BizAppsContracts
1305
+ * * Base Table: Contract
1306
+ * * Base View: vwContracts
1307
+ * * @description The signed agreement — one row per piece of signed (or implied) paper, and the centre of the app. Carries NO hard reference to a Deal: sales creates contracts, so sales depends on this app and a reference upward would invert the dependency graph. The link is the typed polymorphic pair CreatingEntityID + CreatingRecordID.
1308
+ * * Primary Key: ID
1309
+ * @extends {BaseEntity}
1310
+ * @class
1311
+ * @public
1312
+ */
1313
+ let mjBizAppsContractsContractEntity = class mjBizAppsContractsContractEntity extends BaseEntity {
1314
+ constructor() {
1315
+ super(...arguments);
1316
+ /**
1317
+ * Related records: MJ_BizApps_Contracts: Contract Template Modifications
1318
+ *
1319
+ * Loads, validates and persists as one unit with this MJ_BizApps_Contracts: Contracts record — see
1320
+ * guides/TRANSACTIONS_AND_BATCHING_GUIDE.md. Declared by the RelatedRecordCollection metadata on
1321
+ * the 'MJ_BizApps_Contracts: Contracts → MJ_BizApps_Contracts: Contract Template Modifications' relationship; edit that row, not this file.
1322
+ *
1323
+ */
1324
+ this.Modifications = this.DeclareRelatedRecords({
1325
+ Name: 'Modifications',
1326
+ RelatedEntity: 'MJ_BizApps_Contracts: Contract Template Modifications',
1327
+ RelatedEntityJoinField: 'ContractID',
1328
+ OrderBy: '__mj_CreatedAt ASC',
1329
+ Load: 'explicit',
1330
+ OnRemove: 'delete',
1331
+ Source: 'database',
1332
+ });
1333
+ }
1334
+ /**
1335
+ * Loads the MJ_BizApps_Contracts: Contracts record from the database
1336
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contracts record.
1337
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
1338
+ * @returns {Promise<boolean>} - true if successful, false otherwise
1339
+ * @public
1340
+ * @async
1341
+ * @memberof mjBizAppsContractsContractEntity
1342
+ * @method
1343
+ * @override
1344
+ */
1345
+ async Load(ID, EntityRelationshipsToLoad) {
1346
+ const compositeKey = new CompositeKey();
1347
+ compositeKey.KeyValuePairs.push({ FieldName: 'ID', Value: ID });
1348
+ return await super.InnerLoad(compositeKey, EntityRelationshipsToLoad);
1349
+ }
1350
+ /**
1351
+ * Validate() method override for MJ_BizApps_Contracts: Contracts entity. This is an auto-generated method that invokes the generated validators for this entity for the following fields:
1352
+ * * AnnualIncreasePercent: The annual increase percentage must be greater than or equal to zero, ensuring that contract rates do not decrease automatically.
1353
+ * * CancellationWindowDays: The cancellation window days must be zero or a positive number, ensuring that we do not record a negative number of days for the contract cancellation period.
1354
+ * * RenewalNoticeDays: Renewal notice days must be 0 or greater, if specified.
1355
+ * * Table-Level: Both Creating Entity ID and Creating Record ID must be provided together, or both must be left empty, to ensure consistent tracking of the source entity and record.
1356
+ * * Table-Level: The contract end date must be on or after the effective date to ensure logical date ordering.
1357
+ * * Table-Level: A contract cannot be its own parent contract to prevent circular references in the contract hierarchy.
1358
+ * * Table-Level: A contract cannot be superseded by itself. The superseding contract must be a different contract record.
1359
+ * @public
1360
+ * @method
1361
+ * @override
1362
+ */
1363
+ Validate() {
1364
+ const result = super.Validate();
1365
+ this.ValidateAnnualIncreasePercentNonNegative(result);
1366
+ this.ValidateCancellationWindowDaysGreaterThanOrEqualToZero(result);
1367
+ this.ValidateRenewalNoticeDaysGreaterThanOrEqualToZero(result);
1368
+ this.ValidateCreatingEntityAndRecordCoexistence(result);
1369
+ this.ValidateEndDateAfterOrEqualToEffectiveDate(result);
1370
+ this.ValidateParentContractIDNotEqualToID(result);
1371
+ this.ValidateSupersededByContractIDNotEqualToID(result);
1372
+ result.Success = result.Success && (result.Errors.length === 0);
1373
+ return result;
1374
+ }
1375
+ /**
1376
+ * The annual increase percentage must be greater than or equal to zero, ensuring that contract rates do not decrease automatically.
1377
+ * @param result - the ValidationResult object to add any errors or warnings to
1378
+ * @public
1379
+ * @method
1380
+ */
1381
+ ValidateAnnualIncreasePercentNonNegative(result) {
1382
+ if (this.AnnualIncreasePercent != null && this.AnnualIncreasePercent < 0) {
1383
+ result.Errors.push(new ValidationErrorInfo("AnnualIncreasePercent", "Annual increase percentage must be greater than or equal to 0.", this.AnnualIncreasePercent, ValidationErrorType.Failure));
1384
+ }
1385
+ }
1386
+ /**
1387
+ * The cancellation window days must be zero or a positive number, ensuring that we do not record a negative number of days for the contract cancellation period.
1388
+ * @param result - the ValidationResult object to add any errors or warnings to
1389
+ * @public
1390
+ * @method
1391
+ */
1392
+ ValidateCancellationWindowDaysGreaterThanOrEqualToZero(result) {
1393
+ if (this.CancellationWindowDays != null && this.CancellationWindowDays < 0) {
1394
+ result.Errors.push(new ValidationErrorInfo("CancellationWindowDays", "Cancellation window days must be 0 or a positive number.", this.CancellationWindowDays, ValidationErrorType.Failure));
1395
+ }
1396
+ }
1397
+ /**
1398
+ * Renewal notice days must be 0 or greater, if specified.
1399
+ * @param result - the ValidationResult object to add any errors or warnings to
1400
+ * @public
1401
+ * @method
1402
+ */
1403
+ ValidateRenewalNoticeDaysGreaterThanOrEqualToZero(result) {
1404
+ if (this.RenewalNoticeDays != null && this.RenewalNoticeDays < 0) {
1405
+ result.Errors.push(new ValidationErrorInfo("RenewalNoticeDays", "Renewal notice days must be 0 or greater.", this.RenewalNoticeDays, ValidationErrorType.Failure));
1406
+ }
1407
+ }
1408
+ /**
1409
+ * Both Creating Entity ID and Creating Record ID must be provided together, or both must be left empty, to ensure consistent tracking of the source entity and record.
1410
+ * @param result - the ValidationResult object to add any errors or warnings to
1411
+ * @public
1412
+ * @method
1413
+ */
1414
+ ValidateCreatingEntityAndRecordCoexistence(result) {
1415
+ const hasEntity = this.CreatingEntityID != null;
1416
+ const hasRecord = this.CreatingRecordID != null && this.CreatingRecordID !== "";
1417
+ if (hasEntity !== hasRecord) {
1418
+ result.Errors.push(new ValidationErrorInfo("CreatingEntityID", "Creating Entity ID and Creating Record ID must either both be specified or both be empty.", this.CreatingEntityID, ValidationErrorType.Failure));
1419
+ }
1420
+ }
1421
+ /**
1422
+ * The contract end date must be on or after the effective date to ensure logical date ordering.
1423
+ * @param result - the ValidationResult object to add any errors or warnings to
1424
+ * @public
1425
+ * @method
1426
+ */
1427
+ ValidateEndDateAfterOrEqualToEffectiveDate(result) {
1428
+ if (this.EndDate != null && this.EffectiveDate != null) {
1429
+ if (this.EndDate < this.EffectiveDate) {
1430
+ result.Errors.push(new ValidationErrorInfo("EndDate", "The contract End Date must be on or after the Effective Date.", this.EndDate, ValidationErrorType.Failure));
1431
+ }
1432
+ }
1433
+ }
1434
+ /**
1435
+ * A contract cannot be its own parent contract to prevent circular references in the contract hierarchy.
1436
+ * @param result - the ValidationResult object to add any errors or warnings to
1437
+ * @public
1438
+ * @method
1439
+ */
1440
+ ValidateParentContractIDNotEqualToID(result) {
1441
+ if (this.ParentContractID != null && this.ParentContractID === this.ID) {
1442
+ result.Errors.push(new ValidationErrorInfo("ParentContractID", "A contract cannot be its own parent contract.", this.ParentContractID, ValidationErrorType.Failure));
1443
+ }
1444
+ }
1445
+ /**
1446
+ * A contract cannot be superseded by itself. The superseding contract must be a different contract record.
1447
+ * @param result - the ValidationResult object to add any errors or warnings to
1448
+ * @public
1449
+ * @method
1450
+ */
1451
+ ValidateSupersededByContractIDNotEqualToID(result) {
1452
+ if (this.SupersededByContractID != null && this.SupersededByContractID === this.ID) {
1453
+ result.Errors.push(new ValidationErrorInfo("SupersededByContractID", "A contract cannot be superseded by itself. Please select a different contract.", this.SupersededByContractID, ValidationErrorType.Failure));
1454
+ }
1455
+ }
1456
+ /**
1457
+ * * Field Name: ID
1458
+ * * Display Name: ID
1459
+ * * SQL Data Type: uniqueidentifier
1460
+ * * Default Value: newsequentialid()
1461
+ */
1462
+ get ID() {
1463
+ return this.Get('ID');
1464
+ }
1465
+ set ID(value) {
1466
+ this.Set('ID', value);
1467
+ }
1468
+ /**
1469
+ * * Field Name: ContractNumber
1470
+ * * Display Name: Contract Number
1471
+ * * SQL Data Type: nvarchar(50)
1472
+ * * Description: CTR-000001, minted by spAssignNextContractNumber from the seq_ContractNumber database SEQUENCE. Unique. NULLABLE at the schema level because MJ cannot express 'NOT NULL, assigned by the server on insert' -- ContractEntityServer.Save() is what guarantees every contract has one. Gaps are normal and are not to be 'fixed': a save that fails after taking a number leaves one behind, and UQ_Contract_ContractNumber is what guarantees no two contracts share a number.
1473
+ */
1474
+ get ContractNumber() {
1475
+ return this.Get('ContractNumber');
1476
+ }
1477
+ set ContractNumber(value) {
1478
+ this.Set('ContractNumber', value);
1479
+ }
1480
+ /**
1481
+ * * Field Name: ContractTypeID
1482
+ * * Display Name: Contract Type
1483
+ * * SQL Data Type: uniqueidentifier
1484
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Types (vwContractTypes.ID)
1485
+ */
1486
+ get ContractTypeID() {
1487
+ return this.Get('ContractTypeID');
1488
+ }
1489
+ set ContractTypeID(value) {
1490
+ this.Set('ContractTypeID', value);
1491
+ }
1492
+ /**
1493
+ * * Field Name: CompanyID
1494
+ * * Display Name: Company
1495
+ * * SQL Data Type: uniqueidentifier
1496
+ * * Related Entity/Foreign Key: MJ: Companies (vwCompanies.ID)
1497
+ * * Description: The SELLING company (__mj.Company) — which of OUR entities holds this agreement. Not the customer. Stored rather than derived because it is not reliably recoverable from the deal.
1498
+ */
1499
+ get CompanyID() {
1500
+ return this.Get('CompanyID');
1501
+ }
1502
+ set CompanyID(value) {
1503
+ this.Set('CompanyID', value);
1504
+ }
1505
+ /**
1506
+ * * Field Name: CustomerOrganizationID
1507
+ * * Display Name: Customer Organization
1508
+ * * SQL Data Type: uniqueidentifier
1509
+ * * Related Entity/Foreign Key: MJ_BizApps_Common: Organizations (vwOrganizations.ID)
1510
+ * * Description: The customer. NOT NULL: contracts are B2B here by definition, and the individual case lives entirely in orders. v1 allowed an organization-or-person XOR; that is gone.
1511
+ */
1512
+ get CustomerOrganizationID() {
1513
+ return this.Get('CustomerOrganizationID');
1514
+ }
1515
+ set CustomerOrganizationID(value) {
1516
+ this.Set('CustomerOrganizationID', value);
1517
+ }
1518
+ /**
1519
+ * * Field Name: PrimaryContactPersonID
1520
+ * * Display Name: Primary Contact Person
1521
+ * * SQL Data Type: uniqueidentifier
1522
+ * * Related Entity/Foreign Key: MJ_BizApps_Common: People (vwPeople.ID)
1523
+ * * Description: Their named contact, optional.
1524
+ */
1525
+ get PrimaryContactPersonID() {
1526
+ return this.Get('PrimaryContactPersonID');
1527
+ }
1528
+ set PrimaryContactPersonID(value) {
1529
+ this.Set('PrimaryContactPersonID', value);
1530
+ }
1531
+ /**
1532
+ * * Field Name: ContractTemplateID
1533
+ * * Display Name: Contract Template
1534
+ * * SQL Data Type: uniqueidentifier
1535
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Templates (vwContractTemplates.ID)
1536
+ * * Description: The agreement version this contract incorporates. Nullable because a contract created automatically at Closed Won has none until finance reads the PDF.
1537
+ */
1538
+ get ContractTemplateID() {
1539
+ return this.Get('ContractTemplateID');
1540
+ }
1541
+ set ContractTemplateID(value) {
1542
+ this.Set('ContractTemplateID', value);
1543
+ }
1544
+ /**
1545
+ * * Field Name: CreatingEntityID
1546
+ * * Display Name: Creating Entity
1547
+ * * SQL Data Type: uniqueidentifier
1548
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
1549
+ * * Description: Polymorphic reference part 1: the MJ Entity of the record that CREATED this contract, in practice Deals. A real foreign key to __mj.Entity — this is the half that is enforced, and the half that lets MJ resolve the pair generically. Same pattern accounting uses for JournalEntry provenance.
1550
+ */
1551
+ get CreatingEntityID() {
1552
+ return this.Get('CreatingEntityID');
1553
+ }
1554
+ set CreatingEntityID(value) {
1555
+ this.Set('CreatingEntityID', value);
1556
+ }
1557
+ /**
1558
+ * * Field Name: CreatingRecordID
1559
+ * * Display Name: Creating Record ID
1560
+ * * SQL Data Type: nvarchar(450)
1561
+ * * Description: Polymorphic reference part 2: the creating records id. Soft by nature — it points at a record owned by an app this repo has no knowledge of. Set together with CreatingEntityID or not at all.
1562
+ */
1563
+ get CreatingRecordID() {
1564
+ return this.Get('CreatingRecordID');
1565
+ }
1566
+ set CreatingRecordID(value) {
1567
+ this.Set('CreatingRecordID', value);
1568
+ }
1569
+ /**
1570
+ * * Field Name: ParentContractID
1571
+ * * Display Name: Parent Contract
1572
+ * * SQL Data Type: uniqueidentifier
1573
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
1574
+ * * Description: The contract this one amends. How a change order attaches: a change order is signed paper with its own PDF, dates and modifications, so it reuses this entity rather than getting one of its own. The original stays in force.
1575
+ */
1576
+ get ParentContractID() {
1577
+ return this.Get('ParentContractID');
1578
+ }
1579
+ set ParentContractID(value) {
1580
+ this.Set('ParentContractID', value);
1581
+ }
1582
+ /**
1583
+ * * Field Name: SupersededByContractID
1584
+ * * Display Name: Superseded By
1585
+ * * SQL Data Type: uniqueidentifier
1586
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
1587
+ * * Description: The contract that REPLACED this one, where an agreement was re-papered rather than amended. Also the sole source of the derived Superseded state, which is why the old CHECK tying it to a Status column disappeared with that column.
1588
+ */
1589
+ get SupersededByContractID() {
1590
+ return this.Get('SupersededByContractID');
1591
+ }
1592
+ set SupersededByContractID(value) {
1593
+ this.Set('SupersededByContractID', value);
1594
+ }
1595
+ /**
1596
+ * * Field Name: SigningProviderURL
1597
+ * * Display Name: Signing Provider URL
1598
+ * * SQL Data Type: nvarchar(1000)
1599
+ * * Description: Direct link to the document in the signing provider (PandaDoc). The fallback that works before any integration exists, and when a storage sync has broken.
1600
+ */
1601
+ get SigningProviderURL() {
1602
+ return this.Get('SigningProviderURL');
1603
+ }
1604
+ set SigningProviderURL(value) {
1605
+ this.Set('SigningProviderURL', value);
1606
+ }
1607
+ /**
1608
+ * * Field Name: EffectiveDate
1609
+ * * Display Name: Effective Date
1610
+ * * SQL Data Type: date
1611
+ * * Description: When the agreement takes effect.
1612
+ */
1613
+ get EffectiveDate() {
1614
+ return this.Get('EffectiveDate');
1615
+ }
1616
+ set EffectiveDate(value) {
1617
+ this.Set('EffectiveDate', value);
1618
+ }
1619
+ /**
1620
+ * * Field Name: ExecutedDate
1621
+ * * Display Name: Executed Date
1622
+ * * SQL Data Type: date
1623
+ * * Description: When it was signed. May legitimately PRECEDE EffectiveDate — sign in December for a January start is the ordinary case. There is deliberately no constraint ordering the two; v1 had one and it rejected exactly the data a correct contract produces.
1624
+ */
1625
+ get ExecutedDate() {
1626
+ return this.Get('ExecutedDate');
1627
+ }
1628
+ set ExecutedDate(value) {
1629
+ this.Set('ExecutedDate', value);
1630
+ }
1631
+ /**
1632
+ * * Field Name: EndDate
1633
+ * * Display Name: End Date
1634
+ * * SQL Data Type: date
1635
+ * * Description: When the current term ends. This is what drives the renewal watchlist and every expiry projection.
1636
+ */
1637
+ get EndDate() {
1638
+ return this.Get('EndDate');
1639
+ }
1640
+ set EndDate(value) {
1641
+ this.Set('EndDate', value);
1642
+ }
1643
+ /**
1644
+ * * Field Name: TerminatedDate
1645
+ * * Display Name: Terminated Date
1646
+ * * SQL Data Type: date
1647
+ * * Description: When the agreement ended early. Stored rather than derived: it is only recoverable from a successors effective date, and a contract can end with no successor at all when a customer simply leaves.
1648
+ */
1649
+ get TerminatedDate() {
1650
+ return this.Get('TerminatedDate');
1651
+ }
1652
+ set TerminatedDate(value) {
1653
+ this.Set('TerminatedDate', value);
1654
+ }
1655
+ /**
1656
+ * * Field Name: AutoRenew
1657
+ * * Display Name: Auto Renew
1658
+ * * SQL Data Type: bit
1659
+ * * Default Value: 0
1660
+ * * Description: Whether the agreement auto-renews, AS THE PAPER STATES IT. True or false, no third state. Distinct from the subscriptions operational setting in orders, which someone can change later; when the two disagree that is a finding, not a bug.
1661
+ */
1662
+ get AutoRenew() {
1663
+ return this.Get('AutoRenew');
1664
+ }
1665
+ set AutoRenew(value) {
1666
+ this.Set('AutoRenew', value);
1667
+ }
1668
+ /**
1669
+ * * Field Name: RenewalNoticeDays
1670
+ * * Display Name: Renewal Notice (Days)
1671
+ * * SQL Data Type: int
1672
+ * * Description: Days of written notice we owe before a renewal price change, as stated in the agreement. NOT the same field as CancellationWindowDays even though many agreements set them equal — conflating them silently is how a notice obligation gets missed.
1673
+ */
1674
+ get RenewalNoticeDays() {
1675
+ return this.Get('RenewalNoticeDays');
1676
+ }
1677
+ set RenewalNoticeDays(value) {
1678
+ this.Set('RenewalNoticeDays', value);
1679
+ }
1680
+ /**
1681
+ * * Field Name: CancellationWindowDays
1682
+ * * Display Name: Cancellation Window Days
1683
+ * * SQL Data Type: int
1684
+ * * Description: Days of notice the customer owes to cancel without renewing.
1685
+ */
1686
+ get CancellationWindowDays() {
1687
+ return this.Get('CancellationWindowDays');
1688
+ }
1689
+ set CancellationWindowDays(value) {
1690
+ this.Set('CancellationWindowDays', value);
1691
+ }
1692
+ /**
1693
+ * * Field Name: AnnualIncreasePercent
1694
+ * * Display Name: Annual Increase Percent
1695
+ * * SQL Data Type: decimal(7, 4)
1696
+ * * Description: The negotiated year-over-year uplift. Exists here because it exists nowhere else: the orders schema has no escalation concept of any kind, which is why a two-year agreement stepping up 10% in year two is recorded in no other system.
1697
+ */
1698
+ get AnnualIncreasePercent() {
1699
+ return this.Get('AnnualIncreasePercent');
1700
+ }
1701
+ set AnnualIncreasePercent(value) {
1702
+ this.Set('AnnualIncreasePercent', value);
1703
+ }
1704
+ /**
1705
+ * * Field Name: HasModifications
1706
+ * * Display Name: Has Modifications
1707
+ * * SQL Data Type: bit
1708
+ * * Default Value: 0
1709
+ * * Description: Whether the standard agreement was changed for this customer. ASSERTED by a person, not derived — its job is to say "go read the PDF" BEFORE anyone has recorded the modifications, and a derived flag would read false for every contract nobody has processed yet. One direction IS enforced server-side: if modification rows exist this must be true. It is never cleared automatically.
1710
+ */
1711
+ get HasModifications() {
1712
+ return this.Get('HasModifications');
1713
+ }
1714
+ set HasModifications(value) {
1715
+ this.Set('HasModifications', value);
1716
+ }
1717
+ /**
1718
+ * * Field Name: Description
1719
+ * * Display Name: Description
1720
+ * * SQL Data Type: nvarchar(MAX)
1721
+ */
1722
+ get Description() {
1723
+ return this.Get('Description');
1724
+ }
1725
+ set Description(value) {
1726
+ this.Set('Description', value);
1727
+ }
1728
+ /**
1729
+ * * Field Name: Notes
1730
+ * * Display Name: Notes
1731
+ * * SQL Data Type: nvarchar(MAX)
1732
+ * * Description: Free-text working notes for whoever is processing the contract.
1733
+ */
1734
+ get Notes() {
1735
+ return this.Get('Notes');
1736
+ }
1737
+ set Notes(value) {
1738
+ this.Set('Notes', value);
1739
+ }
1740
+ /**
1741
+ * * Field Name: __mj_CreatedAt
1742
+ * * Display Name: Created At
1743
+ * * SQL Data Type: datetimeoffset
1744
+ * * Default Value: getutcdate()
1745
+ */
1746
+ get __mj_CreatedAt() {
1747
+ return this.Get('__mj_CreatedAt');
1748
+ }
1749
+ /**
1750
+ * * Field Name: __mj_UpdatedAt
1751
+ * * Display Name: Updated At
1752
+ * * SQL Data Type: datetimeoffset
1753
+ * * Default Value: getutcdate()
1754
+ */
1755
+ get __mj_UpdatedAt() {
1756
+ return this.Get('__mj_UpdatedAt');
1757
+ }
1758
+ /**
1759
+ * * Field Name: PredictedNonRenewalRisk
1760
+ * * Display Name: Predicted Non Renewal Risk
1761
+ * * SQL Data Type: decimal(5, 4)
1762
+ * * Description: Predicted probability (0.0000 to 1.0000) that this commercial agreement will fail to renew prior to the required notice deadline.
1763
+ */
1764
+ get PredictedNonRenewalRisk() {
1765
+ return this.Get('PredictedNonRenewalRisk');
1766
+ }
1767
+ set PredictedNonRenewalRisk(value) {
1768
+ this.Set('PredictedNonRenewalRisk', value);
1769
+ }
1770
+ /**
1771
+ * * Field Name: PredictedRenewalRiskBand
1772
+ * * Display Name: Predicted Renewal Risk Band
1773
+ * * SQL Data Type: nvarchar(20)
1774
+ * * Value List Type: List
1775
+ * * Possible Values
1776
+ * * Critical
1777
+ * * High
1778
+ * * Low
1779
+ * * Medium
1780
+ * * Description: Derived operational risk band classifying renewal risk: Low (<20%), Medium (20-50%), High (50-80%), Critical (>=80%).
1781
+ */
1782
+ get PredictedRenewalRiskBand() {
1783
+ return this.Get('PredictedRenewalRiskBand');
1784
+ }
1785
+ set PredictedRenewalRiskBand(value) {
1786
+ this.Set('PredictedRenewalRiskBand', value);
1787
+ }
1788
+ /**
1789
+ * * Field Name: PredictedRenewalScoredAt
1790
+ * * Display Name: Predicted Renewal Scored At
1791
+ * * SQL Data Type: datetimeoffset
1792
+ * * Description: Timestamp of the most recent predictive model scoring execution for this contract.
1793
+ */
1794
+ get PredictedRenewalScoredAt() {
1795
+ return this.Get('PredictedRenewalScoredAt');
1796
+ }
1797
+ set PredictedRenewalScoredAt(value) {
1798
+ this.Set('PredictedRenewalScoredAt', value);
1799
+ }
1800
+ /**
1801
+ * * Field Name: ContractType
1802
+ * * Display Name: Contract Type Name
1803
+ * * SQL Data Type: nvarchar(100)
1804
+ */
1805
+ get ContractType() {
1806
+ return this.Get('ContractType');
1807
+ }
1808
+ /**
1809
+ * * Field Name: Company
1810
+ * * Display Name: Company Name
1811
+ * * SQL Data Type: nvarchar(50)
1812
+ */
1813
+ get Company() {
1814
+ return this.Get('Company');
1815
+ }
1816
+ /**
1817
+ * * Field Name: CustomerOrganization
1818
+ * * Display Name: Customer Organization Name
1819
+ * * SQL Data Type: nvarchar(255)
1820
+ */
1821
+ get CustomerOrganization() {
1822
+ return this.Get('CustomerOrganization');
1823
+ }
1824
+ /**
1825
+ * * Field Name: PrimaryContactPerson
1826
+ * * Display Name: Primary Contact Name
1827
+ * * SQL Data Type: nvarchar(100)
1828
+ */
1829
+ get PrimaryContactPerson() {
1830
+ return this.Get('PrimaryContactPerson');
1831
+ }
1832
+ /**
1833
+ * * Field Name: ContractTemplate
1834
+ * * Display Name: Contract Template Name
1835
+ * * SQL Data Type: nvarchar(200)
1836
+ */
1837
+ get ContractTemplate() {
1838
+ return this.Get('ContractTemplate');
1839
+ }
1840
+ /**
1841
+ * * Field Name: CreatingEntity
1842
+ * * Display Name: Creating Entity Name
1843
+ * * SQL Data Type: nvarchar(255)
1844
+ */
1845
+ get CreatingEntity() {
1846
+ return this.Get('CreatingEntity');
1847
+ }
1848
+ /**
1849
+ * * Field Name: ParentContract
1850
+ * * Display Name: Parent Contract
1851
+ * * SQL Data Type: nvarchar(50)
1852
+ */
1853
+ get ParentContract() {
1854
+ return this.Get('ParentContract');
1855
+ }
1856
+ /**
1857
+ * * Field Name: SupersededByContract
1858
+ * * Display Name: Superseded By Contract
1859
+ * * SQL Data Type: nvarchar(50)
1860
+ */
1861
+ get SupersededByContract() {
1862
+ return this.Get('SupersededByContract');
1863
+ }
1864
+ /**
1865
+ * * Field Name: State
1866
+ * * Display Name: State
1867
+ * * SQL Data Type: varchar(10)
1868
+ */
1869
+ get State() {
1870
+ return this.Get('State');
1871
+ }
1872
+ /**
1873
+ * * Field Name: IsAwaitingDocument
1874
+ * * Display Name: Is Awaiting Document
1875
+ * * SQL Data Type: bit
1876
+ */
1877
+ get IsAwaitingDocument() {
1878
+ return this.Get('IsAwaitingDocument');
1879
+ }
1880
+ /**
1881
+ * * Field Name: DaysToEnd
1882
+ * * Display Name: Days To End
1883
+ * * SQL Data Type: int
1884
+ */
1885
+ get DaysToEnd() {
1886
+ return this.Get('DaysToEnd');
1887
+ }
1888
+ /**
1889
+ * * Field Name: RenewalNoticeDeadline
1890
+ * * Display Name: Renewal Notice Deadline
1891
+ * * SQL Data Type: date
1892
+ */
1893
+ get RenewalNoticeDeadline() {
1894
+ return this.Get('RenewalNoticeDeadline');
1895
+ }
1896
+ /**
1897
+ * * Field Name: IsInCancellationWindow
1898
+ * * Display Name: Is In Cancellation Window
1899
+ * * SQL Data Type: bit
1900
+ */
1901
+ get IsInCancellationWindow() {
1902
+ return this.Get('IsInCancellationWindow');
1903
+ }
1904
+ /**
1905
+ * * Field Name: NonRenewalOutcome
1906
+ * * Display Name: Non Renewal Outcome
1907
+ * * SQL Data Type: int
1908
+ */
1909
+ get NonRenewalOutcome() {
1910
+ return this.Get('NonRenewalOutcome');
1911
+ }
1912
+ /**
1913
+ * * Field Name: TermLengthDays
1914
+ * * Display Name: Term Length Days
1915
+ * * SQL Data Type: int
1916
+ */
1917
+ get TermLengthDays() {
1918
+ return this.Get('TermLengthDays');
1919
+ }
1920
+ /**
1921
+ * * Field Name: DaysUntilNoticeDeadline
1922
+ * * Display Name: Days Until Notice Deadline
1923
+ * * SQL Data Type: int
1924
+ */
1925
+ get DaysUntilNoticeDeadline() {
1926
+ return this.Get('DaysUntilNoticeDeadline');
1927
+ }
1928
+ /**
1929
+ * * Field Name: HasModificationsFlag
1930
+ * * Display Name: Has Modifications Flag
1931
+ * * SQL Data Type: int
1932
+ */
1933
+ get HasModificationsFlag() {
1934
+ return this.Get('HasModificationsFlag');
1935
+ }
1936
+ /**
1937
+ * * Field Name: AutoRenewFlag
1938
+ * * Display Name: Auto Renew Flag
1939
+ * * SQL Data Type: int
1940
+ */
1941
+ get AutoRenewFlag() {
1942
+ return this.Get('AutoRenewFlag');
1943
+ }
1944
+ /**
1945
+ * * Field Name: HasParentContract
1946
+ * * Display Name: Has Parent Contract
1947
+ * * SQL Data Type: int
1948
+ */
1949
+ get HasParentContract() {
1950
+ return this.Get('HasParentContract');
1951
+ }
1952
+ /**
1953
+ * * Field Name: HasCancellationWindow
1954
+ * * Display Name: Has Cancellation Window
1955
+ * * SQL Data Type: int
1956
+ */
1957
+ get HasCancellationWindow() {
1958
+ return this.Get('HasCancellationWindow');
1959
+ }
1960
+ /**
1961
+ * * Field Name: HasAnnualIncrease
1962
+ * * Display Name: Has Annual Increase
1963
+ * * SQL Data Type: int
1964
+ */
1965
+ get HasAnnualIncrease() {
1966
+ return this.Get('HasAnnualIncrease');
1967
+ }
1968
+ };
1969
+ mjBizAppsContractsContractEntity = __decorate([
1970
+ RegisterClass(BaseEntity, 'MJ_BizApps_Contracts: Contracts')
1971
+ ], mjBizAppsContractsContractEntity);
1972
+ export { mjBizAppsContractsContractEntity };
1973
+ //# sourceMappingURL=__mj_BizAppsContracts.js.map