@carbonbox/domain 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError.js +1 -1
- package/build/carbonbox/shared/domain/value-objects/AggregateId.js +12 -7
- package/build/types/carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts +9 -5
- package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts.map +1 -1
- package/package.json +1 -1
- package/build/carbonbox/purchase-management-system/service-catalog/domain/entity/IService.js +0 -2
- package/build/carbonbox/purchase-management-system/service-catalog/domain/entity/Service.js +0 -263
- package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCategory.js +0 -20
- package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceStatus.js +0 -9
- package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceType.js +0 -10
- package/build/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCategoryError.js +0 -19
- package/build/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceStatusError.js +0 -19
- package/build/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceTypeError.js +0 -19
- package/build/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceRepository.js +0 -2
- package/build/carbonbox/purchase-management-system/service-catalog/domain/types/ServicePrimitives.js +0 -2
- package/build/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceProps.js +0 -2
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAdditionalUserRoles.js +0 -131
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAllowsDocumentReading.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAllowsSectoralComparison.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceBasePricePercentage.js +0 -140
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCategory.js +0 -243
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCode.js +0 -24
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCreatedByStakeholder.js +0 -26
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceDependsOnServiceCode.js +0 -21
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceDescription.js +0 -23
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceExpertDedicationLevel.js +0 -212
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceFixedPriceAmount.js +0 -193
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceHasBasePrice.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceHasFixedPrice.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceId.js +0 -24
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIncludesCarbonBoxAcademy.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIncludesESGIndicators.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForCorporate.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForEvent.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForProduct.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsRequiredService.js +0 -22
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceMaxUsers.js +0 -246
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceName.js +0 -23
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceReportTypes.js +0 -246
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceStatus.js +0 -221
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceType.js +0 -235
- package/build/carbonbox/shared/domain/exceptions/InvalidSemanticUuidError.js +0 -19
- package/build/carbonbox/shared/domain/services/DateTimeFormattingDomainService.js +0 -172
- package/build/carbonbox/shared/domain/services/contracts/ISemanticUuidDomainService.js +0 -2
- package/build/carbonbox/shared/domain/services/implementations/SemanticUuidDomainService.js +0 -235
- package/build/carbonbox/shared/domain/types/AllPermissions.js +0 -2
- package/build/carbonbox/shared/domain/types/AllPermissionsPrimitives.js +0 -2
- package/build/carbonbox/shared/domain/types/ServiceReference.js +0 -2
- package/build/carbonbox/shared/domain/types/ServiceReferencePrimitives.js +0 -2
- package/build/carbonbox/shared/domain/types/UserEmailProps.js +0 -2
- package/build/carbonbox/shared/domain/value-objects/ServiceReference.js +0 -301
- package/build/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissions.js +0 -2
- package/build/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissionsPrimitives.js +0 -2
- package/build/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissionsValue.js +0 -2
- package/build/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissions.js +0 -2
- package/build/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissionsPrimitives.js +0 -2
- package/build/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissionsValue.js +0 -2
- package/build/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissions.js +0 -2
- package/build/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissionsPrimitives.js +0 -2
- package/build/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissionsValue.js +0 -2
- package/build/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissions.js +0 -2
- package/build/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissionsPrimitives.js +0 -2
- package/build/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissionsValue.js +0 -2
- package/build/carbonbox/stakeholders/shared/domain/enums/StakeholderBusinessStatus.js +0 -10
- package/build/carbonbox/stakeholders/shared/domain/exceptions/InvalidStakeholderBusinessStatusError.js +0 -18
- package/build/carbonbox/stakeholders/shared/domain/types/StakeholderPermissions.js +0 -2
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/IService.d.ts +0 -52
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/IService.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/Service.d.ts +0 -60
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/Service.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCategory.d.ts +0 -17
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCategory.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceStatus.d.ts +0 -6
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceStatus.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceType.d.ts +0 -7
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceType.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCategoryError.d.ts +0 -8
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCategoryError.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceStatusError.d.ts +0 -8
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceStatusError.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceTypeError.d.ts +0 -8
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceTypeError.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceRepository.d.ts +0 -22
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceRepository.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServicePrimitives.d.ts +0 -35
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServicePrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceProps.d.ts +0 -35
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceProps.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAdditionalUserRoles.d.ts +0 -71
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAdditionalUserRoles.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAllowsDocumentReading.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAllowsDocumentReading.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAllowsSectoralComparison.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceAllowsSectoralComparison.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceBasePricePercentage.d.ts +0 -54
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceBasePricePercentage.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCategory.d.ts +0 -123
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCategory.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCode.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCode.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCreatedByStakeholder.d.ts +0 -11
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCreatedByStakeholder.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceDependsOnServiceCode.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceDependsOnServiceCode.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceDescription.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceDescription.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceExpertDedicationLevel.d.ts +0 -92
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceExpertDedicationLevel.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceFixedPriceAmount.d.ts +0 -83
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceFixedPriceAmount.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceHasBasePrice.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceHasBasePrice.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceHasFixedPrice.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceHasFixedPrice.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceId.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceId.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIncludesCarbonBoxAcademy.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIncludesCarbonBoxAcademy.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIncludesESGIndicators.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIncludesESGIndicators.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForCorporate.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForCorporate.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForEvent.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForEvent.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForProduct.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsAvailableForProduct.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsRequiredService.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceIsRequiredService.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceMaxUsers.d.ts +0 -99
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceMaxUsers.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceName.d.ts +0 -9
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceName.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceReportTypes.d.ts +0 -119
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceReportTypes.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceStatus.d.ts +0 -110
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceStatus.d.ts.map +0 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceType.d.ts +0 -111
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceType.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/exceptions/InvalidSemanticUuidError.d.ts +0 -8
- package/build/types/carbonbox/shared/domain/exceptions/InvalidSemanticUuidError.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/services/DateTimeFormattingDomainService.d.ts +0 -95
- package/build/types/carbonbox/shared/domain/services/DateTimeFormattingDomainService.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/services/contracts/ISemanticUuidDomainService.d.ts +0 -85
- package/build/types/carbonbox/shared/domain/services/contracts/ISemanticUuidDomainService.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/services/implementations/SemanticUuidDomainService.d.ts +0 -67
- package/build/types/carbonbox/shared/domain/services/implementations/SemanticUuidDomainService.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/types/AllPermissions.d.ts +0 -12
- package/build/types/carbonbox/shared/domain/types/AllPermissions.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/types/AllPermissionsPrimitives.d.ts +0 -12
- package/build/types/carbonbox/shared/domain/types/AllPermissionsPrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/types/ServiceReference.d.ts +0 -8
- package/build/types/carbonbox/shared/domain/types/ServiceReference.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/types/ServiceReferencePrimitives.d.ts +0 -8
- package/build/types/carbonbox/shared/domain/types/ServiceReferencePrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/types/UserEmailProps.d.ts +0 -5
- package/build/types/carbonbox/shared/domain/types/UserEmailProps.d.ts.map +0 -1
- package/build/types/carbonbox/shared/domain/value-objects/ServiceReference.d.ts +0 -134
- package/build/types/carbonbox/shared/domain/value-objects/ServiceReference.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissions.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissions.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissionsPrimitives.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissionsPrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissionsValue.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-clients/domain/types/CarbonClientPermissionsValue.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissions.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissions.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissionsPrimitives.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissionsPrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissionsValue.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-coordinators/domain/types/CarbonCoordinatorPermissionsValue.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissions.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissions.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissionsPrimitives.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissionsPrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissionsValue.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-host/domain/types/CarbonHostPermissionsValue.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissions.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissions.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissionsPrimitives.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissionsPrimitives.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissionsValue.d.ts +0 -3
- package/build/types/carbonbox/stakeholders/carbon-managers/domain/types/CarbonManagerPermissionsValue.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/shared/domain/enums/StakeholderBusinessStatus.d.ts +0 -7
- package/build/types/carbonbox/stakeholders/shared/domain/enums/StakeholderBusinessStatus.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/shared/domain/exceptions/InvalidStakeholderBusinessStatusError.d.ts +0 -7
- package/build/types/carbonbox/stakeholders/shared/domain/exceptions/InvalidStakeholderBusinessStatusError.d.ts.map +0 -1
- package/build/types/carbonbox/stakeholders/shared/domain/types/StakeholderPermissions.d.ts +0 -10
- package/build/types/carbonbox/stakeholders/shared/domain/types/StakeholderPermissions.d.ts.map +0 -1
|
@@ -16,4 +16,4 @@ class InvalidAggregateIdFormatError extends RootError_1.RootError {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.InvalidAggregateIdFormatError = InvalidAggregateIdFormatError;
|
|
19
|
-
InvalidAggregateIdFormatError.INVALID_AGGREGATE_ID_ERROR_MESSAGE = 'Invalid aggregate ID format. Expected:
|
|
19
|
+
InvalidAggregateIdFormatError.INVALID_AGGREGATE_ID_ERROR_MESSAGE = 'Invalid aggregate ID format. Expected: PREFIX_UUID (e.g., PMS-SC_550e8400-e29b-41d4-a716-446655440000 or USR-STH-CHO_550e8400-e29b-41d4-a716-446655440000)';
|
|
@@ -7,18 +7,22 @@ const InvalidAggregateIdFormatError_1 = require("../exceptions/InvalidAggregateI
|
|
|
7
7
|
/**
|
|
8
8
|
* Pure AggregateId Value Object with structured ID format
|
|
9
9
|
*
|
|
10
|
-
* Format: {
|
|
10
|
+
* Format: {PREFIX}_{UUID} where PREFIX can be BC or BC-SUB1-SUB2-...SUBn
|
|
11
|
+
* Each prefix component can have 1+ uppercase letters (validated by specific Value Objects)
|
|
12
|
+
*
|
|
11
13
|
* Examples:
|
|
12
|
-
* - STC_550e8400-e29b-41d4-a716-446655440000 (BC-level entity)
|
|
13
|
-
* -
|
|
14
|
-
* -
|
|
14
|
+
* - STC_550e8400-e29b-41d4-a716-446655440000 (BC-level entity, 3 letters)
|
|
15
|
+
* - PMS-SC_550e8400-e29b-41d4-a716-446655440000 (subdomain entity, 3-2 letters)
|
|
16
|
+
* - USR-STH-CHO_550e8400-e29b-41d4-a716-446655440000 (subdomain entity, 3-3-3 letters)
|
|
17
|
+
* - ADC-SUB-FLD_123e4567-e89b-12d3-a456-426614174000 (N-level expansion, 3-3-3 letters)
|
|
15
18
|
*
|
|
16
19
|
* This is a PURE Value Object - no external dependencies or business logic.
|
|
17
20
|
*
|
|
18
21
|
* Benefits:
|
|
19
22
|
* - Immutable and pure value object design
|
|
20
23
|
* - Basic validation and extraction methods
|
|
21
|
-
* - Flexible N-level subdomain support
|
|
24
|
+
* - Flexible N-level subdomain support with variable component lengths
|
|
25
|
+
* - Specific prefix validation delegated to concrete Value Objects
|
|
22
26
|
* - Clean separation of concerns
|
|
23
27
|
*/
|
|
24
28
|
class AggregateId extends String_1.String {
|
|
@@ -126,5 +130,6 @@ AggregateId.DEFAULT_PROPERTY_NAME = 'id';
|
|
|
126
130
|
// Standard ID regex (UUID v4 format)
|
|
127
131
|
AggregateId.ID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
128
132
|
// Aggregate ID format: BC_ID or BC-SUB1-SUB2-...SUBn_ID (flexible N-level subdomain support)
|
|
129
|
-
// Pattern: [A-Z]
|
|
130
|
-
|
|
133
|
+
// Pattern: [A-Z]+(-[A-Z]+)*_[ID] - BC alone OR BC with unlimited SUBn levels (1+ letters per component)
|
|
134
|
+
// Each specific Value Object validates its exact prefix format
|
|
135
|
+
AggregateId.AGGREGATE_ID_REGEX = /^[A-Z]+(-[A-Z]+)*_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
package/build/types/carbonbox/shared/domain/exceptions/InvalidAggregateIdFormatError.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,CAAgK;IAE1N,OAAO;WASgB,MAAM,CAC3B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,6BAA6B;IAIhB,QAAQ,IAAI,MAAM;CAGnC"}
|
|
@@ -2,18 +2,22 @@ import { String } from './String';
|
|
|
2
2
|
/**
|
|
3
3
|
* Pure AggregateId Value Object with structured ID format
|
|
4
4
|
*
|
|
5
|
-
* Format: {
|
|
5
|
+
* Format: {PREFIX}_{UUID} where PREFIX can be BC or BC-SUB1-SUB2-...SUBn
|
|
6
|
+
* Each prefix component can have 1+ uppercase letters (validated by specific Value Objects)
|
|
7
|
+
*
|
|
6
8
|
* Examples:
|
|
7
|
-
* - STC_550e8400-e29b-41d4-a716-446655440000 (BC-level entity)
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
9
|
+
* - STC_550e8400-e29b-41d4-a716-446655440000 (BC-level entity, 3 letters)
|
|
10
|
+
* - PMS-SC_550e8400-e29b-41d4-a716-446655440000 (subdomain entity, 3-2 letters)
|
|
11
|
+
* - USR-STH-CHO_550e8400-e29b-41d4-a716-446655440000 (subdomain entity, 3-3-3 letters)
|
|
12
|
+
* - ADC-SUB-FLD_123e4567-e89b-12d3-a456-426614174000 (N-level expansion, 3-3-3 letters)
|
|
10
13
|
*
|
|
11
14
|
* This is a PURE Value Object - no external dependencies or business logic.
|
|
12
15
|
*
|
|
13
16
|
* Benefits:
|
|
14
17
|
* - Immutable and pure value object design
|
|
15
18
|
* - Basic validation and extraction methods
|
|
16
|
-
* - Flexible N-level subdomain support
|
|
19
|
+
* - Flexible N-level subdomain support with variable component lengths
|
|
20
|
+
* - Specific prefix validation delegated to concrete Value Objects
|
|
17
21
|
* - Clean separation of concerns
|
|
18
22
|
*/
|
|
19
23
|
export declare class AggregateId extends String {
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAY,SAAQ,MAAM;IACrC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,QAAQ;IAGvD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAA4E;IAK5G,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAA6F;IAEvI,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"}
|
package/package.json
CHANGED
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _Service_code, _Service_name, _Service_description, _Service_type, _Service_category, _Service_status, _Service_isRequiredService, _Service_dependsOnServiceCode, _Service_hasBasePrice, _Service_basePricePercentage, _Service_hasFixedPrice, _Service_fixedPriceAmount, _Service_expertDedicationLevel, _Service_reportTypes, _Service_additionalUserRoles, _Service_maxUsers, _Service_allowsDocumentReading, _Service_allowsSectoralComparison, _Service_includesCarbonBoxAcademy, _Service_includesESGIndicators, _Service_isAvailableForCorporate, _Service_isAvailableForProduct, _Service_isAvailableForEvent, _Service_createdByStakeholder;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Service = void 0;
|
|
16
|
-
const AggregateRoot_1 = require("../../../../shared/domain/entities/AggregateRoot");
|
|
17
|
-
const ServiceAdditionalUserRoles_1 = require("../value-objects/ServiceAdditionalUserRoles");
|
|
18
|
-
const ServiceAllowsDocumentReading_1 = require("../value-objects/ServiceAllowsDocumentReading");
|
|
19
|
-
const ServiceAllowsSectoralComparison_1 = require("../value-objects/ServiceAllowsSectoralComparison");
|
|
20
|
-
const ServiceBasePricePercentage_1 = require("../value-objects/ServiceBasePricePercentage");
|
|
21
|
-
const ServiceCategory_1 = require("../value-objects/ServiceCategory");
|
|
22
|
-
const ServiceCode_1 = require("../value-objects/ServiceCode");
|
|
23
|
-
const ServiceCreatedByStakeholder_1 = require("../value-objects/ServiceCreatedByStakeholder");
|
|
24
|
-
const ServiceDependsOnServiceCode_1 = require("../value-objects/ServiceDependsOnServiceCode");
|
|
25
|
-
const ServiceDescription_1 = require("../value-objects/ServiceDescription");
|
|
26
|
-
const ServiceExpertDedicationLevel_1 = require("../value-objects/ServiceExpertDedicationLevel");
|
|
27
|
-
const ServiceFixedPriceAmount_1 = require("../value-objects/ServiceFixedPriceAmount");
|
|
28
|
-
const ServiceHasBasePrice_1 = require("../value-objects/ServiceHasBasePrice");
|
|
29
|
-
const ServiceHasFixedPrice_1 = require("../value-objects/ServiceHasFixedPrice");
|
|
30
|
-
const ServiceId_1 = require("../value-objects/ServiceId");
|
|
31
|
-
const ServiceIncludesCarbonBoxAcademy_1 = require("../value-objects/ServiceIncludesCarbonBoxAcademy");
|
|
32
|
-
const ServiceIncludesESGIndicators_1 = require("../value-objects/ServiceIncludesESGIndicators");
|
|
33
|
-
const ServiceIsAvailableForCorporate_1 = require("../value-objects/ServiceIsAvailableForCorporate");
|
|
34
|
-
const ServiceIsAvailableForEvent_1 = require("../value-objects/ServiceIsAvailableForEvent");
|
|
35
|
-
const ServiceIsAvailableForProduct_1 = require("../value-objects/ServiceIsAvailableForProduct");
|
|
36
|
-
const ServiceIsRequiredService_1 = require("../value-objects/ServiceIsRequiredService");
|
|
37
|
-
const ServiceMaxUsers_1 = require("../value-objects/ServiceMaxUsers");
|
|
38
|
-
const ServiceName_1 = require("../value-objects/ServiceName");
|
|
39
|
-
const ServiceReportTypes_1 = require("../value-objects/ServiceReportTypes");
|
|
40
|
-
const ServiceStatus_1 = require("../value-objects/ServiceStatus");
|
|
41
|
-
const ServiceType_1 = require("../value-objects/ServiceType");
|
|
42
|
-
class Service extends AggregateRoot_1.AggregateRoot {
|
|
43
|
-
constructor(props, skipDomainValidation) {
|
|
44
|
-
const id = skipDomainValidation
|
|
45
|
-
? ServiceId_1.ServiceId.fromPrimitives(props.id).toPrimitives()
|
|
46
|
-
: ServiceId_1.ServiceId.create(props.id).toPrimitives();
|
|
47
|
-
super({ id }, skipDomainValidation);
|
|
48
|
-
_Service_code.set(this, void 0);
|
|
49
|
-
_Service_name.set(this, void 0);
|
|
50
|
-
_Service_description.set(this, void 0);
|
|
51
|
-
_Service_type.set(this, void 0);
|
|
52
|
-
_Service_category.set(this, void 0);
|
|
53
|
-
_Service_status.set(this, void 0);
|
|
54
|
-
_Service_isRequiredService.set(this, void 0);
|
|
55
|
-
_Service_dependsOnServiceCode.set(this, void 0);
|
|
56
|
-
_Service_hasBasePrice.set(this, void 0);
|
|
57
|
-
_Service_basePricePercentage.set(this, void 0);
|
|
58
|
-
_Service_hasFixedPrice.set(this, void 0);
|
|
59
|
-
_Service_fixedPriceAmount.set(this, void 0);
|
|
60
|
-
_Service_expertDedicationLevel.set(this, void 0);
|
|
61
|
-
_Service_reportTypes.set(this, void 0);
|
|
62
|
-
_Service_additionalUserRoles.set(this, void 0);
|
|
63
|
-
_Service_maxUsers.set(this, void 0);
|
|
64
|
-
_Service_allowsDocumentReading.set(this, void 0);
|
|
65
|
-
_Service_allowsSectoralComparison.set(this, void 0);
|
|
66
|
-
_Service_includesCarbonBoxAcademy.set(this, void 0);
|
|
67
|
-
_Service_includesESGIndicators.set(this, void 0);
|
|
68
|
-
_Service_isAvailableForCorporate.set(this, void 0);
|
|
69
|
-
_Service_isAvailableForProduct.set(this, void 0);
|
|
70
|
-
_Service_isAvailableForEvent.set(this, void 0);
|
|
71
|
-
_Service_createdByStakeholder.set(this, void 0);
|
|
72
|
-
if (skipDomainValidation === false) {
|
|
73
|
-
// Initialize with domain validation
|
|
74
|
-
__classPrivateFieldSet(this, _Service_code, ServiceCode_1.ServiceCode.create(props.code), "f");
|
|
75
|
-
__classPrivateFieldSet(this, _Service_name, ServiceName_1.ServiceName.create(props.name), "f");
|
|
76
|
-
__classPrivateFieldSet(this, _Service_description, ServiceDescription_1.ServiceDescription.create(props.description), "f");
|
|
77
|
-
__classPrivateFieldSet(this, _Service_type, ServiceType_1.ServiceType.create(props.type), "f");
|
|
78
|
-
__classPrivateFieldSet(this, _Service_category, ServiceCategory_1.ServiceCategory.create(props.category), "f");
|
|
79
|
-
__classPrivateFieldSet(this, _Service_status, ServiceStatus_1.ServiceStatus.create(props.status), "f");
|
|
80
|
-
__classPrivateFieldSet(this, _Service_isRequiredService, ServiceIsRequiredService_1.ServiceIsRequiredService.create(props.isRequiredService), "f");
|
|
81
|
-
__classPrivateFieldSet(this, _Service_dependsOnServiceCode, ServiceDependsOnServiceCode_1.ServiceDependsOnServiceCode.create(props.dependsOnServiceCode), "f");
|
|
82
|
-
__classPrivateFieldSet(this, _Service_hasBasePrice, ServiceHasBasePrice_1.ServiceHasBasePrice.create(props.hasBasePrice), "f");
|
|
83
|
-
__classPrivateFieldSet(this, _Service_basePricePercentage, ServiceBasePricePercentage_1.ServiceBasePricePercentage.create(props.basePricePercentage), "f");
|
|
84
|
-
__classPrivateFieldSet(this, _Service_hasFixedPrice, ServiceHasFixedPrice_1.ServiceHasFixedPrice.create(props.hasFixedPrice), "f");
|
|
85
|
-
__classPrivateFieldSet(this, _Service_fixedPriceAmount, ServiceFixedPriceAmount_1.ServiceFixedPriceAmount.create(props.fixedPriceAmount), "f");
|
|
86
|
-
__classPrivateFieldSet(this, _Service_expertDedicationLevel, ServiceExpertDedicationLevel_1.ServiceExpertDedicationLevel.create(props.expertDedicationLevel), "f");
|
|
87
|
-
__classPrivateFieldSet(this, _Service_reportTypes, ServiceReportTypes_1.ServiceReportTypes.create(props.reportTypes), "f");
|
|
88
|
-
__classPrivateFieldSet(this, _Service_additionalUserRoles, ServiceAdditionalUserRoles_1.ServiceAdditionalUserRoles.create(props.additionalUserRoles), "f");
|
|
89
|
-
__classPrivateFieldSet(this, _Service_maxUsers, ServiceMaxUsers_1.ServiceMaxUsers.create(props.maxUsers), "f");
|
|
90
|
-
__classPrivateFieldSet(this, _Service_allowsDocumentReading, ServiceAllowsDocumentReading_1.ServiceAllowsDocumentReading.create(props.allowsDocumentReading), "f");
|
|
91
|
-
__classPrivateFieldSet(this, _Service_allowsSectoralComparison, ServiceAllowsSectoralComparison_1.ServiceAllowsSectoralComparison.create(props.allowsSectoralComparison), "f");
|
|
92
|
-
__classPrivateFieldSet(this, _Service_includesCarbonBoxAcademy, ServiceIncludesCarbonBoxAcademy_1.ServiceIncludesCarbonBoxAcademy.create(props.includesCarbonBoxAcademy), "f");
|
|
93
|
-
__classPrivateFieldSet(this, _Service_includesESGIndicators, ServiceIncludesESGIndicators_1.ServiceIncludesESGIndicators.create(props.includesESGIndicators), "f");
|
|
94
|
-
__classPrivateFieldSet(this, _Service_isAvailableForCorporate, ServiceIsAvailableForCorporate_1.ServiceIsAvailableForCorporate.create(props.isAvailableForCorporate), "f");
|
|
95
|
-
__classPrivateFieldSet(this, _Service_isAvailableForProduct, ServiceIsAvailableForProduct_1.ServiceIsAvailableForProduct.create(props.isAvailableForProduct), "f");
|
|
96
|
-
__classPrivateFieldSet(this, _Service_isAvailableForEvent, ServiceIsAvailableForEvent_1.ServiceIsAvailableForEvent.create(props.isAvailableForEvent), "f");
|
|
97
|
-
__classPrivateFieldSet(this, _Service_createdByStakeholder, ServiceCreatedByStakeholder_1.ServiceCreatedByStakeholder.create(props.createdByStakeholder), "f");
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
// Initialize from primitives (no domain validation)
|
|
101
|
-
__classPrivateFieldSet(this, _Service_code, ServiceCode_1.ServiceCode.fromPrimitives(props.code), "f");
|
|
102
|
-
__classPrivateFieldSet(this, _Service_name, ServiceName_1.ServiceName.fromPrimitives(props.name), "f");
|
|
103
|
-
__classPrivateFieldSet(this, _Service_description, ServiceDescription_1.ServiceDescription.fromPrimitives(props.description), "f");
|
|
104
|
-
__classPrivateFieldSet(this, _Service_type, ServiceType_1.ServiceType.fromPrimitives(props.type), "f");
|
|
105
|
-
__classPrivateFieldSet(this, _Service_category, ServiceCategory_1.ServiceCategory.fromPrimitives(props.category), "f");
|
|
106
|
-
__classPrivateFieldSet(this, _Service_status, ServiceStatus_1.ServiceStatus.fromPrimitives(props.status), "f");
|
|
107
|
-
__classPrivateFieldSet(this, _Service_isRequiredService, ServiceIsRequiredService_1.ServiceIsRequiredService.fromPrimitives(props.isRequiredService), "f");
|
|
108
|
-
__classPrivateFieldSet(this, _Service_dependsOnServiceCode, ServiceDependsOnServiceCode_1.ServiceDependsOnServiceCode.fromPrimitives(props.dependsOnServiceCode), "f");
|
|
109
|
-
__classPrivateFieldSet(this, _Service_hasBasePrice, ServiceHasBasePrice_1.ServiceHasBasePrice.fromPrimitives(props.hasBasePrice), "f");
|
|
110
|
-
__classPrivateFieldSet(this, _Service_basePricePercentage, ServiceBasePricePercentage_1.ServiceBasePricePercentage.fromPrimitives(props.basePricePercentage), "f");
|
|
111
|
-
__classPrivateFieldSet(this, _Service_hasFixedPrice, ServiceHasFixedPrice_1.ServiceHasFixedPrice.fromPrimitives(props.hasFixedPrice), "f");
|
|
112
|
-
__classPrivateFieldSet(this, _Service_fixedPriceAmount, ServiceFixedPriceAmount_1.ServiceFixedPriceAmount.fromPrimitives(props.fixedPriceAmount), "f");
|
|
113
|
-
__classPrivateFieldSet(this, _Service_expertDedicationLevel, ServiceExpertDedicationLevel_1.ServiceExpertDedicationLevel.fromPrimitives(props.expertDedicationLevel), "f");
|
|
114
|
-
__classPrivateFieldSet(this, _Service_reportTypes, ServiceReportTypes_1.ServiceReportTypes.fromPrimitives(props.reportTypes), "f");
|
|
115
|
-
__classPrivateFieldSet(this, _Service_additionalUserRoles, ServiceAdditionalUserRoles_1.ServiceAdditionalUserRoles.fromPrimitives(props.additionalUserRoles), "f");
|
|
116
|
-
__classPrivateFieldSet(this, _Service_maxUsers, ServiceMaxUsers_1.ServiceMaxUsers.fromPrimitives(props.maxUsers), "f");
|
|
117
|
-
__classPrivateFieldSet(this, _Service_allowsDocumentReading, ServiceAllowsDocumentReading_1.ServiceAllowsDocumentReading.fromPrimitives(props.allowsDocumentReading), "f");
|
|
118
|
-
__classPrivateFieldSet(this, _Service_allowsSectoralComparison, ServiceAllowsSectoralComparison_1.ServiceAllowsSectoralComparison.fromPrimitives(props.allowsSectoralComparison), "f");
|
|
119
|
-
__classPrivateFieldSet(this, _Service_includesCarbonBoxAcademy, ServiceIncludesCarbonBoxAcademy_1.ServiceIncludesCarbonBoxAcademy.fromPrimitives(props.includesCarbonBoxAcademy), "f");
|
|
120
|
-
__classPrivateFieldSet(this, _Service_includesESGIndicators, ServiceIncludesESGIndicators_1.ServiceIncludesESGIndicators.fromPrimitives(props.includesESGIndicators), "f");
|
|
121
|
-
__classPrivateFieldSet(this, _Service_isAvailableForCorporate, ServiceIsAvailableForCorporate_1.ServiceIsAvailableForCorporate.fromPrimitives(props.isAvailableForCorporate), "f");
|
|
122
|
-
__classPrivateFieldSet(this, _Service_isAvailableForProduct, ServiceIsAvailableForProduct_1.ServiceIsAvailableForProduct.fromPrimitives(props.isAvailableForProduct), "f");
|
|
123
|
-
__classPrivateFieldSet(this, _Service_isAvailableForEvent, ServiceIsAvailableForEvent_1.ServiceIsAvailableForEvent.fromPrimitives(props.isAvailableForEvent), "f");
|
|
124
|
-
__classPrivateFieldSet(this, _Service_createdByStakeholder, ServiceCreatedByStakeholder_1.ServiceCreatedByStakeholder.fromPrimitives(props.createdByStakeholder), "f");
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
static create(props) {
|
|
128
|
-
return new Service(props, false);
|
|
129
|
-
}
|
|
130
|
-
static fromPrimitives(primitives) {
|
|
131
|
-
const props = {
|
|
132
|
-
id: primitives.id,
|
|
133
|
-
code: primitives.code,
|
|
134
|
-
name: primitives.name,
|
|
135
|
-
description: primitives.description,
|
|
136
|
-
type: primitives.type,
|
|
137
|
-
category: primitives.category,
|
|
138
|
-
status: primitives.status,
|
|
139
|
-
isRequiredService: primitives.isRequiredService,
|
|
140
|
-
dependsOnServiceCode: primitives.dependsOnServiceCode,
|
|
141
|
-
hasBasePrice: primitives.hasBasePrice,
|
|
142
|
-
basePricePercentage: primitives.basePricePercentage,
|
|
143
|
-
hasFixedPrice: primitives.hasFixedPrice,
|
|
144
|
-
fixedPriceAmount: primitives.fixedPriceAmount,
|
|
145
|
-
expertDedicationLevel: primitives.expertDedicationLevel,
|
|
146
|
-
reportTypes: primitives.reportTypes,
|
|
147
|
-
additionalUserRoles: primitives.additionalUserRoles,
|
|
148
|
-
maxUsers: primitives.maxUsers,
|
|
149
|
-
allowsDocumentReading: primitives.allowsDocumentReading,
|
|
150
|
-
allowsSectoralComparison: primitives.allowsSectoralComparison,
|
|
151
|
-
includesCarbonBoxAcademy: primitives.includesCarbonBoxAcademy,
|
|
152
|
-
includesESGIndicators: primitives.includesESGIndicators,
|
|
153
|
-
isAvailableForCorporate: primitives.isAvailableForCorporate,
|
|
154
|
-
isAvailableForProduct: primitives.isAvailableForProduct,
|
|
155
|
-
isAvailableForEvent: primitives.isAvailableForEvent,
|
|
156
|
-
createdByStakeholder: primitives.createdByStakeholder,
|
|
157
|
-
};
|
|
158
|
-
return new Service(props, true);
|
|
159
|
-
}
|
|
160
|
-
get toPrimitives() {
|
|
161
|
-
return {
|
|
162
|
-
id: this.id.toPrimitives(),
|
|
163
|
-
code: __classPrivateFieldGet(this, _Service_code, "f").toPrimitives(),
|
|
164
|
-
name: __classPrivateFieldGet(this, _Service_name, "f").toPrimitives(),
|
|
165
|
-
description: __classPrivateFieldGet(this, _Service_description, "f").toPrimitives(),
|
|
166
|
-
type: __classPrivateFieldGet(this, _Service_type, "f").toEnum(),
|
|
167
|
-
category: __classPrivateFieldGet(this, _Service_category, "f").toEnum(),
|
|
168
|
-
status: __classPrivateFieldGet(this, _Service_status, "f").toEnum(),
|
|
169
|
-
isRequiredService: __classPrivateFieldGet(this, _Service_isRequiredService, "f").toPrimitives(),
|
|
170
|
-
dependsOnServiceCode: __classPrivateFieldGet(this, _Service_dependsOnServiceCode, "f").toPrimitives(),
|
|
171
|
-
hasBasePrice: __classPrivateFieldGet(this, _Service_hasBasePrice, "f").toPrimitives(),
|
|
172
|
-
basePricePercentage: __classPrivateFieldGet(this, _Service_basePricePercentage, "f").toPrimitives(),
|
|
173
|
-
hasFixedPrice: __classPrivateFieldGet(this, _Service_hasFixedPrice, "f").toPrimitives(),
|
|
174
|
-
fixedPriceAmount: __classPrivateFieldGet(this, _Service_fixedPriceAmount, "f").toPrimitives(),
|
|
175
|
-
expertDedicationLevel: __classPrivateFieldGet(this, _Service_expertDedicationLevel, "f").toEnum(),
|
|
176
|
-
reportTypes: __classPrivateFieldGet(this, _Service_reportTypes, "f").toEnums(),
|
|
177
|
-
additionalUserRoles: __classPrivateFieldGet(this, _Service_additionalUserRoles, "f").toEnums(),
|
|
178
|
-
maxUsers: __classPrivateFieldGet(this, _Service_maxUsers, "f").toPrimitives(),
|
|
179
|
-
allowsDocumentReading: __classPrivateFieldGet(this, _Service_allowsDocumentReading, "f").toPrimitives(),
|
|
180
|
-
allowsSectoralComparison: __classPrivateFieldGet(this, _Service_allowsSectoralComparison, "f").toPrimitives(),
|
|
181
|
-
includesCarbonBoxAcademy: __classPrivateFieldGet(this, _Service_includesCarbonBoxAcademy, "f").toPrimitives(),
|
|
182
|
-
includesESGIndicators: __classPrivateFieldGet(this, _Service_includesESGIndicators, "f").toPrimitives(),
|
|
183
|
-
isAvailableForCorporate: __classPrivateFieldGet(this, _Service_isAvailableForCorporate, "f").toPrimitives(),
|
|
184
|
-
isAvailableForProduct: __classPrivateFieldGet(this, _Service_isAvailableForProduct, "f").toPrimitives(),
|
|
185
|
-
isAvailableForEvent: __classPrivateFieldGet(this, _Service_isAvailableForEvent, "f").toPrimitives(),
|
|
186
|
-
createdByStakeholder: __classPrivateFieldGet(this, _Service_createdByStakeholder, "f").toPrimitives(),
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
get code() {
|
|
190
|
-
return __classPrivateFieldGet(this, _Service_code, "f");
|
|
191
|
-
}
|
|
192
|
-
get name() {
|
|
193
|
-
return __classPrivateFieldGet(this, _Service_name, "f");
|
|
194
|
-
}
|
|
195
|
-
get description() {
|
|
196
|
-
return __classPrivateFieldGet(this, _Service_description, "f");
|
|
197
|
-
}
|
|
198
|
-
get type() {
|
|
199
|
-
return __classPrivateFieldGet(this, _Service_type, "f");
|
|
200
|
-
}
|
|
201
|
-
get category() {
|
|
202
|
-
return __classPrivateFieldGet(this, _Service_category, "f");
|
|
203
|
-
}
|
|
204
|
-
get status() {
|
|
205
|
-
return __classPrivateFieldGet(this, _Service_status, "f");
|
|
206
|
-
}
|
|
207
|
-
get isRequiredService() {
|
|
208
|
-
return __classPrivateFieldGet(this, _Service_isRequiredService, "f");
|
|
209
|
-
}
|
|
210
|
-
get dependsOnServiceCode() {
|
|
211
|
-
return __classPrivateFieldGet(this, _Service_dependsOnServiceCode, "f");
|
|
212
|
-
}
|
|
213
|
-
get hasBasePrice() {
|
|
214
|
-
return __classPrivateFieldGet(this, _Service_hasBasePrice, "f");
|
|
215
|
-
}
|
|
216
|
-
get basePricePercentage() {
|
|
217
|
-
return __classPrivateFieldGet(this, _Service_basePricePercentage, "f");
|
|
218
|
-
}
|
|
219
|
-
get hasFixedPrice() {
|
|
220
|
-
return __classPrivateFieldGet(this, _Service_hasFixedPrice, "f");
|
|
221
|
-
}
|
|
222
|
-
get fixedPriceAmount() {
|
|
223
|
-
return __classPrivateFieldGet(this, _Service_fixedPriceAmount, "f");
|
|
224
|
-
}
|
|
225
|
-
get expertDedicationLevel() {
|
|
226
|
-
return __classPrivateFieldGet(this, _Service_expertDedicationLevel, "f");
|
|
227
|
-
}
|
|
228
|
-
get reportTypes() {
|
|
229
|
-
return __classPrivateFieldGet(this, _Service_reportTypes, "f");
|
|
230
|
-
}
|
|
231
|
-
get additionalUserRoles() {
|
|
232
|
-
return __classPrivateFieldGet(this, _Service_additionalUserRoles, "f");
|
|
233
|
-
}
|
|
234
|
-
get maxUsers() {
|
|
235
|
-
return __classPrivateFieldGet(this, _Service_maxUsers, "f");
|
|
236
|
-
}
|
|
237
|
-
get allowsDocumentReading() {
|
|
238
|
-
return __classPrivateFieldGet(this, _Service_allowsDocumentReading, "f");
|
|
239
|
-
}
|
|
240
|
-
get allowsSectoralComparison() {
|
|
241
|
-
return __classPrivateFieldGet(this, _Service_allowsSectoralComparison, "f");
|
|
242
|
-
}
|
|
243
|
-
get includesCarbonBoxAcademy() {
|
|
244
|
-
return __classPrivateFieldGet(this, _Service_includesCarbonBoxAcademy, "f");
|
|
245
|
-
}
|
|
246
|
-
get includesESGIndicators() {
|
|
247
|
-
return __classPrivateFieldGet(this, _Service_includesESGIndicators, "f");
|
|
248
|
-
}
|
|
249
|
-
get isAvailableForCorporate() {
|
|
250
|
-
return __classPrivateFieldGet(this, _Service_isAvailableForCorporate, "f");
|
|
251
|
-
}
|
|
252
|
-
get isAvailableForProduct() {
|
|
253
|
-
return __classPrivateFieldGet(this, _Service_isAvailableForProduct, "f");
|
|
254
|
-
}
|
|
255
|
-
get isAvailableForEvent() {
|
|
256
|
-
return __classPrivateFieldGet(this, _Service_isAvailableForEvent, "f");
|
|
257
|
-
}
|
|
258
|
-
get createdByStakeholder() {
|
|
259
|
-
return __classPrivateFieldGet(this, _Service_createdByStakeholder, "f");
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
exports.Service = Service;
|
|
263
|
-
_Service_code = new WeakMap(), _Service_name = new WeakMap(), _Service_description = new WeakMap(), _Service_type = new WeakMap(), _Service_category = new WeakMap(), _Service_status = new WeakMap(), _Service_isRequiredService = new WeakMap(), _Service_dependsOnServiceCode = new WeakMap(), _Service_hasBasePrice = new WeakMap(), _Service_basePricePercentage = new WeakMap(), _Service_hasFixedPrice = new WeakMap(), _Service_fixedPriceAmount = new WeakMap(), _Service_expertDedicationLevel = new WeakMap(), _Service_reportTypes = new WeakMap(), _Service_additionalUserRoles = new WeakMap(), _Service_maxUsers = new WeakMap(), _Service_allowsDocumentReading = new WeakMap(), _Service_allowsSectoralComparison = new WeakMap(), _Service_includesCarbonBoxAcademy = new WeakMap(), _Service_includesESGIndicators = new WeakMap(), _Service_isAvailableForCorporate = new WeakMap(), _Service_isAvailableForProduct = new WeakMap(), _Service_isAvailableForEvent = new WeakMap(), _Service_createdByStakeholder = new WeakMap();
|
package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCategory.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceCategory = void 0;
|
|
4
|
-
var ServiceCategory;
|
|
5
|
-
(function (ServiceCategory) {
|
|
6
|
-
ServiceCategory["CORPORATE_FOOTPRINT"] = "CORPORATE_FOOTPRINT";
|
|
7
|
-
ServiceCategory["PRODUCT_FOOTPRINT"] = "PRODUCT_FOOTPRINT";
|
|
8
|
-
ServiceCategory["EVENT_FOOTPRINT"] = "EVENT_FOOTPRINT";
|
|
9
|
-
ServiceCategory["EXPERT_SUPPORT"] = "EXPERT_SUPPORT";
|
|
10
|
-
ServiceCategory["TRAINING"] = "TRAINING";
|
|
11
|
-
ServiceCategory["AUDIT_SUPPORT"] = "AUDIT_SUPPORT";
|
|
12
|
-
ServiceCategory["DATA_VALIDATION"] = "DATA_VALIDATION";
|
|
13
|
-
ServiceCategory["REPORTING"] = "REPORTING";
|
|
14
|
-
ServiceCategory["DOCUMENT_READING"] = "DOCUMENT_READING";
|
|
15
|
-
ServiceCategory["SECTORAL_COMPARISON"] = "SECTORAL_COMPARISON";
|
|
16
|
-
ServiceCategory["ADDITIONAL_USERS"] = "ADDITIONAL_USERS";
|
|
17
|
-
ServiceCategory["CARBONBOX_ACADEMY"] = "CARBONBOX_ACADEMY";
|
|
18
|
-
ServiceCategory["ESG_INDICATORS"] = "ESG_INDICATORS";
|
|
19
|
-
ServiceCategory["CARBON_OFFSETTING"] = "CARBON_OFFSETTING";
|
|
20
|
-
})(ServiceCategory || (exports.ServiceCategory = ServiceCategory = {}));
|
package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceStatus.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceStatus = void 0;
|
|
4
|
-
var ServiceStatus;
|
|
5
|
-
(function (ServiceStatus) {
|
|
6
|
-
ServiceStatus["ACTIVE"] = "ACTIVE";
|
|
7
|
-
ServiceStatus["INACTIVE"] = "INACTIVE";
|
|
8
|
-
ServiceStatus["DISCONTINUED"] = "DISCONTINUED";
|
|
9
|
-
})(ServiceStatus || (exports.ServiceStatus = ServiceStatus = {}));
|
package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceType.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceType = void 0;
|
|
4
|
-
var ServiceType;
|
|
5
|
-
(function (ServiceType) {
|
|
6
|
-
ServiceType["BASE_SERVICE"] = "BASE_SERVICE";
|
|
7
|
-
ServiceType["ADDITIONAL_SERVICE"] = "ADDITIONAL_SERVICE";
|
|
8
|
-
ServiceType["PLATFORM_FEATURE"] = "PLATFORM_FEATURE";
|
|
9
|
-
ServiceType["DEPENDENT_SERVICE"] = "DEPENDENT_SERVICE";
|
|
10
|
-
})(ServiceType || (exports.ServiceType = ServiceType = {}));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvalidServiceCategoryError = void 0;
|
|
4
|
-
const RootError_1 = require("../../../../shared/domain/exceptions/RootError");
|
|
5
|
-
class InvalidServiceCategoryError extends RootError_1.RootError {
|
|
6
|
-
constructor(receivedValue, validCategories) {
|
|
7
|
-
const validCategoriesList = validCategories.join(', ');
|
|
8
|
-
const message = `Invalid service category value '${receivedValue}': must be one of ${validCategoriesList}.`;
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = 'InvalidServiceCategoryError';
|
|
11
|
-
}
|
|
12
|
-
static create(receivedValue, validCategories) {
|
|
13
|
-
return new InvalidServiceCategoryError(receivedValue, validCategories);
|
|
14
|
-
}
|
|
15
|
-
logError() {
|
|
16
|
-
return `${this.name}: ${this.message}`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.InvalidServiceCategoryError = InvalidServiceCategoryError;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvalidServiceStatusError = void 0;
|
|
4
|
-
const RootError_1 = require("../../../../shared/domain/exceptions/RootError");
|
|
5
|
-
class InvalidServiceStatusError extends RootError_1.RootError {
|
|
6
|
-
constructor(receivedValue, validStatuses) {
|
|
7
|
-
const validStatusesList = validStatuses.join(', ');
|
|
8
|
-
const message = `Invalid service status value '${receivedValue}': must be one of ${validStatusesList}.`;
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = 'InvalidServiceStatusError';
|
|
11
|
-
}
|
|
12
|
-
static create(receivedValue, validStatuses) {
|
|
13
|
-
return new InvalidServiceStatusError(receivedValue, validStatuses);
|
|
14
|
-
}
|
|
15
|
-
logError() {
|
|
16
|
-
return `${this.name}: ${this.message}`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.InvalidServiceStatusError = InvalidServiceStatusError;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvalidServiceTypeError = void 0;
|
|
4
|
-
const RootError_1 = require("../../../../shared/domain/exceptions/RootError");
|
|
5
|
-
class InvalidServiceTypeError extends RootError_1.RootError {
|
|
6
|
-
constructor(receivedValue, validTypes) {
|
|
7
|
-
const validTypesList = validTypes.join(', ');
|
|
8
|
-
const message = `Invalid service type value '${receivedValue}': must be one of ${validTypesList}.`;
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = 'InvalidServiceTypeError';
|
|
11
|
-
}
|
|
12
|
-
static create(receivedValue, validTypes) {
|
|
13
|
-
return new InvalidServiceTypeError(receivedValue, validTypes);
|
|
14
|
-
}
|
|
15
|
-
logError() {
|
|
16
|
-
return `${this.name}: ${this.message}`;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.InvalidServiceTypeError = InvalidServiceTypeError;
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceAdditionalUserRoles = void 0;
|
|
4
|
-
const StringList_1 = require("../../../../shared/domain/value-objects/StringList");
|
|
5
|
-
const UserRole_1 = require("../enums/UserRole");
|
|
6
|
-
const InvalidUserRoleError_1 = require("../exceptions/InvalidUserRoleError");
|
|
7
|
-
class ServiceAdditionalUserRoles extends StringList_1.StringList {
|
|
8
|
-
constructor(roles, skipDomainValidation) {
|
|
9
|
-
super(roles, skipDomainValidation, ServiceAdditionalUserRoles.PROPERTY_NAME, { allowEmpty: true });
|
|
10
|
-
if (skipDomainValidation === false) {
|
|
11
|
-
this.validateUserRoles(roles);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
static create(roles) {
|
|
15
|
-
StringList_1.StringList.guardAgainstInvalidStringList(roles, ServiceAdditionalUserRoles.PROPERTY_NAME);
|
|
16
|
-
return new ServiceAdditionalUserRoles(roles, false);
|
|
17
|
-
}
|
|
18
|
-
static fromPrimitives(primitives) {
|
|
19
|
-
const value = primitives.map((primitive) => primitive);
|
|
20
|
-
return new ServiceAdditionalUserRoles(value, true);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Valida que todos los roles sean roles de usuario válidos.
|
|
24
|
-
*/
|
|
25
|
-
validateUserRoles(roles) {
|
|
26
|
-
for (const role of roles) {
|
|
27
|
-
if (!ServiceAdditionalUserRoles.VALID_USER_ROLES.includes(role)) {
|
|
28
|
-
throw InvalidUserRoleError_1.InvalidUserRoleError.create(role, ServiceAdditionalUserRoles.VALID_USER_ROLES);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Verifica si contiene el rol de SUPPLIER.
|
|
34
|
-
*/
|
|
35
|
-
hasSupplierRole() {
|
|
36
|
-
return this.value.includes(UserRole_1.UserRole.SUPPLIER);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Verifica si contiene el rol de OBSERVER.
|
|
40
|
-
*/
|
|
41
|
-
hasObserverRole() {
|
|
42
|
-
return this.value.includes(UserRole_1.UserRole.OBSERVER);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Verifica si contiene el rol de AUDITOR.
|
|
46
|
-
*/
|
|
47
|
-
hasAuditorRole() {
|
|
48
|
-
return this.value.includes(UserRole_1.UserRole.AUDITOR);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Obtiene los roles válidos de usuario.
|
|
52
|
-
*/
|
|
53
|
-
static getValidUserRoles() {
|
|
54
|
-
return Object.freeze([...ServiceAdditionalUserRoles.VALID_USER_ROLES]);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Verifica si un valor es un rol de usuario válido.
|
|
58
|
-
*/
|
|
59
|
-
static isValidUserRole(role) {
|
|
60
|
-
return ServiceAdditionalUserRoles.VALID_USER_ROLES.includes(role);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Agrega un nuevo rol si no está ya presente.
|
|
64
|
-
*/
|
|
65
|
-
addRole(role) {
|
|
66
|
-
if (this.value.includes(role)) {
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
const newRoles = [...this.value, role];
|
|
70
|
-
return new ServiceAdditionalUserRoles(newRoles, false);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Remueve un rol específico.
|
|
74
|
-
*/
|
|
75
|
-
removeRole(role) {
|
|
76
|
-
const newRoles = this.value.filter((r) => r !== role);
|
|
77
|
-
return new ServiceAdditionalUserRoles(newRoles, false);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Verifica si tiene al menos un rol de auditoría (AUDITOR o OBSERVER).
|
|
81
|
-
*/
|
|
82
|
-
hasAuditRole() {
|
|
83
|
-
return this.hasAuditorRole() || this.hasObserverRole();
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Verifica si tiene roles operacionales (SUPPLIER).
|
|
87
|
-
*/
|
|
88
|
-
hasOperationalRole() {
|
|
89
|
-
return this.hasSupplierRole();
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Obtiene el número de roles únicos.
|
|
93
|
-
*/
|
|
94
|
-
getRoleCount() {
|
|
95
|
-
return this.value.length;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Verifica si está vacío (sin roles adicionales).
|
|
99
|
-
*/
|
|
100
|
-
isEmpty() {
|
|
101
|
-
return this.value.length === 0;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Convierte los roles a enum para uso tipado.
|
|
105
|
-
*/
|
|
106
|
-
toEnums() {
|
|
107
|
-
return this.value;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Obtiene una descripción de los roles para debugging.
|
|
111
|
-
*/
|
|
112
|
-
getDescription() {
|
|
113
|
-
if (this.isEmpty()) {
|
|
114
|
-
return 'No additional user roles assigned';
|
|
115
|
-
}
|
|
116
|
-
return `Additional roles: ${this.value.join(', ')}`;
|
|
117
|
-
}
|
|
118
|
-
toPrimitives() {
|
|
119
|
-
return this.value;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Representación como string descriptiva.
|
|
123
|
-
*/
|
|
124
|
-
toString() {
|
|
125
|
-
return this.value.join(', ') || 'No additional roles';
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.ServiceAdditionalUserRoles = ServiceAdditionalUserRoles;
|
|
129
|
-
ServiceAdditionalUserRoles.PROPERTY_NAME = 'additionalUserRoles';
|
|
130
|
-
// Roles de usuario válidos
|
|
131
|
-
ServiceAdditionalUserRoles.VALID_USER_ROLES = Object.values(UserRole_1.UserRole);
|