@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
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceStatus = void 0;
|
|
4
|
-
const String_1 = require("../../../../shared/domain/value-objects/String");
|
|
5
|
-
const ServiceStatus_1 = require("../enums/ServiceStatus");
|
|
6
|
-
const InvalidServiceStatusError_1 = require("../exceptions/InvalidServiceStatusError");
|
|
7
|
-
class ServiceStatus extends String_1.String {
|
|
8
|
-
constructor(value, skipDomainValidation) {
|
|
9
|
-
super(value, skipDomainValidation, ServiceStatus.PROPERTY_NAME);
|
|
10
|
-
if (skipDomainValidation === false) {
|
|
11
|
-
this.validateServiceStatus(value);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
static create(value) {
|
|
15
|
-
String_1.String.guardAgainstEmptyValue(value, ServiceStatus.PROPERTY_NAME);
|
|
16
|
-
String_1.String.guardAgainstInvalidType(value, ServiceStatus.PROPERTY_NAME);
|
|
17
|
-
return new ServiceStatus(value, false);
|
|
18
|
-
}
|
|
19
|
-
static fromPrimitives(primitive) {
|
|
20
|
-
const value = primitive;
|
|
21
|
-
return new ServiceStatus(value, true);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Valida que el valor sea un estado de servicio válido.
|
|
25
|
-
*/
|
|
26
|
-
validateServiceStatus(value) {
|
|
27
|
-
if (!ServiceStatus.VALID_SERVICE_STATUSES.includes(value)) {
|
|
28
|
-
throw InvalidServiceStatusError_1.InvalidServiceStatusError.create(value, ServiceStatus.VALID_SERVICE_STATUSES);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Verifica si el servicio está activo.
|
|
33
|
-
*/
|
|
34
|
-
isActive() {
|
|
35
|
-
return this.value === ServiceStatus_1.ServiceStatus.ACTIVE;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Verifica si el servicio está inactivo.
|
|
39
|
-
*/
|
|
40
|
-
isInactive() {
|
|
41
|
-
return this.value === ServiceStatus_1.ServiceStatus.INACTIVE;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Verifica si el servicio está descontinuado.
|
|
45
|
-
*/
|
|
46
|
-
isDiscontinued() {
|
|
47
|
-
return this.value === ServiceStatus_1.ServiceStatus.DISCONTINUED;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Verifica si el servicio está disponible para uso (activo).
|
|
51
|
-
*/
|
|
52
|
-
isAvailable() {
|
|
53
|
-
return this.isActive();
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Verifica si el servicio no está disponible (inactivo o descontinuado).
|
|
57
|
-
*/
|
|
58
|
-
isUnavailable() {
|
|
59
|
-
return this.isInactive() || this.isDiscontinued();
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Verifica si es un estado temporal (inactivo).
|
|
63
|
-
*/
|
|
64
|
-
isTemporaryStatus() {
|
|
65
|
-
return this.isInactive();
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Verifica si es un estado permanente (activo o descontinuado).
|
|
69
|
-
*/
|
|
70
|
-
isPermanentStatus() {
|
|
71
|
-
return this.isActive() || this.isDiscontinued();
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Verifica si el servicio puede ser reactivado.
|
|
75
|
-
*/
|
|
76
|
-
canBeReactivated() {
|
|
77
|
-
// Los servicios inactivos pueden ser reactivados, los descontinuados no
|
|
78
|
-
return this.isInactive();
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Verifica si el servicio puede ser contratado.
|
|
82
|
-
*/
|
|
83
|
-
canBeContracted() {
|
|
84
|
-
return this.isActive();
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Verifica si requiere migración (descontinuado).
|
|
88
|
-
*/
|
|
89
|
-
requiresMigration() {
|
|
90
|
-
return this.isDiscontinued();
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Obtiene los estados de servicio válidos.
|
|
94
|
-
*/
|
|
95
|
-
static getValidServiceStatuses() {
|
|
96
|
-
return Object.freeze([...ServiceStatus.VALID_SERVICE_STATUSES]);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Verifica si un valor es un estado de servicio válido.
|
|
100
|
-
*/
|
|
101
|
-
static isValidServiceStatus(value) {
|
|
102
|
-
return ServiceStatus.VALID_SERVICE_STATUSES.includes(value);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Obtiene la descripción del estado del servicio.
|
|
106
|
-
*/
|
|
107
|
-
getDescription() {
|
|
108
|
-
const descriptions = {
|
|
109
|
-
[ServiceStatus_1.ServiceStatus.ACTIVE]: 'Servicio activo y disponible para contratación',
|
|
110
|
-
[ServiceStatus_1.ServiceStatus.INACTIVE]: 'Servicio temporalmente inactivo, no disponible para nuevas contrataciones',
|
|
111
|
-
[ServiceStatus_1.ServiceStatus.DISCONTINUED]: 'Servicio descontinuado permanentemente, requiere migración',
|
|
112
|
-
};
|
|
113
|
-
return descriptions[this.value] || this.value;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Obtiene el impacto del estado en el negocio.
|
|
117
|
-
*/
|
|
118
|
-
getBusinessImpact() {
|
|
119
|
-
const impacts = {
|
|
120
|
-
[ServiceStatus_1.ServiceStatus.ACTIVE]: 'Generación de ingresos activa',
|
|
121
|
-
[ServiceStatus_1.ServiceStatus.INACTIVE]: 'Pérdida temporal de ingresos',
|
|
122
|
-
[ServiceStatus_1.ServiceStatus.DISCONTINUED]: 'Fin del ciclo de vida del producto',
|
|
123
|
-
};
|
|
124
|
-
return impacts[this.value] || 'Impacto desconocido';
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Obtiene las acciones recomendadas según el estado.
|
|
128
|
-
*/
|
|
129
|
-
getRecommendedActions() {
|
|
130
|
-
const actions = {
|
|
131
|
-
[ServiceStatus_1.ServiceStatus.ACTIVE]: [
|
|
132
|
-
'Monitorear rendimiento del servicio',
|
|
133
|
-
'Mantener calidad del servicio',
|
|
134
|
-
'Promocionar activamente',
|
|
135
|
-
],
|
|
136
|
-
[ServiceStatus_1.ServiceStatus.INACTIVE]: [
|
|
137
|
-
'Evaluar razones de inactividad',
|
|
138
|
-
'Planificar reactivación si es viable',
|
|
139
|
-
'Comunicar estado a clientes existentes',
|
|
140
|
-
],
|
|
141
|
-
[ServiceStatus_1.ServiceStatus.DISCONTINUED]: [
|
|
142
|
-
'Planificar migración de clientes existentes',
|
|
143
|
-
'Comunicar timeline de descontinuación',
|
|
144
|
-
'Ofrecer alternativas equivalentes',
|
|
145
|
-
],
|
|
146
|
-
};
|
|
147
|
-
return actions[this.value] || [];
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Obtiene el nivel de prioridad de atención.
|
|
151
|
-
*/
|
|
152
|
-
getPriorityLevel() {
|
|
153
|
-
const priorities = {
|
|
154
|
-
[ServiceStatus_1.ServiceStatus.ACTIVE]: 'high',
|
|
155
|
-
[ServiceStatus_1.ServiceStatus.INACTIVE]: 'medium',
|
|
156
|
-
[ServiceStatus_1.ServiceStatus.DISCONTINUED]: 'low',
|
|
157
|
-
};
|
|
158
|
-
return priorities[this.value] || 'medium';
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Verifica si el estado permite actualizaciones del servicio.
|
|
162
|
-
*/
|
|
163
|
-
allowsServiceUpdates() {
|
|
164
|
-
// Solo servicios activos e inactivos permiten actualizaciones
|
|
165
|
-
return this.isActive() || this.isInactive();
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Obtiene las características del estado del servicio.
|
|
169
|
-
*/
|
|
170
|
-
getCharacteristics() {
|
|
171
|
-
return {
|
|
172
|
-
isAvailable: this.isAvailable(),
|
|
173
|
-
isTemporary: this.isTemporaryStatus(),
|
|
174
|
-
canBeReactivated: this.canBeReactivated(),
|
|
175
|
-
canBeContracted: this.canBeContracted(),
|
|
176
|
-
requiresMigration: this.requiresMigration(),
|
|
177
|
-
allowsUpdates: this.allowsServiceUpdates(),
|
|
178
|
-
priorityLevel: this.getPriorityLevel(),
|
|
179
|
-
businessImpact: this.getBusinessImpact(),
|
|
180
|
-
recommendedActions: this.getRecommendedActions(),
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Obtiene los estados de transición válidos desde el estado actual.
|
|
185
|
-
*/
|
|
186
|
-
getValidTransitions() {
|
|
187
|
-
const transitions = {
|
|
188
|
-
[ServiceStatus_1.ServiceStatus.ACTIVE]: [ServiceStatus_1.ServiceStatus.INACTIVE, ServiceStatus_1.ServiceStatus.DISCONTINUED],
|
|
189
|
-
[ServiceStatus_1.ServiceStatus.INACTIVE]: [ServiceStatus_1.ServiceStatus.ACTIVE, ServiceStatus_1.ServiceStatus.DISCONTINUED],
|
|
190
|
-
[ServiceStatus_1.ServiceStatus.DISCONTINUED]: [], // No hay transiciones desde descontinuado
|
|
191
|
-
};
|
|
192
|
-
return transitions[this.value] || [];
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Verifica si puede transicionar a un estado específico.
|
|
196
|
-
*/
|
|
197
|
-
canTransitionTo(targetStatus) {
|
|
198
|
-
return this.getValidTransitions().includes(targetStatus);
|
|
199
|
-
}
|
|
200
|
-
toPrimitives() {
|
|
201
|
-
return this.value;
|
|
202
|
-
}
|
|
203
|
-
toEnum() {
|
|
204
|
-
return this.value;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Representación como string descriptiva.
|
|
208
|
-
*/
|
|
209
|
-
toString() {
|
|
210
|
-
const statusNames = {
|
|
211
|
-
[ServiceStatus_1.ServiceStatus.ACTIVE]: 'Activo',
|
|
212
|
-
[ServiceStatus_1.ServiceStatus.INACTIVE]: 'Inactivo',
|
|
213
|
-
[ServiceStatus_1.ServiceStatus.DISCONTINUED]: 'Descontinuado',
|
|
214
|
-
};
|
|
215
|
-
return statusNames[this.value] || this.value;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
exports.ServiceStatus = ServiceStatus;
|
|
219
|
-
ServiceStatus.PROPERTY_NAME = 'status';
|
|
220
|
-
// Estados de servicio válidos
|
|
221
|
-
ServiceStatus.VALID_SERVICE_STATUSES = Object.values(ServiceStatus_1.ServiceStatus);
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceType = void 0;
|
|
4
|
-
const String_1 = require("../../../../shared/domain/value-objects/String");
|
|
5
|
-
const ServiceType_1 = require("../enums/ServiceType");
|
|
6
|
-
const InvalidServiceTypeError_1 = require("../exceptions/InvalidServiceTypeError");
|
|
7
|
-
class ServiceType extends String_1.String {
|
|
8
|
-
constructor(value, skipDomainValidation) {
|
|
9
|
-
super(value, skipDomainValidation, ServiceType.PROPERTY_NAME);
|
|
10
|
-
if (skipDomainValidation === false) {
|
|
11
|
-
this.validateServiceType(value);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
static create(value) {
|
|
15
|
-
String_1.String.guardAgainstEmptyValue(value, ServiceType.PROPERTY_NAME);
|
|
16
|
-
String_1.String.guardAgainstInvalidType(value, ServiceType.PROPERTY_NAME);
|
|
17
|
-
return new ServiceType(value, false);
|
|
18
|
-
}
|
|
19
|
-
static fromPrimitives(primitive) {
|
|
20
|
-
const value = primitive;
|
|
21
|
-
return new ServiceType(value, true);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Valida que el valor sea un tipo de servicio válido.
|
|
25
|
-
*/
|
|
26
|
-
validateServiceType(value) {
|
|
27
|
-
if (!ServiceType.VALID_SERVICE_TYPES.includes(value)) {
|
|
28
|
-
throw InvalidServiceTypeError_1.InvalidServiceTypeError.create(value, ServiceType.VALID_SERVICE_TYPES);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Verifica si es un servicio base.
|
|
33
|
-
*/
|
|
34
|
-
isBaseService() {
|
|
35
|
-
return this.value === ServiceType_1.ServiceType.BASE_SERVICE;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Verifica si es un servicio adicional.
|
|
39
|
-
*/
|
|
40
|
-
isAdditionalService() {
|
|
41
|
-
return this.value === ServiceType_1.ServiceType.ADDITIONAL_SERVICE;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Verifica si es una característica de plataforma.
|
|
45
|
-
*/
|
|
46
|
-
isPlatformFeature() {
|
|
47
|
-
return this.value === ServiceType_1.ServiceType.PLATFORM_FEATURE;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Verifica si es un servicio dependiente.
|
|
51
|
-
*/
|
|
52
|
-
isDependentService() {
|
|
53
|
-
return this.value === ServiceType_1.ServiceType.DEPENDENT_SERVICE;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Verifica si es un servicio principal (base o adicional).
|
|
57
|
-
*/
|
|
58
|
-
isPrincipalService() {
|
|
59
|
-
return this.isBaseService() || this.isAdditionalService();
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Verifica si es un servicio que requiere dependencias.
|
|
63
|
-
*/
|
|
64
|
-
requiresDependencies() {
|
|
65
|
-
return this.isDependentService();
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Verifica si es un servicio que genera ingresos directos.
|
|
69
|
-
*/
|
|
70
|
-
generatesDirectRevenue() {
|
|
71
|
-
// Los servicios base, adicionales y dependientes generan ingresos directos
|
|
72
|
-
return this.isBaseService() || this.isAdditionalService() || this.isDependentService();
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Verifica si es un servicio que mejora la propuesta de valor.
|
|
76
|
-
*/
|
|
77
|
-
enhancesValueProposition() {
|
|
78
|
-
// Las características de plataforma mejoran la propuesta de valor
|
|
79
|
-
return this.isPlatformFeature();
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Verifica si puede ser contratado independientemente.
|
|
83
|
-
*/
|
|
84
|
-
canBeContractedIndependently() {
|
|
85
|
-
// Solo servicios base y adicionales pueden ser contratados independientemente
|
|
86
|
-
return this.isBaseService() || this.isAdditionalService();
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Verifica si puede ser incluido en paquetes.
|
|
90
|
-
*/
|
|
91
|
-
canBeIncludedInPackages() {
|
|
92
|
-
// Todos los tipos pueden ser incluidos en paquetes
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Verifica si requiere configuración especial.
|
|
97
|
-
*/
|
|
98
|
-
requiresSpecialConfiguration() {
|
|
99
|
-
// Características de plataforma y servicios dependientes requieren configuración especial
|
|
100
|
-
return this.isPlatformFeature() || this.isDependentService();
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Obtiene los tipos de servicio válidos.
|
|
104
|
-
*/
|
|
105
|
-
static getValidServiceTypes() {
|
|
106
|
-
return Object.freeze([...ServiceType.VALID_SERVICE_TYPES]);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Verifica si un valor es un tipo de servicio válido.
|
|
110
|
-
*/
|
|
111
|
-
static isValidServiceType(value) {
|
|
112
|
-
return ServiceType.VALID_SERVICE_TYPES.includes(value);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Obtiene la descripción del tipo de servicio.
|
|
116
|
-
*/
|
|
117
|
-
getDescription() {
|
|
118
|
-
const descriptions = {
|
|
119
|
-
[ServiceType_1.ServiceType.BASE_SERVICE]: 'Servicio principal que constituye la oferta base',
|
|
120
|
-
[ServiceType_1.ServiceType.ADDITIONAL_SERVICE]: 'Servicio adicional opcional que complementa la oferta',
|
|
121
|
-
[ServiceType_1.ServiceType.PLATFORM_FEATURE]: 'Característica de plataforma que mejora la experiencia del usuario',
|
|
122
|
-
[ServiceType_1.ServiceType.DEPENDENT_SERVICE]: 'Servicio que requiere un servicio principal para funcionar',
|
|
123
|
-
};
|
|
124
|
-
return descriptions[this.value] || this.value;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Obtiene el modelo de negocio del tipo de servicio.
|
|
128
|
-
*/
|
|
129
|
-
getBusinessModel() {
|
|
130
|
-
const models = {
|
|
131
|
-
[ServiceType_1.ServiceType.BASE_SERVICE]: 'Ingreso principal recurrente',
|
|
132
|
-
[ServiceType_1.ServiceType.ADDITIONAL_SERVICE]: 'Ingreso adicional opcional',
|
|
133
|
-
[ServiceType_1.ServiceType.PLATFORM_FEATURE]: 'Valor agregado incluido',
|
|
134
|
-
[ServiceType_1.ServiceType.DEPENDENT_SERVICE]: 'Ingreso complementario condicionado',
|
|
135
|
-
};
|
|
136
|
-
return models[this.value] || 'Modelo no definido';
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Obtiene la estrategia de precio del tipo de servicio.
|
|
140
|
-
*/
|
|
141
|
-
getPricingStrategy() {
|
|
142
|
-
const strategies = {
|
|
143
|
-
[ServiceType_1.ServiceType.BASE_SERVICE]: 'Precio base competitivo',
|
|
144
|
-
[ServiceType_1.ServiceType.ADDITIONAL_SERVICE]: 'Precio premium por valor agregado',
|
|
145
|
-
[ServiceType_1.ServiceType.PLATFORM_FEATURE]: 'Incluido en precio base',
|
|
146
|
-
[ServiceType_1.ServiceType.DEPENDENT_SERVICE]: 'Precio condicionado al servicio principal',
|
|
147
|
-
};
|
|
148
|
-
return strategies[this.value] || 'Estrategia no definida';
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Obtiene el nivel de prioridad comercial.
|
|
152
|
-
*/
|
|
153
|
-
getCommercialPriority() {
|
|
154
|
-
const priorities = {
|
|
155
|
-
[ServiceType_1.ServiceType.BASE_SERVICE]: 'high',
|
|
156
|
-
[ServiceType_1.ServiceType.ADDITIONAL_SERVICE]: 'medium',
|
|
157
|
-
[ServiceType_1.ServiceType.PLATFORM_FEATURE]: 'low',
|
|
158
|
-
[ServiceType_1.ServiceType.DEPENDENT_SERVICE]: 'medium',
|
|
159
|
-
};
|
|
160
|
-
return priorities[this.value] || 'medium';
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Obtiene las características del tipo de servicio.
|
|
164
|
-
*/
|
|
165
|
-
getCharacteristics() {
|
|
166
|
-
return {
|
|
167
|
-
isPrincipal: this.isPrincipalService(),
|
|
168
|
-
requiresDependencies: this.requiresDependencies(),
|
|
169
|
-
generatesDirectRevenue: this.generatesDirectRevenue(),
|
|
170
|
-
enhancesValueProposition: this.enhancesValueProposition(),
|
|
171
|
-
canBeContractedIndependently: this.canBeContractedIndependently(),
|
|
172
|
-
canBeIncludedInPackages: this.canBeIncludedInPackages(),
|
|
173
|
-
requiresSpecialConfiguration: this.requiresSpecialConfiguration(),
|
|
174
|
-
commercialPriority: this.getCommercialPriority(),
|
|
175
|
-
businessModel: this.getBusinessModel(),
|
|
176
|
-
pricingStrategy: this.getPricingStrategy(),
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Obtiene los tipos de servicio compatibles para bundling.
|
|
181
|
-
*/
|
|
182
|
-
getCompatibleTypesForBundling() {
|
|
183
|
-
const compatibility = {
|
|
184
|
-
[ServiceType_1.ServiceType.BASE_SERVICE]: [
|
|
185
|
-
ServiceType_1.ServiceType.ADDITIONAL_SERVICE,
|
|
186
|
-
ServiceType_1.ServiceType.PLATFORM_FEATURE,
|
|
187
|
-
ServiceType_1.ServiceType.DEPENDENT_SERVICE,
|
|
188
|
-
],
|
|
189
|
-
[ServiceType_1.ServiceType.ADDITIONAL_SERVICE]: [
|
|
190
|
-
ServiceType_1.ServiceType.BASE_SERVICE,
|
|
191
|
-
ServiceType_1.ServiceType.PLATFORM_FEATURE,
|
|
192
|
-
ServiceType_1.ServiceType.DEPENDENT_SERVICE,
|
|
193
|
-
],
|
|
194
|
-
[ServiceType_1.ServiceType.PLATFORM_FEATURE]: [
|
|
195
|
-
ServiceType_1.ServiceType.BASE_SERVICE,
|
|
196
|
-
ServiceType_1.ServiceType.ADDITIONAL_SERVICE,
|
|
197
|
-
ServiceType_1.ServiceType.DEPENDENT_SERVICE,
|
|
198
|
-
],
|
|
199
|
-
[ServiceType_1.ServiceType.DEPENDENT_SERVICE]: [
|
|
200
|
-
ServiceType_1.ServiceType.BASE_SERVICE,
|
|
201
|
-
ServiceType_1.ServiceType.ADDITIONAL_SERVICE,
|
|
202
|
-
ServiceType_1.ServiceType.PLATFORM_FEATURE,
|
|
203
|
-
],
|
|
204
|
-
};
|
|
205
|
-
return compatibility[this.value] || [];
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Verifica si puede ser bundled con otro tipo de servicio.
|
|
209
|
-
*/
|
|
210
|
-
canBeBundledWith(otherType) {
|
|
211
|
-
return this.getCompatibleTypesForBundling().includes(otherType);
|
|
212
|
-
}
|
|
213
|
-
toPrimitives() {
|
|
214
|
-
return this.value;
|
|
215
|
-
}
|
|
216
|
-
toEnum() {
|
|
217
|
-
return this.value;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Representación como string descriptiva.
|
|
221
|
-
*/
|
|
222
|
-
toString() {
|
|
223
|
-
const typeNames = {
|
|
224
|
-
[ServiceType_1.ServiceType.BASE_SERVICE]: 'Servicio Base',
|
|
225
|
-
[ServiceType_1.ServiceType.ADDITIONAL_SERVICE]: 'Servicio Adicional',
|
|
226
|
-
[ServiceType_1.ServiceType.PLATFORM_FEATURE]: 'Característica de Plataforma',
|
|
227
|
-
[ServiceType_1.ServiceType.DEPENDENT_SERVICE]: 'Servicio Dependiente',
|
|
228
|
-
};
|
|
229
|
-
return typeNames[this.value] || this.value;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
exports.ServiceType = ServiceType;
|
|
233
|
-
ServiceType.PROPERTY_NAME = 'type';
|
|
234
|
-
// Tipos de servicio válidos
|
|
235
|
-
ServiceType.VALID_SERVICE_TYPES = Object.values(ServiceType_1.ServiceType);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvalidSemanticUuidError = void 0;
|
|
4
|
-
const RootError_1 = require("./RootError");
|
|
5
|
-
class InvalidSemanticUuidError extends RootError_1.RootError {
|
|
6
|
-
constructor(semanticUuid, propertyName) {
|
|
7
|
-
const message = `The semantic UUID "${semanticUuid}" violates the domain policy - ${InvalidSemanticUuidError.INVALID_SEMANTIC_UUID_ERROR_MESSAGE}. Property: ${propertyName}`;
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = 'InvalidSemanticUuidError';
|
|
10
|
-
}
|
|
11
|
-
static create(semanticUuid, propertyName) {
|
|
12
|
-
return new InvalidSemanticUuidError(semanticUuid, propertyName);
|
|
13
|
-
}
|
|
14
|
-
logError() {
|
|
15
|
-
return `${this.name}: ${this.message}`;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.InvalidSemanticUuidError = InvalidSemanticUuidError;
|
|
19
|
-
InvalidSemanticUuidError.INVALID_SEMANTIC_UUID_ERROR_MESSAGE = 'Invalid semantic UUID format. Expected: PREFIX_EntityType_UUID (e.g., ADC-SUB_ActivityDataSubmission_550e8400-e29b-41d4-a716-446655440000)';
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateTimeFormattingDomainService = void 0;
|
|
4
|
-
const InvalidDateFormatError_1 = require("../exceptions/InvalidDateFormatError");
|
|
5
|
-
const DateString_1 = require("../value-objects/DateString");
|
|
6
|
-
const DateTimeString_1 = require("../value-objects/DateTimeString");
|
|
7
|
-
/**
|
|
8
|
-
* Domain Service for date and datetime formatting and validation operations.
|
|
9
|
-
* Provides centralized business logic for date/datetime handling across the domain.
|
|
10
|
-
*/
|
|
11
|
-
class DateTimeFormattingDomainService {
|
|
12
|
-
/**
|
|
13
|
-
* Validates if a date string has the correct format (DD/MM/YYYY)
|
|
14
|
-
* @param dateValue The date string to validate
|
|
15
|
-
* @returns true if the format is valid, false otherwise
|
|
16
|
-
*/
|
|
17
|
-
static isValidDateFormat(dateValue) {
|
|
18
|
-
return this.DATE_REGEX.test(dateValue);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Validates if a datetime string has the correct format (DD/MM/YYYY HH:mm:ss)
|
|
22
|
-
* @param dateTimeValue The datetime string to validate
|
|
23
|
-
* @returns true if the format is valid, false otherwise
|
|
24
|
-
*/
|
|
25
|
-
static isValidDateTimeFormat(dateTimeValue) {
|
|
26
|
-
return this.DATETIME_REGEX.test(dateTimeValue);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Formats a Date object to a date string (DD/MM/YYYY)
|
|
30
|
-
* @param date The Date object to format
|
|
31
|
-
* @returns The formatted date string
|
|
32
|
-
*/
|
|
33
|
-
static formatDateToString(date) {
|
|
34
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
35
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
36
|
-
const year = date.getFullYear();
|
|
37
|
-
return `${day}/${month}/${year}`;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Formats a Date object to a datetime string (DD/MM/YYYY HH:mm:ss)
|
|
41
|
-
* @param date The Date object to format
|
|
42
|
-
* @returns The formatted datetime string
|
|
43
|
-
*/
|
|
44
|
-
static formatDateTimeToString(date) {
|
|
45
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
46
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
47
|
-
const year = date.getFullYear();
|
|
48
|
-
const hours = String(date.getHours()).padStart(2, '0');
|
|
49
|
-
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
50
|
-
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
51
|
-
return `${day}/${month}/${year} ${hours}:${minutes}:${seconds}`;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Gets the current date formatted as a string (DD/MM/YYYY)
|
|
55
|
-
* @returns The current date as a formatted string
|
|
56
|
-
*/
|
|
57
|
-
static getCurrentDateString() {
|
|
58
|
-
return this.formatDateToString(new Date());
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Gets the current datetime formatted as a string (DD/MM/YYYY HH:mm:ss)
|
|
62
|
-
* @returns The current datetime as a formatted string
|
|
63
|
-
*/
|
|
64
|
-
static getCurrentDateTimeString() {
|
|
65
|
-
return this.formatDateTimeToString(new Date());
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Parses a date string (DD/MM/YYYY) to a Date object
|
|
69
|
-
* @param dateString The date string to parse
|
|
70
|
-
* @returns The parsed Date object
|
|
71
|
-
* @throws InvalidDateFormatError if the format is invalid
|
|
72
|
-
*/
|
|
73
|
-
static parseDateString(dateString) {
|
|
74
|
-
if (!this.isValidDateFormat(dateString)) {
|
|
75
|
-
throw InvalidDateFormatError_1.InvalidDateFormatError.create(dateString, DateString_1.DateString.getDateFormat());
|
|
76
|
-
}
|
|
77
|
-
const [day, month, year] = dateString.split('/').map(Number);
|
|
78
|
-
return new Date(year, month - 1, day);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Parses a datetime string (DD/MM/YYYY HH:mm:ss) to a Date object
|
|
82
|
-
* @param dateTimeString The datetime string to parse
|
|
83
|
-
* @returns The parsed Date object
|
|
84
|
-
* @throws InvalidDateFormatError if the format is invalid
|
|
85
|
-
*/
|
|
86
|
-
static parseDateTimeString(dateTimeString) {
|
|
87
|
-
if (!this.isValidDateTimeFormat(dateTimeString)) {
|
|
88
|
-
throw InvalidDateFormatError_1.InvalidDateFormatError.create(dateTimeString, DateTimeString_1.DateTimeString.getDateTimeFormat());
|
|
89
|
-
}
|
|
90
|
-
const [datePart, timePart] = dateTimeString.split(' ');
|
|
91
|
-
const [day, month, year] = datePart.split('/').map(Number);
|
|
92
|
-
const [hours, minutes, seconds] = timePart.split(':').map(Number);
|
|
93
|
-
return new Date(year, month - 1, day, hours, minutes, seconds);
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Validates if a date string represents a valid calendar date
|
|
97
|
-
* @param dateString The date string to validate
|
|
98
|
-
* @returns true if the date is valid, false otherwise
|
|
99
|
-
*/
|
|
100
|
-
static isValidDate(dateString) {
|
|
101
|
-
if (!this.isValidDateFormat(dateString)) {
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
try {
|
|
105
|
-
const date = this.parseDateString(dateString);
|
|
106
|
-
const reformattedDate = this.formatDateToString(date);
|
|
107
|
-
return reformattedDate === dateString;
|
|
108
|
-
}
|
|
109
|
-
catch {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Validates if a datetime string represents a valid calendar datetime
|
|
115
|
-
* @param dateTimeString The datetime string to validate
|
|
116
|
-
* @returns true if the datetime is valid, false otherwise
|
|
117
|
-
*/
|
|
118
|
-
static isValidDateTime(dateTimeString) {
|
|
119
|
-
if (!this.isValidDateTimeFormat(dateTimeString)) {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
try {
|
|
123
|
-
const date = this.parseDateTimeString(dateTimeString);
|
|
124
|
-
const reformattedDateTime = this.formatDateTimeToString(date);
|
|
125
|
-
return reformattedDateTime === dateTimeString;
|
|
126
|
-
}
|
|
127
|
-
catch {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Compares two date strings
|
|
133
|
-
* @param dateString1 First date string
|
|
134
|
-
* @param dateString2 Second date string
|
|
135
|
-
* @returns negative if first is earlier, positive if later, 0 if equal
|
|
136
|
-
* @throws InvalidDateFormatError if any format is invalid
|
|
137
|
-
*/
|
|
138
|
-
static compareDates(dateString1, dateString2) {
|
|
139
|
-
const date1 = this.parseDateString(dateString1);
|
|
140
|
-
const date2 = this.parseDateString(dateString2);
|
|
141
|
-
return date1.getTime() - date2.getTime();
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Compares two datetime strings
|
|
145
|
-
* @param dateTimeString1 First datetime string
|
|
146
|
-
* @param dateTimeString2 Second datetime string
|
|
147
|
-
* @returns negative if first is earlier, positive if later, 0 if equal
|
|
148
|
-
* @throws InvalidDateFormatError if any format is invalid
|
|
149
|
-
*/
|
|
150
|
-
static compareDateTimes(dateTimeString1, dateTimeString2) {
|
|
151
|
-
const date1 = this.parseDateTimeString(dateTimeString1);
|
|
152
|
-
const date2 = this.parseDateTimeString(dateTimeString2);
|
|
153
|
-
return date1.getTime() - date2.getTime();
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Gets the supported date format string
|
|
157
|
-
* @returns The date format string
|
|
158
|
-
*/
|
|
159
|
-
static getDateFormat() {
|
|
160
|
-
return DateString_1.DateString.getDateFormat();
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Gets the supported datetime format string
|
|
164
|
-
* @returns The datetime format string
|
|
165
|
-
*/
|
|
166
|
-
static getDateTimeFormat() {
|
|
167
|
-
return DateTimeString_1.DateTimeString.getDateTimeFormat();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
exports.DateTimeFormattingDomainService = DateTimeFormattingDomainService;
|
|
171
|
-
DateTimeFormattingDomainService.DATE_REGEX = /^([0-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/\d{4}$/;
|
|
172
|
-
DateTimeFormattingDomainService.DATETIME_REGEX = /^([0-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/\d{4} ([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/;
|