@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 _EmissionCalculationReference_id, _EmissionCalculationReference_activityDataSubmission, _EmissionCalculationReference_emissionCalculationFormula, _EmissionCalculationReference_emissionSource, _EmissionCalculationReference_carbonClient, _EmissionCalculationReference_calculatedAt;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EmissionCalculationReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -24,7 +24,7 @@ class EmissionCalculationReference extends ObjectValueObject_1.ObjectValueObject
|
|
|
24
24
|
* Constructor protegido para que solo clases hijas puedan instanciar.
|
|
25
25
|
* Aplica todas las validaciones de dominio al momento de construcción.
|
|
26
26
|
*/
|
|
27
|
-
constructor(value, skipDomainValidation, propertyName =
|
|
27
|
+
constructor(value, skipDomainValidation, propertyName = EmissionCalculationReference.DEFAULT_PROPERTY_NAME) {
|
|
28
28
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type EmissionCalculationReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
29
29
|
_EmissionCalculationReference_id.set(this, void 0);
|
|
30
30
|
_EmissionCalculationReference_activityDataSubmission.set(this, void 0);
|
|
@@ -33,7 +33,7 @@ class EmissionCalculationReference extends ObjectValueObject_1.ObjectValueObject
|
|
|
33
33
|
_EmissionCalculationReference_carbonClient.set(this, void 0);
|
|
34
34
|
_EmissionCalculationReference_calculatedAt.set(this, void 0);
|
|
35
35
|
if (skipDomainValidation === false) {
|
|
36
|
-
|
|
36
|
+
EmissionCalculationReference.validateEmissionCalculationReference(value, propertyName);
|
|
37
37
|
}
|
|
38
38
|
__classPrivateFieldSet(this, _EmissionCalculationReference_id, value.id.trim(), "f");
|
|
39
39
|
__classPrivateFieldSet(this, _EmissionCalculationReference_activityDataSubmission, value.activityDataSubmission, "f");
|
|
@@ -46,13 +46,102 @@ class EmissionCalculationReference extends ObjectValueObject_1.ObjectValueObject
|
|
|
46
46
|
* Validación estática para reutilización en factory methods y constructores.
|
|
47
47
|
*/
|
|
48
48
|
static validateEmissionCalculationReference(value, propertyName) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
this.guardAgainstInvalidType(value, propertyName);
|
|
50
|
+
this.guardAgainstInvalidId(value.id);
|
|
51
|
+
this.guardAgainstInvalidActivityDataSubmission(value.activityDataSubmission);
|
|
52
|
+
this.guardAgainstInvalidEmissionCalculationFormula(value.emissionCalculationFormula);
|
|
53
|
+
this.guardAgainstInvalidEmissionSource(value.emissionSource);
|
|
54
|
+
this.guardAgainstInvalidCarbonClient(value.carbonClient);
|
|
55
|
+
this.guardAgainstInvalidCalculatedAt(value.calculatedAt);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Valida que el objeto tenga la estructura correcta.
|
|
59
|
+
*/
|
|
60
|
+
static guardAgainstInvalidType(value, propertyName) {
|
|
61
|
+
if (!value || typeof value !== 'object') {
|
|
62
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EmissionCalculationReference object', typeof value);
|
|
63
|
+
}
|
|
64
|
+
if (typeof value.id !== 'string') {
|
|
65
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
66
|
+
}
|
|
67
|
+
if (typeof value.activityDataSubmission !== 'object') {
|
|
68
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission', 'ActivityDataSubmissionReference object', typeof value.activityDataSubmission);
|
|
69
|
+
}
|
|
70
|
+
if (typeof value.emissionCalculationFormula !== 'object') {
|
|
71
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula', 'EmissionCalculationFormulaReference object', typeof value.emissionCalculationFormula);
|
|
72
|
+
}
|
|
73
|
+
if (typeof value.emissionSource !== 'string') {
|
|
74
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionSource', 'string', typeof value.emissionSource);
|
|
75
|
+
}
|
|
76
|
+
if (typeof value.carbonClient !== 'object') {
|
|
77
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', typeof value.carbonClient);
|
|
78
|
+
}
|
|
79
|
+
if (typeof value.calculatedAt !== 'string') {
|
|
80
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('calculatedAt', 'string', typeof value.calculatedAt);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
static guardAgainstInvalidId(id) {
|
|
84
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
85
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Valida la referencia de activity data submission.
|
|
89
|
+
*/
|
|
90
|
+
static guardAgainstInvalidActivityDataSubmission(activityDataSubmission) {
|
|
91
|
+
if (!activityDataSubmission || typeof activityDataSubmission !== 'object') {
|
|
92
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission', 'ActivityDataSubmissionReference object', typeof activityDataSubmission);
|
|
93
|
+
}
|
|
94
|
+
if (typeof activityDataSubmission.id !== 'string') {
|
|
95
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission.id', 'string', typeof activityDataSubmission.id);
|
|
96
|
+
}
|
|
97
|
+
if (typeof activityDataSubmission.dynamicFormCode !== 'string') {
|
|
98
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission.dynamicFormCode', 'string', typeof activityDataSubmission.dynamicFormCode);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Valida la referencia de emission calculation formula.
|
|
103
|
+
*/
|
|
104
|
+
static guardAgainstInvalidEmissionCalculationFormula(emissionCalculationFormula) {
|
|
105
|
+
if (!emissionCalculationFormula || typeof emissionCalculationFormula !== 'object') {
|
|
106
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula', 'EmissionCalculationFormulaReference object', typeof emissionCalculationFormula);
|
|
107
|
+
}
|
|
108
|
+
if (typeof emissionCalculationFormula.id !== 'string') {
|
|
109
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula.id', 'string', typeof emissionCalculationFormula.id);
|
|
110
|
+
}
|
|
111
|
+
if (typeof emissionCalculationFormula.code !== 'string') {
|
|
112
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula.code', 'string', typeof emissionCalculationFormula.code);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Valida el emission source.
|
|
117
|
+
*/
|
|
118
|
+
static guardAgainstInvalidEmissionSource(emissionSource) {
|
|
119
|
+
String_1.String.guardAgainstEmptyValue(emissionSource, 'emissionSource');
|
|
120
|
+
const validEmissionSources = Object.values(EmissionSource_1.EmissionSource);
|
|
121
|
+
if (!validEmissionSources.includes(emissionSource)) {
|
|
122
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionSource', 'valid EmissionSource', emissionSource);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Valida la referencia de carbon client.
|
|
127
|
+
*/
|
|
128
|
+
static guardAgainstInvalidCarbonClient(carbonClient) {
|
|
129
|
+
if (!carbonClient || typeof carbonClient !== 'object') {
|
|
130
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', typeof carbonClient);
|
|
131
|
+
}
|
|
132
|
+
if (typeof carbonClient.id !== 'string') {
|
|
133
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.id', 'string', typeof carbonClient.id);
|
|
134
|
+
}
|
|
135
|
+
if (typeof carbonClient.displayName !== 'string') {
|
|
136
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.displayName', 'string', typeof carbonClient.displayName);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Valida la fecha/hora de cálculo.
|
|
141
|
+
*/
|
|
142
|
+
static guardAgainstInvalidCalculatedAt(calculatedAt) {
|
|
143
|
+
String_1.String.guardAgainstEmptyValue(calculatedAt, 'calculatedAt');
|
|
144
|
+
DateTimeString_1.DateTimeString.guardAgainstInvalidDateTimeFormat(calculatedAt);
|
|
56
145
|
}
|
|
57
146
|
get id() {
|
|
58
147
|
return __classPrivateFieldGet(this, _EmissionCalculationReference_id, "f");
|
|
@@ -180,7 +269,7 @@ class EmissionCalculationReference extends ObjectValueObject_1.ObjectValueObject
|
|
|
180
269
|
* Dos referencias son iguales si tienen todos los campos idénticos.
|
|
181
270
|
*/
|
|
182
271
|
equals(other) {
|
|
183
|
-
if (!(other instanceof
|
|
272
|
+
if (!(other instanceof EmissionCalculationReference)) {
|
|
184
273
|
return false;
|
|
185
274
|
}
|
|
186
275
|
return (__classPrivateFieldGet(this, _EmissionCalculationReference_id, "f") === __classPrivateFieldGet(other, _EmissionCalculationReference_id, "f")
|
|
@@ -195,7 +284,7 @@ class EmissionCalculationReference extends ObjectValueObject_1.ObjectValueObject
|
|
|
195
284
|
* basándose únicamente en el ID (identificador único).
|
|
196
285
|
*/
|
|
197
286
|
hasSameCalculation(other) {
|
|
198
|
-
if (!(other instanceof
|
|
287
|
+
if (!(other instanceof EmissionCalculationReference)) {
|
|
199
288
|
return false;
|
|
200
289
|
}
|
|
201
290
|
return __classPrivateFieldGet(this, _EmissionCalculationReference_id, "f") === __classPrivateFieldGet(other, _EmissionCalculationReference_id, "f");
|
|
@@ -250,69 +339,5 @@ class EmissionCalculationReference extends ObjectValueObject_1.ObjectValueObject
|
|
|
250
339
|
}
|
|
251
340
|
}
|
|
252
341
|
exports.EmissionCalculationReference = EmissionCalculationReference;
|
|
253
|
-
|
|
254
|
-
if (!value || typeof value !== 'object') {
|
|
255
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EmissionCalculationReference object', typeof value);
|
|
256
|
-
}
|
|
257
|
-
if (typeof value.id !== 'string') {
|
|
258
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
259
|
-
}
|
|
260
|
-
if (typeof value.activityDataSubmission !== 'object') {
|
|
261
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission', 'ActivityDataSubmissionReference object', typeof value.activityDataSubmission);
|
|
262
|
-
}
|
|
263
|
-
if (typeof value.emissionCalculationFormula !== 'object') {
|
|
264
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula', 'EmissionCalculationFormulaReference object', typeof value.emissionCalculationFormula);
|
|
265
|
-
}
|
|
266
|
-
if (typeof value.emissionSource !== 'string') {
|
|
267
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionSource', 'string', typeof value.emissionSource);
|
|
268
|
-
}
|
|
269
|
-
if (typeof value.carbonClient !== 'object') {
|
|
270
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', typeof value.carbonClient);
|
|
271
|
-
}
|
|
272
|
-
if (typeof value.calculatedAt !== 'string') {
|
|
273
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('calculatedAt', 'string', typeof value.calculatedAt);
|
|
274
|
-
}
|
|
275
|
-
}, _EmissionCalculationReference_guardAgainstInvalidId = function _EmissionCalculationReference_guardAgainstInvalidId(id) {
|
|
276
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
277
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
278
|
-
}, _EmissionCalculationReference_guardAgainstInvalidActivityDataSubmission = function _EmissionCalculationReference_guardAgainstInvalidActivityDataSubmission(activityDataSubmission) {
|
|
279
|
-
if (!activityDataSubmission || typeof activityDataSubmission !== 'object') {
|
|
280
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission', 'ActivityDataSubmissionReference object', typeof activityDataSubmission);
|
|
281
|
-
}
|
|
282
|
-
if (typeof activityDataSubmission.id !== 'string') {
|
|
283
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission.id', 'string', typeof activityDataSubmission.id);
|
|
284
|
-
}
|
|
285
|
-
if (typeof activityDataSubmission.dynamicFormCode !== 'string') {
|
|
286
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('activityDataSubmission.dynamicFormCode', 'string', typeof activityDataSubmission.dynamicFormCode);
|
|
287
|
-
}
|
|
288
|
-
}, _EmissionCalculationReference_guardAgainstInvalidEmissionCalculationFormula = function _EmissionCalculationReference_guardAgainstInvalidEmissionCalculationFormula(emissionCalculationFormula) {
|
|
289
|
-
if (!emissionCalculationFormula || typeof emissionCalculationFormula !== 'object') {
|
|
290
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula', 'EmissionCalculationFormulaReference object', typeof emissionCalculationFormula);
|
|
291
|
-
}
|
|
292
|
-
if (typeof emissionCalculationFormula.id !== 'string') {
|
|
293
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula.id', 'string', typeof emissionCalculationFormula.id);
|
|
294
|
-
}
|
|
295
|
-
if (typeof emissionCalculationFormula.code !== 'string') {
|
|
296
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionCalculationFormula.code', 'string', typeof emissionCalculationFormula.code);
|
|
297
|
-
}
|
|
298
|
-
}, _EmissionCalculationReference_guardAgainstInvalidEmissionSource = function _EmissionCalculationReference_guardAgainstInvalidEmissionSource(emissionSource) {
|
|
299
|
-
String_1.String.guardAgainstEmptyValue(emissionSource, 'emissionSource');
|
|
300
|
-
const validEmissionSources = Object.values(EmissionSource_1.EmissionSource);
|
|
301
|
-
if (!validEmissionSources.includes(emissionSource)) {
|
|
302
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('emissionSource', 'valid EmissionSource', emissionSource);
|
|
303
|
-
}
|
|
304
|
-
}, _EmissionCalculationReference_guardAgainstInvalidCarbonClient = function _EmissionCalculationReference_guardAgainstInvalidCarbonClient(carbonClient) {
|
|
305
|
-
if (!carbonClient || typeof carbonClient !== 'object') {
|
|
306
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', typeof carbonClient);
|
|
307
|
-
}
|
|
308
|
-
if (typeof carbonClient.id !== 'string') {
|
|
309
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.id', 'string', typeof carbonClient.id);
|
|
310
|
-
}
|
|
311
|
-
if (typeof carbonClient.displayName !== 'string') {
|
|
312
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.displayName', 'string', typeof carbonClient.displayName);
|
|
313
|
-
}
|
|
314
|
-
}, _EmissionCalculationReference_guardAgainstInvalidCalculatedAt = function _EmissionCalculationReference_guardAgainstInvalidCalculatedAt(calculatedAt) {
|
|
315
|
-
String_1.String.guardAgainstEmptyValue(calculatedAt, 'calculatedAt');
|
|
316
|
-
DateTimeString_1.DateTimeString.guardAgainstInvalidDateTimeFormat(calculatedAt);
|
|
317
|
-
};
|
|
342
|
+
_EmissionCalculationReference_id = new WeakMap(), _EmissionCalculationReference_activityDataSubmission = new WeakMap(), _EmissionCalculationReference_emissionCalculationFormula = new WeakMap(), _EmissionCalculationReference_emissionSource = new WeakMap(), _EmissionCalculationReference_carbonClient = new WeakMap(), _EmissionCalculationReference_calculatedAt = new WeakMap();
|
|
318
343
|
EmissionCalculationReference.DEFAULT_PROPERTY_NAME = 'emissionCalculationReference';
|
|
@@ -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 _EmissionFactorReference_id, _EmissionFactorReference_code, _EmissionFactorReference_name;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EmissionFactorReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -24,13 +24,13 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
24
24
|
* Constructor protegido para que solo clases hijas puedan instanciar.
|
|
25
25
|
* Aplica todas las validaciones de dominio al momento de construcción.
|
|
26
26
|
*/
|
|
27
|
-
constructor(value, skipDomainValidation, propertyName =
|
|
27
|
+
constructor(value, skipDomainValidation, propertyName = EmissionFactorReference.DEFAULT_PROPERTY_NAME) {
|
|
28
28
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type EmissionFactorReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
29
29
|
_EmissionFactorReference_id.set(this, void 0);
|
|
30
30
|
_EmissionFactorReference_code.set(this, void 0);
|
|
31
31
|
_EmissionFactorReference_name.set(this, void 0);
|
|
32
32
|
if (skipDomainValidation === false) {
|
|
33
|
-
|
|
33
|
+
EmissionFactorReference.validateEmissionFactorReference(value, propertyName);
|
|
34
34
|
}
|
|
35
35
|
__classPrivateFieldSet(this, _EmissionFactorReference_id, value.id.trim(), "f");
|
|
36
36
|
__classPrivateFieldSet(this, _EmissionFactorReference_code, value.code.trim().toUpperCase(), "f");
|
|
@@ -40,10 +40,53 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
40
40
|
* Validación estática para reutilización en factory methods y constructores.
|
|
41
41
|
*/
|
|
42
42
|
static validateEmissionFactorReference(value, propertyName) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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 (!value || typeof value !== 'object') {
|
|
53
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EmissionFactorReference 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 el ID usando las validaciones de AggregateId.
|
|
67
|
+
*/
|
|
68
|
+
static guardAgainstInvalidId(id) {
|
|
69
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
70
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Valida el código del factor de emisión.
|
|
74
|
+
*/
|
|
75
|
+
static guardAgainstInvalidCode(code) {
|
|
76
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
77
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Valida el nombre del factor de emisión.
|
|
81
|
+
*/
|
|
82
|
+
static guardAgainstInvalidName(name) {
|
|
83
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
84
|
+
if (name.trim().length < 3) {
|
|
85
|
+
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('name', 'at least 3 characters', `${name.trim().length} characters: "${name.trim()}"`);
|
|
86
|
+
}
|
|
87
|
+
if (name.trim().length > 200) {
|
|
88
|
+
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('name', 'at most 200 characters', `${name.trim().length} characters: "${name.substring(0, 50)}${name.length > 50 ? '...' : ''}"`);
|
|
89
|
+
}
|
|
47
90
|
}
|
|
48
91
|
/**
|
|
49
92
|
* ID único del factor de emisión (UUID).
|
|
@@ -126,7 +169,7 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
126
169
|
* Dos referencias son iguales si tienen el mismo nombre y fuente de datos.
|
|
127
170
|
*/
|
|
128
171
|
equals(other) {
|
|
129
|
-
if (!(other instanceof
|
|
172
|
+
if (!(other instanceof EmissionFactorReference)) {
|
|
130
173
|
return false;
|
|
131
174
|
}
|
|
132
175
|
return (__classPrivateFieldGet(this, _EmissionFactorReference_id, "f") === __classPrivateFieldGet(other, _EmissionFactorReference_id, "f")
|
|
@@ -138,7 +181,7 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
138
181
|
* basándose en nombre y fuente de datos.
|
|
139
182
|
*/
|
|
140
183
|
hasSameReference(other) {
|
|
141
|
-
if (!(other instanceof
|
|
184
|
+
if (!(other instanceof EmissionFactorReference)) {
|
|
142
185
|
return false;
|
|
143
186
|
}
|
|
144
187
|
return __classPrivateFieldGet(this, _EmissionFactorReference_id, "f") === __classPrivateFieldGet(other, _EmissionFactorReference_id, "f");
|
|
@@ -147,7 +190,7 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
147
190
|
* Compara si dos referencias tienen el mismo código.
|
|
148
191
|
*/
|
|
149
192
|
hasSameCode(other) {
|
|
150
|
-
if (!(other instanceof
|
|
193
|
+
if (!(other instanceof EmissionFactorReference)) {
|
|
151
194
|
return false;
|
|
152
195
|
}
|
|
153
196
|
return __classPrivateFieldGet(this, _EmissionFactorReference_code, "f") === __classPrivateFieldGet(other, _EmissionFactorReference_code, "f");
|
|
@@ -156,7 +199,7 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
156
199
|
* Compara si dos referencias tienen el mismo nombre.
|
|
157
200
|
*/
|
|
158
201
|
hasSameName(other) {
|
|
159
|
-
if (!(other instanceof
|
|
202
|
+
if (!(other instanceof EmissionFactorReference)) {
|
|
160
203
|
return false;
|
|
161
204
|
}
|
|
162
205
|
return __classPrivateFieldGet(this, _EmissionFactorReference_name, "f") === __classPrivateFieldGet(other, _EmissionFactorReference_name, "f");
|
|
@@ -165,7 +208,7 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
165
208
|
* Verifica si es compatible con otra referencia basándose en la fuente de datos.
|
|
166
209
|
*/
|
|
167
210
|
isCompatibleWith(other) {
|
|
168
|
-
if (!(other instanceof
|
|
211
|
+
if (!(other instanceof EmissionFactorReference)) {
|
|
169
212
|
return false;
|
|
170
213
|
}
|
|
171
214
|
// Compatibilidad basada en categoría (energía, transporte, etc.)
|
|
@@ -204,32 +247,5 @@ class EmissionFactorReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
204
247
|
}
|
|
205
248
|
}
|
|
206
249
|
exports.EmissionFactorReference = EmissionFactorReference;
|
|
207
|
-
|
|
208
|
-
if (!value || typeof value !== 'object') {
|
|
209
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EmissionFactorReference object', typeof value);
|
|
210
|
-
}
|
|
211
|
-
if (typeof value.id !== 'string') {
|
|
212
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
213
|
-
}
|
|
214
|
-
if (typeof value.code !== 'string') {
|
|
215
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
216
|
-
}
|
|
217
|
-
if (typeof value.name !== 'string') {
|
|
218
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
219
|
-
}
|
|
220
|
-
}, _EmissionFactorReference_guardAgainstInvalidId = function _EmissionFactorReference_guardAgainstInvalidId(id) {
|
|
221
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
222
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
223
|
-
}, _EmissionFactorReference_guardAgainstInvalidCode = function _EmissionFactorReference_guardAgainstInvalidCode(code) {
|
|
224
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
225
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
226
|
-
}, _EmissionFactorReference_guardAgainstInvalidName = function _EmissionFactorReference_guardAgainstInvalidName(name) {
|
|
227
|
-
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
228
|
-
if (name.trim().length < 3) {
|
|
229
|
-
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('name', 'at least 3 characters', `${name.trim().length} characters: "${name.trim()}"`);
|
|
230
|
-
}
|
|
231
|
-
if (name.trim().length > 200) {
|
|
232
|
-
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('name', 'at most 200 characters', `${name.trim().length} characters: "${name.substring(0, 50)}${name.length > 50 ? '...' : ''}"`);
|
|
233
|
-
}
|
|
234
|
-
};
|
|
250
|
+
_EmissionFactorReference_id = new WeakMap(), _EmissionFactorReference_code = new WeakMap(), _EmissionFactorReference_name = new WeakMap();
|
|
235
251
|
EmissionFactorReference.DEFAULT_PROPERTY_NAME = 'formulaEmissionFactorReference';
|
|
@@ -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 _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EventEditionConfigurationCarbonFootprintSubsegmentReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -23,13 +23,13 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
|
|
|
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 = EventEditionConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
|
|
27
27
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type EventEditionConfigurationCarbonFootprintSubsegmentReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
28
28
|
_EventEditionConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
|
|
29
29
|
_EventEditionConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
|
|
30
30
|
_EventEditionConfigurationCarbonFootprintSubsegmentReference_name.set(this, void 0);
|
|
31
31
|
if (skipDomainValidation === false) {
|
|
32
|
-
|
|
32
|
+
EventEditionConfigurationCarbonFootprintSubsegmentReference
|
|
33
33
|
.validateEventEditionConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
|
|
34
34
|
}
|
|
35
35
|
__classPrivateFieldSet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
|
|
@@ -40,10 +40,56 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
|
|
|
40
40
|
* Validación estática para reutilización en factory methods y constructores.
|
|
41
41
|
*/
|
|
42
42
|
static validateEventEditionConfigurationCarbonFootprintSubsegmentReference(value, propertyName) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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 (!value || typeof value !== 'object') {
|
|
53
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionConfigurationCarbonFootprintSubsegmentReference 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 el ID usando las validaciones de AggregateId.
|
|
67
|
+
*/
|
|
68
|
+
static guardAgainstInvalidId(id) {
|
|
69
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
70
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Valida el código de subsegmento usando las validaciones de Code.
|
|
74
|
+
*/
|
|
75
|
+
static guardAgainstInvalidCode(code) {
|
|
76
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
77
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Valida el nombre del subsegmento.
|
|
81
|
+
*/
|
|
82
|
+
static guardAgainstInvalidName(name) {
|
|
83
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
84
|
+
if (this.nameLengthIsInvalid(name)) {
|
|
85
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', `string with maximum ${this.MAX_NAME_LENGTH} characters`, `string with ${name.trim().length} characters`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Verifica si la longitud del nombre es inválida.
|
|
90
|
+
*/
|
|
91
|
+
static nameLengthIsInvalid(name) {
|
|
92
|
+
return name.trim().length > this.MAX_NAME_LENGTH;
|
|
47
93
|
}
|
|
48
94
|
/**
|
|
49
95
|
* ID único del subsegmento (UUID).
|
|
@@ -143,7 +189,7 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
|
|
|
143
189
|
* Dos referencias son iguales si tienen el mismo código y nombre.
|
|
144
190
|
*/
|
|
145
191
|
equals(other) {
|
|
146
|
-
if (!(other instanceof
|
|
192
|
+
if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
|
|
147
193
|
return false;
|
|
148
194
|
}
|
|
149
195
|
return (__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f")
|
|
@@ -155,7 +201,7 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
|
|
|
155
201
|
* basándose únicamente en el código (identificador único).
|
|
156
202
|
*/
|
|
157
203
|
hasSameSubsegment(other) {
|
|
158
|
-
if (!(other instanceof
|
|
204
|
+
if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
|
|
159
205
|
return false;
|
|
160
206
|
}
|
|
161
207
|
return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f");
|
|
@@ -164,7 +210,7 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
|
|
|
164
210
|
* Compara si dos subsegmentos tienen el mismo código.
|
|
165
211
|
*/
|
|
166
212
|
hasSameCode(other) {
|
|
167
|
-
if (!(other instanceof
|
|
213
|
+
if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
|
|
168
214
|
return false;
|
|
169
215
|
}
|
|
170
216
|
return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f");
|
|
@@ -173,7 +219,7 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
|
|
|
173
219
|
* Compara si dos subsegmentos tienen el mismo nombre.
|
|
174
220
|
*/
|
|
175
221
|
hasSameName(other) {
|
|
176
|
-
if (!(other instanceof
|
|
222
|
+
if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
|
|
177
223
|
return false;
|
|
178
224
|
}
|
|
179
225
|
return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f");
|
|
@@ -209,32 +255,6 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
|
|
|
209
255
|
}
|
|
210
256
|
}
|
|
211
257
|
exports.EventEditionConfigurationCarbonFootprintSubsegmentReference = EventEditionConfigurationCarbonFootprintSubsegmentReference;
|
|
212
|
-
|
|
213
|
-
if (!value || typeof value !== 'object') {
|
|
214
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionConfigurationCarbonFootprintSubsegmentReference object', typeof value);
|
|
215
|
-
}
|
|
216
|
-
if (typeof value.id !== 'string') {
|
|
217
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
218
|
-
}
|
|
219
|
-
if (typeof value.code !== 'string') {
|
|
220
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
221
|
-
}
|
|
222
|
-
if (typeof value.name !== 'string') {
|
|
223
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
224
|
-
}
|
|
225
|
-
}, _EventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId = function _EventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId(id) {
|
|
226
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
227
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
228
|
-
}, _EventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidCode = function _EventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidCode(code) {
|
|
229
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
230
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
231
|
-
}, _EventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidName = function _EventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidName(name) {
|
|
232
|
-
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
233
|
-
if (__classPrivateFieldGet(this, _a, "m", _EventEditionConfigurationCarbonFootprintSubsegmentReference_nameLengthIsInvalid).call(this, name)) {
|
|
234
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', `string with maximum ${this.MAX_NAME_LENGTH} characters`, `string with ${name.trim().length} characters`);
|
|
235
|
-
}
|
|
236
|
-
}, _EventEditionConfigurationCarbonFootprintSubsegmentReference_nameLengthIsInvalid = function _EventEditionConfigurationCarbonFootprintSubsegmentReference_nameLengthIsInvalid(name) {
|
|
237
|
-
return name.trim().length > this.MAX_NAME_LENGTH;
|
|
238
|
-
};
|
|
258
|
+
_EventEditionConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _EventEditionConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _EventEditionConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap();
|
|
239
259
|
EventEditionConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'eventEditionStageSubsegmentReference';
|
|
240
260
|
EventEditionConfigurationCarbonFootprintSubsegmentReference.MAX_NAME_LENGTH = 255;
|