@carbonbox/domain 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.js +97 -61
- package/build/carbonbox/shared/domain/value-objects/Address.js +63 -52
- package/build/carbonbox/shared/domain/value-objects/AggregateId.js +13 -18
- package/build/carbonbox/shared/domain/value-objects/Boolean.js +29 -30
- package/build/carbonbox/shared/domain/value-objects/CalculationProcessReference.js +36 -32
- package/build/carbonbox/shared/domain/value-objects/CalculationVariableReferences.js +82 -62
- package/build/carbonbox/shared/domain/value-objects/CarbonClientReference.js +181 -114
- package/build/carbonbox/shared/domain/value-objects/CarbonClientReferences.js +109 -74
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.js +37 -27
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.js +101 -68
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.js +95 -60
- package/build/carbonbox/shared/domain/value-objects/CodeList.js +57 -41
- package/build/carbonbox/shared/domain/value-objects/CollectionFieldReference.js +74 -49
- package/build/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.js +171 -116
- package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.js +70 -43
- package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.js +70 -43
- package/build/carbonbox/shared/domain/value-objects/Currency.js +10 -15
- package/build/carbonbox/shared/domain/value-objects/DateString.js +15 -20
- package/build/carbonbox/shared/domain/value-objects/DateTimeString.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/Email.js +9 -14
- package/build/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.js +46 -31
- package/build/carbonbox/shared/domain/value-objects/EmissionCalculationReference.js +102 -77
- package/build/carbonbox/shared/domain/value-objects/EmissionFactorReference.js +56 -40
- package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.js +58 -38
- package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.js +95 -60
- package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.js +171 -116
- package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.js +43 -30
- package/build/carbonbox/shared/domain/value-objects/EventEditionReference.js +49 -33
- package/build/carbonbox/shared/domain/value-objects/EventEditionReferences.js +65 -49
- package/build/carbonbox/shared/domain/value-objects/EventReference.js +41 -31
- package/build/carbonbox/shared/domain/value-objects/ExecutionPeriod.js +95 -79
- package/build/carbonbox/shared/domain/value-objects/FacilityReference.js +34 -24
- package/build/carbonbox/shared/domain/value-objects/Gender.js +11 -16
- package/build/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.js +72 -53
- package/build/carbonbox/shared/domain/value-objects/Image.js +46 -38
- package/build/carbonbox/shared/domain/value-objects/Integer.js +13 -18
- package/build/carbonbox/shared/domain/value-objects/NullableCode.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.js +49 -31
- package/build/carbonbox/shared/domain/value-objects/NullableDate.js +25 -27
- package/build/carbonbox/shared/domain/value-objects/NullableDateTimeString.js +34 -37
- package/build/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.js +49 -31
- package/build/carbonbox/shared/domain/value-objects/NullableNumeric.js +60 -63
- package/build/carbonbox/shared/domain/value-objects/NullablePositiveInteger.js +4 -11
- package/build/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.js +49 -31
- package/build/carbonbox/shared/domain/value-objects/NullableStakeholderReference.js +8 -8
- package/build/carbonbox/shared/domain/value-objects/NullableString.js +22 -25
- package/build/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.js +43 -35
- package/build/carbonbox/shared/domain/value-objects/Numeric.js +72 -69
- package/build/carbonbox/shared/domain/value-objects/Phone.js +66 -47
- package/build/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.js +176 -121
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.js +101 -61
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.js +101 -61
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.js +60 -40
- package/build/carbonbox/shared/domain/value-objects/ProductReference.js +46 -31
- package/build/carbonbox/shared/domain/value-objects/ServiceCatalogReference.js +60 -40
- package/build/carbonbox/shared/domain/value-objects/StakeholderReference.js +123 -75
- package/build/carbonbox/shared/domain/value-objects/StakeholderReferences.js +124 -81
- package/build/carbonbox/shared/domain/value-objects/String.js +13 -17
- package/build/carbonbox/shared/domain/value-objects/StringList.js +35 -35
- package/build/carbonbox/shared/domain/value-objects/TaxIdentification.js +121 -85
- package/build/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.js +57 -52
- package/build/carbonbox/shared/domain/value-objects/Url.js +14 -19
- package/build/carbonbox/shared/domain/value-objects/UrlList.js +57 -41
- package/build/carbonbox/shared/domain/value-objects/UserBusinessStatus.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/UserEmail.js +48 -40
- package/build/carbonbox/shared/domain/value-objects/UserPassword.js +29 -32
- package/build/carbonbox/shared/domain/value-objects/UserPermissions.js +47 -46
- package/build/carbonbox/shared/domain/value-objects/UserType.js +17 -22
- package/build/carbonbox/shared/domain/value-objects/ValueObject.js +17 -16
- package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts +37 -1
- package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts +22 -4
- package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts +4 -3
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts +2 -2
- package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts +24 -4
- package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts +70 -2
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts +39 -2
- package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts +11 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts +35 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts +38 -2
- package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts +18 -2
- package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts +26 -1
- package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts +64 -2
- package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +30 -2
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +30 -2
- package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts +3 -2
- package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts +5 -3
- package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts +5 -3
- package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts +3 -2
- package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts +16 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts +26 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts +17 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts +3 -3
- package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +22 -2
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts +38 -2
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts +64 -2
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts +14 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts +17 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts +20 -4
- package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts +11 -1
- package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts +16 -1
- package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts +11 -1
- package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts +4 -3
- package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts +21 -2
- package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts +12 -0
- package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts +6 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts +6 -2
- package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts +3 -2
- package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts +2 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts +5 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts +20 -5
- package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts +11 -2
- package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts +21 -2
- package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts +2 -1
- package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts +60 -2
- package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts +45 -4
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +45 -4
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts +21 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts +16 -1
- package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts +21 -1
- package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts +51 -2
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts +46 -2
- package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/String.d.ts +3 -1
- package/build/types/carbonbox/shared/domain/value-objects/String.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts +7 -1
- package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts +41 -3
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts +4 -4
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts +16 -4
- package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts +2 -1
- package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts +18 -2
- package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts +10 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts +7 -3
- package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts +11 -3
- package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts +4 -2
- package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts +2 -0
- package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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 _EventEditionLifecycleStageReference_id, _EventEditionLifecycleStageReference_code, _EventEditionLifecycleStageReference_name;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EventEditionLifecycleStageReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -23,13 +23,13 @@ class EventEditionLifecycleStageReference 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 = EventEditionLifecycleStageReference.DEFAULT_PROPERTY_NAME) {
|
|
27
27
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type EventEditionLifecycleStageReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
28
28
|
_EventEditionLifecycleStageReference_id.set(this, void 0);
|
|
29
29
|
_EventEditionLifecycleStageReference_code.set(this, void 0);
|
|
30
30
|
_EventEditionLifecycleStageReference_name.set(this, void 0);
|
|
31
31
|
if (skipDomainValidation === false) {
|
|
32
|
-
|
|
32
|
+
EventEditionLifecycleStageReference
|
|
33
33
|
.validateEventEditionLifecycleStageReference(value, propertyName);
|
|
34
34
|
}
|
|
35
35
|
__classPrivateFieldSet(this, _EventEditionLifecycleStageReference_id, value.id.trim(), "f");
|
|
@@ -40,10 +40,44 @@ class EventEditionLifecycleStageReference extends ObjectValueObject_1.ObjectValu
|
|
|
40
40
|
* Validación estática para reutilización en factory methods y constructores.
|
|
41
41
|
*/
|
|
42
42
|
static validateEventEditionLifecycleStageReference(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, 'EventEditionLifecycleStageReference 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 edición del evento 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
|
+
static guardAgainstInvalidName(name) {
|
|
80
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
47
81
|
}
|
|
48
82
|
get id() {
|
|
49
83
|
return __classPrivateFieldGet(this, _EventEditionLifecycleStageReference_id, "f");
|
|
@@ -138,7 +172,7 @@ class EventEditionLifecycleStageReference extends ObjectValueObject_1.ObjectValu
|
|
|
138
172
|
* basándose únicamente en el código (identificador único).
|
|
139
173
|
*/
|
|
140
174
|
hasSameStage(other) {
|
|
141
|
-
if (!(other instanceof
|
|
175
|
+
if (!(other instanceof EventEditionLifecycleStageReference)) {
|
|
142
176
|
return false;
|
|
143
177
|
}
|
|
144
178
|
return __classPrivateFieldGet(this, _EventEditionLifecycleStageReference_code, "f") === __classPrivateFieldGet(other, _EventEditionLifecycleStageReference_code, "f");
|
|
@@ -174,26 +208,5 @@ class EventEditionLifecycleStageReference extends ObjectValueObject_1.ObjectValu
|
|
|
174
208
|
}
|
|
175
209
|
}
|
|
176
210
|
exports.EventEditionLifecycleStageReference = EventEditionLifecycleStageReference;
|
|
177
|
-
|
|
178
|
-
if (!value || typeof value !== 'object') {
|
|
179
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionLifecycleStageReference object', typeof value);
|
|
180
|
-
}
|
|
181
|
-
if (typeof value.id !== 'string') {
|
|
182
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
183
|
-
}
|
|
184
|
-
if (typeof value.code !== 'string') {
|
|
185
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
186
|
-
}
|
|
187
|
-
if (typeof value.name !== 'string') {
|
|
188
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
189
|
-
}
|
|
190
|
-
}, _EventEditionLifecycleStageReference_guardAgainstInvalidId = function _EventEditionLifecycleStageReference_guardAgainstInvalidId(id) {
|
|
191
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
192
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
193
|
-
}, _EventEditionLifecycleStageReference_guardAgainstInvalidCode = function _EventEditionLifecycleStageReference_guardAgainstInvalidCode(code) {
|
|
194
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
195
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
196
|
-
}, _EventEditionLifecycleStageReference_guardAgainstInvalidName = function _EventEditionLifecycleStageReference_guardAgainstInvalidName(name) {
|
|
197
|
-
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
198
|
-
};
|
|
211
|
+
_EventEditionLifecycleStageReference_id = new WeakMap(), _EventEditionLifecycleStageReference_code = new WeakMap(), _EventEditionLifecycleStageReference_name = new WeakMap();
|
|
199
212
|
EventEditionLifecycleStageReference.DEFAULT_PROPERTY_NAME = 'eventEditionStageReference';
|
|
@@ -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 _EventEditionReference_id, _EventEditionReference_code, _EventEditionReference_name;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EventEditionReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -23,13 +23,13 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
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 = EventEditionReference.DEFAULT_PROPERTY_NAME) {
|
|
27
27
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type EventEditionReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
28
28
|
_EventEditionReference_id.set(this, void 0);
|
|
29
29
|
_EventEditionReference_code.set(this, void 0);
|
|
30
30
|
_EventEditionReference_name.set(this, void 0);
|
|
31
31
|
if (skipDomainValidation === false) {
|
|
32
|
-
|
|
32
|
+
EventEditionReference.validateEventEditionReference(value, propertyName);
|
|
33
33
|
}
|
|
34
34
|
__classPrivateFieldSet(this, _EventEditionReference_id, value.id.trim(), "f");
|
|
35
35
|
__classPrivateFieldSet(this, _EventEditionReference_code, value.code.trim().toUpperCase(), "f");
|
|
@@ -39,10 +39,47 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
39
39
|
* Validación estática para reutilización en factory methods y constructores.
|
|
40
40
|
*/
|
|
41
41
|
static validateEventEditionReference(value, propertyName) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
this.guardAgainstInvalidType(value, propertyName);
|
|
43
|
+
this.guardAgainstInvalidId(value.id);
|
|
44
|
+
this.guardAgainstInvalidCode(value.code);
|
|
45
|
+
this.guardAgainstInvalidName(value.name);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Valida que el objeto tenga la estructura correcta.
|
|
49
|
+
*/
|
|
50
|
+
static guardAgainstInvalidType(value, propertyName) {
|
|
51
|
+
if (!value || typeof value !== 'object') {
|
|
52
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionReference object', typeof value);
|
|
53
|
+
}
|
|
54
|
+
if (typeof value.id !== 'string') {
|
|
55
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
56
|
+
}
|
|
57
|
+
if (typeof value.code !== 'string') {
|
|
58
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
59
|
+
}
|
|
60
|
+
if (typeof value.name !== 'string') {
|
|
61
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Valida el ID usando las validaciones de AggregateId.
|
|
66
|
+
*/
|
|
67
|
+
static guardAgainstInvalidId(id) {
|
|
68
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
69
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Valida el código de edición del evento usando las validaciones de Code.
|
|
73
|
+
*/
|
|
74
|
+
static guardAgainstInvalidCode(code) {
|
|
75
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
76
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Valida el nombre de la edición del evento.
|
|
80
|
+
*/
|
|
81
|
+
static guardAgainstInvalidName(name) {
|
|
82
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
46
83
|
}
|
|
47
84
|
/**
|
|
48
85
|
* ID único de la edición del evento (UUID).
|
|
@@ -121,7 +158,7 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
121
158
|
* Dos referencias son iguales si tienen el mismo código y nombre.
|
|
122
159
|
*/
|
|
123
160
|
equals(other) {
|
|
124
|
-
if (!(other instanceof
|
|
161
|
+
if (!(other instanceof EventEditionReference)) {
|
|
125
162
|
return false;
|
|
126
163
|
}
|
|
127
164
|
return (__classPrivateFieldGet(this, _EventEditionReference_id, "f") === __classPrivateFieldGet(other, _EventEditionReference_id, "f")
|
|
@@ -133,7 +170,7 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
133
170
|
* basándose únicamente en el código (identificador único).
|
|
134
171
|
*/
|
|
135
172
|
hasSameEdition(other) {
|
|
136
|
-
if (!(other instanceof
|
|
173
|
+
if (!(other instanceof EventEditionReference)) {
|
|
137
174
|
return false;
|
|
138
175
|
}
|
|
139
176
|
return __classPrivateFieldGet(this, _EventEditionReference_id, "f") === __classPrivateFieldGet(other, _EventEditionReference_id, "f");
|
|
@@ -142,7 +179,7 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
142
179
|
* Compara si dos referencias tienen el mismo código.
|
|
143
180
|
*/
|
|
144
181
|
hasSameCode(other) {
|
|
145
|
-
if (!(other instanceof
|
|
182
|
+
if (!(other instanceof EventEditionReference)) {
|
|
146
183
|
return false;
|
|
147
184
|
}
|
|
148
185
|
return __classPrivateFieldGet(this, _EventEditionReference_code, "f") === __classPrivateFieldGet(other, _EventEditionReference_code, "f");
|
|
@@ -151,7 +188,7 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
151
188
|
* Compara si dos referencias tienen el mismo nombre.
|
|
152
189
|
*/
|
|
153
190
|
hasSameName(other) {
|
|
154
|
-
if (!(other instanceof
|
|
191
|
+
if (!(other instanceof EventEditionReference)) {
|
|
155
192
|
return false;
|
|
156
193
|
}
|
|
157
194
|
return __classPrivateFieldGet(this, _EventEditionReference_name, "f") === __classPrivateFieldGet(other, _EventEditionReference_name, "f");
|
|
@@ -187,26 +224,5 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
187
224
|
}
|
|
188
225
|
}
|
|
189
226
|
exports.EventEditionReference = EventEditionReference;
|
|
190
|
-
|
|
191
|
-
if (!value || typeof value !== 'object') {
|
|
192
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionReference object', typeof value);
|
|
193
|
-
}
|
|
194
|
-
if (typeof value.id !== 'string') {
|
|
195
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
196
|
-
}
|
|
197
|
-
if (typeof value.code !== 'string') {
|
|
198
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
199
|
-
}
|
|
200
|
-
if (typeof value.name !== 'string') {
|
|
201
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
202
|
-
}
|
|
203
|
-
}, _EventEditionReference_guardAgainstInvalidId = function _EventEditionReference_guardAgainstInvalidId(id) {
|
|
204
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
205
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
206
|
-
}, _EventEditionReference_guardAgainstInvalidCode = function _EventEditionReference_guardAgainstInvalidCode(code) {
|
|
207
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
208
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
209
|
-
}, _EventEditionReference_guardAgainstInvalidName = function _EventEditionReference_guardAgainstInvalidName(name) {
|
|
210
|
-
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
211
|
-
};
|
|
227
|
+
_EventEditionReference_id = new WeakMap(), _EventEditionReference_code = new WeakMap(), _EventEditionReference_name = new WeakMap();
|
|
212
228
|
EventEditionReference.DEFAULT_PROPERTY_NAME = 'eventEditionReference';
|
|
@@ -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 _EventEditionReferences_eventEditionReferences, _EventEditionReferences_options;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EventEditionReferences = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -24,33 +24,83 @@ class EventEditionReferences extends ValueObject_1.ValueObject {
|
|
|
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 =
|
|
28
|
-
const finalOptions = { ...
|
|
27
|
+
constructor(value, skipDomainValidation, propertyName = EventEditionReferences.DEFAULT_PROPERTY_NAME, options = EventEditionReferences.DEFAULT_OPTIONS) {
|
|
28
|
+
const finalOptions = { ...EventEditionReferences.DEFAULT_OPTIONS, ...options };
|
|
29
29
|
if (skipDomainValidation === false) {
|
|
30
|
-
|
|
30
|
+
EventEditionReferences.validateReferences(value, propertyName, finalOptions);
|
|
31
31
|
}
|
|
32
32
|
// Convertir a array de primitivos para el ValueObject padre
|
|
33
|
-
const primitives =
|
|
33
|
+
const primitives = EventEditionReferences.toPrimitivesArray(value);
|
|
34
34
|
super(primitives, skipDomainValidation, propertyName, 'The provided value must be an array of EventEditionReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
35
35
|
_EventEditionReferences_eventEditionReferences.set(this, void 0);
|
|
36
36
|
_EventEditionReferences_options.set(this, void 0);
|
|
37
37
|
// Almacenar las referencias como types
|
|
38
|
-
__classPrivateFieldSet(this, _EventEditionReferences_eventEditionReferences,
|
|
38
|
+
__classPrivateFieldSet(this, _EventEditionReferences_eventEditionReferences, EventEditionReferences.toCleanReferences(value), "f");
|
|
39
39
|
__classPrivateFieldSet(this, _EventEditionReferences_options, finalOptions, "f");
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Validación estática para reutilización en factory methods y constructores.
|
|
43
43
|
*/
|
|
44
44
|
static validateReferences(value, propertyName, options) {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
this.guardAgainstInvalidType(value, propertyName);
|
|
46
|
+
this.guardAgainstInvalidEmptyArray(value, options, propertyName);
|
|
47
47
|
if (!options.allowDuplicates) {
|
|
48
|
-
|
|
48
|
+
this.guardAgainstDuplicatedIds(value, propertyName);
|
|
49
49
|
}
|
|
50
50
|
value.forEach((reference, index) => {
|
|
51
|
-
|
|
51
|
+
this.guardAgainstInvalidReference(reference, index, propertyName);
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Valida que el valor sea un array válido.
|
|
56
|
+
*/
|
|
57
|
+
static guardAgainstInvalidType(value, propertyName) {
|
|
58
|
+
if (!Array.isArray(value)) {
|
|
59
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'array of EventEditionReference', typeof value);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Valida que el array no esté vacío si no se permite.
|
|
64
|
+
*/
|
|
65
|
+
static guardAgainstInvalidEmptyArray(value, options, propertyName) {
|
|
66
|
+
if (!options.allowEmpty && value.length === 0) {
|
|
67
|
+
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-empty array', 'empty array');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Valida que no haya códigos duplicados en la lista.
|
|
72
|
+
*/
|
|
73
|
+
static guardAgainstDuplicatedIds(value, propertyName) {
|
|
74
|
+
const ids = value.map((item) => item.id.trim());
|
|
75
|
+
const uniqueIds = new Set(ids);
|
|
76
|
+
if (ids.length !== uniqueIds.size) {
|
|
77
|
+
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(`${propertyName}.ids`, 'array with unique IDs', 'array with duplicated IDs');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Valida una referencia individual.
|
|
82
|
+
*/
|
|
83
|
+
static guardAgainstInvalidReference(reference, index, basePropertyName) {
|
|
84
|
+
const propertyName = `${basePropertyName}[${index}]`;
|
|
85
|
+
if (!reference || typeof reference !== 'object') {
|
|
86
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionReference object', typeof reference);
|
|
87
|
+
}
|
|
88
|
+
if (typeof reference.id !== 'string') {
|
|
89
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.id`, 'string', typeof reference.id);
|
|
90
|
+
}
|
|
91
|
+
if (typeof reference.code !== 'string') {
|
|
92
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.code`, 'string', typeof reference.code);
|
|
93
|
+
}
|
|
94
|
+
if (typeof reference.name !== 'string') {
|
|
95
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.name`, 'string', typeof reference.name);
|
|
96
|
+
}
|
|
97
|
+
// Validar usando las reglas de dominio
|
|
98
|
+
String_1.String.guardAgainstEmptyValue(reference.id, `${propertyName}.id`);
|
|
99
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(reference.id, `${propertyName}.id`);
|
|
100
|
+
String_1.String.guardAgainstEmptyValue(reference.code, `${propertyName}.code`);
|
|
101
|
+
Code_1.Code.guardAgainstInvalidCode(reference.code);
|
|
102
|
+
String_1.String.guardAgainstEmptyValue(reference.name, `${propertyName}.name`);
|
|
103
|
+
}
|
|
54
104
|
/**
|
|
55
105
|
* Convierte el array a primitivos.
|
|
56
106
|
*/
|
|
@@ -292,7 +342,7 @@ class EventEditionReferences extends ValueObject_1.ValueObject {
|
|
|
292
342
|
* Compara la igualdad semántica con otra lista de referencias.
|
|
293
343
|
*/
|
|
294
344
|
equals(other) {
|
|
295
|
-
if (!(other instanceof
|
|
345
|
+
if (!(other instanceof EventEditionReferences)) {
|
|
296
346
|
return false;
|
|
297
347
|
}
|
|
298
348
|
if (__classPrivateFieldGet(this, _EventEditionReferences_options, "f").allowEmpty !== __classPrivateFieldGet(other, _EventEditionReferences_options, "f").allowEmpty) {
|
|
@@ -362,10 +412,10 @@ class EventEditionReferences extends ValueObject_1.ValueObject {
|
|
|
362
412
|
/**
|
|
363
413
|
* Método estático para validar si un array es válido.
|
|
364
414
|
*/
|
|
365
|
-
static isValidReferences(value, options =
|
|
415
|
+
static isValidReferences(value, options = EventEditionReferences.DEFAULT_OPTIONS) {
|
|
366
416
|
try {
|
|
367
|
-
const finalOptions = { ...
|
|
368
|
-
|
|
417
|
+
const finalOptions = { ...EventEditionReferences.DEFAULT_OPTIONS, ...options };
|
|
418
|
+
EventEditionReferences.validateReferences(value, 'test', finalOptions);
|
|
369
419
|
return true;
|
|
370
420
|
}
|
|
371
421
|
catch {
|
|
@@ -374,41 +424,7 @@ class EventEditionReferences extends ValueObject_1.ValueObject {
|
|
|
374
424
|
}
|
|
375
425
|
}
|
|
376
426
|
exports.EventEditionReferences = EventEditionReferences;
|
|
377
|
-
|
|
378
|
-
if (!Array.isArray(value)) {
|
|
379
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'array of EventEditionReference', typeof value);
|
|
380
|
-
}
|
|
381
|
-
}, _EventEditionReferences_guardAgainstInvalidEmptyArray = function _EventEditionReferences_guardAgainstInvalidEmptyArray(value, options, propertyName) {
|
|
382
|
-
if (!options.allowEmpty && value.length === 0) {
|
|
383
|
-
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-empty array', 'empty array');
|
|
384
|
-
}
|
|
385
|
-
}, _EventEditionReferences_guardAgainstDuplicatedIds = function _EventEditionReferences_guardAgainstDuplicatedIds(value, propertyName) {
|
|
386
|
-
const ids = value.map((item) => item.id.trim());
|
|
387
|
-
const uniqueIds = new Set(ids);
|
|
388
|
-
if (ids.length !== uniqueIds.size) {
|
|
389
|
-
throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(`${propertyName}.ids`, 'array with unique IDs', 'array with duplicated IDs');
|
|
390
|
-
}
|
|
391
|
-
}, _EventEditionReferences_guardAgainstInvalidReference = function _EventEditionReferences_guardAgainstInvalidReference(reference, index, basePropertyName) {
|
|
392
|
-
const propertyName = `${basePropertyName}[${index}]`;
|
|
393
|
-
if (!reference || typeof reference !== 'object') {
|
|
394
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionReference object', typeof reference);
|
|
395
|
-
}
|
|
396
|
-
if (typeof reference.id !== 'string') {
|
|
397
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.id`, 'string', typeof reference.id);
|
|
398
|
-
}
|
|
399
|
-
if (typeof reference.code !== 'string') {
|
|
400
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.code`, 'string', typeof reference.code);
|
|
401
|
-
}
|
|
402
|
-
if (typeof reference.name !== 'string') {
|
|
403
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.name`, 'string', typeof reference.name);
|
|
404
|
-
}
|
|
405
|
-
// Validar usando las reglas de dominio
|
|
406
|
-
String_1.String.guardAgainstEmptyValue(reference.id, `${propertyName}.id`);
|
|
407
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(reference.id, `${propertyName}.id`);
|
|
408
|
-
String_1.String.guardAgainstEmptyValue(reference.code, `${propertyName}.code`);
|
|
409
|
-
Code_1.Code.guardAgainstInvalidCode(reference.code);
|
|
410
|
-
String_1.String.guardAgainstEmptyValue(reference.name, `${propertyName}.name`);
|
|
411
|
-
};
|
|
427
|
+
_EventEditionReferences_eventEditionReferences = new WeakMap(), _EventEditionReferences_options = new WeakMap();
|
|
412
428
|
EventEditionReferences.DEFAULT_PROPERTY_NAME = 'eventEditionReferences';
|
|
413
429
|
EventEditionReferences.DEFAULT_OPTIONS = {
|
|
414
430
|
allowEmpty: false, // Por defecto no permite estar vacío
|
|
@@ -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 _EventReference_id, _EventReference_code, _EventReference_name;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EventReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
@@ -23,13 +23,13 @@ class EventReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
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 = EventReference.DEFAULT_PROPERTY_NAME) {
|
|
27
27
|
super(value, skipDomainValidation, propertyName, 'The provided value must be of type EventReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
28
28
|
_EventReference_id.set(this, void 0);
|
|
29
29
|
_EventReference_code.set(this, void 0);
|
|
30
30
|
_EventReference_name.set(this, void 0);
|
|
31
31
|
if (skipDomainValidation === false) {
|
|
32
|
-
|
|
32
|
+
EventReference.validateEventReference(value, propertyName);
|
|
33
33
|
}
|
|
34
34
|
__classPrivateFieldSet(this, _EventReference_id, value.id.trim(), "f");
|
|
35
35
|
__classPrivateFieldSet(this, _EventReference_code, value.code.trim().toUpperCase(), "f");
|
|
@@ -39,10 +39,41 @@ class EventReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
39
39
|
* Validación estática para reutilización en factory methods y constructores.
|
|
40
40
|
*/
|
|
41
41
|
static validateEventReference(value, propertyName) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
this.guardAgainstInvalidType(value, propertyName);
|
|
43
|
+
this.guardAgainstInvalidId(value.id);
|
|
44
|
+
this.guardAgainstInvalidCode(value.code);
|
|
45
|
+
this.guardAgainstInvalidName(value.name);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Valida que el objeto tenga la estructura correcta.
|
|
49
|
+
*/
|
|
50
|
+
static guardAgainstInvalidType(value, propertyName) {
|
|
51
|
+
if (!value || typeof value !== 'object') {
|
|
52
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventReference object', typeof value);
|
|
53
|
+
}
|
|
54
|
+
if (typeof value.id !== 'string') {
|
|
55
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
56
|
+
}
|
|
57
|
+
if (typeof value.code !== 'string') {
|
|
58
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
59
|
+
}
|
|
60
|
+
if (typeof value.name !== 'string') {
|
|
61
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Valida el ID usando las validaciones de AggregateId.
|
|
66
|
+
*/
|
|
67
|
+
static guardAgainstInvalidId(id) {
|
|
68
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
69
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
70
|
+
}
|
|
71
|
+
static guardAgainstInvalidCode(code) {
|
|
72
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
73
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
74
|
+
}
|
|
75
|
+
static guardAgainstInvalidName(name) {
|
|
76
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
46
77
|
}
|
|
47
78
|
get id() {
|
|
48
79
|
return __classPrivateFieldGet(this, _EventReference_id, "f");
|
|
@@ -107,7 +138,7 @@ class EventReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
107
138
|
* Dos referencias son iguales si tienen el mismo código y nombre.
|
|
108
139
|
*/
|
|
109
140
|
equals(other) {
|
|
110
|
-
if (!(other instanceof
|
|
141
|
+
if (!(other instanceof EventReference)) {
|
|
111
142
|
return false;
|
|
112
143
|
}
|
|
113
144
|
return (__classPrivateFieldGet(this, _EventReference_id, "f") === __classPrivateFieldGet(other, _EventReference_id, "f")
|
|
@@ -119,7 +150,7 @@ class EventReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
119
150
|
* basándose únicamente en el código (identificador único).
|
|
120
151
|
*/
|
|
121
152
|
hasSameEvent(other) {
|
|
122
|
-
if (!(other instanceof
|
|
153
|
+
if (!(other instanceof EventReference)) {
|
|
123
154
|
return false;
|
|
124
155
|
}
|
|
125
156
|
return __classPrivateFieldGet(this, _EventReference_code, "f") === __classPrivateFieldGet(other, _EventReference_code, "f");
|
|
@@ -155,26 +186,5 @@ class EventReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
155
186
|
}
|
|
156
187
|
}
|
|
157
188
|
exports.EventReference = EventReference;
|
|
158
|
-
|
|
159
|
-
if (!value || typeof value !== 'object') {
|
|
160
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventReference object', typeof value);
|
|
161
|
-
}
|
|
162
|
-
if (typeof value.id !== 'string') {
|
|
163
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
164
|
-
}
|
|
165
|
-
if (typeof value.code !== 'string') {
|
|
166
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
167
|
-
}
|
|
168
|
-
if (typeof value.name !== 'string') {
|
|
169
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
170
|
-
}
|
|
171
|
-
}, _EventReference_guardAgainstInvalidId = function _EventReference_guardAgainstInvalidId(id) {
|
|
172
|
-
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
173
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
174
|
-
}, _EventReference_guardAgainstInvalidCode = function _EventReference_guardAgainstInvalidCode(code) {
|
|
175
|
-
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
176
|
-
Code_1.Code.guardAgainstInvalidCode(code);
|
|
177
|
-
}, _EventReference_guardAgainstInvalidName = function _EventReference_guardAgainstInvalidName(name) {
|
|
178
|
-
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
179
|
-
};
|
|
189
|
+
_EventReference_id = new WeakMap(), _EventReference_code = new WeakMap(), _EventReference_name = new WeakMap();
|
|
180
190
|
EventReference.DEFAULT_PROPERTY_NAME = 'eventReference';
|