@carbonbox/domain 0.6.0 → 0.6.2
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 +28 -0
- package/build/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldId.js +28 -0
- package/build/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleId.js +24 -0
- package/build/carbonbox/activity-data-collection/contextual-labels/domain/value-objects/ContextualLabelId.js +24 -0
- package/build/carbonbox/activity-data-collection/dynamic-forms/domain/value-objects/DynamicFormId.js +24 -0
- package/build/carbonbox/activity-data-collection/stakeholder-adaptations/domain/value-objects/StakeholderAdaptationId.js +24 -0
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationId.js +30 -2
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentId.js +32 -1
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/subsegments/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentId.js +32 -1
- package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/domain/value-objects/CorporateCarbonFootprintConfigurationId.js +24 -0
- package/build/carbonbox/carbon-footprint-configurations/event-configurations/domain/value-objects/EventCarbonFootprintConfigurationId.js +24 -0
- package/build/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/domain/value-objects/EventEditionLifecycleStageConfigurationId.js +30 -2
- package/build/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/domain/value-objects/EventEditionLifecycleStageId.js +30 -2
- package/build/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/subsegments/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentId.js +34 -3
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/domain/value-objects/ProductCarbonFootprintConfigurationId.js +24 -0
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/domain/value-objects/ProductCarbonFootprintSegmentConfigurationId.js +29 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/domain/value-objects/ProductConfigurationCarbonFootprintSegmentId.js +32 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/subsegments/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentId.js +32 -1
- package/build/carbonbox/carbon-footprint-configurations/product-configurations/system-boundaries/domain/value-objects/ProductConfigurationSystemBoundaryId.js +29 -1
- package/build/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintIntensityIndicatorId.js +29 -1
- package/build/carbonbox/company-resources/events/domain/value-objects/EventId.js +28 -0
- package/build/carbonbox/company-resources/events/editions/domain/value-objects/EventEditionId.js +28 -0
- package/build/carbonbox/company-resources/facilities/domain/value-objects/FacilityId.js +29 -1
- package/build/carbonbox/company-resources/products/domain/value-objects/ProductId.js +29 -1
- package/build/carbonbox/emission-calculation-formulas/calculation-variables/domain/value-objects/CalculationVariableId.js +28 -0
- package/build/carbonbox/emission-calculation-formulas/emission-factors/domain/value-objects/EmissionFactorId.js +28 -0
- package/build/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/value-objects/GlobalWarmingPotentialId.js +28 -0
- package/build/carbonbox/emission-calculation-process/calculation-jobs/domain/value-objects/CalculationJobId.js +28 -0
- package/build/carbonbox/emission-calculation-process/calculation-processes/domain/value-objects/CalculationProcessId.js +28 -0
- package/build/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowId.js +28 -0
- package/build/carbonbox/emission-calculation-results/emission-aggregations/domain/value-objects/EmissionAggregationId.js +28 -0
- package/build/carbonbox/emission-calculation-results/emission-calculations/domain/value-objects/EmissionCalculationId.js +28 -0
- package/build/carbonbox/emission-calculation-results/ghg-emission-results/domain/value-objects/GHGEmissionResultId.js +28 -0
- package/build/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractId.js +28 -0
- package/build/carbonbox/purchase-management-system/purchase-orders/domain/value-objects/PurchaseOrderId.js +28 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogId.js +28 -0
- package/build/carbonbox/purchase-management-system/service-pricing/domain/value-objects/ServicePricingId.js +28 -0
- package/build/carbonbox/shared/domain/authorization/enums/Permission.js +1 -0
- package/build/carbonbox/shared/domain/enums/SemanticUuidPrefix.js +16 -0
- package/build/carbonbox/shared/domain/exceptions/InvalidAggregatePrefixError.js +31 -0
- package/build/carbonbox/shared/domain/value-objects/UserId.js +0 -5
- package/build/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientId.js +28 -0
- package/build/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorId.js +28 -0
- package/build/carbonbox/stakeholders/carbon-host/domain/value-objects/CarbonHostId.js +28 -0
- package/build/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerId.js +28 -0
- package/build/types/carbonbox/activity-data-collection/activity-data-submissions/domain/value-objects/ActivityDataSubmissionId.d.ts +5 -0
- package/build/types/carbonbox/activity-data-collection/activity-data-submissions/domain/value-objects/ActivityDataSubmissionId.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldId.d.ts +5 -0
- package/build/types/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldId.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleId.d.ts +2 -0
- package/build/types/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleId.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/contextual-labels/domain/value-objects/ContextualLabelId.d.ts +2 -0
- package/build/types/carbonbox/activity-data-collection/contextual-labels/domain/value-objects/ContextualLabelId.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/dynamic-forms/domain/value-objects/DynamicFormId.d.ts +2 -0
- package/build/types/carbonbox/activity-data-collection/dynamic-forms/domain/value-objects/DynamicFormId.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/stakeholder-adaptations/domain/value-objects/StakeholderAdaptationId.d.ts +2 -0
- package/build/types/carbonbox/activity-data-collection/stakeholder-adaptations/domain/value-objects/StakeholderAdaptationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/subsegments/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/subsegments/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/domain/value-objects/CorporateCarbonFootprintConfigurationId.d.ts +2 -0
- package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/domain/value-objects/CorporateCarbonFootprintConfigurationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/domain/value-objects/EventCarbonFootprintConfigurationId.d.ts +2 -0
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/domain/value-objects/EventCarbonFootprintConfigurationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/domain/value-objects/EventEditionLifecycleStageConfigurationId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/domain/value-objects/EventEditionLifecycleStageConfigurationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/domain/value-objects/EventEditionLifecycleStageId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/domain/value-objects/EventEditionLifecycleStageId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/subsegments/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentId.d.ts +7 -2
- package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/subsegments/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/domain/value-objects/ProductCarbonFootprintConfigurationId.d.ts +2 -0
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/domain/value-objects/ProductCarbonFootprintConfigurationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/domain/value-objects/ProductCarbonFootprintSegmentConfigurationId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/domain/value-objects/ProductCarbonFootprintSegmentConfigurationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/domain/value-objects/ProductConfigurationCarbonFootprintSegmentId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/domain/value-objects/ProductConfigurationCarbonFootprintSegmentId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/subsegments/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/subsegments/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/system-boundaries/domain/value-objects/ProductConfigurationSystemBoundaryId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/system-boundaries/domain/value-objects/ProductConfigurationSystemBoundaryId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintConfigurationId.d.ts +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintConfigurationId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintIntensityIndicatorId.d.ts +5 -0
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintIntensityIndicatorId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSegmentId.d.ts +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSegmentId.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSubsegmentCode.d.ts +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSubsegmentCode.d.ts.map +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSubsegmentId.d.ts +1 -1
- package/build/types/carbonbox/carbon-footprint-configurations/shared/domain/value-objects/CarbonFootprintSubsegmentId.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/domain/value-objects/EventId.d.ts +5 -0
- package/build/types/carbonbox/company-resources/events/domain/value-objects/EventId.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/events/editions/domain/value-objects/EventEditionId.d.ts +5 -0
- package/build/types/carbonbox/company-resources/events/editions/domain/value-objects/EventEditionId.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/facilities/domain/value-objects/FacilityId.d.ts +5 -0
- package/build/types/carbonbox/company-resources/facilities/domain/value-objects/FacilityId.d.ts.map +1 -1
- package/build/types/carbonbox/company-resources/products/domain/value-objects/ProductId.d.ts +5 -0
- package/build/types/carbonbox/company-resources/products/domain/value-objects/ProductId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-formulas/calculation-variables/domain/value-objects/CalculationVariableId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-formulas/calculation-variables/domain/value-objects/CalculationVariableId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-formulas/emission-factors/domain/value-objects/EmissionFactorId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-formulas/emission-factors/domain/value-objects/EmissionFactorId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/value-objects/GlobalWarmingPotentialId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-formulas/global-warming-potentials/domain/value-objects/GlobalWarmingPotentialId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-process/calculation-jobs/domain/value-objects/CalculationJobId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-process/calculation-jobs/domain/value-objects/CalculationJobId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-process/calculation-processes/domain/value-objects/CalculationProcessId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-process/calculation-processes/domain/value-objects/CalculationProcessId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-results/emission-aggregations/domain/value-objects/EmissionAggregationId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-results/emission-aggregations/domain/value-objects/EmissionAggregationId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-results/emission-calculations/domain/value-objects/EmissionCalculationId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-results/emission-calculations/domain/value-objects/EmissionCalculationId.d.ts.map +1 -1
- package/build/types/carbonbox/emission-calculation-results/ghg-emission-results/domain/value-objects/GHGEmissionResultId.d.ts +5 -0
- package/build/types/carbonbox/emission-calculation-results/ghg-emission-results/domain/value-objects/GHGEmissionResultId.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractId.d.ts +5 -0
- package/build/types/carbonbox/purchase-management-system/purchase-contracts/domain/value-objects/PurchaseContractId.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/purchase-orders/domain/value-objects/PurchaseOrderId.d.ts +5 -0
- package/build/types/carbonbox/purchase-management-system/purchase-orders/domain/value-objects/PurchaseOrderId.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogId.d.ts +5 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogId.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/value-objects/ServicePricingId.d.ts +5 -0
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/value-objects/ServicePricingId.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/authorization/enums/Permission.d.ts +2 -1
- package/build/types/carbonbox/shared/domain/authorization/enums/Permission.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/enums/SemanticUuidPrefix.d.ts +15 -0
- package/build/types/carbonbox/shared/domain/enums/SemanticUuidPrefix.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/exceptions/InvalidAggregatePrefixError.d.ts +20 -0
- package/build/types/carbonbox/shared/domain/exceptions/InvalidAggregatePrefixError.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/value-objects/UserId.d.ts +0 -4
- package/build/types/carbonbox/shared/domain/value-objects/UserId.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientId.d.ts +5 -0
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/value-objects/CarbonClientId.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorId.d.ts +5 -0
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/value-objects/CarbonCoordinatorId.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-host/domain/value-objects/CarbonHostId.d.ts +5 -0
- package/build/types/carbonbox/stakeholders/carbon-host/domain/value-objects/CarbonHostId.d.ts.map +1 -1
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerId.d.ts +5 -0
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/value-objects/CarbonManagerId.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventEditionConfigurationCarbonFootprintSubsegmentId = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const CarbonFootprintSubsegmentId_1 = require("../../../../../../shared/domain/value-objects/CarbonFootprintSubsegmentId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
7
|
+
const AggregateId_1 = require("../../../../../../../shared/domain/value-objects/AggregateId");
|
|
8
|
+
class EventEditionConfigurationCarbonFootprintSubsegmentId extends CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId {
|
|
6
9
|
constructor(value, skipDomainValidation) {
|
|
7
10
|
super(value, skipDomainValidation);
|
|
8
11
|
}
|
|
9
12
|
static create(value) {
|
|
10
|
-
|
|
13
|
+
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidType(value, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
15
|
+
CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.guardAgainstInvalidId(value, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
16
|
+
// Validate that the prefix is valid for EventEditionConfigurationCarbonFootprintSubsegment
|
|
17
|
+
EventEditionConfigurationCarbonFootprintSubsegmentId.guardAgainstInvalidPrefix(value);
|
|
11
18
|
return new EventEditionConfigurationCarbonFootprintSubsegmentId(value, false);
|
|
12
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Validates that the UUID has a valid EventEditionConfigurationCarbonFootprintSubsegment prefix
|
|
22
|
+
*/
|
|
23
|
+
static guardAgainstInvalidPrefix(value) {
|
|
24
|
+
try {
|
|
25
|
+
const tempInstance = new EventEditionConfigurationCarbonFootprintSubsegmentId(value, true);
|
|
26
|
+
const prefix = tempInstance.extractPrefix();
|
|
27
|
+
if (EventEditionConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES.includes(prefix) === false) {
|
|
28
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'EventEditionConfigurationCarbonFootprintSubsegment', prefix, EventEditionConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
if (error instanceof Error) {
|
|
36
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'EventEditionConfigurationCarbonFootprintSubsegment', 'UNKNOWN', EventEditionConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
37
|
+
}
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
13
41
|
static fromPrimitives(primitive) {
|
|
14
42
|
const value = primitive;
|
|
15
43
|
return new EventEditionConfigurationCarbonFootprintSubsegmentId(value, true);
|
|
@@ -19,3 +47,6 @@ class EventEditionConfigurationCarbonFootprintSubsegmentId extends CarbonFootpri
|
|
|
19
47
|
}
|
|
20
48
|
}
|
|
21
49
|
exports.EventEditionConfigurationCarbonFootprintSubsegmentId = EventEditionConfigurationCarbonFootprintSubsegmentId;
|
|
50
|
+
EventEditionConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CFC_EVENT_SUBSEGMENT,
|
|
52
|
+
];
|
|
@@ -2,14 +2,35 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProductCarbonFootprintConfigurationId = void 0;
|
|
4
4
|
const CarbonFootprintConfigurationId_1 = require("../../../shared/domain/value-objects/CarbonFootprintConfigurationId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class ProductCarbonFootprintConfigurationId extends CarbonFootprintConfigurationId_1.CarbonFootprintConfigurationId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation);
|
|
8
10
|
}
|
|
9
11
|
static create(value) {
|
|
10
12
|
CarbonFootprintConfigurationId_1.CarbonFootprintConfigurationId.guardAgainstInvalidId(value);
|
|
13
|
+
ProductCarbonFootprintConfigurationId.guardAgainstInvalidPrefix(value);
|
|
11
14
|
return new ProductCarbonFootprintConfigurationId(value, false);
|
|
12
15
|
}
|
|
16
|
+
static guardAgainstInvalidPrefix(value) {
|
|
17
|
+
try {
|
|
18
|
+
const tempInstance = new ProductCarbonFootprintConfigurationId(value, true);
|
|
19
|
+
const prefix = tempInstance.extractPrefix();
|
|
20
|
+
if (ProductCarbonFootprintConfigurationId.VALID_PREFIXES.includes(prefix) === false) {
|
|
21
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductCarbonFootprintConfiguration', prefix, ProductCarbonFootprintConfigurationId.VALID_PREFIXES, ProductCarbonFootprintConfigurationId.PROPERTY_NAME);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
if (error instanceof Error) {
|
|
29
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductCarbonFootprintConfiguration', 'UNKNOWN', ProductCarbonFootprintConfigurationId.VALID_PREFIXES, ProductCarbonFootprintConfigurationId.PROPERTY_NAME);
|
|
30
|
+
}
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
13
34
|
static fromPrimitives(primitive) {
|
|
14
35
|
const value = primitive;
|
|
15
36
|
return new ProductCarbonFootprintConfigurationId(value, true);
|
|
@@ -19,3 +40,6 @@ class ProductCarbonFootprintConfigurationId extends CarbonFootprintConfiguration
|
|
|
19
40
|
}
|
|
20
41
|
}
|
|
21
42
|
exports.ProductCarbonFootprintConfigurationId = ProductCarbonFootprintConfigurationId;
|
|
43
|
+
ProductCarbonFootprintConfigurationId.VALID_PREFIXES = [
|
|
44
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CFC_PRODUCT,
|
|
45
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProductCarbonFootprintSegmentConfigurationId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class ProductCarbonFootprintSegmentConfigurationId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, ProductCarbonFootprintSegmentConfigurationId.PROPERTY_NAME);
|
|
@@ -9,9 +11,32 @@ class ProductCarbonFootprintSegmentConfigurationId extends AggregateId_1.Aggrega
|
|
|
9
11
|
static create(value) {
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, ProductCarbonFootprintSegmentConfigurationId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, ProductCarbonFootprintSegmentConfigurationId.PROPERTY_NAME);
|
|
12
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(value);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(value, ProductCarbonFootprintSegmentConfigurationId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for ProductCarbonFootprintSegmentConfiguration
|
|
16
|
+
ProductCarbonFootprintSegmentConfigurationId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new ProductCarbonFootprintSegmentConfigurationId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid ProductCarbonFootprintSegmentConfiguration prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new ProductCarbonFootprintSegmentConfigurationId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (ProductCarbonFootprintSegmentConfigurationId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductCarbonFootprintSegmentConfiguration', prefix, ProductCarbonFootprintSegmentConfigurationId.VALID_PREFIXES, ProductCarbonFootprintSegmentConfigurationId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductCarbonFootprintSegmentConfiguration', 'UNKNOWN', ProductCarbonFootprintSegmentConfigurationId.VALID_PREFIXES, ProductCarbonFootprintSegmentConfigurationId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new ProductCarbonFootprintSegmentConfigurationId(value, true);
|
|
@@ -22,3 +47,6 @@ class ProductCarbonFootprintSegmentConfigurationId extends AggregateId_1.Aggrega
|
|
|
22
47
|
}
|
|
23
48
|
exports.ProductCarbonFootprintSegmentConfigurationId = ProductCarbonFootprintSegmentConfigurationId;
|
|
24
49
|
ProductCarbonFootprintSegmentConfigurationId.PROPERTY_NAME = 'id';
|
|
50
|
+
ProductCarbonFootprintSegmentConfigurationId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CFC_PRODUCT_SEGMENT,
|
|
52
|
+
];
|
|
@@ -2,14 +2,42 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProductConfigurationCarbonFootprintSegmentId = void 0;
|
|
4
4
|
const CarbonFootprintSegmentId_1 = require("../../../../../shared/domain/value-objects/CarbonFootprintSegmentId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
7
|
+
const AggregateId_1 = require("../../../../../../shared/domain/value-objects/AggregateId");
|
|
5
8
|
class ProductConfigurationCarbonFootprintSegmentId extends CarbonFootprintSegmentId_1.CarbonFootprintSegmentId {
|
|
6
9
|
constructor(value, skipDomainValidation) {
|
|
7
10
|
super(value, skipDomainValidation);
|
|
8
11
|
}
|
|
9
12
|
static create(value) {
|
|
10
|
-
CarbonFootprintSegmentId_1.CarbonFootprintSegmentId.
|
|
13
|
+
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, CarbonFootprintSegmentId_1.CarbonFootprintSegmentId.PROPERTY_NAME);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidType(value, CarbonFootprintSegmentId_1.CarbonFootprintSegmentId.PROPERTY_NAME);
|
|
15
|
+
CarbonFootprintSegmentId_1.CarbonFootprintSegmentId.guardAgainstInvalidId(value, CarbonFootprintSegmentId_1.CarbonFootprintSegmentId.PROPERTY_NAME);
|
|
16
|
+
// Validate that the prefix is valid for ProductConfigurationCarbonFootprintSegment
|
|
17
|
+
ProductConfigurationCarbonFootprintSegmentId.guardAgainstInvalidPrefix(value);
|
|
11
18
|
return new ProductConfigurationCarbonFootprintSegmentId(value, false);
|
|
12
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Validates that the UUID has a valid ProductConfigurationCarbonFootprintSegment prefix
|
|
22
|
+
*/
|
|
23
|
+
static guardAgainstInvalidPrefix(value) {
|
|
24
|
+
try {
|
|
25
|
+
const tempInstance = new ProductConfigurationCarbonFootprintSegmentId(value, true);
|
|
26
|
+
const prefix = tempInstance.extractPrefix();
|
|
27
|
+
if (ProductConfigurationCarbonFootprintSegmentId.VALID_PREFIXES.includes(prefix) === false) {
|
|
28
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductConfigurationCarbonFootprintSegment', prefix, ProductConfigurationCarbonFootprintSegmentId.VALID_PREFIXES, CarbonFootprintSegmentId_1.CarbonFootprintSegmentId.PROPERTY_NAME);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
if (error instanceof Error) {
|
|
36
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductConfigurationCarbonFootprintSegment', 'UNKNOWN', ProductConfigurationCarbonFootprintSegmentId.VALID_PREFIXES, CarbonFootprintSegmentId_1.CarbonFootprintSegmentId.PROPERTY_NAME);
|
|
37
|
+
}
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
13
41
|
static fromPrimitives(primitive) {
|
|
14
42
|
const value = primitive;
|
|
15
43
|
return new ProductConfigurationCarbonFootprintSegmentId(value, true);
|
|
@@ -19,3 +47,6 @@ class ProductConfigurationCarbonFootprintSegmentId extends CarbonFootprintSegmen
|
|
|
19
47
|
}
|
|
20
48
|
}
|
|
21
49
|
exports.ProductConfigurationCarbonFootprintSegmentId = ProductConfigurationCarbonFootprintSegmentId;
|
|
50
|
+
ProductConfigurationCarbonFootprintSegmentId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CFC_PRODUCT_SEGMENT,
|
|
52
|
+
];
|
|
@@ -2,14 +2,42 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProductConfigurationCarbonFootprintSubsegmentId = void 0;
|
|
4
4
|
const CarbonFootprintSubsegmentId_1 = require("../../../../../../shared/domain/value-objects/CarbonFootprintSubsegmentId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
7
|
+
const AggregateId_1 = require("../../../../../../../shared/domain/value-objects/AggregateId");
|
|
5
8
|
class ProductConfigurationCarbonFootprintSubsegmentId extends CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId {
|
|
6
9
|
constructor(value, skipDomainValidation) {
|
|
7
10
|
super(value, skipDomainValidation);
|
|
8
11
|
}
|
|
9
12
|
static create(value) {
|
|
10
|
-
CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.
|
|
13
|
+
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidType(value, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
15
|
+
CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.guardAgainstInvalidId(value, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
16
|
+
// Validate that the prefix is valid for ProductConfigurationCarbonFootprintSubsegment
|
|
17
|
+
ProductConfigurationCarbonFootprintSubsegmentId.guardAgainstInvalidPrefix(value);
|
|
11
18
|
return new ProductConfigurationCarbonFootprintSubsegmentId(value, false);
|
|
12
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Validates that the UUID has a valid ProductConfigurationCarbonFootprintSubsegment prefix
|
|
22
|
+
*/
|
|
23
|
+
static guardAgainstInvalidPrefix(value) {
|
|
24
|
+
try {
|
|
25
|
+
const tempInstance = new ProductConfigurationCarbonFootprintSubsegmentId(value, true);
|
|
26
|
+
const prefix = tempInstance.extractPrefix();
|
|
27
|
+
if (ProductConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES.includes(prefix) === false) {
|
|
28
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductConfigurationCarbonFootprintSubsegment', prefix, ProductConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
if (error instanceof Error) {
|
|
36
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductConfigurationCarbonFootprintSubsegment', 'UNKNOWN', ProductConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES, CarbonFootprintSubsegmentId_1.CarbonFootprintSubsegmentId.PROPERTY_NAME);
|
|
37
|
+
}
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
13
41
|
static fromPrimitives(primitive) {
|
|
14
42
|
const value = primitive;
|
|
15
43
|
return new ProductConfigurationCarbonFootprintSubsegmentId(value, true);
|
|
@@ -19,3 +47,6 @@ class ProductConfigurationCarbonFootprintSubsegmentId extends CarbonFootprintSub
|
|
|
19
47
|
}
|
|
20
48
|
}
|
|
21
49
|
exports.ProductConfigurationCarbonFootprintSubsegmentId = ProductConfigurationCarbonFootprintSubsegmentId;
|
|
50
|
+
ProductConfigurationCarbonFootprintSubsegmentId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CFC_PRODUCT_SUBSEGMENT,
|
|
52
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProductConfigurationSystemBoundaryId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class ProductConfigurationSystemBoundaryId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, ProductConfigurationSystemBoundaryId.PROPERTY_NAME);
|
|
@@ -9,9 +11,32 @@ class ProductConfigurationSystemBoundaryId extends AggregateId_1.AggregateId {
|
|
|
9
11
|
static create(value) {
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, ProductConfigurationSystemBoundaryId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, ProductConfigurationSystemBoundaryId.PROPERTY_NAME);
|
|
12
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(value);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(value, ProductConfigurationSystemBoundaryId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for ProductConfigurationSystemBoundary
|
|
16
|
+
ProductConfigurationSystemBoundaryId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new ProductConfigurationSystemBoundaryId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid ProductConfigurationSystemBoundary prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new ProductConfigurationSystemBoundaryId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (ProductConfigurationSystemBoundaryId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductConfigurationSystemBoundary', prefix, ProductConfigurationSystemBoundaryId.VALID_PREFIXES, ProductConfigurationSystemBoundaryId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'ProductConfigurationSystemBoundary', 'UNKNOWN', ProductConfigurationSystemBoundaryId.VALID_PREFIXES, ProductConfigurationSystemBoundaryId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new ProductConfigurationSystemBoundaryId(value, true);
|
|
@@ -22,3 +47,6 @@ class ProductConfigurationSystemBoundaryId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.ProductConfigurationSystemBoundaryId = ProductConfigurationSystemBoundaryId;
|
|
24
49
|
ProductConfigurationSystemBoundaryId.PROPERTY_NAME = 'id';
|
|
50
|
+
ProductConfigurationSystemBoundaryId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CFC_PRODUCT_BOUNDARY,
|
|
52
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CarbonFootprintIntensityIndicatorId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class CarbonFootprintIntensityIndicatorId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, CarbonFootprintIntensityIndicatorId.PROPERTY_NAME);
|
|
@@ -9,9 +11,32 @@ class CarbonFootprintIntensityIndicatorId extends AggregateId_1.AggregateId {
|
|
|
9
11
|
static create(value) {
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, CarbonFootprintIntensityIndicatorId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, CarbonFootprintIntensityIndicatorId.PROPERTY_NAME);
|
|
12
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(value);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(value, CarbonFootprintIntensityIndicatorId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for CarbonFootprintIntensityIndicator
|
|
16
|
+
CarbonFootprintIntensityIndicatorId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new CarbonFootprintIntensityIndicatorId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid CarbonFootprintIntensityIndicator prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new CarbonFootprintIntensityIndicatorId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (CarbonFootprintIntensityIndicatorId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'CarbonFootprintIntensityIndicator', prefix, CarbonFootprintIntensityIndicatorId.VALID_PREFIXES, CarbonFootprintIntensityIndicatorId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'CarbonFootprintIntensityIndicator', 'UNKNOWN', CarbonFootprintIntensityIndicatorId.VALID_PREFIXES, CarbonFootprintIntensityIndicatorId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new CarbonFootprintIntensityIndicatorId(value, true);
|
|
@@ -22,3 +47,6 @@ class CarbonFootprintIntensityIndicatorId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.CarbonFootprintIntensityIndicatorId = CarbonFootprintIntensityIndicatorId;
|
|
24
49
|
CarbonFootprintIntensityIndicatorId.PROPERTY_NAME = 'id';
|
|
50
|
+
CarbonFootprintIntensityIndicatorId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CFC_INTENSITY,
|
|
52
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class EventId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, EventId.PROPERTY_NAME);
|
|
@@ -10,8 +12,31 @@ class EventId extends AggregateId_1.AggregateId {
|
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, EventId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, EventId.PROPERTY_NAME);
|
|
12
14
|
AggregateId_1.AggregateId.guardAgainstInvalidId(value, EventId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for Event
|
|
16
|
+
EventId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new EventId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid Event prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new EventId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (EventId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'Event', prefix, EventId.VALID_PREFIXES, EventId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'Event', 'UNKNOWN', EventId.VALID_PREFIXES, EventId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new EventId(value, true);
|
|
@@ -22,3 +47,6 @@ class EventId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.EventId = EventId;
|
|
24
49
|
EventId.PROPERTY_NAME = 'id';
|
|
50
|
+
EventId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CPR_EVENTS,
|
|
52
|
+
];
|
package/build/carbonbox/company-resources/events/editions/domain/value-objects/EventEditionId.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventEditionId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class EventEditionId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, EventEditionId.PROPERTY_NAME);
|
|
@@ -10,8 +12,31 @@ class EventEditionId extends AggregateId_1.AggregateId {
|
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, EventEditionId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, EventEditionId.PROPERTY_NAME);
|
|
12
14
|
AggregateId_1.AggregateId.guardAgainstInvalidId(value, EventEditionId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for EventEdition
|
|
16
|
+
EventEditionId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new EventEditionId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid EventEdition prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new EventEditionId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (EventEditionId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'EventEdition', prefix, EventEditionId.VALID_PREFIXES, EventEditionId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'EventEdition', 'UNKNOWN', EventEditionId.VALID_PREFIXES, EventEditionId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new EventEditionId(value, true);
|
|
@@ -22,3 +47,6 @@ class EventEditionId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.EventEditionId = EventEditionId;
|
|
24
49
|
EventEditionId.PROPERTY_NAME = 'id';
|
|
50
|
+
EventEditionId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CPR_EVENT_EDITION,
|
|
52
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FacilityId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class FacilityId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, FacilityId.PROPERTY_NAME);
|
|
@@ -9,9 +11,32 @@ class FacilityId extends AggregateId_1.AggregateId {
|
|
|
9
11
|
static create(value) {
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, FacilityId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, FacilityId.PROPERTY_NAME);
|
|
12
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(value);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(value, FacilityId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for Facility
|
|
16
|
+
FacilityId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new FacilityId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid Facility prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new FacilityId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (FacilityId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'Facility', prefix, FacilityId.VALID_PREFIXES, FacilityId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'Facility', 'UNKNOWN', FacilityId.VALID_PREFIXES, FacilityId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new FacilityId(value, true);
|
|
@@ -22,3 +47,6 @@ class FacilityId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.FacilityId = FacilityId;
|
|
24
49
|
FacilityId.PROPERTY_NAME = 'id';
|
|
50
|
+
FacilityId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CPR_FACILITIES,
|
|
52
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProductId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class ProductId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, ProductId.PROPERTY_NAME);
|
|
@@ -9,9 +11,32 @@ class ProductId extends AggregateId_1.AggregateId {
|
|
|
9
11
|
static create(value) {
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, ProductId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, ProductId.PROPERTY_NAME);
|
|
12
|
-
AggregateId_1.AggregateId.guardAgainstInvalidId(value);
|
|
14
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(value, ProductId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for Product
|
|
16
|
+
ProductId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new ProductId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid Product prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new ProductId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (ProductId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'Product', prefix, ProductId.VALID_PREFIXES, ProductId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'Product', 'UNKNOWN', ProductId.VALID_PREFIXES, ProductId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new ProductId(value, true);
|
|
@@ -22,3 +47,6 @@ class ProductId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.ProductId = ProductId;
|
|
24
49
|
ProductId.PROPERTY_NAME = 'id';
|
|
50
|
+
ProductId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.CPR_PRODUCTS,
|
|
52
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CalculationVariableId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class CalculationVariableId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, CalculationVariableId.PROPERTY_NAME);
|
|
@@ -10,8 +12,31 @@ class CalculationVariableId extends AggregateId_1.AggregateId {
|
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, CalculationVariableId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, CalculationVariableId.PROPERTY_NAME);
|
|
12
14
|
AggregateId_1.AggregateId.guardAgainstInvalidId(value, CalculationVariableId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for CalculationVariable
|
|
16
|
+
CalculationVariableId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new CalculationVariableId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid CalculationVariable prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new CalculationVariableId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (CalculationVariableId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'CalculationVariable', prefix, CalculationVariableId.VALID_PREFIXES, CalculationVariableId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'CalculationVariable', 'UNKNOWN', CalculationVariableId.VALID_PREFIXES, CalculationVariableId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new CalculationVariableId(value, true);
|
|
@@ -22,3 +47,6 @@ class CalculationVariableId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.CalculationVariableId = CalculationVariableId;
|
|
24
49
|
CalculationVariableId.PROPERTY_NAME = 'id';
|
|
50
|
+
CalculationVariableId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.ECF_VARIABLES,
|
|
52
|
+
];
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmissionFactorId = void 0;
|
|
4
4
|
const AggregateId_1 = require("../../../../shared/domain/value-objects/AggregateId");
|
|
5
|
+
const SemanticUuidPrefix_1 = require("../../../../shared/domain/enums/SemanticUuidPrefix");
|
|
6
|
+
const InvalidAggregatePrefixError_1 = require("../../../../shared/domain/exceptions/InvalidAggregatePrefixError");
|
|
5
7
|
class EmissionFactorId extends AggregateId_1.AggregateId {
|
|
6
8
|
constructor(value, skipDomainValidation) {
|
|
7
9
|
super(value, skipDomainValidation, EmissionFactorId.PROPERTY_NAME);
|
|
@@ -10,8 +12,31 @@ class EmissionFactorId extends AggregateId_1.AggregateId {
|
|
|
10
12
|
AggregateId_1.AggregateId.guardAgainstEmptyValue(value, EmissionFactorId.PROPERTY_NAME);
|
|
11
13
|
AggregateId_1.AggregateId.guardAgainstInvalidType(value, EmissionFactorId.PROPERTY_NAME);
|
|
12
14
|
AggregateId_1.AggregateId.guardAgainstInvalidId(value, EmissionFactorId.PROPERTY_NAME);
|
|
15
|
+
// Validate that the prefix is valid for EmissionFactor
|
|
16
|
+
EmissionFactorId.guardAgainstInvalidPrefix(value);
|
|
13
17
|
return new EmissionFactorId(value, false);
|
|
14
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Validates that the UUID has a valid EmissionFactor prefix
|
|
21
|
+
*/
|
|
22
|
+
static guardAgainstInvalidPrefix(value) {
|
|
23
|
+
try {
|
|
24
|
+
const tempInstance = new EmissionFactorId(value, true);
|
|
25
|
+
const prefix = tempInstance.extractPrefix();
|
|
26
|
+
if (EmissionFactorId.VALID_PREFIXES.includes(prefix) === false) {
|
|
27
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'EmissionFactor', prefix, EmissionFactorId.VALID_PREFIXES, EmissionFactorId.PROPERTY_NAME);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
if (error instanceof InvalidAggregatePrefixError_1.InvalidAggregatePrefixError) {
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw InvalidAggregatePrefixError_1.InvalidAggregatePrefixError.create(value, 'EmissionFactor', 'UNKNOWN', EmissionFactorId.VALID_PREFIXES, EmissionFactorId.PROPERTY_NAME);
|
|
36
|
+
}
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
15
40
|
static fromPrimitives(primitive) {
|
|
16
41
|
const value = primitive;
|
|
17
42
|
return new EmissionFactorId(value, true);
|
|
@@ -22,3 +47,6 @@ class EmissionFactorId extends AggregateId_1.AggregateId {
|
|
|
22
47
|
}
|
|
23
48
|
exports.EmissionFactorId = EmissionFactorId;
|
|
24
49
|
EmissionFactorId.PROPERTY_NAME = 'id';
|
|
50
|
+
EmissionFactorId.VALID_PREFIXES = [
|
|
51
|
+
SemanticUuidPrefix_1.SemanticUuidPrefix.ECF_FACTORS,
|
|
52
|
+
];
|