@carbonbox/domain 0.4.7 → 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/main/index.js +4 -2
- 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/build/types/main/index.d.ts +1 -0
- package/build/types/main/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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 _CorporateConfigurationCarbonFootprintSubsegmentReference_id, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, _CorporateConfigurationCarbonFootprintSubsegmentReference_name;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CorporateConfigurationCarbonFootprintSubsegmentReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -23,14 +23,13 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
|
|
|
23
23
|
* Constructor protegido para que solo clases hijas puedan instanciar.
|
|
24
24
|
* Aplica todas las validaciones de dominio al momento de construcción.
|
|
25
25
|
*/
|
|
26
|
-
constructor(value, skipDomainValidation, propertyName =
|
|
26
|
+
constructor(value, skipDomainValidation, propertyName = CorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
|
|
27
27
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type CorporateConfigurationCarbonFootprintSubsegmentReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
28
|
-
_CorporateConfigurationCarbonFootprintSubsegmentReference_instances.add(this);
|
|
29
28
|
_CorporateConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
|
|
30
29
|
_CorporateConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
|
|
31
30
|
_CorporateConfigurationCarbonFootprintSubsegmentReference_name.set(this, void 0);
|
|
32
31
|
if (skipDomainValidation === false) {
|
|
33
|
-
|
|
32
|
+
CorporateConfigurationCarbonFootprintSubsegmentReference
|
|
34
33
|
.validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
|
|
35
34
|
}
|
|
36
35
|
__classPrivateFieldSet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
|
|
@@ -41,10 +40,62 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
|
|
|
41
40
|
* Validación estática para reutilización en factory methods y constructores.
|
|
42
41
|
*/
|
|
43
42
|
static validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
this.guardAgainstInvalidType(value, propertyName);
|
|
44
|
+
this.guardAgainstInvalidId(value.id);
|
|
45
|
+
this.guardAgainstInvalidCode(value.code);
|
|
46
|
+
this.guardAgainstInvalidName(value.name);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Valida que el objeto tenga la estructura correcta.
|
|
50
|
+
*/
|
|
51
|
+
static guardAgainstInvalidType(value, propertyName) {
|
|
52
|
+
if (this.valueIsInvalid(value)) {
|
|
53
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CorporateConfigurationCarbonFootprintSubsegmentReference object', typeof value);
|
|
54
|
+
}
|
|
55
|
+
if (typeof value.id !== 'string') {
|
|
56
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
57
|
+
}
|
|
58
|
+
if (typeof value.code !== 'string') {
|
|
59
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
60
|
+
}
|
|
61
|
+
if (typeof value.name !== 'string') {
|
|
62
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Valida si el valor principal es inválido.
|
|
67
|
+
*/
|
|
68
|
+
static valueIsInvalid(value) {
|
|
69
|
+
return value === null || value === undefined || typeof value !== 'object';
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Valida el ID usando las validaciones de AggregateId.
|
|
73
|
+
*/
|
|
74
|
+
static guardAgainstInvalidId(id) {
|
|
75
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
76
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Valida el código del subsegmento corporativo.
|
|
80
|
+
*/
|
|
81
|
+
static guardAgainstInvalidCode(code) {
|
|
82
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
83
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Valida el nombre del subsegmento corporativo.
|
|
87
|
+
*/
|
|
88
|
+
static guardAgainstInvalidName(name) {
|
|
89
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
90
|
+
if (this.nameLengthIsInvalid(name)) {
|
|
91
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', `string with maximum ${this.MAX_NAME_LENGTH} characters`, `string with ${name.trim().length} characters`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Verifica si la longitud del nombre de subsegmento es inválida.
|
|
96
|
+
*/
|
|
97
|
+
static nameLengthIsInvalid(name) {
|
|
98
|
+
return name.trim().length > this.MAX_NAME_LENGTH;
|
|
48
99
|
}
|
|
49
100
|
/**
|
|
50
101
|
* ID único del subsegmento corporativo.
|
|
@@ -126,18 +177,24 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
|
|
|
126
177
|
* Compara la igualdad semántica con otro objeto CorporateConfigurationCarbonFootprintSubsegmentReference.
|
|
127
178
|
*/
|
|
128
179
|
equals(other) {
|
|
129
|
-
if (
|
|
180
|
+
if (this.otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other)) {
|
|
130
181
|
return false;
|
|
131
182
|
}
|
|
132
183
|
return (__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f")
|
|
133
184
|
&& __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f")
|
|
134
185
|
&& __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f"));
|
|
135
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Verifica si el otro objeto no es una instancia de CorporateConfigurationCarbonFootprintSubsegmentReference.
|
|
189
|
+
*/
|
|
190
|
+
otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other) {
|
|
191
|
+
return (other instanceof CorporateConfigurationCarbonFootprintSubsegmentReference) === false;
|
|
192
|
+
}
|
|
136
193
|
/**
|
|
137
194
|
* Compara si dos segmentos tienen el mismo código.
|
|
138
195
|
*/
|
|
139
196
|
hasSameCode(other) {
|
|
140
|
-
if (
|
|
197
|
+
if (this.otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other)) {
|
|
141
198
|
return false;
|
|
142
199
|
}
|
|
143
200
|
return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f");
|
|
@@ -146,7 +203,7 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
|
|
|
146
203
|
* Compara si dos subsegmentos tienen el mismo nombre.
|
|
147
204
|
*/
|
|
148
205
|
hasSameName(other) {
|
|
149
|
-
if (
|
|
206
|
+
if (this.otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other)) {
|
|
150
207
|
return false;
|
|
151
208
|
}
|
|
152
209
|
return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f");
|
|
@@ -155,7 +212,7 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
|
|
|
155
212
|
* Compara si dos subsegmentos tienen el mismo ID.
|
|
156
213
|
*/
|
|
157
214
|
hasSameId(other) {
|
|
158
|
-
if (
|
|
215
|
+
if (this.otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other)) {
|
|
159
216
|
return false;
|
|
160
217
|
}
|
|
161
218
|
return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f");
|
|
@@ -196,36 +253,6 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
|
|
|
196
253
|
}
|
|
197
254
|
}
|
|
198
255
|
exports.CorporateConfigurationCarbonFootprintSubsegmentReference = CorporateConfigurationCarbonFootprintSubsegmentReference;
|
|
199
|
-
|
|
200
|
-
if (__classPrivateFieldGet(this, _a, "m", _CorporateConfigurationCarbonFootprintSubsegmentReference_valueIsInvalid).call(this, value)) {
|
|
201
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CorporateConfigurationCarbonFootprintSubsegmentReference object', typeof value);
|
|
202
|
-
}
|
|
203
|
-
if (typeof value.id !== 'string') {
|
|
204
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
205
|
-
}
|
|
206
|
-
if (typeof value.code !== 'string') {
|
|
207
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
208
|
-
}
|
|
209
|
-
if (typeof value.name !== 'string') {
|
|
210
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
211
|
-
}
|
|
212
|
-
}, _CorporateConfigurationCarbonFootprintSubsegmentReference_valueIsInvalid = function _CorporateConfigurationCarbonFootprintSubsegmentReference_valueIsInvalid(value) {
|
|
213
|
-
return value === null || value === undefined || typeof value !== 'object';
|
|
214
|
-
}, _CorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId = function _CorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId(id) {
|
|
215
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
216
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
217
|
-
}, _CorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidCode = function _CorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidCode(code) {
|
|
218
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
219
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
220
|
-
}, _CorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidName = function _CorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidName(name) {
|
|
221
|
-
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
222
|
-
if (__classPrivateFieldGet(this, _a, "m", _CorporateConfigurationCarbonFootprintSubsegmentReference_nameLengthIsInvalid).call(this, name)) {
|
|
223
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', `string with maximum ${this.MAX_NAME_LENGTH} characters`, `string with ${name.trim().length} characters`);
|
|
224
|
-
}
|
|
225
|
-
}, _CorporateConfigurationCarbonFootprintSubsegmentReference_nameLengthIsInvalid = function _CorporateConfigurationCarbonFootprintSubsegmentReference_nameLengthIsInvalid(name) {
|
|
226
|
-
return name.trim().length > this.MAX_NAME_LENGTH;
|
|
227
|
-
}, _CorporateConfigurationCarbonFootprintSubsegmentReference_otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference = function _CorporateConfigurationCarbonFootprintSubsegmentReference_otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other) {
|
|
228
|
-
return (other instanceof _a) === false;
|
|
229
|
-
};
|
|
256
|
+
_CorporateConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _CorporateConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _CorporateConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap();
|
|
230
257
|
CorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'corporateSubsegmentReference';
|
|
231
258
|
CorporateConfigurationCarbonFootprintSubsegmentReference.MAX_NAME_LENGTH = 255;
|
|
@@ -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 _a, _Currency_currencyIsInvalid, _Currency_currencyIsValid;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.Currency = void 0;
|
|
10
4
|
const String_1 = require("./String");
|
|
@@ -14,20 +8,26 @@ class Currency extends String_1.String {
|
|
|
14
8
|
constructor(value, skipDomainValidation, propertyName) {
|
|
15
9
|
super(value, skipDomainValidation, propertyName);
|
|
16
10
|
if (skipDomainValidation === false) {
|
|
17
|
-
|
|
11
|
+
Currency.guardAgainstInvalidCurrency(value, propertyName);
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
14
|
static guardAgainstInvalidCurrency(currency, propertyName) {
|
|
21
15
|
String_1.String.guardAgainstEmptyValue(currency, propertyName);
|
|
22
|
-
if (
|
|
23
|
-
throw InvalidCurrencyError_1.InvalidCurrencyError.create(currency,
|
|
16
|
+
if (this.currencyIsInvalid(currency)) {
|
|
17
|
+
throw InvalidCurrencyError_1.InvalidCurrencyError.create(currency, Currency.VALID_CURRENCIES);
|
|
24
18
|
}
|
|
25
19
|
}
|
|
20
|
+
static currencyIsInvalid(currency) {
|
|
21
|
+
return this.currencyIsValid(currency) === false;
|
|
22
|
+
}
|
|
23
|
+
static currencyIsValid(currency) {
|
|
24
|
+
return Currency.VALID_CURRENCIES.includes(currency.trim().toUpperCase());
|
|
25
|
+
}
|
|
26
26
|
toEnum() {
|
|
27
27
|
return this.value;
|
|
28
28
|
}
|
|
29
29
|
static getValidCurrencies() {
|
|
30
|
-
return
|
|
30
|
+
return Currency.VALID_CURRENCIES;
|
|
31
31
|
}
|
|
32
32
|
isUSD() {
|
|
33
33
|
return this.value === Currency_1.Currency.USD;
|
|
@@ -78,9 +78,4 @@ class Currency extends String_1.String {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.Currency = Currency;
|
|
81
|
-
_a = Currency, _Currency_currencyIsInvalid = function _Currency_currencyIsInvalid(currency) {
|
|
82
|
-
return __classPrivateFieldGet(this, _a, "m", _Currency_currencyIsValid).call(this, currency) === false;
|
|
83
|
-
}, _Currency_currencyIsValid = function _Currency_currencyIsValid(currency) {
|
|
84
|
-
return _a.VALID_CURRENCIES.includes(currency.trim().toUpperCase());
|
|
85
|
-
};
|
|
86
81
|
Currency.VALID_CURRENCIES = Object.values(Currency_1.Currency);
|
|
@@ -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 _DateString_instances, _a, _DateString_dateFormatIsInvalid, _DateString_dateFormatIsValid, _DateString_parseDateComponents;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.DateString = void 0;
|
|
10
4
|
const InvalidDateFormatError_1 = require("../exceptions/InvalidDateFormatError");
|
|
@@ -13,9 +7,8 @@ const String_1 = require("./String");
|
|
|
13
7
|
class DateString extends String_1.String {
|
|
14
8
|
constructor(value, skipDomainValidation, propertyName) {
|
|
15
9
|
super(value, skipDomainValidation, propertyName);
|
|
16
|
-
_DateString_instances.add(this);
|
|
17
10
|
if (skipDomainValidation === false) {
|
|
18
|
-
|
|
11
|
+
DateString.guardAgainstInvalidDateFormat(value);
|
|
19
12
|
}
|
|
20
13
|
}
|
|
21
14
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -26,30 +19,32 @@ class DateString extends String_1.String {
|
|
|
26
19
|
return this.fromDate(new Date());
|
|
27
20
|
}
|
|
28
21
|
toDate() {
|
|
29
|
-
const [day, month, year] =
|
|
22
|
+
const [day, month, year] = this.parseDateComponents();
|
|
30
23
|
return new Date(year, month - 1, day);
|
|
31
24
|
}
|
|
32
25
|
static guardAgainstInvalidDateFormat(value) {
|
|
33
|
-
if (
|
|
34
|
-
throw InvalidDateFormatError_1.InvalidDateFormatError.create(value,
|
|
26
|
+
if (this.dateFormatIsInvalid(value)) {
|
|
27
|
+
throw InvalidDateFormatError_1.InvalidDateFormatError.create(value, DateString.DATE_FORMAT);
|
|
35
28
|
}
|
|
36
29
|
}
|
|
30
|
+
static dateFormatIsInvalid(value) {
|
|
31
|
+
return this.dateFormatIsValid(value) === false;
|
|
32
|
+
}
|
|
33
|
+
static dateFormatIsValid(value) {
|
|
34
|
+
return DateString.DATE_REGEX.test(value);
|
|
35
|
+
}
|
|
36
|
+
parseDateComponents() {
|
|
37
|
+
const [day, month, year] = this.value.split('/').map(Number);
|
|
38
|
+
return [day, month, year];
|
|
39
|
+
}
|
|
37
40
|
/**
|
|
38
41
|
* Gets the supported date format string
|
|
39
42
|
* @returns The date format string
|
|
40
43
|
*/
|
|
41
44
|
static getDateFormat() {
|
|
42
|
-
return
|
|
45
|
+
return DateString.DATE_FORMAT;
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
exports.DateString = DateString;
|
|
46
|
-
_a = DateString, _DateString_instances = new WeakSet(), _DateString_dateFormatIsInvalid = function _DateString_dateFormatIsInvalid(value) {
|
|
47
|
-
return __classPrivateFieldGet(this, _a, "m", _DateString_dateFormatIsValid).call(this, value) === false;
|
|
48
|
-
}, _DateString_dateFormatIsValid = function _DateString_dateFormatIsValid(value) {
|
|
49
|
-
return _a.DATE_REGEX.test(value);
|
|
50
|
-
}, _DateString_parseDateComponents = function _DateString_parseDateComponents() {
|
|
51
|
-
const [day, month, year] = this.value.split('/').map(Number);
|
|
52
|
-
return [day, month, year];
|
|
53
|
-
};
|
|
54
49
|
DateString.DATE_REGEX = /^([0-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/\d{4}$/;
|
|
55
50
|
DateString.DATE_FORMAT = 'DD/MM/YYYY';
|
|
@@ -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 _DateTimeString_instances, _a, _DateTimeString_dateTimeFormatIsInvalid, _DateTimeString_dateTimeFormatIsValid, _DateTimeString_parseDateTimeComponents;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.DateTimeString = void 0;
|
|
10
4
|
const InvalidDateFormatError_1 = require("../exceptions/InvalidDateFormatError");
|
|
@@ -13,9 +7,8 @@ const String_1 = require("./String");
|
|
|
13
7
|
class DateTimeString extends String_1.String {
|
|
14
8
|
constructor(value, skipDomainValidation, propertyName) {
|
|
15
9
|
super(value, skipDomainValidation, propertyName);
|
|
16
|
-
_DateTimeString_instances.add(this);
|
|
17
10
|
if (skipDomainValidation === false) {
|
|
18
|
-
|
|
11
|
+
DateTimeString.guardAgainstInvalidDateTimeFormat(value);
|
|
19
12
|
}
|
|
20
13
|
}
|
|
21
14
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -26,32 +19,34 @@ class DateTimeString extends String_1.String {
|
|
|
26
19
|
return this.fromDate(new Date());
|
|
27
20
|
}
|
|
28
21
|
toDate() {
|
|
29
|
-
const [day, month, year, hours, minutes, seconds] =
|
|
22
|
+
const [day, month, year, hours, minutes, seconds] = this.parseDateTimeComponents();
|
|
30
23
|
return new Date(year, month - 1, day, hours, minutes, seconds);
|
|
31
24
|
}
|
|
32
25
|
static guardAgainstInvalidDateTimeFormat(value) {
|
|
33
|
-
if (
|
|
34
|
-
throw InvalidDateFormatError_1.InvalidDateFormatError.create(value,
|
|
26
|
+
if (this.dateTimeFormatIsInvalid(value)) {
|
|
27
|
+
throw InvalidDateFormatError_1.InvalidDateFormatError.create(value, DateTimeString.DATETIME_FORMAT);
|
|
35
28
|
}
|
|
36
29
|
}
|
|
30
|
+
static dateTimeFormatIsInvalid(value) {
|
|
31
|
+
return this.dateTimeFormatIsValid(value) === false;
|
|
32
|
+
}
|
|
33
|
+
static dateTimeFormatIsValid(value) {
|
|
34
|
+
return DateTimeString.DATETIME_REGEX.test(value);
|
|
35
|
+
}
|
|
36
|
+
parseDateTimeComponents() {
|
|
37
|
+
const [datePart, timePart] = this.value.split(' ');
|
|
38
|
+
const [day, month, year] = datePart.split('/').map(Number);
|
|
39
|
+
const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
40
|
+
return [day, month, year, hours, minutes, seconds];
|
|
41
|
+
}
|
|
37
42
|
/**
|
|
38
43
|
* Gets the supported datetime format string
|
|
39
44
|
* @returns The datetime format string
|
|
40
45
|
*/
|
|
41
46
|
static getDateTimeFormat() {
|
|
42
|
-
return
|
|
47
|
+
return DateTimeString.DATETIME_FORMAT;
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
exports.DateTimeString = DateTimeString;
|
|
46
|
-
_a = DateTimeString, _DateTimeString_instances = new WeakSet(), _DateTimeString_dateTimeFormatIsInvalid = function _DateTimeString_dateTimeFormatIsInvalid(value) {
|
|
47
|
-
return __classPrivateFieldGet(this, _a, "m", _DateTimeString_dateTimeFormatIsValid).call(this, value) === false;
|
|
48
|
-
}, _DateTimeString_dateTimeFormatIsValid = function _DateTimeString_dateTimeFormatIsValid(value) {
|
|
49
|
-
return _a.DATETIME_REGEX.test(value);
|
|
50
|
-
}, _DateTimeString_parseDateTimeComponents = function _DateTimeString_parseDateTimeComponents() {
|
|
51
|
-
const [datePart, timePart] = this.value.split(' ');
|
|
52
|
-
const [day, month, year] = datePart.split('/').map(Number);
|
|
53
|
-
const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
54
|
-
return [day, month, year, hours, minutes, seconds];
|
|
55
|
-
};
|
|
56
51
|
DateTimeString.DATETIME_REGEX = /^([0-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/\d{4} ([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/;
|
|
57
52
|
DateTimeString.DATETIME_FORMAT = 'DD/MM/YYYY HH:mm:ss';
|
|
@@ -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 _a, _Email_emailFormatIsInvalid, _Email_emailFormatIsValid;
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.Email = void 0;
|
|
10
4
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -13,19 +7,25 @@ class Email extends String_1.String {
|
|
|
13
7
|
constructor(value, skipDomainValidation, propertyName) {
|
|
14
8
|
super(value, skipDomainValidation, propertyName);
|
|
15
9
|
if (skipDomainValidation === false) {
|
|
16
|
-
|
|
10
|
+
Email.guardAgainstInvalidEmail(value, propertyName);
|
|
17
11
|
}
|
|
18
12
|
}
|
|
19
13
|
static guardAgainstInvalidEmail(value, propertyName) {
|
|
20
14
|
String_1.String.guardAgainstInvalidType(value, propertyName);
|
|
21
15
|
String_1.String.guardAgainstEmptyValue(value, propertyName);
|
|
22
|
-
if (
|
|
16
|
+
if (this.emailFormatIsInvalid(value)) {
|
|
23
17
|
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'valid email', 'invalid email format');
|
|
24
18
|
}
|
|
25
19
|
}
|
|
20
|
+
static emailFormatIsInvalid(value) {
|
|
21
|
+
return this.emailFormatIsValid(value) === false;
|
|
22
|
+
}
|
|
23
|
+
static emailFormatIsValid(value) {
|
|
24
|
+
return Email.EMAIL_REGEX.test(value.trim());
|
|
25
|
+
}
|
|
26
26
|
static isValidEmail(value) {
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
Email.guardAgainstInvalidEmail(value, 'test');
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
31
|
catch {
|
|
@@ -40,9 +40,4 @@ class Email extends String_1.String {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
exports.Email = Email;
|
|
43
|
-
_a = Email, _Email_emailFormatIsInvalid = function _Email_emailFormatIsInvalid(value) {
|
|
44
|
-
return __classPrivateFieldGet(this, _a, "m", _Email_emailFormatIsValid).call(this, value) === false;
|
|
45
|
-
}, _Email_emailFormatIsValid = function _Email_emailFormatIsValid(value) {
|
|
46
|
-
return _a.EMAIL_REGEX.test(value.trim());
|
|
47
|
-
};
|
|
48
43
|
Email.EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
@@ -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 _EmissionCalculationFormulaReference_id, _EmissionCalculationFormulaReference_code, _EmissionCalculationFormulaReference_expression;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EmissionCalculationFormulaReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -23,13 +23,13 @@ class EmissionCalculationFormulaReference extends ObjectValueObject_1.ObjectValu
|
|
|
23
23
|
* Constructor protegido para que solo clases hijas puedan instanciar.
|
|
24
24
|
* Aplica todas las validaciones de dominio al momento de construcción.
|
|
25
25
|
*/
|
|
26
|
-
constructor(value, skipDomainValidation, propertyName =
|
|
26
|
+
constructor(value, skipDomainValidation, propertyName = EmissionCalculationFormulaReference.DEFAULT_PROPERTY_NAME) {
|
|
27
27
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type EmissionCalculationFormulaReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
28
28
|
_EmissionCalculationFormulaReference_id.set(this, void 0);
|
|
29
29
|
_EmissionCalculationFormulaReference_code.set(this, void 0);
|
|
30
30
|
_EmissionCalculationFormulaReference_expression.set(this, void 0);
|
|
31
31
|
if (skipDomainValidation === false) {
|
|
32
|
-
|
|
32
|
+
EmissionCalculationFormulaReference
|
|
33
33
|
.validateEmissionCalculationFormulaReference(value, propertyName);
|
|
34
34
|
}
|
|
35
35
|
__classPrivateFieldSet(this, _EmissionCalculationFormulaReference_id, value.id.trim(), "f");
|
|
@@ -40,10 +40,46 @@ class EmissionCalculationFormulaReference extends ObjectValueObject_1.ObjectValu
|
|
|
40
40
|
* Validación estática para reutilización en factory methods y constructores.
|
|
41
41
|
*/
|
|
42
42
|
static validateEmissionCalculationFormulaReference(value, propertyName) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
this.guardAgainstInvalidType(value, propertyName);
|
|
44
|
+
this.guardAgainstInvalidId(value.id);
|
|
45
|
+
this.guardAgainstInvalidCode(value.code);
|
|
46
|
+
this.guardAgainstInvalidExpression(value.expression);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Valida que el objeto tenga la estructura correcta.
|
|
50
|
+
*/
|
|
51
|
+
static guardAgainstInvalidType(value, propertyName) {
|
|
52
|
+
if (!value || typeof value !== 'object') {
|
|
53
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EmissionCalculationFormulaReference object', typeof value);
|
|
54
|
+
}
|
|
55
|
+
if (typeof value.id !== 'string') {
|
|
56
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
57
|
+
}
|
|
58
|
+
if (typeof value.code !== 'string') {
|
|
59
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
60
|
+
}
|
|
61
|
+
if (typeof value.expression !== 'string') {
|
|
62
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('expression', 'string', typeof value.expression);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
static guardAgainstInvalidId(id) {
|
|
66
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
67
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Valida el código de la fórmula de cálculo de emisiones usando las validaciones de Code.
|
|
71
|
+
* El código debe ser un UUID válido.
|
|
72
|
+
*/
|
|
73
|
+
static guardAgainstInvalidCode(code) {
|
|
74
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
75
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Valida la expresión de la fórmula de cálculo de emisiones.
|
|
79
|
+
* No debe ser vacía después de aplicar trim.
|
|
80
|
+
*/
|
|
81
|
+
static guardAgainstInvalidExpression(expression) {
|
|
82
|
+
String_1.String.guardAgainstEmptyValue(expression, 'expression');
|
|
47
83
|
}
|
|
48
84
|
get id() {
|
|
49
85
|
return __classPrivateFieldGet(this, _EmissionCalculationFormulaReference_id, "f");
|
|
@@ -107,7 +143,7 @@ class EmissionCalculationFormulaReference extends ObjectValueObject_1.ObjectValu
|
|
|
107
143
|
* Dos referencias son iguales si tienen todos los campos idénticos.
|
|
108
144
|
*/
|
|
109
145
|
equals(other) {
|
|
110
|
-
if (!(other instanceof
|
|
146
|
+
if (!(other instanceof EmissionCalculationFormulaReference)) {
|
|
111
147
|
return false;
|
|
112
148
|
}
|
|
113
149
|
return (__classPrivateFieldGet(this, _EmissionCalculationFormulaReference_id, "f") === __classPrivateFieldGet(other, _EmissionCalculationFormulaReference_id, "f")
|
|
@@ -119,7 +155,7 @@ class EmissionCalculationFormulaReference extends ObjectValueObject_1.ObjectValu
|
|
|
119
155
|
* basándose únicamente en el código (identificador único).
|
|
120
156
|
*/
|
|
121
157
|
hasSameFormula(other) {
|
|
122
|
-
if (!(other instanceof
|
|
158
|
+
if (!(other instanceof EmissionCalculationFormulaReference)) {
|
|
123
159
|
return false;
|
|
124
160
|
}
|
|
125
161
|
return __classPrivateFieldGet(this, _EmissionCalculationFormulaReference_code, "f") === __classPrivateFieldGet(other, _EmissionCalculationFormulaReference_code, "f");
|
|
@@ -168,26 +204,5 @@ class EmissionCalculationFormulaReference extends ObjectValueObject_1.ObjectValu
|
|
|
168
204
|
}
|
|
169
205
|
}
|
|
170
206
|
exports.EmissionCalculationFormulaReference = EmissionCalculationFormulaReference;
|
|
171
|
-
|
|
172
|
-
if (!value || typeof value !== 'object') {
|
|
173
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EmissionCalculationFormulaReference object', typeof value);
|
|
174
|
-
}
|
|
175
|
-
if (typeof value.id !== 'string') {
|
|
176
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
177
|
-
}
|
|
178
|
-
if (typeof value.code !== 'string') {
|
|
179
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
180
|
-
}
|
|
181
|
-
if (typeof value.expression !== 'string') {
|
|
182
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('expression', 'string', typeof value.expression);
|
|
183
|
-
}
|
|
184
|
-
}, _EmissionCalculationFormulaReference_guardAgainstInvalidId = function _EmissionCalculationFormulaReference_guardAgainstInvalidId(id) {
|
|
185
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
186
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
187
|
-
}, _EmissionCalculationFormulaReference_guardAgainstInvalidCode = function _EmissionCalculationFormulaReference_guardAgainstInvalidCode(code) {
|
|
188
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
189
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
190
|
-
}, _EmissionCalculationFormulaReference_guardAgainstInvalidExpression = function _EmissionCalculationFormulaReference_guardAgainstInvalidExpression(expression) {
|
|
191
|
-
String_1.String.guardAgainstEmptyValue(expression, 'expression');
|
|
192
|
-
};
|
|
207
|
+
_EmissionCalculationFormulaReference_id = new WeakMap(), _EmissionCalculationFormulaReference_code = new WeakMap(), _EmissionCalculationFormulaReference_expression = new WeakMap();
|
|
193
208
|
EmissionCalculationFormulaReference.DEFAULT_PROPERTY_NAME = 'emissionCalculationFormulaReference';
|