@carbonbox/domain 0.7.22 → 0.7.24

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.
Files changed (85) hide show
  1. package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationSegment.js +0 -2
  2. package/build/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentIncludedSubsegments.js +0 -2
  3. package/build/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/domain/value-objects/EventEditionLifecycleStageConfigurationStage.js +0 -2
  4. package/build/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/domain/value-objects/EventEditionLifecycleStageIncludedSubsegments.js +0 -2
  5. package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/domain/value-objects/ProductCarbonFootprintSegmentConfigurationSegment.js +0 -2
  6. package/build/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/domain/value-objects/ProductConfigurationCarbonFootprintSegmentIncludedSubsegments.js +0 -2
  7. package/build/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowJobSequence.js +3 -5
  8. package/build/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowParallelJobs.js +28 -27
  9. package/build/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.js +16 -103
  10. package/build/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.js +15 -29
  11. package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.js +6 -131
  12. package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.js +6 -131
  13. package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.js +7 -149
  14. package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.js +9 -165
  15. package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.js +42 -50
  16. package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.js +8 -112
  17. package/build/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.js +11 -136
  18. package/build/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.js +11 -168
  19. package/build/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.js +11 -136
  20. package/build/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.js +35 -56
  21. package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.js +6 -172
  22. package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.js +6 -172
  23. package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationSegment.d.ts.map +1 -1
  24. package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentIncludedSubsegments.d.ts.map +1 -1
  25. package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/domain/value-objects/EventEditionLifecycleStageConfigurationStage.d.ts.map +1 -1
  26. package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/event-edition-lifecycle-stages/domain/value-objects/EventEditionLifecycleStageIncludedSubsegments.d.ts.map +1 -1
  27. package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/domain/value-objects/ProductCarbonFootprintSegmentConfigurationSegment.d.ts.map +1 -1
  28. package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/domain/value-objects/ProductConfigurationCarbonFootprintSegmentIncludedSubsegments.d.ts.map +1 -1
  29. package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowJobSequence.d.ts +2 -2
  30. package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowJobSequence.d.ts.map +1 -1
  31. package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowParallelJobs.d.ts +5 -5
  32. package/build/types/carbonbox/emission-calculation-process/calculation-workflows/domain/value-objects/CalculationWorkflowParallelJobs.d.ts.map +1 -1
  33. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +0 -2
  34. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  35. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts +0 -2
  36. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts.map +1 -1
  37. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +0 -2
  38. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  39. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts +0 -2
  40. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts.map +1 -1
  41. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +0 -2
  42. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  43. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts +0 -2
  44. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts.map +1 -1
  45. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReference.d.ts +0 -2
  46. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReference.d.ts.map +1 -1
  47. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReferencePrimitives.d.ts +0 -2
  48. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReferencePrimitives.d.ts.map +1 -1
  49. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReference.d.ts +0 -2
  50. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  51. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts +0 -2
  52. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts.map +1 -1
  53. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +0 -2
  54. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  55. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts +0 -2
  56. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts.map +1 -1
  57. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts +7 -43
  58. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts.map +1 -1
  59. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts +6 -8
  60. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  61. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +1 -62
  62. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  63. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +1 -71
  64. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  65. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -78
  66. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  67. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts +5 -68
  68. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts.map +1 -1
  69. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts +20 -19
  70. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts.map +1 -1
  71. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts +2 -45
  72. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts.map +1 -1
  73. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -62
  74. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  75. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -77
  76. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  77. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -62
  78. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  79. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts +15 -17
  80. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  81. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts +1 -81
  82. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  83. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +1 -90
  84. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  85. package/package.json +1 -1
@@ -10,14 +10,13 @@ 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 _CorporateConfigurationCarbonFootprintSegmentReference_id, _CorporateConfigurationCarbonFootprintSegmentReference_code, _CorporateConfigurationCarbonFootprintSegmentReference_name;
13
+ var _CorporateConfigurationCarbonFootprintSegmentReference_id;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CorporateConfigurationCarbonFootprintSegmentReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
17
17
  const ObjectValueObject_1 = require("./ObjectValueObject");
18
18
  const String_1 = require("./String");
19
19
  const AggregateId_1 = require("./AggregateId");
20
- const Code_1 = require("./Code");
21
20
  class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueObject_1.ObjectValueObject {
22
21
  /**
23
22
  * Constructor protegido para que solo clases hijas puedan instanciar.
@@ -26,15 +25,11 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
26
25
  constructor(value, skipDomainValidation, propertyName = CorporateConfigurationCarbonFootprintSegmentReference.DEFAULT_PROPERTY_NAME) {
27
26
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type CorporateConfigurationCarbonFootprintSegmentReference from the domain layer', { allowNull: false, allowUndefined: false });
28
27
  _CorporateConfigurationCarbonFootprintSegmentReference_id.set(this, void 0);
29
- _CorporateConfigurationCarbonFootprintSegmentReference_code.set(this, void 0);
30
- _CorporateConfigurationCarbonFootprintSegmentReference_name.set(this, void 0);
31
28
  if (skipDomainValidation === false) {
32
29
  CorporateConfigurationCarbonFootprintSegmentReference
33
30
  .validateCorporateConfigurationCarbonFootprintSegmentReference(value, propertyName);
34
31
  }
35
32
  __classPrivateFieldSet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, value.id.trim(), "f");
36
- __classPrivateFieldSet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, value.code.trim().toUpperCase(), "f");
37
- __classPrivateFieldSet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, value.name.trim(), "f");
38
33
  }
39
34
  /**
40
35
  * Validación estática para reutilización en factory methods y constructores.
@@ -42,8 +37,6 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
42
37
  static validateCorporateConfigurationCarbonFootprintSegmentReference(value, propertyName) {
43
38
  this.guardAgainstInvalidType(value, propertyName);
44
39
  this.guardAgainstInvalidId(value.id);
45
- this.guardAgainstInvalidCode(value.code);
46
- this.guardAgainstInvalidName(value.name);
47
40
  }
48
41
  /**
49
42
  * Valida que el objeto tenga la estructura correcta.
@@ -55,12 +48,6 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
55
48
  if (typeof value.id !== 'string') {
56
49
  throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
57
50
  }
58
- if (typeof value.code !== 'string') {
59
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
60
- }
61
- if (typeof value.name !== 'string') {
62
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
63
- }
64
51
  }
65
52
  /**
66
53
  * Valida si el valor principal es inválido.
@@ -75,101 +62,12 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
75
62
  String_1.String.guardAgainstEmptyValue(id, 'id');
76
63
  AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
77
64
  }
78
- /**
79
- * Valida el código del segmento corporativo.
80
- */
81
- static guardAgainstInvalidCode(code) {
82
- String_1.String.guardAgainstEmptyValue(code, 'code');
83
- Code_1.Code.guardAgainstInvalidCode(code);
84
- }
85
- /**
86
- * Valida el nombre del segmento corporativo.
87
- */
88
- static guardAgainstInvalidName(name) {
89
- String_1.String.guardAgainstEmptyValue(name, 'name');
90
- if (this.nameLengthIsInvalid(name)) {
91
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', `string with maximum ${this.MAX_NAME_LENGTH} characters`, `string with ${name.trim().length} characters`);
92
- }
93
- }
94
- /**
95
- * Verifica si la longitud del nombre de segmento es inválida.
96
- */
97
- static nameLengthIsInvalid(name) {
98
- return name.trim().length > this.MAX_NAME_LENGTH;
99
- }
100
65
  /**
101
66
  * ID único del segmento corporativo.
102
67
  */
103
68
  get id() {
104
69
  return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f");
105
70
  }
106
- /**
107
- * Código del segmento corporativo.
108
- */
109
- get code() {
110
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f");
111
- }
112
- /**
113
- * Nombre del segmento corporativo.
114
- */
115
- get name() {
116
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f");
117
- }
118
- /**
119
- * Verifica si el segmento tiene un código específico.
120
- */
121
- hasCode(code) {
122
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f") === code.trim().toUpperCase();
123
- }
124
- /**
125
- * Verifica si el nombre del segmento contiene una palabra específica.
126
- */
127
- nameContains(keyword) {
128
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f").toLowerCase().includes(keyword.toLowerCase());
129
- }
130
- /**
131
- * Verifica si es un segmento de tecnología.
132
- */
133
- isTechnologySegment() {
134
- const techKeywords = ['tech', 'technology', 'digital', 'software', 'it', 'innovation'];
135
- return techKeywords.some((keyword) => this.nameContains(keyword));
136
- }
137
- /**
138
- * Verifica si es un segmento financiero.
139
- */
140
- isFinancialSegment() {
141
- const financialKeywords = ['financial', 'bank', 'finance', 'insurance', 'investment'];
142
- return financialKeywords.some((keyword) => this.nameContains(keyword));
143
- }
144
- /**
145
- * Verifica si es un segmento de manufactura.
146
- */
147
- isManufacturingSegment() {
148
- const manufacturingKeywords = ['manufacturing', 'production', 'factory', 'industrial'];
149
- return manufacturingKeywords.some((keyword) => this.nameContains(keyword));
150
- }
151
- /**
152
- * Verifica si es un segmento de servicios.
153
- */
154
- isServicesSegment() {
155
- const servicesKeywords = ['services', 'consulting', 'professional', 'advisory'];
156
- return servicesKeywords.some((keyword) => this.nameContains(keyword));
157
- }
158
- /**
159
- * Obtiene una representación formateada para mostrar al usuario.
160
- */
161
- getFormattedDisplay() {
162
- return `${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f")} - ${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f")}`;
163
- }
164
- /**
165
- * Obtiene una versión abreviada del nombre si es muy largo.
166
- */
167
- getAbbreviatedName(maxLength = 50) {
168
- if (__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f").length <= maxLength) {
169
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f");
170
- }
171
- return `${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f").substring(0, maxLength - 3)}...`;
172
- }
173
71
  /**
174
72
  * Compara la igualdad semántica con otro objeto CorporateConfigurationCarbonFootprintSegmentReference.
175
73
  */
@@ -177,9 +75,7 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
177
75
  if (this.otherIsNotCorporateConfigurationCarbonFootprintSegmentReference(other)) {
178
76
  return false;
179
77
  }
180
- return (__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f")
181
- && __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f")
182
- && __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f"));
78
+ return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f");
183
79
  }
184
80
  /**
185
81
  * Verifica si el otro objeto no es una instancia de CorporateConfigurationCarbonFootprintSegmentReference.
@@ -187,24 +83,6 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
187
83
  otherIsNotCorporateConfigurationCarbonFootprintSegmentReference(other) {
188
84
  return (other instanceof CorporateConfigurationCarbonFootprintSegmentReference) === false;
189
85
  }
190
- /**
191
- * Compara si dos segmentos tienen el mismo código.
192
- */
193
- hasSameCode(other) {
194
- if (this.otherIsNotCorporateConfigurationCarbonFootprintSegmentReference(other)) {
195
- return false;
196
- }
197
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f");
198
- }
199
- /**
200
- * Compara si dos segmentos tienen el mismo nombre.
201
- */
202
- hasSameName(other) {
203
- if (this.otherIsNotCorporateConfigurationCarbonFootprintSegmentReference(other)) {
204
- return false;
205
- }
206
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f");
207
- }
208
86
  /**
209
87
  * Compara si dos segmentos tienen el mismo ID.
210
88
  */
@@ -218,7 +96,7 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
218
96
  * Genera un hash code para usar en colecciones.
219
97
  */
220
98
  hashCode() {
221
- return `${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f")}_${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f")}_${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f")}`;
99
+ return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f");
222
100
  }
223
101
  /**
224
102
  * Convierte a representación primitiva para persistencia.
@@ -226,15 +104,13 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
226
104
  toPrimitives() {
227
105
  return {
228
106
  id: __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f"),
229
- code: __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f"),
230
- name: __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_name, "f"),
231
107
  };
232
108
  }
233
109
  /**
234
- * Representación como string (código del segmento).
110
+ * Representación como string (ID del segmento).
235
111
  */
236
112
  toString() {
237
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_code, "f");
113
+ return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSegmentReference_id, "f");
238
114
  }
239
115
  /**
240
116
  * Representación JSON para serialización.
@@ -250,6 +126,5 @@ class CorporateConfigurationCarbonFootprintSegmentReference extends ObjectValueO
250
126
  }
251
127
  }
252
128
  exports.CorporateConfigurationCarbonFootprintSegmentReference = CorporateConfigurationCarbonFootprintSegmentReference;
253
- _CorporateConfigurationCarbonFootprintSegmentReference_id = new WeakMap(), _CorporateConfigurationCarbonFootprintSegmentReference_code = new WeakMap(), _CorporateConfigurationCarbonFootprintSegmentReference_name = new WeakMap();
129
+ _CorporateConfigurationCarbonFootprintSegmentReference_id = new WeakMap();
254
130
  CorporateConfigurationCarbonFootprintSegmentReference.DEFAULT_PROPERTY_NAME = 'corporateSegmentReference';
255
- CorporateConfigurationCarbonFootprintSegmentReference.MAX_NAME_LENGTH = 255;
@@ -10,14 +10,13 @@ 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 _CorporateConfigurationCarbonFootprintSubsegmentReference_id, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, _CorporateConfigurationCarbonFootprintSubsegmentReference_name;
13
+ var _CorporateConfigurationCarbonFootprintSubsegmentReference_id;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CorporateConfigurationCarbonFootprintSubsegmentReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
17
17
  const ObjectValueObject_1 = require("./ObjectValueObject");
18
18
  const String_1 = require("./String");
19
19
  const AggregateId_1 = require("./AggregateId");
20
- const Code_1 = require("./Code");
21
20
  class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectValueObject_1.ObjectValueObject {
22
21
  /**
23
22
  * Constructor protegido para que solo clases hijas puedan instanciar.
@@ -26,15 +25,11 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
26
25
  constructor(value, skipDomainValidation, propertyName = CorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
27
26
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type CorporateConfigurationCarbonFootprintSubsegmentReference from the domain layer', { allowNull: false, allowUndefined: false });
28
27
  _CorporateConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
29
- _CorporateConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
30
- _CorporateConfigurationCarbonFootprintSubsegmentReference_name.set(this, void 0);
31
28
  if (skipDomainValidation === false) {
32
29
  CorporateConfigurationCarbonFootprintSubsegmentReference
33
30
  .validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
34
31
  }
35
32
  __classPrivateFieldSet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
36
- __classPrivateFieldSet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, value.code.trim().toUpperCase(), "f");
37
- __classPrivateFieldSet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, value.name.trim(), "f");
38
33
  }
39
34
  /**
40
35
  * Validación estática para reutilización en factory methods y constructores.
@@ -42,8 +37,6 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
42
37
  static validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName) {
43
38
  this.guardAgainstInvalidType(value, propertyName);
44
39
  this.guardAgainstInvalidId(value.id);
45
- this.guardAgainstInvalidCode(value.code);
46
- this.guardAgainstInvalidName(value.name);
47
40
  }
48
41
  /**
49
42
  * Valida que el objeto tenga la estructura correcta.
@@ -55,12 +48,6 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
55
48
  if (typeof value.id !== 'string') {
56
49
  throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
57
50
  }
58
- if (typeof value.code !== 'string') {
59
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
60
- }
61
- if (typeof value.name !== 'string') {
62
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
63
- }
64
51
  }
65
52
  /**
66
53
  * Valida si el valor principal es inválido.
@@ -75,104 +62,15 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
75
62
  String_1.String.guardAgainstEmptyValue(id, 'id');
76
63
  AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
77
64
  }
78
- /**
79
- * Valida el código del subsegmento corporativo.
80
- */
81
- static guardAgainstInvalidCode(code) {
82
- String_1.String.guardAgainstEmptyValue(code, 'code');
83
- Code_1.Code.guardAgainstInvalidCode(code);
84
- }
85
- /**
86
- * Valida el nombre del subsegmento corporativo.
87
- */
88
- static guardAgainstInvalidName(name) {
89
- String_1.String.guardAgainstEmptyValue(name, 'name');
90
- if (this.nameLengthIsInvalid(name)) {
91
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', `string with maximum ${this.MAX_NAME_LENGTH} characters`, `string with ${name.trim().length} characters`);
92
- }
93
- }
94
- /**
95
- * Verifica si la longitud del nombre de subsegmento es inválida.
96
- */
97
- static nameLengthIsInvalid(name) {
98
- return name.trim().length > this.MAX_NAME_LENGTH;
99
- }
100
65
  /**
101
66
  * ID único del subsegmento corporativo.
102
67
  */
103
68
  get id() {
104
69
  return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f");
105
70
  }
106
- /**
107
- * Código del subsegmento corporativo.
108
- */
109
- get code() {
110
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f");
111
- }
112
- /**
113
- * Nombre del subsegmento corporativo.
114
- */
115
- get name() {
116
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f");
117
- }
118
71
  hasId(id) {
119
72
  return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f") === id.trim();
120
73
  }
121
- /**
122
- * Verifica si el subsegmento tiene un código específico.
123
- */
124
- hasCode(code) {
125
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f") === code.trim().toUpperCase();
126
- }
127
- /**
128
- * Verifica si el nombre del subsegmento contiene una palabra específica.
129
- */
130
- nameContains(keyword) {
131
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f").toLowerCase().includes(keyword.toLowerCase());
132
- }
133
- /**
134
- * Verifica si es un segmento de tecnología.
135
- */
136
- isTechnologySegment() {
137
- const techKeywords = ['tech', 'technology', 'digital', 'software', 'it', 'innovation'];
138
- return techKeywords.some((keyword) => this.nameContains(keyword));
139
- }
140
- /**
141
- * Verifica si es un segmento financiero.
142
- */
143
- isFinancialSegment() {
144
- const financialKeywords = ['financial', 'bank', 'finance', 'insurance', 'investment'];
145
- return financialKeywords.some((keyword) => this.nameContains(keyword));
146
- }
147
- /**
148
- * Verifica si es un segmento de manufactura.
149
- */
150
- isManufacturingSegment() {
151
- const manufacturingKeywords = ['manufacturing', 'production', 'factory', 'industrial'];
152
- return manufacturingKeywords.some((keyword) => this.nameContains(keyword));
153
- }
154
- /**
155
- * Verifica si es un segmento de servicios.
156
- */
157
- isServicesSegment() {
158
- const servicesKeywords = ['services', 'consulting', 'professional', 'advisory'];
159
- return servicesKeywords.some((keyword) => this.nameContains(keyword));
160
- }
161
- /**
162
- * Obtiene una representación formateada para mostrar al usuario.
163
- */
164
- getFormattedDisplay() {
165
- return `${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f")} - ${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f")}`;
166
- }
167
- /**
168
- * Obtiene una versión abreviada del nombre si es muy largo.
169
- */
170
- getAbbreviatedName(maxLength = 50) {
171
- if (__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f").length <= maxLength) {
172
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f");
173
- }
174
- return `${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f").substring(0, maxLength - 3)}...`;
175
- }
176
74
  /**
177
75
  * Compara la igualdad semántica con otro objeto CorporateConfigurationCarbonFootprintSubsegmentReference.
178
76
  */
@@ -180,9 +78,7 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
180
78
  if (this.otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other)) {
181
79
  return false;
182
80
  }
183
- return (__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f")
184
- && __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f")
185
- && __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f"));
81
+ return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f");
186
82
  }
187
83
  /**
188
84
  * Verifica si el otro objeto no es una instancia de CorporateConfigurationCarbonFootprintSubsegmentReference.
@@ -190,24 +86,6 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
190
86
  otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other) {
191
87
  return (other instanceof CorporateConfigurationCarbonFootprintSubsegmentReference) === false;
192
88
  }
193
- /**
194
- * Compara si dos segmentos tienen el mismo código.
195
- */
196
- hasSameCode(other) {
197
- if (this.otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other)) {
198
- return false;
199
- }
200
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f");
201
- }
202
- /**
203
- * Compara si dos subsegmentos tienen el mismo nombre.
204
- */
205
- hasSameName(other) {
206
- if (this.otherIsNotCorporateConfigurationCarbonFootprintSubsegmentReference(other)) {
207
- return false;
208
- }
209
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f") === __classPrivateFieldGet(other, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f");
210
- }
211
89
  /**
212
90
  * Compara si dos subsegmentos tienen el mismo ID.
213
91
  */
@@ -221,7 +99,7 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
221
99
  * Genera un hash code para usar en colecciones.
222
100
  */
223
101
  hashCode() {
224
- return `${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f")}_${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f")}_${__classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f")}`;
102
+ return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f");
225
103
  }
226
104
  /**
227
105
  * Convierte a representación primitiva para persistencia.
@@ -229,15 +107,13 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
229
107
  toPrimitives() {
230
108
  return {
231
109
  id: __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f"),
232
- code: __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f"),
233
- name: __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_name, "f"),
234
110
  };
235
111
  }
236
112
  /**
237
- * Representación como string (código del segmento).
113
+ * Representación como string (id del subsegmento).
238
114
  */
239
115
  toString() {
240
- return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_code, "f");
116
+ return __classPrivateFieldGet(this, _CorporateConfigurationCarbonFootprintSubsegmentReference_id, "f");
241
117
  }
242
118
  /**
243
119
  * Representación JSON para serialización.
@@ -253,6 +129,5 @@ class CorporateConfigurationCarbonFootprintSubsegmentReference extends ObjectVal
253
129
  }
254
130
  }
255
131
  exports.CorporateConfigurationCarbonFootprintSubsegmentReference = CorporateConfigurationCarbonFootprintSubsegmentReference;
256
- _CorporateConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _CorporateConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _CorporateConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap();
132
+ _CorporateConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap();
257
133
  CorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'corporateSubsegmentReference';
258
- CorporateConfigurationCarbonFootprintSubsegmentReference.MAX_NAME_LENGTH = 255;