@carbonbox/domain 0.4.13 → 0.4.14
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/activity-data-collection/activity-data-submissions/domain/value-objects/ActivityDataSubmissionId.js +1 -1
- package/build/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldId.js +1 -1
- package/build/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleId.js +1 -1
- package/build/carbonbox/activity-data-collection/contextual-labels/domain/value-objects/ContextualLabelId.js +1 -1
- package/build/carbonbox/activity-data-collection/dynamic-forms/domain/value-objects/DynamicFormId.js +1 -1
- package/build/carbonbox/activity-data-collection/stakeholder-adaptations/domain/value-objects/StakeholderAdaptationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/subsegments/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/domain/value-objects/CorporateCarbonFootprintConfigurationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/event-configurations/domain/value-objects/EventCarbonFootprintConfigurationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/domain/value-objects/EventEditionLifecycleStageConfigurationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/domain/value-objects/EventEditionLifecycleStageId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/domain/value-objects/ProductCarbonFootprintConfigurationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/domain/value-objects/ProductCarbonFootprintSegmentConfigurationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/domain/value-objects/ProductConfigurationCarbonFootprintSegmentId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/subsegments/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/system-boundaries/domain/value-objects/ProductConfigurationSystemBoundaryId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintConfigurationId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintConfigurationIntensityIndicatorConfigurations.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintIntensityIndicatorId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSegmentId.js +1 -1
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSubsegmentId.js +1 -1
- package/build/carbonbox/company-resources/events/domain/value-objects/EventId.js +1 -1
- package/build/carbonbox/company-resources/events/editions/domain/value-objects/EventEditionId.js +1 -1
- package/build/carbonbox/company-resources/facilities/domain/value-objects/FacilityId.js +1 -1
- package/build/carbonbox/company-resources/products/domain/value-objects/ProductId.js +1 -1
- package/build/carbonbox/emission-calculation-formulas/calculation-variables/domain/value-objects/CalculationVariableActivityDataConditions.js +1 -1
- package/build/carbonbox/emission-calculation-formulas/calculation-variables/domain/value-objects/CalculationVariableId.js +1 -1
- package/build/carbonbox/emission-calculation-formulas/domain/value-objects/EmissionCalculationFormulaId.js +1 -1
- package/build/carbonbox/emission-calculation-formulas/emission-factors/domain/value-objects/EmissionFactorId.js +1 -1
- package/build/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/value-objects/GlobalWarmingPotentialId.js +1 -1
- package/build/carbonbox/emission-calculation-process/calculation-jobs/domain/value-objects/CalculationJobId.js +1 -1
- package/build/carbonbox/emission-calculation-process/calculation-processes/domain/value-objects/CalculationProcessId.js +1 -1
- package/build/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowId.js +1 -1
- package/build/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowParallelJobs.js +1 -1
- package/build/carbonbox/emission-calculation-results/emission-aggregations/domain/value-objects/EmissionAggregationId.js +1 -1
- package/build/carbonbox/emission-calculation-results/emission-calculations/domain/value-objects/EmissionCalculationId.js +1 -1
- package/build/carbonbox/emission-calculation-results/ghg-emission-results/domain/value-objects/GHGEmissionResultId.js +1 -1
- package/build/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractCarbonClientId.js +1 -1
- package/build/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractContractAmendments.js +1 -1
- package/build/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractId.js +1 -1
- package/build/carbonbox/purchase-management-system/purchase-orders/domain/value-objects/PurchaseOrderCarbonClientId.js +1 -1
- package/build/carbonbox/purchase-management-system/purchase-orders/domain/value-objects/PurchaseOrderId.js +1 -1
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogId.js +1 -1
- package/build/carbonbox/purchase-management-system/service-pricing/domain/value-objects/ServicePricingId.js +1 -1
- package/build/carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError.js +19 -0
- package/build/carbonbox/shared/domain/services/contracts/IAggregateIdDomainService.js +2 -0
- package/build/carbonbox/shared/domain/services/implementations/AggregateIdDomainService.js +290 -0
- package/build/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/AggregateId.js +34 -38
- package/build/carbonbox/shared/domain/value-objects/AggregateIdList.js +3 -3
- package/build/carbonbox/shared/domain/value-objects/CalculationProcessReference.js +3 -3
- package/build/carbonbox/shared/domain/value-objects/CalculationVariableReferences.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/CarbonClientReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/CollectionFieldReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.js +2 -2
- package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EmissionCalculationReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EmissionFactorReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.js +2 -2
- package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EventEditionReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EventEditionReferences.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/EventReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/FacilityReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.js +2 -2
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/ProductReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/ServiceCatalogReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/StakeholderReference.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/StakeholderReferences.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/UserId.js +1 -1
- package/build/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientId.js +1 -1
- package/build/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorId.js +1 -1
- package/build/carbonbox/stakeholders/carbon-host/domain/value-objects/CarbonHostId.js +1 -1
- package/build/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerId.js +1 -1
- package/build/carbonbox/stakeholders/shared/domain/value-objects/StakeholderId.js +1 -1
- package/build/main/index.js +6 -6
- package/build/types/carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError.d.ts +8 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/services/contracts/IAggregateIdDomainService.d.ts +85 -0
- package/build/types/carbonbox/shared/domain/services/contracts/IAggregateIdDomainService.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/services/implementations/AggregateIdDomainService.d.ts +67 -0
- package/build/types/carbonbox/shared/domain/services/implementations/AggregateIdDomainService.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts +17 -19
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts.map +1 -1
- package/build/types/main/index.d.ts +3 -3
- package/build/types/main/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -110,7 +110,7 @@ class EventEditionLifecycleStageConfigurationReferences extends ValueObject_1.Va
|
|
|
110
110
|
*/
|
|
111
111
|
static guardAgainstInvalidConfigurationId(id, propertyName) {
|
|
112
112
|
String_1.String.guardAgainstEmptyValue(id, propertyName);
|
|
113
|
-
AggregateId_1.AggregateId.
|
|
113
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, propertyName);
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* Valida la referencia de etapa de edición de evento.
|
|
@@ -162,7 +162,7 @@ class EventEditionLifecycleStageConfigurationReferences extends ValueObject_1.Va
|
|
|
162
162
|
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.name`, 'string', typeof reference.name);
|
|
163
163
|
}
|
|
164
164
|
String_1.String.guardAgainstEmptyValue(reference.id, `${propertyName}.id`);
|
|
165
|
-
AggregateId_1.AggregateId.
|
|
165
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(reference.id, `${propertyName}.id`);
|
|
166
166
|
String_1.String.guardAgainstEmptyValue(reference.code, `${propertyName}.code`);
|
|
167
167
|
Code_1.Code.guardAgainstInvalidCode(reference.code);
|
|
168
168
|
String_1.String.guardAgainstEmptyValue(reference.name, `${propertyName}.name`);
|
|
@@ -67,7 +67,7 @@ class EventEditionLifecycleStageReference extends ObjectValueObject_1.ObjectValu
|
|
|
67
67
|
*/
|
|
68
68
|
static guardAgainstInvalidId(id) {
|
|
69
69
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
70
|
-
AggregateId_1.AggregateId.
|
|
70
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* Valida el código de edición del evento usando las validaciones de Code.
|
|
@@ -66,7 +66,7 @@ class EventEditionReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
66
66
|
*/
|
|
67
67
|
static guardAgainstInvalidId(id) {
|
|
68
68
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
69
|
-
AggregateId_1.AggregateId.
|
|
69
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Valida el código de edición del evento usando las validaciones de Code.
|
|
@@ -96,7 +96,7 @@ class EventEditionReferences extends ValueObject_1.ValueObject {
|
|
|
96
96
|
}
|
|
97
97
|
// Validar usando las reglas de dominio
|
|
98
98
|
String_1.String.guardAgainstEmptyValue(reference.id, `${propertyName}.id`);
|
|
99
|
-
AggregateId_1.AggregateId.
|
|
99
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(reference.id, `${propertyName}.id`);
|
|
100
100
|
String_1.String.guardAgainstEmptyValue(reference.code, `${propertyName}.code`);
|
|
101
101
|
Code_1.Code.guardAgainstInvalidCode(reference.code);
|
|
102
102
|
String_1.String.guardAgainstEmptyValue(reference.name, `${propertyName}.name`);
|
|
@@ -66,7 +66,7 @@ class EventReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
66
66
|
*/
|
|
67
67
|
static guardAgainstInvalidId(id) {
|
|
68
68
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
69
|
-
AggregateId_1.AggregateId.
|
|
69
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
70
70
|
}
|
|
71
71
|
static guardAgainstInvalidCode(code) {
|
|
72
72
|
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
@@ -56,7 +56,7 @@ class FacilityReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
56
56
|
}
|
|
57
57
|
static guardAgainstInvalidId(id) {
|
|
58
58
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
59
|
-
AggregateId_1.AggregateId.
|
|
59
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Valida el nombre comercial de la sucursal.
|
|
@@ -70,7 +70,7 @@ class GlobalWarmingPotentialReference extends ObjectValueObject_1.ObjectValueObj
|
|
|
70
70
|
}
|
|
71
71
|
static guardAgainstInvalidId(id) {
|
|
72
72
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
73
|
-
AggregateId_1.AggregateId.
|
|
73
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Valida el nombre de referencia.
|
|
@@ -78,7 +78,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
|
|
|
78
78
|
*/
|
|
79
79
|
static guardAgainstInvalidId(id) {
|
|
80
80
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
81
|
-
AggregateId_1.AggregateId.
|
|
81
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Valida el código de subsegmento corporativo usando las validaciones de Code.
|
|
@@ -78,7 +78,7 @@ class NullableEventEditionConfigurationCarbonFootprintSubsegmentReference extend
|
|
|
78
78
|
*/
|
|
79
79
|
static guardAgainstInvalidId(id) {
|
|
80
80
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
81
|
-
AggregateId_1.AggregateId.
|
|
81
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Valida el código de subsegmento de etapa usando las validaciones de Code.
|
|
@@ -78,7 +78,7 @@ class NullableProductConfigurationCarbonFootprintSubsegmentReference extends Val
|
|
|
78
78
|
*/
|
|
79
79
|
static guardAgainstInvalidId(id) {
|
|
80
80
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
81
|
-
AggregateId_1.AggregateId.
|
|
81
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Valida el código de subsegmento de producto usando las validaciones de Code.
|
|
@@ -111,7 +111,7 @@ class ProductCarbonFootprintSegmentConfigurationReferences extends ValueObject_1
|
|
|
111
111
|
*/
|
|
112
112
|
static guardAgainstInvalidId(id, propertyName) {
|
|
113
113
|
String_1.String.guardAgainstEmptyValue(id, propertyName);
|
|
114
|
-
AggregateId_1.AggregateId.
|
|
114
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, propertyName);
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Valida la referencia de segmento.
|
|
@@ -144,7 +144,7 @@ class ProductCarbonFootprintSegmentConfigurationReferences extends ValueObject_1
|
|
|
144
144
|
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.name`, 'string', typeof reference.name);
|
|
145
145
|
}
|
|
146
146
|
String_1.String.guardAgainstEmptyValue(reference.id, `${propertyName}.id`);
|
|
147
|
-
AggregateId_1.AggregateId.
|
|
147
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(reference.id, `${propertyName}.id`);
|
|
148
148
|
String_1.String.guardAgainstEmptyValue(reference.code, `${propertyName}.code`);
|
|
149
149
|
Code_1.Code.guardAgainstInvalidCode(reference.code);
|
|
150
150
|
String_1.String.guardAgainstEmptyValue(reference.name, `${propertyName}.name`);
|
|
@@ -70,7 +70,7 @@ class ProductConfigurationCarbonFootprintSegmentReference extends ObjectValueObj
|
|
|
70
70
|
}
|
|
71
71
|
static guardAgainstInvalidId(id) {
|
|
72
72
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
73
|
-
AggregateId_1.AggregateId.
|
|
73
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Valida el código del segmento de producto.
|
|
@@ -70,7 +70,7 @@ class ProductConfigurationCarbonFootprintSubsegmentReference extends ObjectValue
|
|
|
70
70
|
}
|
|
71
71
|
static guardAgainstInvalidId(id) {
|
|
72
72
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
73
|
-
AggregateId_1.AggregateId.
|
|
73
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Valida el código del segmento de producto.
|
package/build/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.js
CHANGED
|
@@ -71,7 +71,7 @@ class ProductConfigurationSystemBoundaryReference extends ObjectValueObject_1.Ob
|
|
|
71
71
|
}
|
|
72
72
|
static guardAgainstInvalidId(id) {
|
|
73
73
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
74
|
-
AggregateId_1.AggregateId.
|
|
74
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Valida el código de límite del sistema usando las validaciones de Code.
|
|
@@ -63,7 +63,7 @@ class ProductReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
63
63
|
}
|
|
64
64
|
static guardAgainstInvalidId(id) {
|
|
65
65
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
66
|
-
AggregateId_1.AggregateId.
|
|
66
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Valida el código de producto usando las validaciones de Code.
|
|
@@ -70,7 +70,7 @@ class ServiceCatalogReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
70
70
|
}
|
|
71
71
|
static guardAgainstInvalidId(id) {
|
|
72
72
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
73
|
-
AggregateId_1.AggregateId.
|
|
73
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Valida el código de servicio usando las validaciones de Code.
|
|
@@ -72,7 +72,7 @@ class StakeholderReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
72
72
|
}
|
|
73
73
|
static guardAgainstInvalidId(id) {
|
|
74
74
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
75
|
-
AggregateId_1.AggregateId.
|
|
75
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Valida si el valor principal es inválido.
|
|
@@ -121,7 +121,7 @@ class StakeholderReferences extends ValueObject_1.ValueObject {
|
|
|
121
121
|
*/
|
|
122
122
|
static guardAgainstInvalidId(id, propertyName) {
|
|
123
123
|
String_1.String.guardAgainstEmptyValue(id, propertyName);
|
|
124
|
-
AggregateId_1.AggregateId.
|
|
124
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, propertyName);
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* Valida el nombre para mostrar.
|
|
@@ -17,7 +17,7 @@ class UserId extends AggregateId_1.AggregateId {
|
|
|
17
17
|
static create(value) {
|
|
18
18
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, UserId.PROPERTY_NAME);
|
|
19
19
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, UserId.PROPERTY_NAME);
|
|
20
|
-
AggregateId_1.AggregateId.
|
|
20
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(value, UserId.PROPERTY_NAME);
|
|
21
21
|
// Validate that the prefix is a valid user prefix
|
|
22
22
|
UserId.guardAgainstInvalidUserPrefix(value);
|
|
23
23
|
return new UserId(value, false);
|
|
@@ -9,7 +9,7 @@ class CarbonClientId extends StakeholderId_1.StakeholderId {
|
|
|
9
9
|
static create(value) {
|
|
10
10
|
StakeholderId_1.StakeholderId.guardAgainstEmptyValue(value, CarbonClientId.PROPERTY_NAME);
|
|
11
11
|
StakeholderId_1.StakeholderId.guardAgainstInvalidType(value, CarbonClientId.PROPERTY_NAME);
|
|
12
|
-
StakeholderId_1.StakeholderId.
|
|
12
|
+
StakeholderId_1.StakeholderId.guardAgainstInvalidId(value);
|
|
13
13
|
return new CarbonClientId(value, false);
|
|
14
14
|
}
|
|
15
15
|
static fromPrimitives(primitive) {
|
package/build/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorId.js
CHANGED
|
@@ -9,7 +9,7 @@ class CarbonCoordinatorId extends StakeholderId_1.StakeholderId {
|
|
|
9
9
|
static create(value) {
|
|
10
10
|
StakeholderId_1.StakeholderId.guardAgainstEmptyValue(value, CarbonCoordinatorId.PROPERTY_NAME);
|
|
11
11
|
StakeholderId_1.StakeholderId.guardAgainstInvalidType(value, CarbonCoordinatorId.PROPERTY_NAME);
|
|
12
|
-
StakeholderId_1.StakeholderId.
|
|
12
|
+
StakeholderId_1.StakeholderId.guardAgainstInvalidId(value);
|
|
13
13
|
return new CarbonCoordinatorId(value, false);
|
|
14
14
|
}
|
|
15
15
|
static fromPrimitives(primitive) {
|
|
@@ -9,7 +9,7 @@ class CarbonHostId extends StakeholderId_1.StakeholderId {
|
|
|
9
9
|
static create(value) {
|
|
10
10
|
StakeholderId_1.StakeholderId.guardAgainstEmptyValue(value, CarbonHostId.PROPERTY_NAME);
|
|
11
11
|
StakeholderId_1.StakeholderId.guardAgainstInvalidType(value, CarbonHostId.PROPERTY_NAME);
|
|
12
|
-
StakeholderId_1.StakeholderId.
|
|
12
|
+
StakeholderId_1.StakeholderId.guardAgainstInvalidId(value);
|
|
13
13
|
return new CarbonHostId(value, false);
|
|
14
14
|
}
|
|
15
15
|
static fromPrimitives(primitive) {
|
package/build/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerId.js
CHANGED
|
@@ -9,7 +9,7 @@ class CarbonManagerId extends StakeholderId_1.StakeholderId {
|
|
|
9
9
|
static create(value) {
|
|
10
10
|
StakeholderId_1.StakeholderId.guardAgainstEmptyValue(value, CarbonManagerId.PROPERTY_NAME);
|
|
11
11
|
StakeholderId_1.StakeholderId.guardAgainstInvalidType(value, CarbonManagerId.PROPERTY_NAME);
|
|
12
|
-
StakeholderId_1.StakeholderId.
|
|
12
|
+
StakeholderId_1.StakeholderId.guardAgainstInvalidId(value);
|
|
13
13
|
return new CarbonManagerId(value, false);
|
|
14
14
|
}
|
|
15
15
|
static fromPrimitives(primitive) {
|
|
@@ -9,7 +9,7 @@ class StakeholderId extends UserId_1.UserId {
|
|
|
9
9
|
static create(value) {
|
|
10
10
|
UserId_1.UserId.guardAgainstEmptyValue(value, StakeholderId.PROPERTY_NAME);
|
|
11
11
|
UserId_1.UserId.guardAgainstInvalidType(value, StakeholderId.PROPERTY_NAME);
|
|
12
|
-
UserId_1.UserId.
|
|
12
|
+
UserId_1.UserId.guardAgainstInvalidId(value, StakeholderId.PROPERTY_NAME);
|
|
13
13
|
return new StakeholderId(value, false);
|
|
14
14
|
}
|
|
15
15
|
static fromPrimitives(primitive) {
|
package/build/main/index.js
CHANGED
|
@@ -11,10 +11,10 @@ exports.ServiceCatalogName = exports.ServiceCatalogCode = exports.ServiceCatalog
|
|
|
11
11
|
exports.InvalidReportTypeError = exports.InvalidExpertDedicationLevelError = exports.InvalidTotalAmountFactorError = exports.InvalidTaxAmountFactorError = exports.InvalidSubtotalAmountFactorError = exports.InvalidSubtotalAmountError = exports.InvalidPurchaseOrderStatusError = exports.InvalidPercentageRangeError = exports.InvalidPaymentStatusError = exports.InvalidPaymentMethodError = exports.InvalidMaximumSubtotalError = exports.InvalidFixedDiscountAmountError = exports.InvalidDiscountAmountFactorError = exports.InvalidTaxRateError = exports.InvalidPaymentTermsError = exports.InvalidPaymentScheduleError = exports.InvalidContractValueFactorError = exports.InvalidContractTypeError = exports.InvalidContractStatusError = exports.PricingStatusEnum = exports.PricingModelEnum = exports.UserRoleEnum = exports.ReportTypeEnum = exports.ExpertDedicationLevelEnum = exports.ServiceCatalogStatusEnum = exports.ServiceCatalogTypeEnum = exports.ServiceCatalogCategoryEnum = exports.PaymentStatusEnum = exports.PaymentMethodEnum = exports.OrderStatusEnum = exports.PaymentTermsEnum = exports.PaymentScheduleEnum = exports.ContractDurationUnitEnum = exports.ContractTypeEnum = exports.ContractStatusEnum = exports.ServicePricingCreatedByStakeholder = exports.ServicePricingBaseServiceReferenceCode = exports.ServicePricingCurrency = exports.ServicePricingPricePerUnit = exports.ServicePricingBasePrice = exports.ServicePricingPricingStatus = exports.ServicePricingPricingModel = exports.ServicePricingService = exports.ServicePricingId = exports.ServiceCatalogCreatedByStakeholder = exports.ServiceCatalogDependsOnServiceCode = exports.ServiceCatalogStatus = exports.ServiceCatalogType = exports.ServiceCatalogCategory = exports.ServiceCatalogDescription = void 0;
|
|
12
12
|
exports.AggregateId = exports.Code = exports.Url = exports.Image = exports.Address = exports.Phone = exports.Email = exports.DateTimeString = exports.DateString = exports.Boolean = exports.Numeric = exports.PositiveInteger = exports.Integer = exports.String = exports.SemanticUuidPrefixEnum = exports.TaxIdentificationEnum = exports.SystemBoundaryEnum = exports.StakeholderRoleEnum = exports.ReportingStandardEnum = exports.ISOCategoryEnum = exports.GreenhouseGasEnum = exports.GenderEnum = exports.GHGSubScopeEnum = exports.GHGScopeEnum = exports.EmissionSourceEnum = exports.EmissionCategoryEnum = exports.DayOfWeekEnum = exports.CurrencyEnum = exports.CountryCodeEnum = exports.BusinessScaleEnum = exports.UserBusinessStatusEnum = exports.UserTypeEnum = exports.RootError = exports.ObjectValueObject = exports.PrimitiveValueObject = exports.ValueObject = exports.User = exports.DomainError = exports.AggregateRoot = exports.InvalidUnitsError = exports.InvalidTaxPercentageError = exports.InvalidPricingStatusError = exports.InvalidPricingModelError = exports.InvalidPricePerUnitError = exports.InvalidMarkupPercentageError = exports.InvalidDiscountPercentageError = exports.InvalidUserRoleError = exports.InvalidServiceCatalogTypeError = exports.InvalidServiceCatalogStatusError = exports.InvalidServiceCatalogCategoryError = void 0;
|
|
13
13
|
exports.CorporateConfigurationCarbonFootprintSegmentReference = exports.CorporateCarbonFootprintSegmentConfigurationReferences = exports.CollectionFieldReference = exports.CarbonFootprintSegmentReferences = exports.CarbonFootprintIntensityIndicatorReference = exports.CarbonFootprintConfigurationReference = exports.GlobalWarmingPotentialReference = exports.EmissionFactorReference = exports.EmissionCalculationFormulaReference = exports.EmissionCalculationReference = exports.CalculationVariableReferences = exports.CalculationProcessReference = exports.ActivityDataSubmissionReference = exports.EmissionSource = exports.EmissionSources = exports.CarbonClientReferences = exports.CarbonClientReference = exports.StakeholderReferences = exports.StakeholderReference = exports.UserType = exports.UserLastAccessAt = exports.UserAvatar = exports.UserBusinessStatus = exports.UserPassword = exports.UserDisplayName = exports.UserId = exports.UserEmail = exports.NullableProductConfigurationCarbonFootprintSubsegmentReference = exports.NullableEventEditionConfigurationCarbonFootprintSubsegmentReference = exports.NullableCorporateConfigurationCarbonFootprintSubsegmentReference = exports.NullableStakeholderReference = exports.NullableColombianNIT = exports.NullableTaxIdentificationNumber = exports.NullablePositiveInteger = exports.NullableNumeric = exports.NullableDateTimeString = exports.NullableDate = exports.NullableCode = exports.NullableString = exports.TaxIdentificationNumberList = exports.UrlList = exports.StringList = exports.CodeList = exports.AggregateIdList = exports.TaxIdentification = exports.Gender = exports.Currency = exports.ColombiaNIT = exports.TaxIdentificationNumber = exports.ExecutionPeriod = void 0;
|
|
14
|
-
exports.MinimumValueViolationError = exports.InvalidUrlListError = exports.InvalidCodeListError = exports.InvalidStringListError = exports.EmptyArrayNotAllowedError = exports.PasswordPolicyViolationError = exports.InvalidNationalNumberError = exports.InvalidFullInternationalNumberError = exports.InvalidEmailPolicyError = exports.InvalidCoordinatesError = exports.InvalidTimeFormatError = exports.InvalidDateRangeError = exports.InvalidDateFormatError = exports.InvalidColombianNITNumberError = exports.InvalidColombianNITCheckDigitError = exports.InvalidColombianNITFormatError = exports.InvalidTaxIdentificationTypeError = exports.InvalidStakeholderRoleTypeError = exports.InvalidGenderError = exports.InvalidCurrencyError = exports.InvalidCountryCodeError = exports.InvalidBusinessScaleError = exports.UnknownBoundedContextCodeError = exports.InvalidUuidFormatError = exports.InvalidUserPrefixError = exports.InvalidUserIdFormatError = exports.InvalidSemanticUuidFormatError = exports.
|
|
14
|
+
exports.MinimumValueViolationError = exports.InvalidUrlListError = exports.InvalidCodeListError = exports.InvalidStringListError = exports.EmptyArrayNotAllowedError = exports.PasswordPolicyViolationError = exports.InvalidNationalNumberError = exports.InvalidFullInternationalNumberError = exports.InvalidEmailPolicyError = exports.InvalidCoordinatesError = exports.InvalidTimeFormatError = exports.InvalidDateRangeError = exports.InvalidDateFormatError = exports.InvalidColombianNITNumberError = exports.InvalidColombianNITCheckDigitError = exports.InvalidColombianNITFormatError = exports.InvalidTaxIdentificationTypeError = exports.InvalidStakeholderRoleTypeError = exports.InvalidGenderError = exports.InvalidCurrencyError = exports.InvalidCountryCodeError = exports.InvalidBusinessScaleError = exports.UnknownBoundedContextCodeError = exports.InvalidUuidFormatError = exports.InvalidUserPrefixError = exports.InvalidUserIdFormatError = exports.InvalidSemanticUuidFormatError = exports.InvalidAggregateIdFormatError = exports.InvalidPropertyValueError = exports.InvalidPropertyTypeError = exports.InvalidValueObjectConfigurationError = exports.UndefinedValueError = exports.NullValueError = exports.MethodNotImplementedError = exports.CreateMethodNotImplementedError = exports.ServiceCatalogReference = exports.ProductReference = exports.ProductConfigurationSystemBoundaryReference = exports.ProductConfigurationCarbonFootprintSubsegmentReference = exports.ProductConfigurationCarbonFootprintSegmentReference = exports.ProductCarbonFootprintSegmentConfigurationReferences = exports.FacilityReference = exports.EventReference = exports.EventEditionReferences = exports.EventEditionReference = exports.EventEditionLifecycleStageReference = exports.EventEditionLifecycleStageConfigurationReferences = exports.EventEditionConfigurationCarbonFootprintSubsegmentReferences = exports.EventEditionConfigurationCarbonFootprintSubsegmentReference = exports.CorporateConfigurationCarbonFootprintSubsegmentReference = void 0;
|
|
15
15
|
exports.CarbonClientDisplayName = exports.CarbonClientEmail = exports.CarbonClientId = exports.StakeholderUserType = exports.StakeholderLastAccessAt = exports.StakeholderAvatar = exports.StakeholderTaxIdentification = exports.StakeholderRoleType = exports.StakeholderBusinessStatus = exports.StakeholderPassword = exports.StakeholderDisplayName = exports.StakeholderEmail = exports.StakeholderId = exports.CarbonManager = exports.CarbonHost = exports.CarbonCoordinator = exports.CarbonClient = exports.Stakeholder = exports.CannotAccessRightOnLeftValueError = exports.CannotAccessLeftOnRightValueError = exports.ResultExtensions = exports.EitherUtils = exports.ResultFactory = exports.EitherFactory = exports.RightEither = exports.LeftEither = exports.Either = exports.TaxIdentificationNumberWithControlCharactersError = exports.InvalidTaxIdentificationNumberLengthError = exports.InvalidTaxIdentificationNumberFormatError = exports.InvalidSupervisorRoleError = exports.InvalidMinutesDurationError = exports.InvalidMeasurementUnitOperationError = exports.InvalidManagedStakeholderRoleError = exports.InvalidDomainCodeError = exports.InvalidCountrySpecificTaxIdentificationNumberError = exports.InvalidCodeError = exports.InvalidAssignerRoleError = exports.InvalidAggregateIdError = exports.EmptyTaxIdentificationNumberError = exports.EmptySegmentNameError = exports.EmptySegmentCodeError = exports.EmptyDisplayNameError = exports.DateGreaterThanError = exports.InvalidUserBusinessStatusError = exports.InvalidUserTypeError = exports.DivisionByZeroError = exports.MoneyOverflowError = exports.NotIntegerError = exports.NegativeAmountError = void 0;
|
|
16
16
|
exports.CarbonClientAccountEnum = exports.CarbonManagerLastAccessAt = exports.CarbonManagerTaxIdentification = exports.CarbonManagerBusinessStatus = exports.CarbonManagerRoleType = exports.CarbonManagerUserType = exports.CarbonManagerManagedStakeholders = exports.CarbonManagerDisplayName = exports.CarbonManagerEmail = exports.CarbonManagerId = exports.CarbonHostPermissions = exports.CarbonHostAvatar = exports.CarbonHostLastAccessAt = exports.CarbonHostUserType = exports.CarbonHostBusinessStatus = exports.CarbonHostDisplayName = exports.CarbonHostTaxIdentification = exports.CarbonHostRoleType = exports.CarbonHostPassword = exports.CarbonHostEmail = exports.CarbonHostId = exports.CarbonCoordinatorReportsToStakeholder = exports.CarbonCoordinatorAssignedByStakeholder = exports.CarbonCoordinatorLastAccessAt = exports.CarbonCoordinatorTaxIdentification = exports.CarbonCoordinatorBusinessStatus = exports.CarbonCoordinatorRoleType = exports.CarbonCoordinatorManagedCarbonClients = exports.CarbonCoordinatorWeeklyWorkingSchedule = exports.CarbonCoordinatorGender = exports.CarbonCoordinatorUserType = exports.CarbonCoordinatorAvailabilityStatus = exports.CarbonCoordinatorDisplayName = exports.CarbonCoordinatorEmail = exports.CarbonCoordinatorId = exports.CarbonClientBusinessStatus = exports.CarbonClientLastAccessAt = exports.CarbonClientSupervisedByStakeholder = exports.CarbonClientRoleType = exports.CarbonClientTaxIdentification = exports.CarbonClientPrimaryContactPhone = exports.CarbonClientPrimaryContactEmail = exports.CarbonClientLogo = exports.CarbonClientWebsiteUrl = exports.CarbonClientPhysicalAddress = exports.CarbonClientOrganizationSize = exports.CarbonClientIndustryType = exports.CarbonClientUserType = exports.CarbonClientLegalBusinessName = exports.CarbonClientAccountType = void 0;
|
|
17
|
-
exports.StakeholderPermissions = exports.UserPermissions = exports.SecurityContextReconstructionError = exports.SecurityContext = exports.PermissionSet = exports.PermissionEnum = exports.AuthorizationDecisionEnum = exports.
|
|
17
|
+
exports.StakeholderPermissions = exports.UserPermissions = exports.SecurityContextReconstructionError = exports.SecurityContext = exports.PermissionSet = exports.PermissionEnum = exports.AuthorizationDecisionEnum = exports.AggregateIdDomainService = exports.DateTimeFormattingDomainService = exports.InvalidCarbonCoordinatorAvailabilityStatusError = exports.InvalidCarbonClientAccountTypeError = exports.CarbonCoordinatorAvailabilityStatusEnum = void 0;
|
|
18
18
|
// ─── Entity Classes (For Application Layer) ─────────────────────────────────
|
|
19
19
|
var ActivityDataSubmission_1 = require("../carbonbox/activity-data-collection/activity-data-submissions/domain/entity/ActivityDataSubmission");
|
|
20
20
|
Object.defineProperty(exports, "ActivityDataSubmission", { enumerable: true, get: function () { return ActivityDataSubmission_1.ActivityDataSubmission; } });
|
|
@@ -969,8 +969,8 @@ var InvalidPropertyTypeError_1 = require("../carbonbox/shared/domain/exceptions/
|
|
|
969
969
|
Object.defineProperty(exports, "InvalidPropertyTypeError", { enumerable: true, get: function () { return InvalidPropertyTypeError_1.InvalidPropertyTypeError; } });
|
|
970
970
|
var InvalidPropertyValueError_1 = require("../carbonbox/shared/domain/exceptions/InvalidPropertyValueError");
|
|
971
971
|
Object.defineProperty(exports, "InvalidPropertyValueError", { enumerable: true, get: function () { return InvalidPropertyValueError_1.InvalidPropertyValueError; } });
|
|
972
|
-
var
|
|
973
|
-
Object.defineProperty(exports, "
|
|
972
|
+
var InvalidAggregateIdFormatError_1 = require("../carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError");
|
|
973
|
+
Object.defineProperty(exports, "InvalidAggregateIdFormatError", { enumerable: true, get: function () { return InvalidAggregateIdFormatError_1.InvalidAggregateIdFormatError; } });
|
|
974
974
|
var InvalidSemanticUuidFormatError_1 = require("../carbonbox/shared/domain/exceptions/InvalidSemanticUuidFormatError");
|
|
975
975
|
Object.defineProperty(exports, "InvalidSemanticUuidFormatError", { enumerable: true, get: function () { return InvalidSemanticUuidFormatError_1.InvalidSemanticUuidFormatError; } });
|
|
976
976
|
var InvalidUserIdFormatError_1 = require("../carbonbox/shared/domain/exceptions/InvalidUserIdFormatError");
|
|
@@ -1246,8 +1246,8 @@ Object.defineProperty(exports, "InvalidCarbonCoordinatorAvailabilityStatusError"
|
|
|
1246
1246
|
// ─── Date and Time Services ──────────────────────────────────────────────────
|
|
1247
1247
|
var DateTimeFormattingDomainService_1 = require("../carbonbox/shared/domain/services/implementations/DateTimeFormattingDomainService");
|
|
1248
1248
|
Object.defineProperty(exports, "DateTimeFormattingDomainService", { enumerable: true, get: function () { return DateTimeFormattingDomainService_1.DateTimeFormattingDomainService; } });
|
|
1249
|
-
var
|
|
1250
|
-
Object.defineProperty(exports, "
|
|
1249
|
+
var AggregateIdDomainService_1 = require("../carbonbox/shared/domain/services/implementations/AggregateIdDomainService");
|
|
1250
|
+
Object.defineProperty(exports, "AggregateIdDomainService", { enumerable: true, get: function () { return AggregateIdDomainService_1.AggregateIdDomainService; } });
|
|
1251
1251
|
// ─── Enums ──────────────────────────────────────────────────────────────────
|
|
1252
1252
|
var AuthorizationDecision_1 = require("../carbonbox/shared/domain/authorization/enums/AuthorizationDecision");
|
|
1253
1253
|
Object.defineProperty(exports, "AuthorizationDecisionEnum", { enumerable: true, get: function () { return AuthorizationDecision_1.AuthorizationDecision; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RootError } from './RootError';
|
|
2
|
+
export declare class InvalidAggregateIdFormatError extends RootError {
|
|
3
|
+
private static readonly INVALID_AGGREGATE_ID_ERROR_MESSAGE;
|
|
4
|
+
private constructor();
|
|
5
|
+
static create(aggregateId: string, propertyName: string): InvalidAggregateIdFormatError;
|
|
6
|
+
logError(): string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=InvalidAggregateIdFormatError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvalidAggregateIdFormatError.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,6BAA8B,SAAQ,SAAS;IAC1D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kCAAkC,CAA6I;IAEvM,OAAO;WASgB,MAAM,CAC3B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,6BAA6B;IAIhB,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IEither } from '../../../either';
|
|
2
|
+
import { SemanticUuidPrefix } from '../../enums/SemanticUuidPrefix';
|
|
3
|
+
import { InvalidAggregateIdFormatError } from '../../exceptions/InvalidAggregateIdFormatError';
|
|
4
|
+
/**
|
|
5
|
+
* Interface for Aggregate ID parsing and validation domain service.
|
|
6
|
+
* Provides centralized business logic for aggregate ID handling across the domain.
|
|
7
|
+
* Uses Either pattern for functional error handling.
|
|
8
|
+
*
|
|
9
|
+
* This service is designed to be used in factories, application services, and other
|
|
10
|
+
* non-value-object contexts to maintain Value Object purity.
|
|
11
|
+
*/
|
|
12
|
+
export interface IAggregateIdDomainService {
|
|
13
|
+
/**
|
|
14
|
+
* Validates if a string is a valid aggregate ID prefix
|
|
15
|
+
* @param prefix The prefix string to validate
|
|
16
|
+
* @returns Either with validation result or error
|
|
17
|
+
*/
|
|
18
|
+
isValidPrefix(prefix: string): IEither<InvalidAggregateIdFormatError, boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the bounded context name from an aggregate ID prefix
|
|
21
|
+
* @param prefix The aggregate ID prefix
|
|
22
|
+
* @returns Either with bounded context name or error
|
|
23
|
+
*/
|
|
24
|
+
getBoundedContext(prefix: SemanticUuidPrefix): IEither<InvalidAggregateIdFormatError, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the subdomain from an aggregate ID prefix
|
|
27
|
+
* @param prefix The aggregate ID prefix
|
|
28
|
+
* @returns Either with subdomain name or error
|
|
29
|
+
*/
|
|
30
|
+
getSubdomain(prefix: SemanticUuidPrefix): IEither<InvalidAggregateIdFormatError, string>;
|
|
31
|
+
/**
|
|
32
|
+
* Gets all available prefixes as an array
|
|
33
|
+
* @returns Either with array of all prefixes or error
|
|
34
|
+
*/
|
|
35
|
+
getAllPrefixes(): IEither<InvalidAggregateIdFormatError, string[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Gets prefixes by bounded context
|
|
38
|
+
* @param boundedContext The bounded context name
|
|
39
|
+
* @returns Either with array of prefixes for the context or error
|
|
40
|
+
*/
|
|
41
|
+
getPrefixesByBoundedContext(boundedContext: string): IEither<InvalidAggregateIdFormatError, SemanticUuidPrefix[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Validates a complete aggregate ID format
|
|
44
|
+
* @param aggregateId The complete aggregate ID to validate
|
|
45
|
+
* @returns Either with validation result or error
|
|
46
|
+
*/
|
|
47
|
+
validateAggregateIdFormat(aggregateId: string): IEither<InvalidAggregateIdFormatError, boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Extracts and validates the prefix from an aggregate ID
|
|
50
|
+
* @param aggregateId The complete aggregate ID
|
|
51
|
+
* @returns Either with extracted prefix or error
|
|
52
|
+
*/
|
|
53
|
+
extractPrefix(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
54
|
+
/**
|
|
55
|
+
* Extracts and validates the ID from an aggregate ID
|
|
56
|
+
* @param aggregateId The complete aggregate ID
|
|
57
|
+
* @returns Either with extracted ID or error
|
|
58
|
+
*/
|
|
59
|
+
extractId(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
60
|
+
/**
|
|
61
|
+
* Extracts the bounded context code (first 3 letters) from an aggregate ID
|
|
62
|
+
* @param aggregateId The complete aggregate ID
|
|
63
|
+
* @returns Either with bounded context code or error
|
|
64
|
+
*/
|
|
65
|
+
extractBoundedContextCode(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
66
|
+
/**
|
|
67
|
+
* Extracts all subdomain parts from an aggregate ID
|
|
68
|
+
* @param aggregateId The complete aggregate ID
|
|
69
|
+
* @returns Either with array of subdomain parts or error
|
|
70
|
+
*/
|
|
71
|
+
extractSubdomains(aggregateId: string): IEither<InvalidAggregateIdFormatError, string[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Checks if an aggregate ID has subdomains or is BC-level only
|
|
74
|
+
* @param aggregateId The complete aggregate ID
|
|
75
|
+
* @returns Either with boolean indicating if it has subdomains or error
|
|
76
|
+
*/
|
|
77
|
+
hasSubdomains(aggregateId: string): IEither<InvalidAggregateIdFormatError, boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a human-readable log representation of an aggregate ID
|
|
80
|
+
* @param aggregateId The complete aggregate ID
|
|
81
|
+
* @returns Either with log string or error
|
|
82
|
+
*/
|
|
83
|
+
toLogString(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=IAggregateIdDomainService.d.ts.map
|
package/build/types/carbonbox/shared/domain/services/contracts/IAggregateIdDomainService.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAggregateIdDomainService.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/shared/domain/services/contracts/IAggregateIdDomainService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAE/F;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;IAE/E;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAE9F;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAEzF;;;OAGG;IACH,cAAc,IAAI,OAAO,CAAC,6BAA6B,EAAE,MAAM,EAAE,CAAC,CAAC;IAEnE;;;;OAIG;IACH,2BAA2B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAElH;;;;OAIG;IACH,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;IAEhG;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAEnF;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAE/E;;;;OAIG;IACH,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAE/F;;;;OAIG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,EAAE,CAAC,CAAC;IAEzF;;;;OAIG;IACH,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;IAEpF;;;;OAIG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;CAClF"}
|
package/build/types/carbonbox/shared/domain/services/implementations/AggregateIdDomainService.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IEither } from '../../../either';
|
|
2
|
+
import { SemanticUuidPrefix } from '../../enums/SemanticUuidPrefix';
|
|
3
|
+
import { InvalidAggregateIdFormatError } from '../../exceptions/InvalidAggregateIdFormatError';
|
|
4
|
+
import { IAggregateIdDomainService } from '../contracts/IAggregateIdDomainService';
|
|
5
|
+
/**
|
|
6
|
+
* Domain Service for aggregate ID parsing, validation and business logic operations.
|
|
7
|
+
* Provides centralized business logic for aggregate ID handling across the domain.
|
|
8
|
+
* Refactored to support dependency injection and Either pattern for error handling.
|
|
9
|
+
*
|
|
10
|
+
* This service maintains Value Object purity by being used in factories,
|
|
11
|
+
* application services, and other appropriate contexts.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AggregateIdDomainService implements IAggregateIdDomainService {
|
|
14
|
+
private constructor();
|
|
15
|
+
static create(): AggregateIdDomainService;
|
|
16
|
+
private readonly AGGREGATE_ID_REGEX;
|
|
17
|
+
private readonly ID_REGEX;
|
|
18
|
+
/**
|
|
19
|
+
* Validates if a string is a valid aggregate ID prefix
|
|
20
|
+
*/
|
|
21
|
+
isValidPrefix(prefix: string): IEither<InvalidAggregateIdFormatError, boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the bounded context name from an aggregate ID prefix
|
|
24
|
+
*/
|
|
25
|
+
getBoundedContext(prefix: SemanticUuidPrefix): IEither<InvalidAggregateIdFormatError, string>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the subdomain from an aggregate ID prefix
|
|
28
|
+
*/
|
|
29
|
+
getSubdomain(prefix: SemanticUuidPrefix): IEither<InvalidAggregateIdFormatError, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Gets all available prefixes as an array
|
|
32
|
+
*/
|
|
33
|
+
getAllPrefixes(): IEither<InvalidAggregateIdFormatError, string[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Gets prefixes by bounded context
|
|
36
|
+
*/
|
|
37
|
+
getPrefixesByBoundedContext(boundedContext: string): IEither<InvalidAggregateIdFormatError, SemanticUuidPrefix[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Validates a complete aggregate ID format
|
|
40
|
+
*/
|
|
41
|
+
validateAggregateIdFormat(aggregateId: string): IEither<InvalidAggregateIdFormatError, boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Extracts and validates the prefix from an aggregate ID
|
|
44
|
+
*/
|
|
45
|
+
extractPrefix(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
46
|
+
/**
|
|
47
|
+
* Extracts and validates the ID from an aggregate ID
|
|
48
|
+
*/
|
|
49
|
+
extractId(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
50
|
+
/**
|
|
51
|
+
* Extracts the bounded context code (first 3 letters) from an aggregate ID
|
|
52
|
+
*/
|
|
53
|
+
extractBoundedContextCode(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
54
|
+
/**
|
|
55
|
+
* Extracts all subdomain parts from an aggregate ID
|
|
56
|
+
*/
|
|
57
|
+
extractSubdomains(aggregateId: string): IEither<InvalidAggregateIdFormatError, string[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if an aggregate ID has subdomains or is BC-level only
|
|
60
|
+
*/
|
|
61
|
+
hasSubdomains(aggregateId: string): IEither<InvalidAggregateIdFormatError, boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a human-readable log representation of an aggregate ID
|
|
64
|
+
*/
|
|
65
|
+
toLogString(aggregateId: string): IEither<InvalidAggregateIdFormatError, string>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=AggregateIdDomainService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AggregateIdDomainService.d.ts","sourceRoot":"","sources":["../../../../../../../src/carbonbox/shared/domain/services/implementations/AggregateIdDomainService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAI/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEnF;;;;;;;GAOG;AACH,qBAAa,wBAAyB,YAAW,yBAAyB;IACxE,OAAO;WAIO,MAAM,IAAI,wBAAwB;IAKhD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAiG;IAGpI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4E;IAErG;;OAEG;IACI,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,OAAO,CAAC;IAmBrF;;OAEG;IACI,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAqEpG;;OAEG;IACI,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAqB/F;;OAEG;IACI,cAAc,IAAI,OAAO,CAAC,6BAA6B,EAAE,MAAM,EAAE,CAAC;IAazE;;OAEG;IACI,2BAA2B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,kBAAkB,EAAE,CAAC;IAoDxH;;OAEG;IACI,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,OAAO,CAAC;IAmBtG;;OAEG;IACI,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAwBzF;;OAEG;IACI,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAiCrF;;OAEG;IACI,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAarG;;OAEG;IACI,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,EAAE,CAAC;IAiB/F;;OAEG;IACI,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,OAAO,CAAC;IAI1F;;OAEG;IACI,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC;CAaxF"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { String } from './String';
|
|
2
2
|
/**
|
|
3
|
-
* Pure AggregateId Value Object with
|
|
3
|
+
* Pure AggregateId Value Object with structured ID format
|
|
4
4
|
*
|
|
5
|
-
* Format: {BC}_{
|
|
5
|
+
* Format: {BC}_{ID} or {BC}-{SUB1}-{SUB2}-...{SUBn}_{ID}
|
|
6
6
|
* Examples:
|
|
7
7
|
* - STC_550e8400-e29b-41d4-a716-446655440000 (BC-level entity)
|
|
8
8
|
* - USR-STH-CHO_550e8400-e29b-41d4-a716-446655440000 (subdomain entity)
|
|
9
9
|
* - ADC-SUB-FLD_123e4567-e89b-12d3-a456-426614174000 (future N-level expansion)
|
|
10
10
|
*
|
|
11
11
|
* This is a PURE Value Object - no external dependencies or business logic.
|
|
12
|
-
* For semantic parsing and business logic, use SemanticUuidDomainService.
|
|
13
12
|
*
|
|
14
13
|
* Benefits:
|
|
15
14
|
* - Immutable and pure value object design
|
|
@@ -19,17 +18,17 @@ import { String } from './String';
|
|
|
19
18
|
*/
|
|
20
19
|
export declare class AggregateId extends String {
|
|
21
20
|
protected static readonly DEFAULT_PROPERTY_NAME = "id";
|
|
22
|
-
private static readonly
|
|
23
|
-
private static readonly
|
|
21
|
+
private static readonly ID_REGEX;
|
|
22
|
+
private static readonly AGGREGATE_ID_REGEX;
|
|
24
23
|
protected constructor(value: string, skipDomainValidation: boolean, propertyName?: string);
|
|
25
24
|
static create(id: string): AggregateId;
|
|
26
25
|
static fromPrimitives(id: string): AggregateId;
|
|
27
26
|
/**
|
|
28
|
-
* Extracts the raw
|
|
27
|
+
* Extracts the raw ID from the aggregate ID
|
|
29
28
|
*/
|
|
30
|
-
|
|
29
|
+
extractId(): string;
|
|
31
30
|
/**
|
|
32
|
-
* Extracts the full prefix from the
|
|
31
|
+
* Extracts the full prefix from the aggregate ID (BC-SUB1-SUB2-...SUBn)
|
|
33
32
|
*/
|
|
34
33
|
extractPrefix(): string;
|
|
35
34
|
/**
|
|
@@ -38,7 +37,7 @@ export declare class AggregateId extends String {
|
|
|
38
37
|
extractBoundedContext(): string;
|
|
39
38
|
/**
|
|
40
39
|
* Extracts all subdomain parts from the prefix
|
|
41
|
-
* Returns empty array if BC has no subdomains (e.g.,
|
|
40
|
+
* Returns empty array if BC has no subdomains (e.g., STC_id)
|
|
42
41
|
*/
|
|
43
42
|
extractSubdomains(): string[];
|
|
44
43
|
/**
|
|
@@ -47,21 +46,20 @@ export declare class AggregateId extends String {
|
|
|
47
46
|
*/
|
|
48
47
|
extractPrimarySubdomain(): string;
|
|
49
48
|
/**
|
|
50
|
-
* Checks if this
|
|
49
|
+
* Checks if this ID has subdomains or is BC-level only
|
|
51
50
|
*/
|
|
52
51
|
hasSubdomains(): boolean;
|
|
53
52
|
/**
|
|
54
53
|
* Validation methods
|
|
55
54
|
*/
|
|
56
|
-
static
|
|
57
|
-
protected static
|
|
58
|
-
protected static
|
|
59
|
-
protected static
|
|
60
|
-
protected static
|
|
61
|
-
protected static
|
|
62
|
-
static
|
|
63
|
-
static
|
|
64
|
-
static isValidUuidValue(uuid: string): boolean;
|
|
55
|
+
static guardAgainstInvalidId(id: string, propertyName?: string): void;
|
|
56
|
+
protected static guardAgainstInvalidRawId(rawId: string, propertyName?: string): void;
|
|
57
|
+
protected static isInvalidId(id: string): boolean;
|
|
58
|
+
protected static isInvalidRawId(rawId: string): boolean;
|
|
59
|
+
protected static isValidId(id: string): boolean;
|
|
60
|
+
protected static isValidRawId(rawId: string): boolean;
|
|
61
|
+
static isValidIdValue(id: string): boolean;
|
|
62
|
+
static isValidRawIdValue(rawId: string): boolean;
|
|
65
63
|
toPrimitives(): string;
|
|
66
64
|
}
|
|
67
65
|
//# sourceMappingURL=AggregateId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregateId.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/value-objects/AggregateId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC
|
|
1
|
+
{"version":3,"file":"AggregateId.d.ts","sourceRoot":"","sources":["../../../../../../src/carbonbox/shared/domain/value-objects/AggregateId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,WAAY,SAAQ,MAAM;IACrC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,QAAQ;IAGvD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAA4E;IAI5G,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAiG;IAE3I,SAAS,aACP,KAAK,EAAE,MAAM,EACb,oBAAoB,EAAE,OAAO,EAC7B,YAAY,GAAE,MAA0C;WAanC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW;WAI/B,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW;IAI9D;;OAEG;IACI,SAAS,IAAI,MAAM;IAQ1B;;OAEG;IACI,aAAa,IAAI,MAAM;IAQ9B;;OAEG;IACI,qBAAqB,IAAI,MAAM;IAKtC;;;OAGG;IACI,iBAAiB,IAAI,MAAM,EAAE;IAQpC;;;OAGG;IACI,uBAAuB,IAAI,MAAM;IAKxC;;OAEG;IACI,aAAa,IAAI,OAAO;IAI/B;;OAEG;WACW,qBAAqB,CACjC,EAAE,EAAE,MAAM,EACV,YAAY,GAAE,MAA0C,GACvD,IAAI;IAMP,SAAS,CAAC,MAAM,CAAC,wBAAwB,CACvC,KAAK,EAAE,MAAM,EACb,YAAY,GAAE,MAAa,GAC1B,IAAI;IAMP,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIjD,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIvD,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI/C,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;WAIvC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;WAInC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIvC,YAAY,IAAI,MAAM;CAGvC"}
|