@carbonbox/domain 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractContractAmendments.js +30 -8
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendment.d.ts +2 -1
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendment.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendmentPrimitives.d.ts +2 -1
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendmentPrimitives.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractContractAmendments.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -50,7 +50,12 @@ class PurchaseContractContractAmendments extends ValueObject_1.ValueObject {
|
|
|
50
50
|
amendmentReason: amendment.amendmentReason.trim(),
|
|
51
51
|
modifiedSections: [...amendment.modifiedSections],
|
|
52
52
|
effectiveDate: amendment.effectiveDate.trim(),
|
|
53
|
-
amendedByStakeholder:
|
|
53
|
+
amendedByStakeholder: {
|
|
54
|
+
id: amendment.amendedByStakeholder.id.trim(),
|
|
55
|
+
displayName: amendment.amendedByStakeholder.displayName.trim(),
|
|
56
|
+
taxIdentification: amendment.amendedByStakeholder.taxIdentification,
|
|
57
|
+
roleType: amendment.amendedByStakeholder.roleType,
|
|
58
|
+
},
|
|
54
59
|
}));
|
|
55
60
|
}
|
|
56
61
|
static toCleanAmendments(value) {
|
|
@@ -61,7 +66,12 @@ class PurchaseContractContractAmendments extends ValueObject_1.ValueObject {
|
|
|
61
66
|
amendmentReason: amendment.amendmentReason.trim(),
|
|
62
67
|
modifiedSections: [...amendment.modifiedSections],
|
|
63
68
|
effectiveDate: amendment.effectiveDate.trim(),
|
|
64
|
-
amendedByStakeholder:
|
|
69
|
+
amendedByStakeholder: {
|
|
70
|
+
id: amendment.amendedByStakeholder.id.trim(),
|
|
71
|
+
displayName: amendment.amendedByStakeholder.displayName.trim(),
|
|
72
|
+
taxIdentification: amendment.amendedByStakeholder.taxIdentification,
|
|
73
|
+
roleType: amendment.amendedByStakeholder.roleType,
|
|
74
|
+
},
|
|
65
75
|
}));
|
|
66
76
|
}
|
|
67
77
|
get contractAmendments() {
|
|
@@ -86,7 +96,7 @@ class PurchaseContractContractAmendments extends ValueObject_1.ValueObject {
|
|
|
86
96
|
return __classPrivateFieldGet(this, _PurchaseContractContractAmendments_contractAmendments, "f").map((amendment) => amendment.amendmentNumber);
|
|
87
97
|
}
|
|
88
98
|
getAmendmentsByStakeholder(stakeholderId) {
|
|
89
|
-
return __classPrivateFieldGet(this, _PurchaseContractContractAmendments_contractAmendments, "f").filter((amendment) => amendment.amendedByStakeholder === stakeholderId.trim());
|
|
99
|
+
return __classPrivateFieldGet(this, _PurchaseContractContractAmendments_contractAmendments, "f").filter((amendment) => amendment.amendedByStakeholder.id === stakeholderId.trim());
|
|
90
100
|
}
|
|
91
101
|
getAmendmentsEffectiveOn(date) {
|
|
92
102
|
return __classPrivateFieldGet(this, _PurchaseContractContractAmendments_contractAmendments, "f").filter((amendment) => __classPrivateFieldGet(this, _PurchaseContractContractAmendments_instances, "m", _PurchaseContractContractAmendments_isEffectiveOn).call(this, amendment.effectiveDate, date));
|
|
@@ -152,7 +162,12 @@ class PurchaseContractContractAmendments extends ValueObject_1.ValueObject {
|
|
|
152
162
|
amendmentReason: amendment.amendmentReason,
|
|
153
163
|
modifiedSections: [...amendment.modifiedSections],
|
|
154
164
|
effectiveDate: amendment.effectiveDate,
|
|
155
|
-
amendedByStakeholder:
|
|
165
|
+
amendedByStakeholder: {
|
|
166
|
+
id: amendment.amendedByStakeholder.id,
|
|
167
|
+
displayName: amendment.amendedByStakeholder.displayName,
|
|
168
|
+
taxIdentification: amendment.amendedByStakeholder.taxIdentification,
|
|
169
|
+
roleType: amendment.amendedByStakeholder.roleType,
|
|
170
|
+
},
|
|
156
171
|
}));
|
|
157
172
|
}
|
|
158
173
|
toJSON() {
|
|
@@ -208,8 +223,8 @@ _a = PurchaseContractContractAmendments, _PurchaseContractContractAmendments_con
|
|
|
208
223
|
if (typeof value.effectiveDate !== 'string') {
|
|
209
224
|
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('effectiveDate', 'string', typeof value.effectiveDate);
|
|
210
225
|
}
|
|
211
|
-
if (typeof value.amendedByStakeholder !== '
|
|
212
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('amendedByStakeholder', '
|
|
226
|
+
if (!value.amendedByStakeholder || typeof value.amendedByStakeholder !== 'object') {
|
|
227
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('amendedByStakeholder', 'StakeholderReference', typeof value.amendedByStakeholder);
|
|
213
228
|
}
|
|
214
229
|
}, _PurchaseContractContractAmendments_guardAgainstInvalidAmendmentNumber = function _PurchaseContractContractAmendments_guardAgainstInvalidAmendmentNumber(amendmentNumber) {
|
|
215
230
|
String_1.String.guardAgainstEmptyValue(amendmentNumber, 'amendmentNumber');
|
|
@@ -230,8 +245,15 @@ _a = PurchaseContractContractAmendments, _PurchaseContractContractAmendments_con
|
|
|
230
245
|
}, _PurchaseContractContractAmendments_guardAgainstInvalidEffectiveDate = function _PurchaseContractContractAmendments_guardAgainstInvalidEffectiveDate(effectiveDate) {
|
|
231
246
|
DateString_1.DateString.guardAgainstInvalidDateFormat(effectiveDate);
|
|
232
247
|
}, _PurchaseContractContractAmendments_guardAgainstInvalidAmendedByStakeholder = function _PurchaseContractContractAmendments_guardAgainstInvalidAmendedByStakeholder(amendedByStakeholder) {
|
|
233
|
-
|
|
234
|
-
|
|
248
|
+
if (!amendedByStakeholder) {
|
|
249
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('amendedByStakeholder', 'StakeholderReference', 'null or undefined');
|
|
250
|
+
}
|
|
251
|
+
if (typeof amendedByStakeholder !== 'object') {
|
|
252
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('amendedByStakeholder', 'StakeholderReference', typeof amendedByStakeholder);
|
|
253
|
+
}
|
|
254
|
+
String_1.String.guardAgainstEmptyValue(amendedByStakeholder.id, 'amendedByStakeholder.id');
|
|
255
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(amendedByStakeholder.id, 'amendedByStakeholder.id');
|
|
256
|
+
String_1.String.guardAgainstEmptyValue(amendedByStakeholder.displayName, 'amendedByStakeholder.displayName');
|
|
235
257
|
}, _PurchaseContractContractAmendments_isEffectiveOn = function _PurchaseContractContractAmendments_isEffectiveOn(effectiveDate, checkDate) {
|
|
236
258
|
try {
|
|
237
259
|
const effective = __classPrivateFieldGet(this, _PurchaseContractContractAmendments_instances, "m", _PurchaseContractContractAmendments_parseDate).call(this, effectiveDate);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StakeholderReference } from '../../../../shared/domain/types/StakeholderReference';
|
|
1
2
|
export type ContractAmendment = {
|
|
2
3
|
amendmentNumber: string;
|
|
3
4
|
amendmentDate: string;
|
|
@@ -5,6 +6,6 @@ export type ContractAmendment = {
|
|
|
5
6
|
amendmentReason: string;
|
|
6
7
|
modifiedSections: string[];
|
|
7
8
|
effectiveDate: string;
|
|
8
|
-
amendedByStakeholder:
|
|
9
|
+
amendedByStakeholder: StakeholderReference;
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=ContractAmendment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractAmendment.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendment.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"ContractAmendment.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAE5F,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,oBAAoB,CAAC;CAC5C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StakeholderReferencePrimitives } from '../../../../shared/domain/types/StakeholderReferencePrimitives';
|
|
1
2
|
export type ContractAmendmentPrimitives = {
|
|
2
3
|
amendmentNumber: string;
|
|
3
4
|
amendmentDate: string;
|
|
@@ -5,6 +6,6 @@ export type ContractAmendmentPrimitives = {
|
|
|
5
6
|
amendmentReason: string;
|
|
6
7
|
modifiedSections: string[];
|
|
7
8
|
effectiveDate: string;
|
|
8
|
-
amendedByStakeholder:
|
|
9
|
+
amendedByStakeholder: StakeholderReferencePrimitives;
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=ContractAmendmentPrimitives.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractAmendmentPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendmentPrimitives.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"ContractAmendmentPrimitives.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/types/ContractAmendmentPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,gEAAgE,CAAC;AAEhH,MAAM,MAAM,2BAA2B,GAAG;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,8BAA8B,CAAC;CACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PurchaseContractContractAmendments.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractContractAmendments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"PurchaseContractContractAmendments.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractContractAmendments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B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