@mj-biz-apps/contracts-entities 0.5.0 → 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,1345 @@
1
+ import { BaseEntity, ValidationResult } from "@memberjunction/core";
2
+ import { z } from "zod";
3
+ /**
4
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Template Modifications
5
+ */
6
+ export declare const mjBizAppsContractsContractTemplateModificationSchema: z.ZodObject<{
7
+ ID: z.ZodString;
8
+ ContractID: z.ZodString;
9
+ ContractTemplateProvisionID: z.ZodString;
10
+ ModificationText: z.ZodString;
11
+ Notes: z.ZodNullable<z.ZodString>;
12
+ __mj_CreatedAt: z.ZodDate;
13
+ __mj_UpdatedAt: z.ZodDate;
14
+ Contract: z.ZodNullable<z.ZodString>;
15
+ ContractTemplateProvision: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ ID?: string;
18
+ ContractID?: string;
19
+ ContractTemplateProvisionID?: string;
20
+ ModificationText?: string;
21
+ Notes?: string;
22
+ __mj_CreatedAt?: Date;
23
+ __mj_UpdatedAt?: Date;
24
+ Contract?: string;
25
+ ContractTemplateProvision?: string;
26
+ }, {
27
+ ID?: string;
28
+ ContractID?: string;
29
+ ContractTemplateProvisionID?: string;
30
+ ModificationText?: string;
31
+ Notes?: string;
32
+ __mj_CreatedAt?: Date;
33
+ __mj_UpdatedAt?: Date;
34
+ Contract?: string;
35
+ ContractTemplateProvision?: string;
36
+ }>;
37
+ export type mjBizAppsContractsContractTemplateModificationEntityType = z.infer<typeof mjBizAppsContractsContractTemplateModificationSchema>;
38
+ /**
39
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Template Provisions
40
+ */
41
+ export declare const mjBizAppsContractsContractTemplateProvisionSchema: z.ZodObject<{
42
+ ID: z.ZodString;
43
+ ContractTemplateID: z.ZodString;
44
+ ProvisionNumber: z.ZodString;
45
+ Title: z.ZodString;
46
+ ProvisionText: z.ZodString;
47
+ Description: z.ZodNullable<z.ZodString>;
48
+ ProvisionSortKey: z.ZodNullable<z.ZodString>;
49
+ __mj_CreatedAt: z.ZodDate;
50
+ __mj_UpdatedAt: z.ZodDate;
51
+ ContractTemplate: z.ZodString;
52
+ }, "strip", z.ZodTypeAny, {
53
+ ID?: string;
54
+ __mj_CreatedAt?: Date;
55
+ __mj_UpdatedAt?: Date;
56
+ ContractTemplateID?: string;
57
+ ProvisionNumber?: string;
58
+ Title?: string;
59
+ ProvisionText?: string;
60
+ Description?: string;
61
+ ProvisionSortKey?: string;
62
+ ContractTemplate?: string;
63
+ }, {
64
+ ID?: string;
65
+ __mj_CreatedAt?: Date;
66
+ __mj_UpdatedAt?: Date;
67
+ ContractTemplateID?: string;
68
+ ProvisionNumber?: string;
69
+ Title?: string;
70
+ ProvisionText?: string;
71
+ Description?: string;
72
+ ProvisionSortKey?: string;
73
+ ContractTemplate?: string;
74
+ }>;
75
+ export type mjBizAppsContractsContractTemplateProvisionEntityType = z.infer<typeof mjBizAppsContractsContractTemplateProvisionSchema>;
76
+ /**
77
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Template Types
78
+ */
79
+ export declare const mjBizAppsContractsContractTemplateTypeSchema: z.ZodObject<{
80
+ ID: z.ZodString;
81
+ Name: z.ZodString;
82
+ Description: z.ZodNullable<z.ZodString>;
83
+ Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Inactive">]>;
84
+ __mj_CreatedAt: z.ZodDate;
85
+ __mj_UpdatedAt: z.ZodDate;
86
+ }, "strip", z.ZodTypeAny, {
87
+ ID?: string;
88
+ __mj_CreatedAt?: Date;
89
+ __mj_UpdatedAt?: Date;
90
+ Description?: string;
91
+ Name?: string;
92
+ Status?: "Active" | "Inactive";
93
+ }, {
94
+ ID?: string;
95
+ __mj_CreatedAt?: Date;
96
+ __mj_UpdatedAt?: Date;
97
+ Description?: string;
98
+ Name?: string;
99
+ Status?: "Active" | "Inactive";
100
+ }>;
101
+ export type mjBizAppsContractsContractTemplateTypeEntityType = z.infer<typeof mjBizAppsContractsContractTemplateTypeSchema>;
102
+ /**
103
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Templates
104
+ */
105
+ export declare const mjBizAppsContractsContractTemplateSchema: z.ZodObject<{
106
+ ID: z.ZodString;
107
+ Name: z.ZodString;
108
+ ContractTemplateTypeID: z.ZodString;
109
+ VersionLabel: z.ZodNullable<z.ZodString>;
110
+ IntroducedDate: z.ZodNullable<z.ZodDate>;
111
+ SourceURL: z.ZodNullable<z.ZodString>;
112
+ Description: z.ZodNullable<z.ZodString>;
113
+ Status: z.ZodUnion<[z.ZodLiteral<"Draft">, z.ZodLiteral<"Published">]>;
114
+ __mj_CreatedAt: z.ZodDate;
115
+ __mj_UpdatedAt: z.ZodDate;
116
+ ContractTemplateType: z.ZodString;
117
+ IsUsable: z.ZodNullable<z.ZodBoolean>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ ID?: string;
120
+ __mj_CreatedAt?: Date;
121
+ __mj_UpdatedAt?: Date;
122
+ Description?: string;
123
+ Name?: string;
124
+ Status?: "Draft" | "Published";
125
+ ContractTemplateTypeID?: string;
126
+ VersionLabel?: string;
127
+ IntroducedDate?: Date;
128
+ SourceURL?: string;
129
+ ContractTemplateType?: string;
130
+ IsUsable?: boolean;
131
+ }, {
132
+ ID?: string;
133
+ __mj_CreatedAt?: Date;
134
+ __mj_UpdatedAt?: Date;
135
+ Description?: string;
136
+ Name?: string;
137
+ Status?: "Draft" | "Published";
138
+ ContractTemplateTypeID?: string;
139
+ VersionLabel?: string;
140
+ IntroducedDate?: Date;
141
+ SourceURL?: string;
142
+ ContractTemplateType?: string;
143
+ IsUsable?: boolean;
144
+ }>;
145
+ export type mjBizAppsContractsContractTemplateEntityType = z.infer<typeof mjBizAppsContractsContractTemplateSchema>;
146
+ /**
147
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contract Types
148
+ */
149
+ export declare const mjBizAppsContractsContractTypeSchema: z.ZodObject<{
150
+ ID: z.ZodString;
151
+ Name: z.ZodString;
152
+ Description: z.ZodNullable<z.ZodString>;
153
+ RequiresExecutedDocument: z.ZodBoolean;
154
+ Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Inactive">]>;
155
+ MustBeRoot: z.ZodBoolean;
156
+ MustBeChild: z.ZodBoolean;
157
+ TemplateRequired: z.ZodBoolean;
158
+ __mj_CreatedAt: z.ZodDate;
159
+ __mj_UpdatedAt: z.ZodDate;
160
+ }, "strip", z.ZodTypeAny, {
161
+ ID?: string;
162
+ __mj_CreatedAt?: Date;
163
+ __mj_UpdatedAt?: Date;
164
+ Description?: string;
165
+ Name?: string;
166
+ Status?: "Active" | "Inactive";
167
+ RequiresExecutedDocument?: boolean;
168
+ MustBeRoot?: boolean;
169
+ MustBeChild?: boolean;
170
+ TemplateRequired?: boolean;
171
+ }, {
172
+ ID?: string;
173
+ __mj_CreatedAt?: Date;
174
+ __mj_UpdatedAt?: Date;
175
+ Description?: string;
176
+ Name?: string;
177
+ Status?: "Active" | "Inactive";
178
+ RequiresExecutedDocument?: boolean;
179
+ MustBeRoot?: boolean;
180
+ MustBeChild?: boolean;
181
+ TemplateRequired?: boolean;
182
+ }>;
183
+ export type mjBizAppsContractsContractTypeEntityType = z.infer<typeof mjBizAppsContractsContractTypeSchema>;
184
+ /**
185
+ * zod schema definition for the entity MJ_BizApps_Contracts: Contracts
186
+ */
187
+ export declare const mjBizAppsContractsContractSchema: z.ZodObject<{
188
+ ID: z.ZodString;
189
+ ContractNumber: z.ZodNullable<z.ZodString>;
190
+ ContractTypeID: z.ZodString;
191
+ CompanyID: z.ZodString;
192
+ CustomerOrganizationID: z.ZodString;
193
+ PrimaryContactPersonID: z.ZodNullable<z.ZodString>;
194
+ ContractTemplateID: z.ZodNullable<z.ZodString>;
195
+ CreatingEntityID: z.ZodNullable<z.ZodString>;
196
+ CreatingRecordID: z.ZodNullable<z.ZodString>;
197
+ ParentContractID: z.ZodNullable<z.ZodString>;
198
+ SupersededByContractID: z.ZodNullable<z.ZodString>;
199
+ SigningProviderURL: z.ZodNullable<z.ZodString>;
200
+ EffectiveDate: z.ZodNullable<z.ZodDate>;
201
+ ExecutedDate: z.ZodNullable<z.ZodDate>;
202
+ EndDate: z.ZodNullable<z.ZodDate>;
203
+ TerminatedDate: z.ZodNullable<z.ZodDate>;
204
+ AutoRenew: z.ZodBoolean;
205
+ RenewalNoticeDays: z.ZodNullable<z.ZodNumber>;
206
+ CancellationWindowDays: z.ZodNullable<z.ZodNumber>;
207
+ AnnualIncreasePercent: z.ZodNullable<z.ZodNumber>;
208
+ HasModifications: z.ZodBoolean;
209
+ Description: z.ZodNullable<z.ZodString>;
210
+ Notes: z.ZodNullable<z.ZodString>;
211
+ __mj_CreatedAt: z.ZodDate;
212
+ __mj_UpdatedAt: z.ZodDate;
213
+ PredictedNonRenewalRisk: z.ZodNullable<z.ZodNumber>;
214
+ PredictedRenewalRiskBand: z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"Critical">, z.ZodLiteral<"High">, z.ZodLiteral<"Low">, z.ZodLiteral<"Medium">]>>;
215
+ PredictedRenewalScoredAt: z.ZodNullable<z.ZodDate>;
216
+ ContractType: z.ZodString;
217
+ Company: z.ZodString;
218
+ CustomerOrganization: z.ZodString;
219
+ PrimaryContactPerson: z.ZodNullable<z.ZodString>;
220
+ ContractTemplate: z.ZodNullable<z.ZodString>;
221
+ CreatingEntity: z.ZodNullable<z.ZodString>;
222
+ ParentContract: z.ZodNullable<z.ZodString>;
223
+ SupersededByContract: z.ZodNullable<z.ZodString>;
224
+ State: z.ZodString;
225
+ IsAwaitingDocument: z.ZodNullable<z.ZodBoolean>;
226
+ DaysToEnd: z.ZodNullable<z.ZodNumber>;
227
+ RenewalNoticeDeadline: z.ZodNullable<z.ZodDate>;
228
+ IsInCancellationWindow: z.ZodNullable<z.ZodBoolean>;
229
+ NonRenewalOutcome: z.ZodNullable<z.ZodNumber>;
230
+ TermLengthDays: z.ZodNullable<z.ZodNumber>;
231
+ DaysUntilNoticeDeadline: z.ZodNullable<z.ZodNumber>;
232
+ HasModificationsFlag: z.ZodNumber;
233
+ AutoRenewFlag: z.ZodNumber;
234
+ HasParentContract: z.ZodNumber;
235
+ HasCancellationWindow: z.ZodNumber;
236
+ HasAnnualIncrease: z.ZodNumber;
237
+ }, "strip", z.ZodTypeAny, {
238
+ ID?: string;
239
+ Notes?: string;
240
+ __mj_CreatedAt?: Date;
241
+ __mj_UpdatedAt?: Date;
242
+ ContractTemplateID?: string;
243
+ Description?: string;
244
+ ContractTemplate?: string;
245
+ ContractNumber?: string;
246
+ ContractTypeID?: string;
247
+ CompanyID?: string;
248
+ CustomerOrganizationID?: string;
249
+ PrimaryContactPersonID?: string;
250
+ CreatingEntityID?: string;
251
+ CreatingRecordID?: string;
252
+ ParentContractID?: string;
253
+ SupersededByContractID?: string;
254
+ SigningProviderURL?: string;
255
+ EffectiveDate?: Date;
256
+ ExecutedDate?: Date;
257
+ EndDate?: Date;
258
+ TerminatedDate?: Date;
259
+ AutoRenew?: boolean;
260
+ RenewalNoticeDays?: number;
261
+ CancellationWindowDays?: number;
262
+ AnnualIncreasePercent?: number;
263
+ HasModifications?: boolean;
264
+ PredictedNonRenewalRisk?: number;
265
+ PredictedRenewalRiskBand?: "Critical" | "High" | "Low" | "Medium";
266
+ PredictedRenewalScoredAt?: Date;
267
+ ContractType?: string;
268
+ Company?: string;
269
+ CustomerOrganization?: string;
270
+ PrimaryContactPerson?: string;
271
+ CreatingEntity?: string;
272
+ ParentContract?: string;
273
+ SupersededByContract?: string;
274
+ State?: string;
275
+ IsAwaitingDocument?: boolean;
276
+ DaysToEnd?: number;
277
+ RenewalNoticeDeadline?: Date;
278
+ IsInCancellationWindow?: boolean;
279
+ NonRenewalOutcome?: number;
280
+ TermLengthDays?: number;
281
+ DaysUntilNoticeDeadline?: number;
282
+ HasModificationsFlag?: number;
283
+ AutoRenewFlag?: number;
284
+ HasParentContract?: number;
285
+ HasCancellationWindow?: number;
286
+ HasAnnualIncrease?: number;
287
+ }, {
288
+ ID?: string;
289
+ Notes?: string;
290
+ __mj_CreatedAt?: Date;
291
+ __mj_UpdatedAt?: Date;
292
+ ContractTemplateID?: string;
293
+ Description?: string;
294
+ ContractTemplate?: string;
295
+ ContractNumber?: string;
296
+ ContractTypeID?: string;
297
+ CompanyID?: string;
298
+ CustomerOrganizationID?: string;
299
+ PrimaryContactPersonID?: string;
300
+ CreatingEntityID?: string;
301
+ CreatingRecordID?: string;
302
+ ParentContractID?: string;
303
+ SupersededByContractID?: string;
304
+ SigningProviderURL?: string;
305
+ EffectiveDate?: Date;
306
+ ExecutedDate?: Date;
307
+ EndDate?: Date;
308
+ TerminatedDate?: Date;
309
+ AutoRenew?: boolean;
310
+ RenewalNoticeDays?: number;
311
+ CancellationWindowDays?: number;
312
+ AnnualIncreasePercent?: number;
313
+ HasModifications?: boolean;
314
+ PredictedNonRenewalRisk?: number;
315
+ PredictedRenewalRiskBand?: "Critical" | "High" | "Low" | "Medium";
316
+ PredictedRenewalScoredAt?: Date;
317
+ ContractType?: string;
318
+ Company?: string;
319
+ CustomerOrganization?: string;
320
+ PrimaryContactPerson?: string;
321
+ CreatingEntity?: string;
322
+ ParentContract?: string;
323
+ SupersededByContract?: string;
324
+ State?: string;
325
+ IsAwaitingDocument?: boolean;
326
+ DaysToEnd?: number;
327
+ RenewalNoticeDeadline?: Date;
328
+ IsInCancellationWindow?: boolean;
329
+ NonRenewalOutcome?: number;
330
+ TermLengthDays?: number;
331
+ DaysUntilNoticeDeadline?: number;
332
+ HasModificationsFlag?: number;
333
+ AutoRenewFlag?: number;
334
+ HasParentContract?: number;
335
+ HasCancellationWindow?: number;
336
+ HasAnnualIncrease?: number;
337
+ }>;
338
+ export type mjBizAppsContractsContractEntityType = z.infer<typeof mjBizAppsContractsContractSchema>;
339
+ /**
340
+ * MJ_BizApps_Contracts: Contract Template Modifications - strongly typed entity sub-class
341
+ * * Schema: __mj_BizAppsContracts
342
+ * * Base Table: ContractTemplateModification
343
+ * * Base View: vwContractTemplateModifications
344
+ * * @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.
345
+ * * Primary Key: ID
346
+ * @extends {BaseEntity}
347
+ * @class
348
+ * @public
349
+ */
350
+ export declare class mjBizAppsContractsContractTemplateModificationEntity extends BaseEntity<mjBizAppsContractsContractTemplateModificationEntityType> {
351
+ /**
352
+ * Loads the MJ_BizApps_Contracts: Contract Template Modifications record from the database
353
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Template Modifications record.
354
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
355
+ * @returns {Promise<boolean>} - true if successful, false otherwise
356
+ * @public
357
+ * @async
358
+ * @memberof mjBizAppsContractsContractTemplateModificationEntity
359
+ * @method
360
+ * @override
361
+ */
362
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
363
+ /**
364
+ * 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:
365
+ * * ModificationText: The modification text must contain actual text and cannot be empty or consist only of spaces.
366
+ * @public
367
+ * @method
368
+ * @override
369
+ */
370
+ Validate(): ValidationResult;
371
+ /**
372
+ * The modification text must contain actual text and cannot be empty or consist only of spaces.
373
+ * @param result - the ValidationResult object to add any errors or warnings to
374
+ * @public
375
+ * @method
376
+ */
377
+ ValidateModificationTextNotEmpty(result: ValidationResult): void;
378
+ /**
379
+ * * Field Name: ID
380
+ * * Display Name: ID
381
+ * * SQL Data Type: uniqueidentifier
382
+ * * Default Value: newsequentialid()
383
+ */
384
+ get ID(): string;
385
+ set ID(value: string);
386
+ /**
387
+ * * Field Name: ContractID
388
+ * * Display Name: Contract
389
+ * * SQL Data Type: uniqueidentifier
390
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
391
+ */
392
+ get ContractID(): string;
393
+ set ContractID(value: string);
394
+ /**
395
+ * * Field Name: ContractTemplateProvisionID
396
+ * * Display Name: Contract Template Provision
397
+ * * SQL Data Type: uniqueidentifier
398
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Template Provisions (vwContractTemplateProvisions.ID)
399
+ * * 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.
400
+ */
401
+ get ContractTemplateProvisionID(): string;
402
+ set ContractTemplateProvisionID(value: string);
403
+ /**
404
+ * * Field Name: ModificationText
405
+ * * Display Name: Modification Text
406
+ * * SQL Data Type: nvarchar(MAX)
407
+ * * Description: What this contract says INSTEAD of the standard clause. Read as a pair with ContractTemplateProvision.ProvisionText.
408
+ */
409
+ get ModificationText(): string;
410
+ set ModificationText(value: string);
411
+ /**
412
+ * * Field Name: Notes
413
+ * * Display Name: Notes
414
+ * * SQL Data Type: nvarchar(MAX)
415
+ * * Description: Optional working note, e.g. who negotiated it.
416
+ */
417
+ get Notes(): string | null;
418
+ set Notes(value: string | null);
419
+ /**
420
+ * * Field Name: __mj_CreatedAt
421
+ * * Display Name: Created At
422
+ * * SQL Data Type: datetimeoffset
423
+ * * Default Value: getutcdate()
424
+ */
425
+ get __mj_CreatedAt(): Date;
426
+ /**
427
+ * * Field Name: __mj_UpdatedAt
428
+ * * Display Name: Updated At
429
+ * * SQL Data Type: datetimeoffset
430
+ * * Default Value: getutcdate()
431
+ */
432
+ get __mj_UpdatedAt(): Date;
433
+ /**
434
+ * * Field Name: Contract
435
+ * * Display Name: Contract
436
+ * * SQL Data Type: nvarchar(50)
437
+ */
438
+ get Contract(): string | null;
439
+ /**
440
+ * * Field Name: ContractTemplateProvision
441
+ * * Display Name: Contract Template Provision
442
+ * * SQL Data Type: nvarchar(20)
443
+ */
444
+ get ContractTemplateProvision(): string;
445
+ }
446
+ /**
447
+ * MJ_BizApps_Contracts: Contract Template Provisions - strongly typed entity sub-class
448
+ * * Schema: __mj_BizAppsContracts
449
+ * * Base Table: ContractTemplateProvision
450
+ * * Base View: vwContractTemplateProvisions
451
+ * * @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.
452
+ * * Primary Key: ID
453
+ * @extends {BaseEntity}
454
+ * @class
455
+ * @public
456
+ */
457
+ export declare class mjBizAppsContractsContractTemplateProvisionEntity extends BaseEntity<mjBizAppsContractsContractTemplateProvisionEntityType> {
458
+ /**
459
+ * Loads the MJ_BizApps_Contracts: Contract Template Provisions record from the database
460
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Template Provisions record.
461
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
462
+ * @returns {Promise<boolean>} - true if successful, false otherwise
463
+ * @public
464
+ * @async
465
+ * @memberof mjBizAppsContractsContractTemplateProvisionEntity
466
+ * @method
467
+ * @override
468
+ */
469
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
470
+ /**
471
+ * 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:
472
+ * * ProvisionText: The provision text cannot be empty or consist only of spaces. It must contain actual text content.
473
+ * @public
474
+ * @method
475
+ * @override
476
+ */
477
+ Validate(): ValidationResult;
478
+ /**
479
+ * The provision text cannot be empty or consist only of spaces. It must contain actual text content.
480
+ * @param result - the ValidationResult object to add any errors or warnings to
481
+ * @public
482
+ * @method
483
+ */
484
+ ValidateProvisionTextNotEmpty(result: ValidationResult): void;
485
+ /**
486
+ * * Field Name: ID
487
+ * * Display Name: ID
488
+ * * SQL Data Type: uniqueidentifier
489
+ * * Default Value: newsequentialid()
490
+ */
491
+ get ID(): string;
492
+ set ID(value: string);
493
+ /**
494
+ * * Field Name: ContractTemplateID
495
+ * * Display Name: Contract Template
496
+ * * SQL Data Type: uniqueidentifier
497
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Templates (vwContractTemplates.ID)
498
+ */
499
+ get ContractTemplateID(): string;
500
+ set ContractTemplateID(value: string);
501
+ /**
502
+ * * Field Name: ProvisionNumber
503
+ * * Display Name: Provision Number
504
+ * * SQL Data Type: nvarchar(20)
505
+ * * Description: The clause number as the document writes it, e.g. "3.5(b)". Unique within its template.
506
+ */
507
+ get ProvisionNumber(): string;
508
+ set ProvisionNumber(value: string);
509
+ /**
510
+ * * Field Name: Title
511
+ * * Display Name: Title
512
+ * * SQL Data Type: nvarchar(200)
513
+ * * Description: The clause heading, e.g. "Limitation of Liability". This plus the number is what a person picks from.
514
+ */
515
+ get Title(): string;
516
+ set Title(value: string);
517
+ /**
518
+ * * Field Name: ProvisionText
519
+ * * Display Name: Provision Text
520
+ * * SQL Data Type: nvarchar(MAX)
521
+ * * 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.
522
+ */
523
+ get ProvisionText(): string;
524
+ set ProvisionText(value: string);
525
+ /**
526
+ * * Field Name: Description
527
+ * * Display Name: Description
528
+ * * SQL Data Type: nvarchar(MAX)
529
+ */
530
+ get Description(): string | null;
531
+ set Description(value: string | null);
532
+ /**
533
+ * * Field Name: ProvisionSortKey
534
+ * * Display Name: Sort Key
535
+ * * SQL Data Type: nvarchar(200)
536
+ * * 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.
537
+ */
538
+ get ProvisionSortKey(): string | null;
539
+ /**
540
+ * * Field Name: __mj_CreatedAt
541
+ * * Display Name: Created At
542
+ * * SQL Data Type: datetimeoffset
543
+ * * Default Value: getutcdate()
544
+ */
545
+ get __mj_CreatedAt(): Date;
546
+ /**
547
+ * * Field Name: __mj_UpdatedAt
548
+ * * Display Name: Updated At
549
+ * * SQL Data Type: datetimeoffset
550
+ * * Default Value: getutcdate()
551
+ */
552
+ get __mj_UpdatedAt(): Date;
553
+ /**
554
+ * * Field Name: ContractTemplate
555
+ * * Display Name: Contract Template Name
556
+ * * SQL Data Type: nvarchar(200)
557
+ */
558
+ get ContractTemplate(): string;
559
+ }
560
+ /**
561
+ * MJ_BizApps_Contracts: Contract Template Types - strongly typed entity sub-class
562
+ * * Schema: __mj_BizAppsContracts
563
+ * * Base Table: ContractTemplateType
564
+ * * Base View: vwContractTemplateTypes
565
+ * * @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.
566
+ * * Primary Key: ID
567
+ * @extends {BaseEntity}
568
+ * @class
569
+ * @public
570
+ */
571
+ export declare class mjBizAppsContractsContractTemplateTypeEntity extends BaseEntity<mjBizAppsContractsContractTemplateTypeEntityType> {
572
+ /**
573
+ * Loads the MJ_BizApps_Contracts: Contract Template Types record from the database
574
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Template Types record.
575
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
576
+ * @returns {Promise<boolean>} - true if successful, false otherwise
577
+ * @public
578
+ * @async
579
+ * @memberof mjBizAppsContractsContractTemplateTypeEntity
580
+ * @method
581
+ * @override
582
+ */
583
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
584
+ /**
585
+ * * Field Name: ID
586
+ * * Display Name: ID
587
+ * * SQL Data Type: uniqueidentifier
588
+ * * Default Value: newsequentialid()
589
+ */
590
+ get ID(): string;
591
+ set ID(value: string);
592
+ /**
593
+ * * Field Name: Name
594
+ * * Display Name: Name
595
+ * * SQL Data Type: nvarchar(100)
596
+ */
597
+ get Name(): string;
598
+ set Name(value: string);
599
+ /**
600
+ * * Field Name: Description
601
+ * * Display Name: Description
602
+ * * SQL Data Type: nvarchar(MAX)
603
+ */
604
+ get Description(): string | null;
605
+ set Description(value: string | null);
606
+ /**
607
+ * * Field Name: Status
608
+ * * Display Name: Status
609
+ * * SQL Data Type: nvarchar(10)
610
+ * * Default Value: Active
611
+ * * Value List Type: List
612
+ * * Possible Values
613
+ * * Active
614
+ * * Inactive
615
+ * * Description: Active | Inactive. Retiring a type hides it from pickers without touching the templates that used it.
616
+ */
617
+ get Status(): 'Active' | 'Inactive';
618
+ set Status(value: 'Active' | 'Inactive');
619
+ /**
620
+ * * Field Name: __mj_CreatedAt
621
+ * * Display Name: Created At
622
+ * * SQL Data Type: datetimeoffset
623
+ * * Default Value: getutcdate()
624
+ */
625
+ get __mj_CreatedAt(): Date;
626
+ /**
627
+ * * Field Name: __mj_UpdatedAt
628
+ * * Display Name: Updated At
629
+ * * SQL Data Type: datetimeoffset
630
+ * * Default Value: getutcdate()
631
+ */
632
+ get __mj_UpdatedAt(): Date;
633
+ }
634
+ /**
635
+ * MJ_BizApps_Contracts: Contract Templates - strongly typed entity sub-class
636
+ * * Schema: __mj_BizAppsContracts
637
+ * * Base Table: ContractTemplate
638
+ * * Base View: vwContractTemplates
639
+ * * @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.
640
+ * * Primary Key: ID
641
+ * @extends {BaseEntity}
642
+ * @class
643
+ * @public
644
+ */
645
+ export declare class mjBizAppsContractsContractTemplateEntity extends BaseEntity<mjBizAppsContractsContractTemplateEntityType> {
646
+ /**
647
+ * Related records: MJ_BizApps_Contracts: Contract Template Provisions
648
+ *
649
+ * Loads, validates and persists as one unit with this MJ_BizApps_Contracts: Contract Templates record — see
650
+ * guides/TRANSACTIONS_AND_BATCHING_GUIDE.md. Declared by the RelatedRecordCollection metadata on
651
+ * the 'MJ_BizApps_Contracts: Contract Templates → MJ_BizApps_Contracts: Contract Template Provisions' relationship; edit that row, not this file.
652
+ *
653
+ */
654
+ readonly Provisions: import("@memberjunction/core").RelatedRecordCollection<mjBizAppsContractsContractTemplateProvisionEntity>;
655
+ /**
656
+ * Loads the MJ_BizApps_Contracts: Contract Templates record from the database
657
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Templates record.
658
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
659
+ * @returns {Promise<boolean>} - true if successful, false otherwise
660
+ * @public
661
+ * @async
662
+ * @memberof mjBizAppsContractsContractTemplateEntity
663
+ * @method
664
+ * @override
665
+ */
666
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
667
+ /**
668
+ * * Field Name: ID
669
+ * * Display Name: ID
670
+ * * SQL Data Type: uniqueidentifier
671
+ * * Default Value: newsequentialid()
672
+ */
673
+ get ID(): string;
674
+ set ID(value: string);
675
+ /**
676
+ * * Field Name: Name
677
+ * * Display Name: Name
678
+ * * SQL Data Type: nvarchar(200)
679
+ */
680
+ get Name(): string;
681
+ set Name(value: string);
682
+ /**
683
+ * * Field Name: ContractTemplateTypeID
684
+ * * Display Name: Template Type ID
685
+ * * SQL Data Type: uniqueidentifier
686
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Template Types (vwContractTemplateTypes.ID)
687
+ */
688
+ get ContractTemplateTypeID(): string;
689
+ set ContractTemplateTypeID(value: string);
690
+ /**
691
+ * * Field Name: VersionLabel
692
+ * * Display Name: Version Label
693
+ * * SQL Data Type: nvarchar(50)
694
+ * * Description: The version the document names itself, e.g. "v6". Free text, because it is the documents own label rather than something we derive.
695
+ */
696
+ get VersionLabel(): string | null;
697
+ set VersionLabel(value: string | null);
698
+ /**
699
+ * * Field Name: IntroducedDate
700
+ * * Display Name: Introduced Date
701
+ * * SQL Data Type: date
702
+ * * 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.
703
+ */
704
+ get IntroducedDate(): Date | null;
705
+ set IntroducedDate(value: Date | null);
706
+ /**
707
+ * * Field Name: SourceURL
708
+ * * Display Name: Source URL
709
+ * * SQL Data Type: nvarchar(1000)
710
+ * * 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.
711
+ */
712
+ get SourceURL(): string | null;
713
+ set SourceURL(value: string | null);
714
+ /**
715
+ * * Field Name: Description
716
+ * * Display Name: Description
717
+ * * SQL Data Type: nvarchar(MAX)
718
+ */
719
+ get Description(): string | null;
720
+ set Description(value: string | null);
721
+ /**
722
+ * * Field Name: Status
723
+ * * Display Name: Status
724
+ * * SQL Data Type: nvarchar(20)
725
+ * * Default Value: Draft
726
+ * * Value List Type: List
727
+ * * Possible Values
728
+ * * Draft
729
+ * * Published
730
+ * * 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.
731
+ */
732
+ get Status(): 'Draft' | 'Published';
733
+ set Status(value: 'Draft' | 'Published');
734
+ /**
735
+ * * Field Name: __mj_CreatedAt
736
+ * * Display Name: Created At
737
+ * * SQL Data Type: datetimeoffset
738
+ * * Default Value: getutcdate()
739
+ */
740
+ get __mj_CreatedAt(): Date;
741
+ /**
742
+ * * Field Name: __mj_UpdatedAt
743
+ * * Display Name: Updated At
744
+ * * SQL Data Type: datetimeoffset
745
+ * * Default Value: getutcdate()
746
+ */
747
+ get __mj_UpdatedAt(): Date;
748
+ /**
749
+ * * Field Name: ContractTemplateType
750
+ * * Display Name: Template Type
751
+ * * SQL Data Type: nvarchar(100)
752
+ */
753
+ get ContractTemplateType(): string;
754
+ /**
755
+ * * Field Name: IsUsable
756
+ * * Display Name: Is Usable
757
+ * * SQL Data Type: bit
758
+ */
759
+ get IsUsable(): boolean | null;
760
+ }
761
+ /**
762
+ * MJ_BizApps_Contracts: Contract Types - strongly typed entity sub-class
763
+ * * Schema: __mj_BizAppsContracts
764
+ * * Base Table: ContractType
765
+ * * Base View: vwContractTypes
766
+ * * @description The kind of paper: Order Form, Statement of Work, Payment Link, Change Order. A lookup TABLE for the same reason as ContractTemplateType.
767
+ * * Primary Key: ID
768
+ * @extends {BaseEntity}
769
+ * @class
770
+ * @public
771
+ */
772
+ export declare class mjBizAppsContractsContractTypeEntity extends BaseEntity<mjBizAppsContractsContractTypeEntityType> {
773
+ /**
774
+ * Loads the MJ_BizApps_Contracts: Contract Types record from the database
775
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contract Types record.
776
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
777
+ * @returns {Promise<boolean>} - true if successful, false otherwise
778
+ * @public
779
+ * @async
780
+ * @memberof mjBizAppsContractsContractTypeEntity
781
+ * @method
782
+ * @override
783
+ */
784
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
785
+ /**
786
+ * 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:
787
+ * * Table-Level: An entity cannot be designated as both a root and a child at the same time.
788
+ * @public
789
+ * @method
790
+ * @override
791
+ */
792
+ Validate(): ValidationResult;
793
+ /**
794
+ * An entity cannot be designated as both a root and a child at the same time.
795
+ * @param result - the ValidationResult object to add any errors or warnings to
796
+ * @public
797
+ * @method
798
+ */
799
+ ValidateRootAndChildExclusivity(result: ValidationResult): void;
800
+ /**
801
+ * * Field Name: ID
802
+ * * Display Name: ID
803
+ * * SQL Data Type: uniqueidentifier
804
+ * * Default Value: newsequentialid()
805
+ */
806
+ get ID(): string;
807
+ set ID(value: string);
808
+ /**
809
+ * * Field Name: Name
810
+ * * Display Name: Name
811
+ * * SQL Data Type: nvarchar(100)
812
+ */
813
+ get Name(): string;
814
+ set Name(value: string);
815
+ /**
816
+ * * Field Name: Description
817
+ * * Display Name: Description
818
+ * * SQL Data Type: nvarchar(MAX)
819
+ */
820
+ get Description(): string | null;
821
+ set Description(value: string | null);
822
+ /**
823
+ * * Field Name: RequiresExecutedDocument
824
+ * * Display Name: Requires Executed Document
825
+ * * SQL Data Type: bit
826
+ * * Default Value: 1
827
+ * * 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.
828
+ */
829
+ get RequiresExecutedDocument(): boolean;
830
+ set RequiresExecutedDocument(value: boolean);
831
+ /**
832
+ * * Field Name: Status
833
+ * * Display Name: Status
834
+ * * SQL Data Type: nvarchar(10)
835
+ * * Default Value: Active
836
+ * * Value List Type: List
837
+ * * Possible Values
838
+ * * Active
839
+ * * Inactive
840
+ * * Description: Active | Inactive.
841
+ */
842
+ get Status(): 'Active' | 'Inactive';
843
+ set Status(value: 'Active' | 'Inactive');
844
+ /**
845
+ * * Field Name: MustBeRoot
846
+ * * Display Name: Must Be Root
847
+ * * SQL Data Type: bit
848
+ * * Default Value: 0
849
+ * * 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.
850
+ */
851
+ get MustBeRoot(): boolean;
852
+ set MustBeRoot(value: boolean);
853
+ /**
854
+ * * Field Name: MustBeChild
855
+ * * Display Name: Must Be Child
856
+ * * SQL Data Type: bit
857
+ * * Default Value: 0
858
+ * * 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.
859
+ */
860
+ get MustBeChild(): boolean;
861
+ set MustBeChild(value: boolean);
862
+ /**
863
+ * * Field Name: TemplateRequired
864
+ * * Display Name: Template Required
865
+ * * SQL Data Type: bit
866
+ * * Default Value: 0
867
+ * * 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.
868
+ */
869
+ get TemplateRequired(): boolean;
870
+ set TemplateRequired(value: boolean);
871
+ /**
872
+ * * Field Name: __mj_CreatedAt
873
+ * * Display Name: Created At
874
+ * * SQL Data Type: datetimeoffset
875
+ * * Default Value: getutcdate()
876
+ */
877
+ get __mj_CreatedAt(): Date;
878
+ /**
879
+ * * Field Name: __mj_UpdatedAt
880
+ * * Display Name: Updated At
881
+ * * SQL Data Type: datetimeoffset
882
+ * * Default Value: getutcdate()
883
+ */
884
+ get __mj_UpdatedAt(): Date;
885
+ }
886
+ /**
887
+ * MJ_BizApps_Contracts: Contracts - strongly typed entity sub-class
888
+ * * Schema: __mj_BizAppsContracts
889
+ * * Base Table: Contract
890
+ * * Base View: vwContracts
891
+ * * @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.
892
+ * * Primary Key: ID
893
+ * @extends {BaseEntity}
894
+ * @class
895
+ * @public
896
+ */
897
+ export declare class mjBizAppsContractsContractEntity extends BaseEntity<mjBizAppsContractsContractEntityType> {
898
+ /**
899
+ * Related records: MJ_BizApps_Contracts: Contract Template Modifications
900
+ *
901
+ * Loads, validates and persists as one unit with this MJ_BizApps_Contracts: Contracts record — see
902
+ * guides/TRANSACTIONS_AND_BATCHING_GUIDE.md. Declared by the RelatedRecordCollection metadata on
903
+ * the 'MJ_BizApps_Contracts: Contracts → MJ_BizApps_Contracts: Contract Template Modifications' relationship; edit that row, not this file.
904
+ *
905
+ */
906
+ readonly Modifications: import("@memberjunction/core").RelatedRecordCollection<mjBizAppsContractsContractTemplateModificationEntity>;
907
+ /**
908
+ * Loads the MJ_BizApps_Contracts: Contracts record from the database
909
+ * @param ID: string - primary key value to load the MJ_BizApps_Contracts: Contracts record.
910
+ * @param EntityRelationshipsToLoad - (optional) the relationships to load
911
+ * @returns {Promise<boolean>} - true if successful, false otherwise
912
+ * @public
913
+ * @async
914
+ * @memberof mjBizAppsContractsContractEntity
915
+ * @method
916
+ * @override
917
+ */
918
+ Load(ID: string, EntityRelationshipsToLoad?: string[]): Promise<boolean>;
919
+ /**
920
+ * 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:
921
+ * * AnnualIncreasePercent: The annual increase percentage must be greater than or equal to zero, ensuring that contract rates do not decrease automatically.
922
+ * * 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.
923
+ * * RenewalNoticeDays: Renewal notice days must be 0 or greater, if specified.
924
+ * * 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.
925
+ * * Table-Level: The contract end date must be on or after the effective date to ensure logical date ordering.
926
+ * * Table-Level: A contract cannot be its own parent contract to prevent circular references in the contract hierarchy.
927
+ * * Table-Level: A contract cannot be superseded by itself. The superseding contract must be a different contract record.
928
+ * @public
929
+ * @method
930
+ * @override
931
+ */
932
+ Validate(): ValidationResult;
933
+ /**
934
+ * The annual increase percentage must be greater than or equal to zero, ensuring that contract rates do not decrease automatically.
935
+ * @param result - the ValidationResult object to add any errors or warnings to
936
+ * @public
937
+ * @method
938
+ */
939
+ ValidateAnnualIncreasePercentNonNegative(result: ValidationResult): void;
940
+ /**
941
+ * 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.
942
+ * @param result - the ValidationResult object to add any errors or warnings to
943
+ * @public
944
+ * @method
945
+ */
946
+ ValidateCancellationWindowDaysGreaterThanOrEqualToZero(result: ValidationResult): void;
947
+ /**
948
+ * Renewal notice days must be 0 or greater, if specified.
949
+ * @param result - the ValidationResult object to add any errors or warnings to
950
+ * @public
951
+ * @method
952
+ */
953
+ ValidateRenewalNoticeDaysGreaterThanOrEqualToZero(result: ValidationResult): void;
954
+ /**
955
+ * 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.
956
+ * @param result - the ValidationResult object to add any errors or warnings to
957
+ * @public
958
+ * @method
959
+ */
960
+ ValidateCreatingEntityAndRecordCoexistence(result: ValidationResult): void;
961
+ /**
962
+ * The contract end date must be on or after the effective date to ensure logical date ordering.
963
+ * @param result - the ValidationResult object to add any errors or warnings to
964
+ * @public
965
+ * @method
966
+ */
967
+ ValidateEndDateAfterOrEqualToEffectiveDate(result: ValidationResult): void;
968
+ /**
969
+ * A contract cannot be its own parent contract to prevent circular references in the contract hierarchy.
970
+ * @param result - the ValidationResult object to add any errors or warnings to
971
+ * @public
972
+ * @method
973
+ */
974
+ ValidateParentContractIDNotEqualToID(result: ValidationResult): void;
975
+ /**
976
+ * A contract cannot be superseded by itself. The superseding contract must be a different contract record.
977
+ * @param result - the ValidationResult object to add any errors or warnings to
978
+ * @public
979
+ * @method
980
+ */
981
+ ValidateSupersededByContractIDNotEqualToID(result: ValidationResult): void;
982
+ /**
983
+ * * Field Name: ID
984
+ * * Display Name: ID
985
+ * * SQL Data Type: uniqueidentifier
986
+ * * Default Value: newsequentialid()
987
+ */
988
+ get ID(): string;
989
+ set ID(value: string);
990
+ /**
991
+ * * Field Name: ContractNumber
992
+ * * Display Name: Contract Number
993
+ * * SQL Data Type: nvarchar(50)
994
+ * * 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.
995
+ */
996
+ get ContractNumber(): string | null;
997
+ set ContractNumber(value: string | null);
998
+ /**
999
+ * * Field Name: ContractTypeID
1000
+ * * Display Name: Contract Type
1001
+ * * SQL Data Type: uniqueidentifier
1002
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Types (vwContractTypes.ID)
1003
+ */
1004
+ get ContractTypeID(): string;
1005
+ set ContractTypeID(value: string);
1006
+ /**
1007
+ * * Field Name: CompanyID
1008
+ * * Display Name: Company
1009
+ * * SQL Data Type: uniqueidentifier
1010
+ * * Related Entity/Foreign Key: MJ: Companies (vwCompanies.ID)
1011
+ * * 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.
1012
+ */
1013
+ get CompanyID(): string;
1014
+ set CompanyID(value: string);
1015
+ /**
1016
+ * * Field Name: CustomerOrganizationID
1017
+ * * Display Name: Customer Organization
1018
+ * * SQL Data Type: uniqueidentifier
1019
+ * * Related Entity/Foreign Key: MJ_BizApps_Common: Organizations (vwOrganizations.ID)
1020
+ * * 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.
1021
+ */
1022
+ get CustomerOrganizationID(): string;
1023
+ set CustomerOrganizationID(value: string);
1024
+ /**
1025
+ * * Field Name: PrimaryContactPersonID
1026
+ * * Display Name: Primary Contact Person
1027
+ * * SQL Data Type: uniqueidentifier
1028
+ * * Related Entity/Foreign Key: MJ_BizApps_Common: People (vwPeople.ID)
1029
+ * * Description: Their named contact, optional.
1030
+ */
1031
+ get PrimaryContactPersonID(): string | null;
1032
+ set PrimaryContactPersonID(value: string | null);
1033
+ /**
1034
+ * * Field Name: ContractTemplateID
1035
+ * * Display Name: Contract Template
1036
+ * * SQL Data Type: uniqueidentifier
1037
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contract Templates (vwContractTemplates.ID)
1038
+ * * Description: The agreement version this contract incorporates. Nullable because a contract created automatically at Closed Won has none until finance reads the PDF.
1039
+ */
1040
+ get ContractTemplateID(): string | null;
1041
+ set ContractTemplateID(value: string | null);
1042
+ /**
1043
+ * * Field Name: CreatingEntityID
1044
+ * * Display Name: Creating Entity
1045
+ * * SQL Data Type: uniqueidentifier
1046
+ * * Related Entity/Foreign Key: MJ: Entities (vwEntities.ID)
1047
+ * * 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.
1048
+ */
1049
+ get CreatingEntityID(): string | null;
1050
+ set CreatingEntityID(value: string | null);
1051
+ /**
1052
+ * * Field Name: CreatingRecordID
1053
+ * * Display Name: Creating Record ID
1054
+ * * SQL Data Type: nvarchar(450)
1055
+ * * 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.
1056
+ */
1057
+ get CreatingRecordID(): string | null;
1058
+ set CreatingRecordID(value: string | null);
1059
+ /**
1060
+ * * Field Name: ParentContractID
1061
+ * * Display Name: Parent Contract
1062
+ * * SQL Data Type: uniqueidentifier
1063
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
1064
+ * * 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.
1065
+ */
1066
+ get ParentContractID(): string | null;
1067
+ set ParentContractID(value: string | null);
1068
+ /**
1069
+ * * Field Name: SupersededByContractID
1070
+ * * Display Name: Superseded By
1071
+ * * SQL Data Type: uniqueidentifier
1072
+ * * Related Entity/Foreign Key: MJ_BizApps_Contracts: Contracts (vwContracts.ID)
1073
+ * * 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.
1074
+ */
1075
+ get SupersededByContractID(): string | null;
1076
+ set SupersededByContractID(value: string | null);
1077
+ /**
1078
+ * * Field Name: SigningProviderURL
1079
+ * * Display Name: Signing Provider URL
1080
+ * * SQL Data Type: nvarchar(1000)
1081
+ * * 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.
1082
+ */
1083
+ get SigningProviderURL(): string | null;
1084
+ set SigningProviderURL(value: string | null);
1085
+ /**
1086
+ * * Field Name: EffectiveDate
1087
+ * * Display Name: Effective Date
1088
+ * * SQL Data Type: date
1089
+ * * Description: When the agreement takes effect.
1090
+ */
1091
+ get EffectiveDate(): Date | null;
1092
+ set EffectiveDate(value: Date | null);
1093
+ /**
1094
+ * * Field Name: ExecutedDate
1095
+ * * Display Name: Executed Date
1096
+ * * SQL Data Type: date
1097
+ * * 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.
1098
+ */
1099
+ get ExecutedDate(): Date | null;
1100
+ set ExecutedDate(value: Date | null);
1101
+ /**
1102
+ * * Field Name: EndDate
1103
+ * * Display Name: End Date
1104
+ * * SQL Data Type: date
1105
+ * * Description: When the current term ends. This is what drives the renewal watchlist and every expiry projection.
1106
+ */
1107
+ get EndDate(): Date | null;
1108
+ set EndDate(value: Date | null);
1109
+ /**
1110
+ * * Field Name: TerminatedDate
1111
+ * * Display Name: Terminated Date
1112
+ * * SQL Data Type: date
1113
+ * * 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.
1114
+ */
1115
+ get TerminatedDate(): Date | null;
1116
+ set TerminatedDate(value: Date | null);
1117
+ /**
1118
+ * * Field Name: AutoRenew
1119
+ * * Display Name: Auto Renew
1120
+ * * SQL Data Type: bit
1121
+ * * Default Value: 0
1122
+ * * 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.
1123
+ */
1124
+ get AutoRenew(): boolean;
1125
+ set AutoRenew(value: boolean);
1126
+ /**
1127
+ * * Field Name: RenewalNoticeDays
1128
+ * * Display Name: Renewal Notice (Days)
1129
+ * * SQL Data Type: int
1130
+ * * 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.
1131
+ */
1132
+ get RenewalNoticeDays(): number | null;
1133
+ set RenewalNoticeDays(value: number | null);
1134
+ /**
1135
+ * * Field Name: CancellationWindowDays
1136
+ * * Display Name: Cancellation Window Days
1137
+ * * SQL Data Type: int
1138
+ * * Description: Days of notice the customer owes to cancel without renewing.
1139
+ */
1140
+ get CancellationWindowDays(): number | null;
1141
+ set CancellationWindowDays(value: number | null);
1142
+ /**
1143
+ * * Field Name: AnnualIncreasePercent
1144
+ * * Display Name: Annual Increase Percent
1145
+ * * SQL Data Type: decimal(7, 4)
1146
+ * * 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.
1147
+ */
1148
+ get AnnualIncreasePercent(): number | null;
1149
+ set AnnualIncreasePercent(value: number | null);
1150
+ /**
1151
+ * * Field Name: HasModifications
1152
+ * * Display Name: Has Modifications
1153
+ * * SQL Data Type: bit
1154
+ * * Default Value: 0
1155
+ * * 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.
1156
+ */
1157
+ get HasModifications(): boolean;
1158
+ set HasModifications(value: boolean);
1159
+ /**
1160
+ * * Field Name: Description
1161
+ * * Display Name: Description
1162
+ * * SQL Data Type: nvarchar(MAX)
1163
+ */
1164
+ get Description(): string | null;
1165
+ set Description(value: string | null);
1166
+ /**
1167
+ * * Field Name: Notes
1168
+ * * Display Name: Notes
1169
+ * * SQL Data Type: nvarchar(MAX)
1170
+ * * Description: Free-text working notes for whoever is processing the contract.
1171
+ */
1172
+ get Notes(): string | null;
1173
+ set Notes(value: string | null);
1174
+ /**
1175
+ * * Field Name: __mj_CreatedAt
1176
+ * * Display Name: Created At
1177
+ * * SQL Data Type: datetimeoffset
1178
+ * * Default Value: getutcdate()
1179
+ */
1180
+ get __mj_CreatedAt(): Date;
1181
+ /**
1182
+ * * Field Name: __mj_UpdatedAt
1183
+ * * Display Name: Updated At
1184
+ * * SQL Data Type: datetimeoffset
1185
+ * * Default Value: getutcdate()
1186
+ */
1187
+ get __mj_UpdatedAt(): Date;
1188
+ /**
1189
+ * * Field Name: PredictedNonRenewalRisk
1190
+ * * Display Name: Predicted Non Renewal Risk
1191
+ * * SQL Data Type: decimal(5, 4)
1192
+ * * Description: Predicted probability (0.0000 to 1.0000) that this commercial agreement will fail to renew prior to the required notice deadline.
1193
+ */
1194
+ get PredictedNonRenewalRisk(): number | null;
1195
+ set PredictedNonRenewalRisk(value: number | null);
1196
+ /**
1197
+ * * Field Name: PredictedRenewalRiskBand
1198
+ * * Display Name: Predicted Renewal Risk Band
1199
+ * * SQL Data Type: nvarchar(20)
1200
+ * * Value List Type: List
1201
+ * * Possible Values
1202
+ * * Critical
1203
+ * * High
1204
+ * * Low
1205
+ * * Medium
1206
+ * * Description: Derived operational risk band classifying renewal risk: Low (<20%), Medium (20-50%), High (50-80%), Critical (>=80%).
1207
+ */
1208
+ get PredictedRenewalRiskBand(): 'Critical' | 'High' | 'Low' | 'Medium' | null;
1209
+ set PredictedRenewalRiskBand(value: 'Critical' | 'High' | 'Low' | 'Medium' | null);
1210
+ /**
1211
+ * * Field Name: PredictedRenewalScoredAt
1212
+ * * Display Name: Predicted Renewal Scored At
1213
+ * * SQL Data Type: datetimeoffset
1214
+ * * Description: Timestamp of the most recent predictive model scoring execution for this contract.
1215
+ */
1216
+ get PredictedRenewalScoredAt(): Date | null;
1217
+ set PredictedRenewalScoredAt(value: Date | null);
1218
+ /**
1219
+ * * Field Name: ContractType
1220
+ * * Display Name: Contract Type Name
1221
+ * * SQL Data Type: nvarchar(100)
1222
+ */
1223
+ get ContractType(): string;
1224
+ /**
1225
+ * * Field Name: Company
1226
+ * * Display Name: Company Name
1227
+ * * SQL Data Type: nvarchar(50)
1228
+ */
1229
+ get Company(): string;
1230
+ /**
1231
+ * * Field Name: CustomerOrganization
1232
+ * * Display Name: Customer Organization Name
1233
+ * * SQL Data Type: nvarchar(255)
1234
+ */
1235
+ get CustomerOrganization(): string;
1236
+ /**
1237
+ * * Field Name: PrimaryContactPerson
1238
+ * * Display Name: Primary Contact Name
1239
+ * * SQL Data Type: nvarchar(100)
1240
+ */
1241
+ get PrimaryContactPerson(): string | null;
1242
+ /**
1243
+ * * Field Name: ContractTemplate
1244
+ * * Display Name: Contract Template Name
1245
+ * * SQL Data Type: nvarchar(200)
1246
+ */
1247
+ get ContractTemplate(): string | null;
1248
+ /**
1249
+ * * Field Name: CreatingEntity
1250
+ * * Display Name: Creating Entity Name
1251
+ * * SQL Data Type: nvarchar(255)
1252
+ */
1253
+ get CreatingEntity(): string | null;
1254
+ /**
1255
+ * * Field Name: ParentContract
1256
+ * * Display Name: Parent Contract
1257
+ * * SQL Data Type: nvarchar(50)
1258
+ */
1259
+ get ParentContract(): string | null;
1260
+ /**
1261
+ * * Field Name: SupersededByContract
1262
+ * * Display Name: Superseded By Contract
1263
+ * * SQL Data Type: nvarchar(50)
1264
+ */
1265
+ get SupersededByContract(): string | null;
1266
+ /**
1267
+ * * Field Name: State
1268
+ * * Display Name: State
1269
+ * * SQL Data Type: varchar(10)
1270
+ */
1271
+ get State(): string;
1272
+ /**
1273
+ * * Field Name: IsAwaitingDocument
1274
+ * * Display Name: Is Awaiting Document
1275
+ * * SQL Data Type: bit
1276
+ */
1277
+ get IsAwaitingDocument(): boolean | null;
1278
+ /**
1279
+ * * Field Name: DaysToEnd
1280
+ * * Display Name: Days To End
1281
+ * * SQL Data Type: int
1282
+ */
1283
+ get DaysToEnd(): number | null;
1284
+ /**
1285
+ * * Field Name: RenewalNoticeDeadline
1286
+ * * Display Name: Renewal Notice Deadline
1287
+ * * SQL Data Type: date
1288
+ */
1289
+ get RenewalNoticeDeadline(): Date | null;
1290
+ /**
1291
+ * * Field Name: IsInCancellationWindow
1292
+ * * Display Name: Is In Cancellation Window
1293
+ * * SQL Data Type: bit
1294
+ */
1295
+ get IsInCancellationWindow(): boolean | null;
1296
+ /**
1297
+ * * Field Name: NonRenewalOutcome
1298
+ * * Display Name: Non Renewal Outcome
1299
+ * * SQL Data Type: int
1300
+ */
1301
+ get NonRenewalOutcome(): number | null;
1302
+ /**
1303
+ * * Field Name: TermLengthDays
1304
+ * * Display Name: Term Length Days
1305
+ * * SQL Data Type: int
1306
+ */
1307
+ get TermLengthDays(): number | null;
1308
+ /**
1309
+ * * Field Name: DaysUntilNoticeDeadline
1310
+ * * Display Name: Days Until Notice Deadline
1311
+ * * SQL Data Type: int
1312
+ */
1313
+ get DaysUntilNoticeDeadline(): number | null;
1314
+ /**
1315
+ * * Field Name: HasModificationsFlag
1316
+ * * Display Name: Has Modifications Flag
1317
+ * * SQL Data Type: int
1318
+ */
1319
+ get HasModificationsFlag(): number;
1320
+ /**
1321
+ * * Field Name: AutoRenewFlag
1322
+ * * Display Name: Auto Renew Flag
1323
+ * * SQL Data Type: int
1324
+ */
1325
+ get AutoRenewFlag(): number;
1326
+ /**
1327
+ * * Field Name: HasParentContract
1328
+ * * Display Name: Has Parent Contract
1329
+ * * SQL Data Type: int
1330
+ */
1331
+ get HasParentContract(): number;
1332
+ /**
1333
+ * * Field Name: HasCancellationWindow
1334
+ * * Display Name: Has Cancellation Window
1335
+ * * SQL Data Type: int
1336
+ */
1337
+ get HasCancellationWindow(): number;
1338
+ /**
1339
+ * * Field Name: HasAnnualIncrease
1340
+ * * Display Name: Has Annual Increase
1341
+ * * SQL Data Type: int
1342
+ */
1343
+ get HasAnnualIncrease(): number;
1344
+ }
1345
+ //# sourceMappingURL=__mj_BizAppsContracts.d.ts.map