@carbonbox/domain 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldCollectionType.js +1 -1
- package/build/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldDataType.js +3 -3
- package/build/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldDefaultValue.js +2 -2
- package/build/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleAction.js +20 -16
- package/build/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleTriggerValue.js +14 -10
- package/build/carbonbox/activity-data-collection/contextual-labels/domain/value-objects/ContextualLabelLabelMappings.js +7 -7
- package/build/carbonbox/activity-data-collection/contextual-labels/domain/value-objects/ContextualLabelPlaceholderMappings.js +6 -6
- package/build/carbonbox/activity-data-collection/stakeholder-adaptations/domain/value-objects/StakeholderAdaptationFootprintType.js +1 -1
- package/build/carbonbox/activity-data-collection/stakeholder-adaptations/domain/value-objects/StakeholderAdaptationStakeholderType.js +1 -1
- package/build/carbonbox/emission-calculation-process/calculation-processes/domain/entity/CalculationProcess.js +2 -1
- package/build/carbonbox/purchase-management-system/service-catalog/domain/entity/IServiceCatalog.js +2 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/entity/ServiceCatalog.js +263 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogCategory.js +20 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogStatus.js +9 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogType.js +10 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogCategoryError.js +19 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogStatusError.js +19 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogTypeError.js +19 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceCatalogRepository.js +2 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceCatalogPrimitives.js +2 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceCatalogProps.js +2 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAdditionalUserRoles.js +131 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAllowsDocumentReading.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAllowsSectoralComparison.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogBasePricePercentage.js +140 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCategory.js +247 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCode.js +24 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCreatedByStakeholder.js +26 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogDependsOnServiceCode.js +21 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogDescription.js +23 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogExpertDedicationLevel.js +212 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogFixedPriceAmount.js +193 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogHasBasePrice.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogHasFixedPrice.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogId.js +24 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIncludesCarbonBoxAcademy.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIncludesESGIndicators.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForCorporate.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForEvent.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForProduct.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsRequiredService.js +22 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogMaxUsers.js +246 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogName.js +23 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogReportTypes.js +246 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogStatus.js +221 -0
- package/build/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogType.js +235 -0
- package/build/carbonbox/purchase-management-system/service-pricing/domain/value-objects/ServicePricingService.js +2 -2
- package/build/carbonbox/shared/domain/types/ServiceCatalogReference.js +2 -0
- package/build/carbonbox/shared/domain/types/ServiceCatalogReferencePrimitives.js +2 -0
- package/build/carbonbox/shared/domain/value-objects/ServiceCatalogReference.js +301 -0
- package/build/carbonbox/shared/domain/value-objects/ServiceReference.js +75 -75
- package/build/main/index.js +45 -37
- package/build/types/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldDataType.d.ts +1 -1
- package/build/types/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldDataType.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldDefaultValue.d.ts +1 -1
- package/build/types/carbonbox/activity-data-collection/collection-fields/domain/value-objects/CollectionFieldDefaultValue.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleAction.d.ts +1 -4
- package/build/types/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleAction.d.ts.map +1 -1
- package/build/types/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleTriggerValue.d.ts +2 -5
- package/build/types/carbonbox/activity-data-collection/conditional-logic/domain/value-objects/ConditionalFieldRuleTriggerValue.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/IServiceCatalog.d.ts +52 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/IServiceCatalog.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/ServiceCatalog.d.ts +60 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/entity/ServiceCatalog.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogCategory.d.ts +17 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogCategory.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogStatus.d.ts +6 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogStatus.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogType.d.ts +7 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/enums/ServiceCatalogType.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogCategoryError.d.ts +8 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogCategoryError.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogStatusError.d.ts +8 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogStatusError.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogTypeError.d.ts +8 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/exceptions/InvalidServiceCatalogTypeError.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceCatalogRepository.d.ts +22 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceCatalogRepository.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceRepository.d.ts +19 -19
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/repository/IServiceRepository.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceCatalogPrimitives.d.ts +35 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceCatalogPrimitives.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceCatalogProps.d.ts +35 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/types/ServiceCatalogProps.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAdditionalUserRoles.d.ts +71 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAdditionalUserRoles.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAllowsDocumentReading.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAllowsDocumentReading.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAllowsSectoralComparison.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogAllowsSectoralComparison.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogBasePricePercentage.d.ts +54 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogBasePricePercentage.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCategory.d.ts +120 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCategory.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCode.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCode.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCreatedByStakeholder.d.ts +11 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogCreatedByStakeholder.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogDependsOnServiceCode.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogDependsOnServiceCode.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogDescription.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogDescription.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogExpertDedicationLevel.d.ts +92 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogExpertDedicationLevel.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogFixedPriceAmount.d.ts +83 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogFixedPriceAmount.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogHasBasePrice.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogHasBasePrice.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogHasFixedPrice.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogHasFixedPrice.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogId.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogId.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIncludesCarbonBoxAcademy.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIncludesCarbonBoxAcademy.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIncludesESGIndicators.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIncludesESGIndicators.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForCorporate.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForCorporate.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForEvent.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForEvent.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForProduct.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsAvailableForProduct.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsRequiredService.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogIsRequiredService.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogMaxUsers.d.ts +99 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogMaxUsers.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogName.d.ts +9 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogName.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogReportTypes.d.ts +119 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogReportTypes.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogStatus.d.ts +110 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogStatus.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogType.d.ts +111 -0
- package/build/types/carbonbox/purchase-management-system/service-catalog/domain/value-objects/ServiceCatalogType.d.ts.map +1 -0
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/types/ServicePricingPrimitives.d.ts +2 -2
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/types/ServicePricingPrimitives.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/types/ServicePricingProps.d.ts +2 -2
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/types/ServicePricingProps.d.ts.map +1 -1
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/value-objects/ServicePricingService.d.ts +7 -7
- package/build/types/carbonbox/purchase-management-system/service-pricing/domain/value-objects/ServicePricingService.d.ts.map +1 -1
- package/build/types/carbonbox/shared/domain/types/ServiceCatalogReference.d.ts +8 -0
- package/build/types/carbonbox/shared/domain/types/ServiceCatalogReference.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/types/ServiceCatalogReferencePrimitives.d.ts +8 -0
- package/build/types/carbonbox/shared/domain/types/ServiceCatalogReferencePrimitives.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts +134 -0
- package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts.map +1 -0
- package/build/types/carbonbox/shared/domain/value-objects/ServiceReference.d.ts +18 -18
- package/build/types/carbonbox/shared/domain/value-objects/ServiceReference.d.ts.map +1 -1
- package/build/types/main/index.d.ts +25 -21
- package/build/types/main/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,301 @@
|
|
|
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 _a, _ServiceCatalogReference_id, _ServiceCatalogReference_code, _ServiceCatalogReference_name, _ServiceCatalogReference_type, _ServiceCatalogReference_guardAgainstInvalidType, _ServiceCatalogReference_guardAgainstInvalidId, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ServiceCatalogReference = void 0;
|
|
16
|
+
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
17
|
+
const ObjectValueObject_1 = require("./ObjectValueObject");
|
|
18
|
+
const Code_1 = require("./Code");
|
|
19
|
+
const String_1 = require("./String");
|
|
20
|
+
const AggregateId_1 = require("./AggregateId");
|
|
21
|
+
const ServiceCatalogType_1 = require("../../../purchase-management-system/service-catalog/domain/enums/ServiceCatalogType");
|
|
22
|
+
class ServiceCatalogReference extends ObjectValueObject_1.ObjectValueObject {
|
|
23
|
+
/**
|
|
24
|
+
* Constructor protegido para que solo clases hijas puedan instanciar.
|
|
25
|
+
* Aplica todas las validaciones de dominio al momento de construcción.
|
|
26
|
+
*/
|
|
27
|
+
constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
|
|
28
|
+
super(value, skipDomainValidation, propertyName, 'The provided value must be of type ServiceCatalogReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
29
|
+
_ServiceCatalogReference_id.set(this, void 0);
|
|
30
|
+
_ServiceCatalogReference_code.set(this, void 0);
|
|
31
|
+
_ServiceCatalogReference_name.set(this, void 0);
|
|
32
|
+
_ServiceCatalogReference_type.set(this, void 0);
|
|
33
|
+
if (skipDomainValidation === false) {
|
|
34
|
+
_a.validateServiceCatalogReference(value, propertyName);
|
|
35
|
+
}
|
|
36
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_id, value.id.trim(), "f");
|
|
37
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_code, value.code.trim().toUpperCase(), "f");
|
|
38
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_name, value.name.trim(), "f");
|
|
39
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_type, value.type, "f");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Validación estática para reutilización en factory methods y constructores.
|
|
43
|
+
*/
|
|
44
|
+
static validateServiceCatalogReference(value, propertyName) {
|
|
45
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidType).call(this, value, propertyName);
|
|
46
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidId).call(this, value.id);
|
|
47
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode).call(this, value.code);
|
|
48
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName).call(this, value.name);
|
|
49
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType).call(this, value.type);
|
|
50
|
+
}
|
|
51
|
+
get id() {
|
|
52
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_id, "f");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Código único del servicio (UUID).
|
|
56
|
+
*/
|
|
57
|
+
get code() {
|
|
58
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f");
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Nombre descriptivo del servicio.
|
|
62
|
+
*/
|
|
63
|
+
get name() {
|
|
64
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Tipo de servicio.
|
|
68
|
+
*/
|
|
69
|
+
get type() {
|
|
70
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f");
|
|
71
|
+
}
|
|
72
|
+
hasId(id) {
|
|
73
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_id, "f") === id.trim();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Verifica si el servicio corresponde a un código específico.
|
|
77
|
+
*/
|
|
78
|
+
hasCode(code) {
|
|
79
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f") === code.trim().toUpperCase();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Verifica si el servicio tiene un nombre específico.
|
|
83
|
+
*/
|
|
84
|
+
hasName(name) {
|
|
85
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f") === name.trim();
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Verifica si el servicio es de un tipo específico.
|
|
89
|
+
*/
|
|
90
|
+
hasType(type) {
|
|
91
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === type;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Verifica si es un servicio base.
|
|
95
|
+
*/
|
|
96
|
+
isBaseServiceCatalog() {
|
|
97
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.BASE_SERVICE;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Verifica si es un servicio adicional.
|
|
101
|
+
*/
|
|
102
|
+
isAdditionalServiceCatalog() {
|
|
103
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.ADDITIONAL_SERVICE;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Verifica si es una característica de plataforma.
|
|
107
|
+
*/
|
|
108
|
+
isPlatformFeature() {
|
|
109
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.PLATFORM_FEATURE;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Verifica si es un servicio dependiente.
|
|
113
|
+
*/
|
|
114
|
+
isDependentServiceCatalog() {
|
|
115
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.DEPENDENT_SERVICE;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Verifica si es un servicio principal (base o adicional).
|
|
119
|
+
*/
|
|
120
|
+
isPrincipalServiceCatalog() {
|
|
121
|
+
return this.isBaseServiceCatalog() || this.isAdditionalServiceCatalog();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Verifica si requiere dependencias.
|
|
125
|
+
*/
|
|
126
|
+
requiresDependencies() {
|
|
127
|
+
return this.isDependentServiceCatalog();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Obtiene una representación legible del servicio.
|
|
131
|
+
*/
|
|
132
|
+
getDisplayName() {
|
|
133
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f");
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Obtiene una representación completa con código y nombre.
|
|
137
|
+
*/
|
|
138
|
+
getFullDisplayName() {
|
|
139
|
+
return `${__classPrivateFieldGet(this, _ServiceCatalogReference_name, "f")} (${__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f")})`;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Obtiene una representación completa con código, nombre y tipo.
|
|
143
|
+
*/
|
|
144
|
+
getFullDisplayNameWithType() {
|
|
145
|
+
return `${__classPrivateFieldGet(this, _ServiceCatalogReference_name, "f")} (${__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f")}) - ${__classPrivateFieldGet(this, _ServiceCatalogReference_type, "f")}`;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Obtiene el nombre del tipo de servicio en formato legible.
|
|
149
|
+
*/
|
|
150
|
+
getTypeDisplayName() {
|
|
151
|
+
const typeNames = {
|
|
152
|
+
[ServiceCatalogType_1.ServiceCatalogType.BASE_SERVICE]: 'Servicio Base',
|
|
153
|
+
[ServiceCatalogType_1.ServiceCatalogType.ADDITIONAL_SERVICE]: 'Servicio Adicional',
|
|
154
|
+
[ServiceCatalogType_1.ServiceCatalogType.PLATFORM_FEATURE]: 'Característica de Plataforma',
|
|
155
|
+
[ServiceCatalogType_1.ServiceCatalogType.DEPENDENT_SERVICE]: 'Servicio Dependiente',
|
|
156
|
+
};
|
|
157
|
+
return typeNames[__classPrivateFieldGet(this, _ServiceCatalogReference_type, "f")] || __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f");
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Verifica si el nombre del servicio contiene un texto específico.
|
|
161
|
+
* Útil para búsquedas parciales.
|
|
162
|
+
*/
|
|
163
|
+
nameContains(searchText) {
|
|
164
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f").toLowerCase().includes(searchText.toLowerCase().trim());
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Verifica si el servicio coincide con un patrón de búsqueda en código, nombre o tipo.
|
|
168
|
+
* Útil para filtros generales.
|
|
169
|
+
*/
|
|
170
|
+
matches(searchText) {
|
|
171
|
+
const trimmedSearch = searchText.toLowerCase().trim();
|
|
172
|
+
return (__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f").toLowerCase().includes(trimmedSearch)
|
|
173
|
+
|| __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f").toLowerCase().includes(trimmedSearch)
|
|
174
|
+
|| __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f").toLowerCase().includes(trimmedSearch));
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Verifica si el servicio coincide con criterios específicos.
|
|
178
|
+
*/
|
|
179
|
+
matchesCriteria(criteria) {
|
|
180
|
+
if (criteria.code && !this.hasCode(criteria.code)) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
if (criteria.name && !this.hasName(criteria.name)) {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
if (criteria.type && !this.hasType(criteria.type)) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if (criteria.searchText && !this.matches(criteria.searchText)) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Compara la igualdad semántica con otra referencia de servicio.
|
|
196
|
+
* Dos referencias son iguales si tienen el mismo código, nombre y tipo.
|
|
197
|
+
*/
|
|
198
|
+
equals(other) {
|
|
199
|
+
if (!(other instanceof _a)) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
return (__classPrivateFieldGet(this, _ServiceCatalogReference_id, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_id, "f")
|
|
203
|
+
&& __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_code, "f")
|
|
204
|
+
&& __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_name, "f")
|
|
205
|
+
&& __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_type, "f"));
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Compara si dos referencias apuntan al mismo servicio
|
|
209
|
+
* basándose únicamente en el código (identificador único).
|
|
210
|
+
*/
|
|
211
|
+
hasSameServiceCatalog(other) {
|
|
212
|
+
if (!(other instanceof _a)) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_code, "f");
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Verifica si es compatible con otro servicio para bundling.
|
|
219
|
+
*/
|
|
220
|
+
isCompatibleForBundling(other) {
|
|
221
|
+
if (!(other instanceof _a)) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
// Un servicio no puede ser bundled consigo mismo
|
|
225
|
+
if (this.hasSameServiceCatalog(other)) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
// Lógica específica de compatibilidad basada en tipos
|
|
229
|
+
if (this.isDependentServiceCatalog() && other.isBaseServiceCatalog()) {
|
|
230
|
+
return true; // Servicios dependientes pueden ser bundled con servicios base
|
|
231
|
+
}
|
|
232
|
+
if (this.isBaseServiceCatalog() && other.isAdditionalServiceCatalog()) {
|
|
233
|
+
return true; // Servicios base pueden ser bundled con servicios adicionales
|
|
234
|
+
}
|
|
235
|
+
if (this.isPlatformFeature()) {
|
|
236
|
+
return true; // Las características de plataforma pueden ser bundled con cualquier servicio
|
|
237
|
+
}
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Genera un hash code para usar en colecciones.
|
|
242
|
+
* Basado en el código de servicio, nombre y tipo.
|
|
243
|
+
*/
|
|
244
|
+
hashCode() {
|
|
245
|
+
return `${__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f")}_${__classPrivateFieldGet(this, _ServiceCatalogReference_name, "f")}_${__classPrivateFieldGet(this, _ServiceCatalogReference_type, "f")}`;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Convierte a representación primitiva para persistencia.
|
|
249
|
+
*/
|
|
250
|
+
toPrimitives() {
|
|
251
|
+
return {
|
|
252
|
+
id: __classPrivateFieldGet(this, _ServiceCatalogReference_id, "f"),
|
|
253
|
+
code: __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f"),
|
|
254
|
+
name: __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f"),
|
|
255
|
+
type: __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f"),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Representación como string (nombre del servicio).
|
|
260
|
+
*/
|
|
261
|
+
toString() {
|
|
262
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f");
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Representación JSON para serialización.
|
|
266
|
+
*/
|
|
267
|
+
toJSON() {
|
|
268
|
+
return this.toPrimitives();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
exports.ServiceCatalogReference = ServiceCatalogReference;
|
|
272
|
+
_a = ServiceCatalogReference, _ServiceCatalogReference_id = new WeakMap(), _ServiceCatalogReference_code = new WeakMap(), _ServiceCatalogReference_name = new WeakMap(), _ServiceCatalogReference_type = new WeakMap(), _ServiceCatalogReference_guardAgainstInvalidType = function _ServiceCatalogReference_guardAgainstInvalidType(value, propertyName) {
|
|
273
|
+
if (!value || typeof value !== 'object') {
|
|
274
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'ServiceCatalogReference object', typeof value);
|
|
275
|
+
}
|
|
276
|
+
if (typeof value.id !== 'string') {
|
|
277
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
278
|
+
}
|
|
279
|
+
if (typeof value.code !== 'string') {
|
|
280
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
|
|
281
|
+
}
|
|
282
|
+
if (typeof value.name !== 'string') {
|
|
283
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
|
|
284
|
+
}
|
|
285
|
+
if (typeof value.type !== 'string') {
|
|
286
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('type', 'string', typeof value.type);
|
|
287
|
+
}
|
|
288
|
+
}, _ServiceCatalogReference_guardAgainstInvalidId = function _ServiceCatalogReference_guardAgainstInvalidId(id) {
|
|
289
|
+
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
290
|
+
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
291
|
+
}, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode = function _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode(code) {
|
|
292
|
+
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
293
|
+
Code_1.Code.guardAgainstInvalidCode(code);
|
|
294
|
+
}, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName = function _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName(name) {
|
|
295
|
+
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
296
|
+
}, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType = function _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType(type) {
|
|
297
|
+
if (!Object.values(ServiceCatalogType_1.ServiceCatalogType).includes(type)) {
|
|
298
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('type', 'valid ServiceCatalogType', type);
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
ServiceCatalogReference.DEFAULT_PROPERTY_NAME = 'serviceCatalogReference';
|
|
@@ -10,158 +10,158 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _a,
|
|
13
|
+
var _a, _ServiceCatalogReference_id, _ServiceCatalogReference_code, _ServiceCatalogReference_name, _ServiceCatalogReference_type, _ServiceCatalogReference_guardAgainstInvalidType, _ServiceCatalogReference_guardAgainstInvalidId, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.ServiceCatalogReference = void 0;
|
|
16
16
|
const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
|
|
17
17
|
const ObjectValueObject_1 = require("./ObjectValueObject");
|
|
18
18
|
const Code_1 = require("./Code");
|
|
19
19
|
const String_1 = require("./String");
|
|
20
20
|
const AggregateId_1 = require("./AggregateId");
|
|
21
|
-
const
|
|
22
|
-
class
|
|
21
|
+
const ServiceCatalogType_1 = require("../../../purchase-management-system/service-catalog/domain/enums/ServiceCatalogType");
|
|
22
|
+
class ServiceCatalogReference extends ObjectValueObject_1.ObjectValueObject {
|
|
23
23
|
/**
|
|
24
24
|
* Constructor protegido para que solo clases hijas puedan instanciar.
|
|
25
25
|
* Aplica todas las validaciones de dominio al momento de construcción.
|
|
26
26
|
*/
|
|
27
27
|
constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
|
|
28
|
-
super(value, skipDomainValidation, propertyName, 'The provided value must be of type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
super(value, skipDomainValidation, propertyName, 'The provided value must be of type ServiceCatalogReference from the domain layer', { allowNull: false, allowUndefined: false });
|
|
29
|
+
_ServiceCatalogReference_id.set(this, void 0);
|
|
30
|
+
_ServiceCatalogReference_code.set(this, void 0);
|
|
31
|
+
_ServiceCatalogReference_name.set(this, void 0);
|
|
32
|
+
_ServiceCatalogReference_type.set(this, void 0);
|
|
33
33
|
if (skipDomainValidation === false) {
|
|
34
|
-
_a.
|
|
34
|
+
_a.validateServiceCatalogReference(value, propertyName);
|
|
35
35
|
}
|
|
36
|
-
__classPrivateFieldSet(this,
|
|
37
|
-
__classPrivateFieldSet(this,
|
|
38
|
-
__classPrivateFieldSet(this,
|
|
39
|
-
__classPrivateFieldSet(this,
|
|
36
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_id, value.id.trim(), "f");
|
|
37
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_code, value.code.trim().toUpperCase(), "f");
|
|
38
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_name, value.name.trim(), "f");
|
|
39
|
+
__classPrivateFieldSet(this, _ServiceCatalogReference_type, value.type, "f");
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Validación estática para reutilización en factory methods y constructores.
|
|
43
43
|
*/
|
|
44
|
-
static
|
|
45
|
-
__classPrivateFieldGet(this, _a, "m",
|
|
46
|
-
__classPrivateFieldGet(this, _a, "m",
|
|
47
|
-
__classPrivateFieldGet(this, _a, "m",
|
|
48
|
-
__classPrivateFieldGet(this, _a, "m",
|
|
49
|
-
__classPrivateFieldGet(this, _a, "m",
|
|
44
|
+
static validateServiceCatalogReference(value, propertyName) {
|
|
45
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidType).call(this, value, propertyName);
|
|
46
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidId).call(this, value.id);
|
|
47
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode).call(this, value.code);
|
|
48
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName).call(this, value.name);
|
|
49
|
+
__classPrivateFieldGet(this, _a, "m", _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType).call(this, value.type);
|
|
50
50
|
}
|
|
51
51
|
get id() {
|
|
52
|
-
return __classPrivateFieldGet(this,
|
|
52
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_id, "f");
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Código único del servicio (UUID).
|
|
56
56
|
*/
|
|
57
57
|
get code() {
|
|
58
|
-
return __classPrivateFieldGet(this,
|
|
58
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f");
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Nombre descriptivo del servicio.
|
|
62
62
|
*/
|
|
63
63
|
get name() {
|
|
64
|
-
return __classPrivateFieldGet(this,
|
|
64
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f");
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Tipo de servicio.
|
|
68
68
|
*/
|
|
69
69
|
get type() {
|
|
70
|
-
return __classPrivateFieldGet(this,
|
|
70
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f");
|
|
71
71
|
}
|
|
72
72
|
hasId(id) {
|
|
73
|
-
return __classPrivateFieldGet(this,
|
|
73
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_id, "f") === id.trim();
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Verifica si el servicio corresponde a un código específico.
|
|
77
77
|
*/
|
|
78
78
|
hasCode(code) {
|
|
79
|
-
return __classPrivateFieldGet(this,
|
|
79
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f") === code.trim().toUpperCase();
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* Verifica si el servicio tiene un nombre específico.
|
|
83
83
|
*/
|
|
84
84
|
hasName(name) {
|
|
85
|
-
return __classPrivateFieldGet(this,
|
|
85
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f") === name.trim();
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* Verifica si el servicio es de un tipo específico.
|
|
89
89
|
*/
|
|
90
90
|
hasType(type) {
|
|
91
|
-
return __classPrivateFieldGet(this,
|
|
91
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === type;
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* Verifica si es un servicio base.
|
|
95
95
|
*/
|
|
96
|
-
|
|
97
|
-
return __classPrivateFieldGet(this,
|
|
96
|
+
isBaseServiceCatalog() {
|
|
97
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.BASE_SERVICE;
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
100
|
* Verifica si es un servicio adicional.
|
|
101
101
|
*/
|
|
102
|
-
|
|
103
|
-
return __classPrivateFieldGet(this,
|
|
102
|
+
isAdditionalServiceCatalog() {
|
|
103
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.ADDITIONAL_SERVICE;
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* Verifica si es una característica de plataforma.
|
|
107
107
|
*/
|
|
108
108
|
isPlatformFeature() {
|
|
109
|
-
return __classPrivateFieldGet(this,
|
|
109
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.PLATFORM_FEATURE;
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* Verifica si es un servicio dependiente.
|
|
113
113
|
*/
|
|
114
|
-
|
|
115
|
-
return __classPrivateFieldGet(this,
|
|
114
|
+
isDependentServiceCatalog() {
|
|
115
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === ServiceCatalogType_1.ServiceCatalogType.DEPENDENT_SERVICE;
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
* Verifica si es un servicio principal (base o adicional).
|
|
119
119
|
*/
|
|
120
|
-
|
|
121
|
-
return this.
|
|
120
|
+
isPrincipalServiceCatalog() {
|
|
121
|
+
return this.isBaseServiceCatalog() || this.isAdditionalServiceCatalog();
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Verifica si requiere dependencias.
|
|
125
125
|
*/
|
|
126
126
|
requiresDependencies() {
|
|
127
|
-
return this.
|
|
127
|
+
return this.isDependentServiceCatalog();
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* Obtiene una representación legible del servicio.
|
|
131
131
|
*/
|
|
132
132
|
getDisplayName() {
|
|
133
|
-
return __classPrivateFieldGet(this,
|
|
133
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f");
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* Obtiene una representación completa con código y nombre.
|
|
137
137
|
*/
|
|
138
138
|
getFullDisplayName() {
|
|
139
|
-
return `${__classPrivateFieldGet(this,
|
|
139
|
+
return `${__classPrivateFieldGet(this, _ServiceCatalogReference_name, "f")} (${__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f")})`;
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
142
|
* Obtiene una representación completa con código, nombre y tipo.
|
|
143
143
|
*/
|
|
144
144
|
getFullDisplayNameWithType() {
|
|
145
|
-
return `${__classPrivateFieldGet(this,
|
|
145
|
+
return `${__classPrivateFieldGet(this, _ServiceCatalogReference_name, "f")} (${__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f")}) - ${__classPrivateFieldGet(this, _ServiceCatalogReference_type, "f")}`;
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Obtiene el nombre del tipo de servicio en formato legible.
|
|
149
149
|
*/
|
|
150
150
|
getTypeDisplayName() {
|
|
151
151
|
const typeNames = {
|
|
152
|
-
[
|
|
153
|
-
[
|
|
154
|
-
[
|
|
155
|
-
[
|
|
152
|
+
[ServiceCatalogType_1.ServiceCatalogType.BASE_SERVICE]: 'Servicio Base',
|
|
153
|
+
[ServiceCatalogType_1.ServiceCatalogType.ADDITIONAL_SERVICE]: 'Servicio Adicional',
|
|
154
|
+
[ServiceCatalogType_1.ServiceCatalogType.PLATFORM_FEATURE]: 'Característica de Plataforma',
|
|
155
|
+
[ServiceCatalogType_1.ServiceCatalogType.DEPENDENT_SERVICE]: 'Servicio Dependiente',
|
|
156
156
|
};
|
|
157
|
-
return typeNames[__classPrivateFieldGet(this,
|
|
157
|
+
return typeNames[__classPrivateFieldGet(this, _ServiceCatalogReference_type, "f")] || __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f");
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
160
160
|
* Verifica si el nombre del servicio contiene un texto específico.
|
|
161
161
|
* Útil para búsquedas parciales.
|
|
162
162
|
*/
|
|
163
163
|
nameContains(searchText) {
|
|
164
|
-
return __classPrivateFieldGet(this,
|
|
164
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f").toLowerCase().includes(searchText.toLowerCase().trim());
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* Verifica si el servicio coincide con un patrón de búsqueda en código, nombre o tipo.
|
|
@@ -169,9 +169,9 @@ class ServiceReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
169
169
|
*/
|
|
170
170
|
matches(searchText) {
|
|
171
171
|
const trimmedSearch = searchText.toLowerCase().trim();
|
|
172
|
-
return (__classPrivateFieldGet(this,
|
|
173
|
-
|| __classPrivateFieldGet(this,
|
|
174
|
-
|| __classPrivateFieldGet(this,
|
|
172
|
+
return (__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f").toLowerCase().includes(trimmedSearch)
|
|
173
|
+
|| __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f").toLowerCase().includes(trimmedSearch)
|
|
174
|
+
|| __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f").toLowerCase().includes(trimmedSearch));
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Verifica si el servicio coincide con criterios específicos.
|
|
@@ -199,20 +199,20 @@ class ServiceReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
199
199
|
if (!(other instanceof _a)) {
|
|
200
200
|
return false;
|
|
201
201
|
}
|
|
202
|
-
return (__classPrivateFieldGet(this,
|
|
203
|
-
&& __classPrivateFieldGet(this,
|
|
204
|
-
&& __classPrivateFieldGet(this,
|
|
205
|
-
&& __classPrivateFieldGet(this,
|
|
202
|
+
return (__classPrivateFieldGet(this, _ServiceCatalogReference_id, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_id, "f")
|
|
203
|
+
&& __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_code, "f")
|
|
204
|
+
&& __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_name, "f")
|
|
205
|
+
&& __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_type, "f"));
|
|
206
206
|
}
|
|
207
207
|
/**
|
|
208
208
|
* Compara si dos referencias apuntan al mismo servicio
|
|
209
209
|
* basándose únicamente en el código (identificador único).
|
|
210
210
|
*/
|
|
211
|
-
|
|
211
|
+
hasSameServiceCatalog(other) {
|
|
212
212
|
if (!(other instanceof _a)) {
|
|
213
213
|
return false;
|
|
214
214
|
}
|
|
215
|
-
return __classPrivateFieldGet(this,
|
|
215
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f") === __classPrivateFieldGet(other, _ServiceCatalogReference_code, "f");
|
|
216
216
|
}
|
|
217
217
|
/**
|
|
218
218
|
* Verifica si es compatible con otro servicio para bundling.
|
|
@@ -222,14 +222,14 @@ class ServiceReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
222
222
|
return false;
|
|
223
223
|
}
|
|
224
224
|
// Un servicio no puede ser bundled consigo mismo
|
|
225
|
-
if (this.
|
|
225
|
+
if (this.hasSameServiceCatalog(other)) {
|
|
226
226
|
return false;
|
|
227
227
|
}
|
|
228
228
|
// Lógica específica de compatibilidad basada en tipos
|
|
229
|
-
if (this.
|
|
229
|
+
if (this.isDependentServiceCatalog() && other.isBaseServiceCatalog()) {
|
|
230
230
|
return true; // Servicios dependientes pueden ser bundled con servicios base
|
|
231
231
|
}
|
|
232
|
-
if (this.
|
|
232
|
+
if (this.isBaseServiceCatalog() && other.isAdditionalServiceCatalog()) {
|
|
233
233
|
return true; // Servicios base pueden ser bundled con servicios adicionales
|
|
234
234
|
}
|
|
235
235
|
if (this.isPlatformFeature()) {
|
|
@@ -242,24 +242,24 @@ class ServiceReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
242
242
|
* Basado en el código de servicio, nombre y tipo.
|
|
243
243
|
*/
|
|
244
244
|
hashCode() {
|
|
245
|
-
return `${__classPrivateFieldGet(this,
|
|
245
|
+
return `${__classPrivateFieldGet(this, _ServiceCatalogReference_code, "f")}_${__classPrivateFieldGet(this, _ServiceCatalogReference_name, "f")}_${__classPrivateFieldGet(this, _ServiceCatalogReference_type, "f")}`;
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
248
248
|
* Convierte a representación primitiva para persistencia.
|
|
249
249
|
*/
|
|
250
250
|
toPrimitives() {
|
|
251
251
|
return {
|
|
252
|
-
id: __classPrivateFieldGet(this,
|
|
253
|
-
code: __classPrivateFieldGet(this,
|
|
254
|
-
name: __classPrivateFieldGet(this,
|
|
255
|
-
type: __classPrivateFieldGet(this,
|
|
252
|
+
id: __classPrivateFieldGet(this, _ServiceCatalogReference_id, "f"),
|
|
253
|
+
code: __classPrivateFieldGet(this, _ServiceCatalogReference_code, "f"),
|
|
254
|
+
name: __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f"),
|
|
255
|
+
type: __classPrivateFieldGet(this, _ServiceCatalogReference_type, "f"),
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
259
|
* Representación como string (nombre del servicio).
|
|
260
260
|
*/
|
|
261
261
|
toString() {
|
|
262
|
-
return __classPrivateFieldGet(this,
|
|
262
|
+
return __classPrivateFieldGet(this, _ServiceCatalogReference_name, "f");
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
265
|
* Representación JSON para serialización.
|
|
@@ -268,10 +268,10 @@ class ServiceReference extends ObjectValueObject_1.ObjectValueObject {
|
|
|
268
268
|
return this.toPrimitives();
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
exports.
|
|
272
|
-
_a =
|
|
271
|
+
exports.ServiceCatalogReference = ServiceCatalogReference;
|
|
272
|
+
_a = ServiceCatalogReference, _ServiceCatalogReference_id = new WeakMap(), _ServiceCatalogReference_code = new WeakMap(), _ServiceCatalogReference_name = new WeakMap(), _ServiceCatalogReference_type = new WeakMap(), _ServiceCatalogReference_guardAgainstInvalidType = function _ServiceCatalogReference_guardAgainstInvalidType(value, propertyName) {
|
|
273
273
|
if (!value || typeof value !== 'object') {
|
|
274
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, '
|
|
274
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'ServiceCatalogReference object', typeof value);
|
|
275
275
|
}
|
|
276
276
|
if (typeof value.id !== 'string') {
|
|
277
277
|
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
|
|
@@ -285,17 +285,17 @@ _a = ServiceReference, _ServiceReference_id = new WeakMap(), _ServiceReference_c
|
|
|
285
285
|
if (typeof value.type !== 'string') {
|
|
286
286
|
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('type', 'string', typeof value.type);
|
|
287
287
|
}
|
|
288
|
-
},
|
|
288
|
+
}, _ServiceCatalogReference_guardAgainstInvalidId = function _ServiceCatalogReference_guardAgainstInvalidId(id) {
|
|
289
289
|
String_1.String.guardAgainstEmptyValue(id, 'id');
|
|
290
290
|
AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
|
|
291
|
-
},
|
|
291
|
+
}, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode = function _ServiceCatalogReference_guardAgainstInvalidServiceCatalogCode(code) {
|
|
292
292
|
String_1.String.guardAgainstEmptyValue(code, 'code');
|
|
293
293
|
Code_1.Code.guardAgainstInvalidCode(code);
|
|
294
|
-
},
|
|
294
|
+
}, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName = function _ServiceCatalogReference_guardAgainstInvalidServiceCatalogName(name) {
|
|
295
295
|
String_1.String.guardAgainstEmptyValue(name, 'name');
|
|
296
|
-
},
|
|
297
|
-
if (!Object.values(
|
|
298
|
-
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('type', 'valid
|
|
296
|
+
}, _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType = function _ServiceCatalogReference_guardAgainstInvalidServiceCatalogType(type) {
|
|
297
|
+
if (!Object.values(ServiceCatalogType_1.ServiceCatalogType).includes(type)) {
|
|
298
|
+
throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('type', 'valid ServiceCatalogType', type);
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
|
-
|
|
301
|
+
ServiceCatalogReference.DEFAULT_PROPERTY_NAME = 'serviceCatalogReference';
|