@carbonbox/domain 0.4.8 → 0.4.9
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/shared/domain/value-objects/ActivityDataSubmissionReference.js +97 -61
- package/build/carbonbox/shared/domain/value-objects/Address.js +63 -52
- package/build/carbonbox/shared/domain/value-objects/AggregateId.js +13 -18
- package/build/carbonbox/shared/domain/value-objects/Boolean.js +29 -30
- package/build/carbonbox/shared/domain/value-objects/CalculationProcessReference.js +36 -32
- package/build/carbonbox/shared/domain/value-objects/CalculationVariableReferences.js +82 -62
- package/build/carbonbox/shared/domain/value-objects/CarbonClientReference.js +181 -114
- package/build/carbonbox/shared/domain/value-objects/CarbonClientReferences.js +109 -74
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.js +37 -27
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.js +101 -68
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.js +95 -60
- package/build/carbonbox/shared/domain/value-objects/CodeList.js +57 -41
- package/build/carbonbox/shared/domain/value-objects/CollectionFieldReference.js +74 -49
- package/build/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.js +171 -116
- package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.js +70 -43
- package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.js +70 -43
- package/build/carbonbox/shared/domain/value-objects/Currency.js +10 -15
- package/build/carbonbox/shared/domain/value-objects/DateString.js +15 -20
- package/build/carbonbox/shared/domain/value-objects/DateTimeString.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/Email.js +9 -14
- package/build/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.js +46 -31
- package/build/carbonbox/shared/domain/value-objects/EmissionCalculationReference.js +102 -77
- package/build/carbonbox/shared/domain/value-objects/EmissionFactorReference.js +56 -40
- package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.js +58 -38
- package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.js +95 -60
- package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.js +171 -116
- package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.js +43 -30
- package/build/carbonbox/shared/domain/value-objects/EventEditionReference.js +49 -33
- package/build/carbonbox/shared/domain/value-objects/EventEditionReferences.js +65 -49
- package/build/carbonbox/shared/domain/value-objects/EventReference.js +41 -31
- package/build/carbonbox/shared/domain/value-objects/ExecutionPeriod.js +95 -79
- package/build/carbonbox/shared/domain/value-objects/FacilityReference.js +34 -24
- package/build/carbonbox/shared/domain/value-objects/Gender.js +11 -16
- package/build/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.js +72 -53
- package/build/carbonbox/shared/domain/value-objects/Image.js +46 -38
- package/build/carbonbox/shared/domain/value-objects/Integer.js +13 -18
- package/build/carbonbox/shared/domain/value-objects/NullableCode.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.js +49 -31
- package/build/carbonbox/shared/domain/value-objects/NullableDate.js +25 -27
- package/build/carbonbox/shared/domain/value-objects/NullableDateTimeString.js +34 -37
- package/build/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.js +49 -31
- package/build/carbonbox/shared/domain/value-objects/NullableNumeric.js +60 -63
- package/build/carbonbox/shared/domain/value-objects/NullablePositiveInteger.js +4 -11
- package/build/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.js +49 -31
- package/build/carbonbox/shared/domain/value-objects/NullableStakeholderReference.js +8 -8
- package/build/carbonbox/shared/domain/value-objects/NullableString.js +22 -25
- package/build/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.js +43 -35
- package/build/carbonbox/shared/domain/value-objects/Numeric.js +72 -69
- package/build/carbonbox/shared/domain/value-objects/Phone.js +66 -47
- package/build/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.js +176 -121
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.js +101 -61
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.js +101 -61
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.js +60 -40
- package/build/carbonbox/shared/domain/value-objects/ProductReference.js +46 -31
- package/build/carbonbox/shared/domain/value-objects/ServiceCatalogReference.js +60 -40
- package/build/carbonbox/shared/domain/value-objects/StakeholderReference.js +123 -75
- package/build/carbonbox/shared/domain/value-objects/StakeholderReferences.js +124 -81
- package/build/carbonbox/shared/domain/value-objects/String.js +13 -17
- package/build/carbonbox/shared/domain/value-objects/StringList.js +35 -35
- package/build/carbonbox/shared/domain/value-objects/TaxIdentification.js +121 -85
- package/build/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.js +57 -52
- package/build/carbonbox/shared/domain/value-objects/Url.js +14 -19
- package/build/carbonbox/shared/domain/value-objects/UrlList.js +57 -41
- package/build/carbonbox/shared/domain/value-objects/UserBusinessStatus.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/UserEmail.js +48 -40
- package/build/carbonbox/shared/domain/value-objects/UserPassword.js +29 -32
- package/build/carbonbox/shared/domain/value-objects/UserPermissions.js +47 -46
- package/build/carbonbox/shared/domain/value-objects/UserType.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/ValueObject.js +17 -16
- package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts +37 -1
- package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts +22 -4
- package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts +4 -3
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts +2 -2
- package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts +24 -4
- package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts +70 -2
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts +39 -2
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts +11 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts +35 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts +38 -2
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts +18 -2
- package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts +26 -1
- package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts +64 -2
- package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +30 -2
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +30 -2
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts +3 -2
- package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts +5 -3
- package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts +5 -3
- package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts +3 -2
- package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts +16 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts +26 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts +17 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts +3 -3
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +22 -2
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts +38 -2
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts +64 -2
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts +14 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts +17 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts +20 -4
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts +11 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts +16 -1
- package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts +11 -1
- package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts +4 -3
- package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts +21 -2
- package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts +12 -0
- package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts +6 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts +6 -2
- package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts +3 -2
- package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts +2 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts +20 -5
- package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts +11 -2
- package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts +21 -2
- package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts +2 -1
- package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts +60 -2
- package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts +45 -4
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +45 -4
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts +21 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts +16 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts +21 -1
- package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts +51 -2
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts +46 -2
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/String.d.ts +3 -1
- package/build/types/carbonbox/shared/domain/value-objects/String.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts +7 -1
- package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts +41 -3
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts +4 -4
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts +16 -4
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts +2 -1
- package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts +18 -2
- package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts +10 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts +7 -3
- package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts +11 -3
- package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts +2 -0
- package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
2
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
8
3
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
9
4
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
10
5
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
11
6
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
7
|
};
|
|
13
|
-
var
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _Image_fullSizeUrl, _Image_thumbnailUrl, _Image_altText, _Image_uploadedAt, _Image_dimensions;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.Image = void 0;
|
|
16
16
|
const DateString_1 = require("./DateString");
|
|
@@ -22,14 +22,13 @@ const InvalidPropertyValueError_1 = require("../exceptions/InvalidPropertyValueE
|
|
|
22
22
|
class Image extends ObjectValueObject_1.ObjectValueObject {
|
|
23
23
|
constructor(value, skipDomainValidation, propertyName) {
|
|
24
24
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type Image from the domain layer', { allowNull: false, allowUndefined: false });
|
|
25
|
-
_Image_instances.add(this);
|
|
26
25
|
_Image_fullSizeUrl.set(this, void 0);
|
|
27
26
|
_Image_thumbnailUrl.set(this, void 0);
|
|
28
27
|
_Image_altText.set(this, void 0);
|
|
29
28
|
_Image_uploadedAt.set(this, void 0);
|
|
30
29
|
_Image_dimensions.set(this, void 0);
|
|
31
30
|
if (skipDomainValidation === false) {
|
|
32
|
-
|
|
31
|
+
this.guardAgainstInvalidImageProperties(value);
|
|
33
32
|
}
|
|
34
33
|
__classPrivateFieldSet(this, _Image_fullSizeUrl, value.fullSizeUrl, "f");
|
|
35
34
|
__classPrivateFieldSet(this, _Image_thumbnailUrl, value.thumbnailUrl, "f");
|
|
@@ -40,6 +39,44 @@ class Image extends ObjectValueObject_1.ObjectValueObject {
|
|
|
40
39
|
height: value.dimensions.height,
|
|
41
40
|
}, "f");
|
|
42
41
|
}
|
|
42
|
+
guardAgainstInvalidImageProperties(value) {
|
|
43
|
+
this.guardAgainstInvalidUploadedAt(value.uploadedAt);
|
|
44
|
+
this.guardAgainstInvalidFullSizeUrl(value.fullSizeUrl);
|
|
45
|
+
this.guardAgainstInvalidAltText(value.altText);
|
|
46
|
+
this.guardAgainstInvalidDimensions(value.dimensions);
|
|
47
|
+
this.guardAgainstInvalidThumbnailUrl(value.thumbnailUrl);
|
|
48
|
+
}
|
|
49
|
+
guardAgainstInvalidUploadedAt(value) {
|
|
50
|
+
DateString_1.DateString.guardAgainstInvalidDateFormat(value);
|
|
51
|
+
}
|
|
52
|
+
guardAgainstInvalidFullSizeUrl(value) {
|
|
53
|
+
Url_1.Url.guardAgainstInvalidUrl(value, 'fullSizeUrl');
|
|
54
|
+
}
|
|
55
|
+
guardAgainstInvalidAltText(value) {
|
|
56
|
+
String_1.String.guardAgainstInvalidType(value, 'altText');
|
|
57
|
+
}
|
|
58
|
+
guardAgainstInvalidDimensions(value) {
|
|
59
|
+
this.guardAgainstInvalidWidth(value.width);
|
|
60
|
+
this.guardAgainstInvalidHeight(value.height);
|
|
61
|
+
}
|
|
62
|
+
guardAgainstInvalidWidth(width) {
|
|
63
|
+
if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(width)) {
|
|
64
|
+
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.width', 'positive integer', width.toString());
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
guardAgainstInvalidHeight(height) {
|
|
68
|
+
if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(height)) {
|
|
69
|
+
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.height', 'positive integer', height.toString());
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
guardAgainstInvalidThumbnailUrl(thumbnailUrl) {
|
|
73
|
+
if (this.thumbnailUrlIsProvided(thumbnailUrl)) {
|
|
74
|
+
Url_1.Url.guardAgainstInvalidUrl(thumbnailUrl, 'thumbnailUrl');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
thumbnailUrlIsProvided(thumbnailUrl) {
|
|
78
|
+
return thumbnailUrl !== undefined && thumbnailUrl !== null;
|
|
79
|
+
}
|
|
43
80
|
get fullSizeUrl() {
|
|
44
81
|
return __classPrivateFieldGet(this, _Image_fullSizeUrl, "f");
|
|
45
82
|
}
|
|
@@ -63,33 +100,4 @@ class Image extends ObjectValueObject_1.ObjectValueObject {
|
|
|
63
100
|
}
|
|
64
101
|
}
|
|
65
102
|
exports.Image = Image;
|
|
66
|
-
_Image_fullSizeUrl = new WeakMap(), _Image_thumbnailUrl = new WeakMap(), _Image_altText = new WeakMap(), _Image_uploadedAt = new WeakMap(), _Image_dimensions = new WeakMap()
|
|
67
|
-
__classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidUploadedAt).call(this, value.uploadedAt);
|
|
68
|
-
__classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidFullSizeUrl).call(this, value.fullSizeUrl);
|
|
69
|
-
__classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidAltText).call(this, value.altText);
|
|
70
|
-
__classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidDimensions).call(this, value.dimensions);
|
|
71
|
-
__classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidThumbnailUrl).call(this, value.thumbnailUrl);
|
|
72
|
-
}, _Image_guardAgainstInvalidUploadedAt = function _Image_guardAgainstInvalidUploadedAt(value) {
|
|
73
|
-
DateString_1.DateString.guardAgainstInvalidDateFormat(value);
|
|
74
|
-
}, _Image_guardAgainstInvalidFullSizeUrl = function _Image_guardAgainstInvalidFullSizeUrl(value) {
|
|
75
|
-
Url_1.Url.guardAgainstInvalidUrl(value, 'fullSizeUrl');
|
|
76
|
-
}, _Image_guardAgainstInvalidAltText = function _Image_guardAgainstInvalidAltText(value) {
|
|
77
|
-
String_1.String.guardAgainstInvalidType(value, 'altText');
|
|
78
|
-
}, _Image_guardAgainstInvalidDimensions = function _Image_guardAgainstInvalidDimensions(value) {
|
|
79
|
-
__classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidWidth).call(this, value.width);
|
|
80
|
-
__classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidHeight).call(this, value.height);
|
|
81
|
-
}, _Image_guardAgainstInvalidWidth = function _Image_guardAgainstInvalidWidth(width) {
|
|
82
|
-
if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(width)) {
|
|
83
|
-
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.width', 'positive integer', width.toString());
|
|
84
|
-
}
|
|
85
|
-
}, _Image_guardAgainstInvalidHeight = function _Image_guardAgainstInvalidHeight(height) {
|
|
86
|
-
if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(height)) {
|
|
87
|
-
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.height', 'positive integer', height.toString());
|
|
88
|
-
}
|
|
89
|
-
}, _Image_guardAgainstInvalidThumbnailUrl = function _Image_guardAgainstInvalidThumbnailUrl(thumbnailUrl) {
|
|
90
|
-
if (__classPrivateFieldGet(this, _Image_instances, "m", _Image_thumbnailUrlIsProvided).call(this, thumbnailUrl)) {
|
|
91
|
-
Url_1.Url.guardAgainstInvalidUrl(thumbnailUrl, 'thumbnailUrl');
|
|
92
|
-
}
|
|
93
|
-
}, _Image_thumbnailUrlIsProvided = function _Image_thumbnailUrlIsProvided(thumbnailUrl) {
|
|
94
|
-
return thumbnailUrl !== undefined && thumbnailUrl !== null;
|
|
95
|
-
};
|
|
103
|
+
_Image_fullSizeUrl = new WeakMap(), _Image_thumbnailUrl = new WeakMap(), _Image_altText = new WeakMap(), _Image_uploadedAt = new WeakMap(), _Image_dimensions = new WeakMap();
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _Integer_instances, _a, _Integer_guardAgainstNonIntegerValue, _Integer_valueIsNotInteger, _Integer_valueIsInteger;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.Integer = void 0;
|
|
10
4
|
const NotIntegerError_1 = require("../exceptions/NotIntegerError");
|
|
11
5
|
const PrimitiveValueObject_1 = require("./PrimitiveValueObject");
|
|
12
6
|
class Integer extends PrimitiveValueObject_1.PrimitiveValueObject {
|
|
13
|
-
constructor(value, skipDomainValidation, propertyName =
|
|
7
|
+
constructor(value, skipDomainValidation, propertyName = Integer.DEFAULT_PROPERTY_NAME) {
|
|
14
8
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type Integer from the domain layer', { allowNull: false, allowUndefined: false });
|
|
15
|
-
_Integer_instances.add(this);
|
|
16
9
|
if (skipDomainValidation === false) {
|
|
17
|
-
|
|
10
|
+
this.guardAgainstNonIntegerValue(value, propertyName);
|
|
18
11
|
}
|
|
19
12
|
}
|
|
20
13
|
static guardAgainstInvalidInteger(value, propertyName) {
|
|
21
|
-
if (
|
|
14
|
+
if (this.valueIsNotInteger(value)) {
|
|
22
15
|
throw NotIntegerError_1.NotIntegerError.create(propertyName, value);
|
|
23
16
|
}
|
|
24
17
|
}
|
|
18
|
+
guardAgainstNonIntegerValue(value, propertyName) {
|
|
19
|
+
Integer.guardAgainstInvalidInteger(value, propertyName);
|
|
20
|
+
}
|
|
21
|
+
static valueIsNotInteger(value) {
|
|
22
|
+
return this.valueIsInteger(value) === false;
|
|
23
|
+
}
|
|
24
|
+
static valueIsInteger(value) {
|
|
25
|
+
return Number.isInteger(value);
|
|
26
|
+
}
|
|
25
27
|
static isValidInteger(value) {
|
|
26
|
-
return
|
|
28
|
+
return this.valueIsInteger(value);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
exports.Integer = Integer;
|
|
30
|
-
_a = Integer, _Integer_instances = new WeakSet(), _Integer_guardAgainstNonIntegerValue = function _Integer_guardAgainstNonIntegerValue(value, propertyName) {
|
|
31
|
-
_a.guardAgainstInvalidInteger(value, propertyName);
|
|
32
|
-
}, _Integer_valueIsNotInteger = function _Integer_valueIsNotInteger(value) {
|
|
33
|
-
return __classPrivateFieldGet(this, _a, "m", _Integer_valueIsInteger).call(this, value) === false;
|
|
34
|
-
}, _Integer_valueIsInteger = function _Integer_valueIsInteger(value) {
|
|
35
|
-
return Number.isInteger(value);
|
|
36
|
-
};
|
|
37
32
|
Integer.DEFAULT_PROPERTY_NAME = 'integer';
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _NullableCode_instances, _NullableCode_guardAgainstInvalidNullableCode, _NullableCode_guardAgainstInvalidCodeValue, _NullableCode_valueIsNotNull;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.NullableCode = void 0;
|
|
10
4
|
const ValueObject_1 = require("./ValueObject");
|
|
@@ -13,14 +7,24 @@ const InvalidCodeError_1 = require("../exceptions/InvalidCodeError");
|
|
|
13
7
|
class NullableCode extends ValueObject_1.ValueObject {
|
|
14
8
|
constructor(value, skipDomainValidation, propertyName = NullableCode.DEFAULT_PROPERTY_NAME) {
|
|
15
9
|
super(value, skipDomainValidation, propertyName, 'string | null', { allowNull: true, allowUndefined: false });
|
|
16
|
-
_NullableCode_instances.add(this);
|
|
17
10
|
if (skipDomainValidation === false) {
|
|
18
|
-
|
|
11
|
+
this.guardAgainstInvalidNullableCode(value, propertyName);
|
|
19
12
|
}
|
|
20
13
|
}
|
|
14
|
+
guardAgainstInvalidNullableCode(value, propertyName) {
|
|
15
|
+
if (this.valueIsNotNull(value)) {
|
|
16
|
+
this.guardAgainstInvalidCodeValue(value, propertyName);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
guardAgainstInvalidCodeValue(value, propertyName) {
|
|
20
|
+
Code_1.Code.guardAgainstInvalidCode(value, propertyName);
|
|
21
|
+
}
|
|
22
|
+
valueIsNotNull(value) {
|
|
23
|
+
return value !== null;
|
|
24
|
+
}
|
|
21
25
|
// Métodos de consulta públicos
|
|
22
26
|
hasValue() {
|
|
23
|
-
return
|
|
27
|
+
return this.valueIsNotNull(this.value);
|
|
24
28
|
}
|
|
25
29
|
getValue() {
|
|
26
30
|
return this.value;
|
|
@@ -136,12 +140,12 @@ class NullableCode extends ValueObject_1.ValueObject {
|
|
|
136
140
|
}
|
|
137
141
|
// Métodos de guardas para casos específicos
|
|
138
142
|
guardAgainstEmptyCode(value, propertyName) {
|
|
139
|
-
if (
|
|
143
|
+
if (this.valueIsNotNull(value) && value.trim() === '') {
|
|
140
144
|
throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
guardAgainstCodeLength(value, propertyName, minLength, maxLength) {
|
|
144
|
-
if (
|
|
148
|
+
if (this.valueIsNotNull(value)) {
|
|
145
149
|
const { length } = value;
|
|
146
150
|
if (length < minLength || length > maxLength) {
|
|
147
151
|
throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
|
|
@@ -149,12 +153,12 @@ class NullableCode extends ValueObject_1.ValueObject {
|
|
|
149
153
|
}
|
|
150
154
|
}
|
|
151
155
|
guardAgainstInvalidPrefix(value, propertyName, requiredPrefix) {
|
|
152
|
-
if (
|
|
156
|
+
if (this.valueIsNotNull(value) && !value.startsWith(requiredPrefix)) {
|
|
153
157
|
throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
160
|
guardAgainstInvalidSuffix(value, propertyName, requiredSuffix) {
|
|
157
|
-
if (
|
|
161
|
+
if (this.valueIsNotNull(value) && !value.endsWith(requiredSuffix)) {
|
|
158
162
|
throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
|
|
159
163
|
}
|
|
160
164
|
}
|
|
@@ -169,14 +173,5 @@ class NullableCode extends ValueObject_1.ValueObject {
|
|
|
169
173
|
}
|
|
170
174
|
}
|
|
171
175
|
exports.NullableCode = NullableCode;
|
|
172
|
-
_NullableCode_instances = new WeakSet(), _NullableCode_guardAgainstInvalidNullableCode = function _NullableCode_guardAgainstInvalidNullableCode(value, propertyName) {
|
|
173
|
-
if (__classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_valueIsNotNull).call(this, value)) {
|
|
174
|
-
__classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_guardAgainstInvalidCodeValue).call(this, value, propertyName);
|
|
175
|
-
}
|
|
176
|
-
}, _NullableCode_guardAgainstInvalidCodeValue = function _NullableCode_guardAgainstInvalidCodeValue(value, propertyName) {
|
|
177
|
-
Code_1.Code.guardAgainstInvalidCode(value, propertyName);
|
|
178
|
-
}, _NullableCode_valueIsNotNull = function _NullableCode_valueIsNotNull(value) {
|
|
179
|
-
return value !== null;
|
|
180
|
-
};
|
|
181
176
|
NullableCode.DEFAULT_PROPERTY_NAME = 'code';
|
|
182
177
|
NullableCode.DEFAULT_CODE_REGEX = /^[A-Za-z0-9][A-Za-z0-9_.-]*$/;
|
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_name, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.NullableCorporateConfigurationCarbonFootprintSubsegmentReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -24,7 +24,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
|
|
|
24
24
|
* Aplica todas las validaciones de dominio al momento de construcción.
|
|
25
25
|
* Permite valores null para representar la ausencia de subsegmento corporativo.
|
|
26
26
|
*/
|
|
27
|
-
constructor(value, skipDomainValidation, propertyName =
|
|
27
|
+
constructor(value, skipDomainValidation, propertyName = NullableCorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
|
|
28
28
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type CorporateConfigurationCarbonFootprintSubsegmentReference from the domain layer or null', { allowNull: true, allowUndefined: false });
|
|
29
29
|
_NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
|
|
30
30
|
_NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
|
|
@@ -38,7 +38,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
|
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
if (skipDomainValidation === false) {
|
|
41
|
-
|
|
41
|
+
NullableCorporateConfigurationCarbonFootprintSubsegmentReference
|
|
42
42
|
.validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
|
|
43
43
|
}
|
|
44
44
|
__classPrivateFieldSet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
|
|
@@ -51,10 +51,49 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
|
|
|
51
51
|
* Validación estática para reutilización en factory methods y constructores.
|
|
52
52
|
*/
|
|
53
53
|
static validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
this.guardAgainstInvalidType(value, propertyName);
|
|
55
|
+
this.guardAgainstInvalidId(value.id);
|
|
56
|
+
this.guardAgainstInvalidSubsegmentCode(value.code);
|
|
57
|
+
this.guardAgainstInvalidSubsegmentName(value.name);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Valida que el objeto tenga la estructura correcta.
|
|
61
|
+
*/
|
|
62
|
+
static guardAgainstInvalidType(value, propertyName) {
|
|
63
|
+
if (!value || typeof value !== 'object') {
|
|
64
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CorporateConfigurationCarbonFootprintSubsegmentReference object', typeof value);
|
|
65
|
+
}
|
|
66
|
+
if (typeof value.id !== 'string') {
|
|
67
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
68
|
+
}
|
|
69
|
+
if (typeof value.code !== 'string') {
|
|
70
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
71
|
+
}
|
|
72
|
+
if (typeof value.name !== 'string') {
|
|
73
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Valida el ID usando las validaciones de AggregateId.
|
|
78
|
+
*/
|
|
79
|
+
static guardAgainstInvalidId(id) {
|
|
80
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
81
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Valida el código de subsegmento corporativo usando las validaciones de Code.
|
|
85
|
+
* El código debe ser un UUID válido.
|
|
86
|
+
*/
|
|
87
|
+
static guardAgainstInvalidSubsegmentCode(code) {
|
|
88
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
89
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Valida el nombre del subsegmento corporativo.
|
|
93
|
+
* No debe ser vacío después de aplicar trim.
|
|
94
|
+
*/
|
|
95
|
+
static guardAgainstInvalidSubsegmentName(name) {
|
|
96
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
58
97
|
}
|
|
59
98
|
get id() {
|
|
60
99
|
return __classPrivateFieldGet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id, "f");
|
|
@@ -171,7 +210,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
|
|
|
171
210
|
* Dos referencias son iguales si ambas son null o si tienen el mismo código y nombre.
|
|
172
211
|
*/
|
|
173
212
|
equals(other) {
|
|
174
|
-
if (!(other instanceof
|
|
213
|
+
if (!(other instanceof NullableCorporateConfigurationCarbonFootprintSubsegmentReference)) {
|
|
175
214
|
return false;
|
|
176
215
|
}
|
|
177
216
|
if (__classPrivateFieldGet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
|
|
@@ -188,7 +227,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
|
|
|
188
227
|
* basándose únicamente en el código (identificador único).
|
|
189
228
|
*/
|
|
190
229
|
hasSameSubsegment(other) {
|
|
191
|
-
if (!(other instanceof
|
|
230
|
+
if (!(other instanceof NullableCorporateConfigurationCarbonFootprintSubsegmentReference)) {
|
|
192
231
|
return false;
|
|
193
232
|
}
|
|
194
233
|
if (__classPrivateFieldGet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
|
|
@@ -236,26 +275,5 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
|
|
|
236
275
|
}
|
|
237
276
|
}
|
|
238
277
|
exports.NullableCorporateConfigurationCarbonFootprintSubsegmentReference = NullableCorporateConfigurationCarbonFootprintSubsegmentReference;
|
|
239
|
-
|
|
240
|
-
if (!value || typeof value !== 'object') {
|
|
241
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CorporateConfigurationCarbonFootprintSubsegmentReference object', typeof value);
|
|
242
|
-
}
|
|
243
|
-
if (typeof value.id !== 'string') {
|
|
244
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
245
|
-
}
|
|
246
|
-
if (typeof value.code !== 'string') {
|
|
247
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
248
|
-
}
|
|
249
|
-
if (typeof value.name !== 'string') {
|
|
250
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
251
|
-
}
|
|
252
|
-
}, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId = function _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId(id) {
|
|
253
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
254
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
255
|
-
}, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode = function _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode(code) {
|
|
256
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
257
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
258
|
-
}, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName = function _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName(name) {
|
|
259
|
-
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
260
|
-
};
|
|
278
|
+
_NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull = new WeakMap();
|
|
261
279
|
NullableCorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'corporateSubsegmentReference';
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _NullableDate_instances, _NullableDate_guardAgainstInvalidNullableDate, _NullableDate_guardAgainstInvalidDateString, _NullableDate_guardAgainstEmptyDateString, _NullableDate_guardAgainstInvalidStringType, _NullableDate_guardAgainstInvalidDateFormat, _NullableDate_valueIsNotNull;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.NullableDate = void 0;
|
|
10
4
|
const DateString_1 = require("./DateString");
|
|
@@ -13,16 +7,37 @@ const String_1 = require("./String");
|
|
|
13
7
|
class NullableDate extends NullableString_1.NullableString {
|
|
14
8
|
constructor(value, skipDomainValidation, propertyName) {
|
|
15
9
|
super(value, skipDomainValidation, propertyName);
|
|
16
|
-
_NullableDate_instances.add(this);
|
|
17
10
|
if (skipDomainValidation === false) {
|
|
18
|
-
|
|
11
|
+
this.guardAgainstInvalidNullableDate(value, propertyName);
|
|
19
12
|
}
|
|
20
13
|
}
|
|
14
|
+
guardAgainstInvalidNullableDate(value, propertyName) {
|
|
15
|
+
if (this.valueIsNotNull(value)) {
|
|
16
|
+
this.guardAgainstInvalidDateString(value, propertyName);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
guardAgainstInvalidDateString(value, propertyName) {
|
|
20
|
+
this.guardAgainstEmptyDateString(value, propertyName);
|
|
21
|
+
this.guardAgainstInvalidStringType(value, propertyName);
|
|
22
|
+
this.guardAgainstInvalidDateFormat(value);
|
|
23
|
+
}
|
|
24
|
+
guardAgainstEmptyDateString(value, propertyName) {
|
|
25
|
+
String_1.String.guardAgainstEmptyValue(value, propertyName);
|
|
26
|
+
}
|
|
27
|
+
guardAgainstInvalidStringType(value, propertyName) {
|
|
28
|
+
String_1.String.guardAgainstInvalidType(value, propertyName);
|
|
29
|
+
}
|
|
30
|
+
guardAgainstInvalidDateFormat(value) {
|
|
31
|
+
DateString_1.DateString.guardAgainstInvalidDateFormat(value);
|
|
32
|
+
}
|
|
33
|
+
valueIsNotNull(value) {
|
|
34
|
+
return value !== null;
|
|
35
|
+
}
|
|
21
36
|
hasValue() {
|
|
22
|
-
return
|
|
37
|
+
return this.valueIsNotNull(this.value);
|
|
23
38
|
}
|
|
24
39
|
toDate() {
|
|
25
|
-
if (
|
|
40
|
+
if (this.valueIsNotNull(this.value)) {
|
|
26
41
|
const [day, month, year] = this.value.split('/').map(Number);
|
|
27
42
|
return new Date(year, month - 1, day);
|
|
28
43
|
}
|
|
@@ -44,20 +59,3 @@ class NullableDate extends NullableString_1.NullableString {
|
|
|
44
59
|
}
|
|
45
60
|
}
|
|
46
61
|
exports.NullableDate = NullableDate;
|
|
47
|
-
_NullableDate_instances = new WeakSet(), _NullableDate_guardAgainstInvalidNullableDate = function _NullableDate_guardAgainstInvalidNullableDate(value, propertyName) {
|
|
48
|
-
if (__classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_valueIsNotNull).call(this, value)) {
|
|
49
|
-
__classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstInvalidDateString).call(this, value, propertyName);
|
|
50
|
-
}
|
|
51
|
-
}, _NullableDate_guardAgainstInvalidDateString = function _NullableDate_guardAgainstInvalidDateString(value, propertyName) {
|
|
52
|
-
__classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstEmptyDateString).call(this, value, propertyName);
|
|
53
|
-
__classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstInvalidStringType).call(this, value, propertyName);
|
|
54
|
-
__classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstInvalidDateFormat).call(this, value);
|
|
55
|
-
}, _NullableDate_guardAgainstEmptyDateString = function _NullableDate_guardAgainstEmptyDateString(value, propertyName) {
|
|
56
|
-
String_1.String.guardAgainstEmptyValue(value, propertyName);
|
|
57
|
-
}, _NullableDate_guardAgainstInvalidStringType = function _NullableDate_guardAgainstInvalidStringType(value, propertyName) {
|
|
58
|
-
String_1.String.guardAgainstInvalidType(value, propertyName);
|
|
59
|
-
}, _NullableDate_guardAgainstInvalidDateFormat = function _NullableDate_guardAgainstInvalidDateFormat(value) {
|
|
60
|
-
DateString_1.DateString.guardAgainstInvalidDateFormat(value);
|
|
61
|
-
}, _NullableDate_valueIsNotNull = function _NullableDate_valueIsNotNull(value) {
|
|
62
|
-
return value !== null;
|
|
63
|
-
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
-
};
|
|
7
|
-
var _NullableDateTimeString_instances, _NullableDateTimeString_guardAgainstInvalidNullableDateTimeString, _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue, _NullableDateTimeString_valueIsNotNull, _NullableDateTimeString_parseDateTimeComponents, _NullableDateTimeString_parseStringToDate;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.NullableDateTimeString = void 0;
|
|
10
4
|
const DateTimeString_1 = require("./DateTimeString");
|
|
@@ -12,30 +6,40 @@ const ValueObject_1 = require("./ValueObject");
|
|
|
12
6
|
class NullableDateTimeString extends ValueObject_1.ValueObject {
|
|
13
7
|
constructor(value, skipDomainValidation, propertyName) {
|
|
14
8
|
super(value, skipDomainValidation, propertyName, 'string | null', { allowNull: true, allowUndefined: false });
|
|
15
|
-
_NullableDateTimeString_instances.add(this);
|
|
16
9
|
if (skipDomainValidation === false) {
|
|
17
|
-
|
|
10
|
+
this.guardAgainstInvalidNullableDateTimeString(value);
|
|
18
11
|
}
|
|
19
12
|
}
|
|
13
|
+
guardAgainstInvalidNullableDateTimeString(value) {
|
|
14
|
+
if (this.valueIsNotNull(value)) {
|
|
15
|
+
this.guardAgainstInvalidDateTimeStringValue(value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
guardAgainstInvalidDateTimeStringValue(value) {
|
|
19
|
+
DateTimeString_1.DateTimeString.guardAgainstInvalidDateTimeFormat(value);
|
|
20
|
+
}
|
|
21
|
+
valueIsNotNull(value) {
|
|
22
|
+
return value !== null;
|
|
23
|
+
}
|
|
20
24
|
// Métodos de consulta públicos
|
|
21
25
|
hasValue() {
|
|
22
|
-
return
|
|
26
|
+
return this.valueIsNotNull(this.value);
|
|
23
27
|
}
|
|
24
28
|
toDate() {
|
|
25
|
-
if (
|
|
26
|
-
const [day, month, year, hours, minutes, seconds] =
|
|
29
|
+
if (this.valueIsNotNull(this.value)) {
|
|
30
|
+
const [day, month, year, hours, minutes, seconds] = this.parseDateTimeComponents(this.value);
|
|
27
31
|
return new Date(year, month - 1, day, hours, minutes, seconds);
|
|
28
32
|
}
|
|
29
33
|
return null;
|
|
30
34
|
}
|
|
31
35
|
getDatePart() {
|
|
32
|
-
if (
|
|
36
|
+
if (this.valueIsNotNull(this.value)) {
|
|
33
37
|
return this.value.split(' ')[0];
|
|
34
38
|
}
|
|
35
39
|
return null;
|
|
36
40
|
}
|
|
37
41
|
getTimePart() {
|
|
38
|
-
if (
|
|
42
|
+
if (this.valueIsNotNull(this.value)) {
|
|
39
43
|
return this.value.split(' ')[1];
|
|
40
44
|
}
|
|
41
45
|
return null;
|
|
@@ -55,7 +59,7 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
|
|
|
55
59
|
return null;
|
|
56
60
|
}
|
|
57
61
|
const thisDate = this.toDate();
|
|
58
|
-
const otherDate =
|
|
62
|
+
const otherDate = this.parseStringToDate(compareValue);
|
|
59
63
|
if (thisDate === null || otherDate === null) {
|
|
60
64
|
return null;
|
|
61
65
|
}
|
|
@@ -76,7 +80,7 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
|
|
|
76
80
|
return null;
|
|
77
81
|
}
|
|
78
82
|
const thisDate = this.toDate();
|
|
79
|
-
const otherDate =
|
|
83
|
+
const otherDate = this.parseStringToDate(compareValue);
|
|
80
84
|
if (thisDate === null || otherDate === null) {
|
|
81
85
|
return null;
|
|
82
86
|
}
|
|
@@ -98,6 +102,21 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
|
|
|
98
102
|
}
|
|
99
103
|
return this.value === compareValue;
|
|
100
104
|
}
|
|
105
|
+
parseDateTimeComponents(value) {
|
|
106
|
+
const [datePart, timePart] = value.split(' ');
|
|
107
|
+
const [day, month, year] = datePart.split('/').map(Number);
|
|
108
|
+
const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
109
|
+
return [day, month, year, hours, minutes, seconds];
|
|
110
|
+
}
|
|
111
|
+
parseStringToDate(value) {
|
|
112
|
+
try {
|
|
113
|
+
const [day, month, year, hours, minutes, seconds] = this.parseDateTimeComponents(value);
|
|
114
|
+
return new Date(year, month - 1, day, hours, minutes, seconds);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
101
120
|
// Métodos estáticos de validación
|
|
102
121
|
static isValidNullableDateTimeString(value) {
|
|
103
122
|
if (value === null) {
|
|
@@ -119,25 +138,3 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
|
|
|
119
138
|
}
|
|
120
139
|
}
|
|
121
140
|
exports.NullableDateTimeString = NullableDateTimeString;
|
|
122
|
-
_NullableDateTimeString_instances = new WeakSet(), _NullableDateTimeString_guardAgainstInvalidNullableDateTimeString = function _NullableDateTimeString_guardAgainstInvalidNullableDateTimeString(value) {
|
|
123
|
-
if (__classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_valueIsNotNull).call(this, value)) {
|
|
124
|
-
__classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue).call(this, value);
|
|
125
|
-
}
|
|
126
|
-
}, _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue = function _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue(value) {
|
|
127
|
-
DateTimeString_1.DateTimeString.guardAgainstInvalidDateTimeFormat(value);
|
|
128
|
-
}, _NullableDateTimeString_valueIsNotNull = function _NullableDateTimeString_valueIsNotNull(value) {
|
|
129
|
-
return value !== null;
|
|
130
|
-
}, _NullableDateTimeString_parseDateTimeComponents = function _NullableDateTimeString_parseDateTimeComponents(value) {
|
|
131
|
-
const [datePart, timePart] = value.split(' ');
|
|
132
|
-
const [day, month, year] = datePart.split('/').map(Number);
|
|
133
|
-
const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
134
|
-
return [day, month, year, hours, minutes, seconds];
|
|
135
|
-
}, _NullableDateTimeString_parseStringToDate = function _NullableDateTimeString_parseStringToDate(value) {
|
|
136
|
-
try {
|
|
137
|
-
const [day, month, year, hours, minutes, seconds] = __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_parseDateTimeComponents).call(this, value);
|
|
138
|
-
return new Date(year, month - 1, day, hours, minutes, seconds);
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
};
|