@carbonbox/domain 0.7.22 → 0.7.23

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 (79) 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/shared/domain/value-objects/CarbonFootprintSegmentReferences.js +16 -103
  8. package/build/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.js +15 -29
  9. package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.js +6 -131
  10. package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.js +6 -131
  11. package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.js +7 -149
  12. package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.js +9 -165
  13. package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.js +42 -50
  14. package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.js +8 -112
  15. package/build/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.js +11 -136
  16. package/build/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.js +11 -168
  17. package/build/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.js +11 -136
  18. package/build/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.js +35 -56
  19. package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.js +6 -172
  20. package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.js +6 -172
  21. package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationSegment.d.ts.map +1 -1
  22. package/build/types/carbonbox/carbon-footprint-configurations/corporate-configurations/corporate-segment-configurations/segments/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentIncludedSubsegments.d.ts.map +1 -1
  23. package/build/types/carbonbox/carbon-footprint-configurations/event-configurations/event-edition-lifecycle-stage-configurations/domain/value-objects/EventEditionLifecycleStageConfigurationStage.d.ts.map +1 -1
  24. 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
  25. package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/domain/value-objects/ProductCarbonFootprintSegmentConfigurationSegment.d.ts.map +1 -1
  26. package/build/types/carbonbox/carbon-footprint-configurations/product-configurations/product-segment-configurations/segments/domain/value-objects/ProductConfigurationCarbonFootprintSegmentIncludedSubsegments.d.ts.map +1 -1
  27. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +0 -2
  28. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  29. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts +0 -2
  30. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts.map +1 -1
  31. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +0 -2
  32. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  33. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts +0 -2
  34. package/build/types/carbonbox/shared/domain/types/CorporateConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts.map +1 -1
  35. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +0 -2
  36. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  37. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts +0 -2
  38. package/build/types/carbonbox/shared/domain/types/EventEditionConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts.map +1 -1
  39. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReference.d.ts +0 -2
  40. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReference.d.ts.map +1 -1
  41. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReferencePrimitives.d.ts +0 -2
  42. package/build/types/carbonbox/shared/domain/types/EventEditionLifecycleStageReferencePrimitives.d.ts.map +1 -1
  43. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReference.d.ts +0 -2
  44. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  45. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts +0 -2
  46. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSegmentReferencePrimitives.d.ts.map +1 -1
  47. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +0 -2
  48. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  49. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts +0 -2
  50. package/build/types/carbonbox/shared/domain/types/ProductConfigurationCarbonFootprintSubsegmentReferencePrimitives.d.ts.map +1 -1
  51. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts +7 -43
  52. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts.map +1 -1
  53. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts +6 -8
  54. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  55. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +1 -62
  56. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  57. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +1 -71
  58. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  59. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -78
  60. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  61. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts +5 -68
  62. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts.map +1 -1
  63. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts +20 -19
  64. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts.map +1 -1
  65. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts +2 -45
  66. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts.map +1 -1
  67. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -62
  68. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  69. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -77
  70. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  71. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts +2 -62
  72. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  73. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts +15 -17
  74. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  75. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts +1 -81
  76. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  77. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +1 -90
  78. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  79. 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 _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;
@@ -10,13 +10,12 @@ 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 _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name;
13
+ var _EventEditionConfigurationCarbonFootprintSubsegmentReference_id;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.EventEditionConfigurationCarbonFootprintSubsegmentReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
17
17
  const ObjectValueObject_1 = require("./ObjectValueObject");
18
18
  const AggregateId_1 = require("./AggregateId");
19
- const Code_1 = require("./Code");
20
19
  const String_1 = require("./String");
21
20
  class EventEditionConfigurationCarbonFootprintSubsegmentReference extends ObjectValueObject_1.ObjectValueObject {
22
21
  /**
@@ -26,15 +25,11 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
26
25
  constructor(value, skipDomainValidation, propertyName = EventEditionConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
27
26
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type EventEditionConfigurationCarbonFootprintSubsegmentReference from the domain layer', { allowNull: false, allowUndefined: false });
28
27
  _EventEditionConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
29
- _EventEditionConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
30
- _EventEditionConfigurationCarbonFootprintSubsegmentReference_name.set(this, void 0);
31
28
  if (skipDomainValidation === false) {
32
29
  EventEditionConfigurationCarbonFootprintSubsegmentReference
33
30
  .validateEventEditionConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
34
31
  }
35
32
  __classPrivateFieldSet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
36
- __classPrivateFieldSet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, value.code.trim().toUpperCase(), "f");
37
- __classPrivateFieldSet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_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 EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
42
37
  static validateEventEditionConfigurationCarbonFootprintSubsegmentReference(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 EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
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 el ID usando las validaciones de AggregateId.
@@ -69,136 +56,29 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
69
56
  String_1.String.guardAgainstEmptyValue(id, 'id');
70
57
  AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
71
58
  }
72
- /**
73
- * Valida el código de subsegmento usando las validaciones de Code.
74
- */
75
- static guardAgainstInvalidCode(code) {
76
- String_1.String.guardAgainstEmptyValue(code, 'code');
77
- Code_1.Code.guardAgainstInvalidCode(code);
78
- }
79
- /**
80
- * Valida el nombre del subsegmento.
81
- */
82
- static guardAgainstInvalidName(name) {
83
- String_1.String.guardAgainstEmptyValue(name, 'name');
84
- if (this.nameLengthIsInvalid(name)) {
85
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', `string with maximum ${this.MAX_NAME_LENGTH} characters`, `string with ${name.trim().length} characters`);
86
- }
87
- }
88
- /**
89
- * Verifica si la longitud del nombre es inválida.
90
- */
91
- static nameLengthIsInvalid(name) {
92
- return name.trim().length > this.MAX_NAME_LENGTH;
93
- }
94
59
  /**
95
60
  * ID único del subsegmento (UUID).
96
61
  */
97
62
  get id() {
98
63
  return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f");
99
64
  }
100
- /**
101
- * Código del subsegmento.
102
- */
103
- get code() {
104
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f");
105
- }
106
- /**
107
- * Nombre descriptivo del subsegmento.
108
- */
109
- get name() {
110
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f");
111
- }
112
- /**
113
- * Verifica si el subsegmento corresponde a un código específico.
114
- */
115
- hasCode(code) {
116
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f") === code.trim().toUpperCase();
117
- }
118
- /**
119
- * Verifica si el subsegmento tiene un nombre específico.
120
- */
121
- hasName(name) {
122
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f") === name.trim();
123
- }
124
65
  /**
125
66
  * Verifica si el subsegmento tiene un ID específico.
126
67
  */
127
68
  hasId(id) {
128
69
  return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f") === id.trim();
129
70
  }
130
- /**
131
- * Obtiene una representación legible del subsegmento.
132
- */
133
- getDisplayName() {
134
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f");
135
- }
136
- /**
137
- * Obtiene una representación completa con código y nombre.
138
- */
139
- getFullDisplayName() {
140
- return `${__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f")} - ${__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f")}`;
141
- }
142
- /**
143
- * Verifica si el nombre del subsegmento contiene un texto específico.
144
- */
145
- nameContains(searchText) {
146
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f").toLowerCase().includes(searchText.toLowerCase().trim());
147
- }
148
- /**
149
- * Verifica si el subsegmento coincide con un patrón de búsqueda en código o nombre.
150
- */
151
- matches(searchText) {
152
- const trimmedSearch = searchText.toLowerCase().trim();
153
- return (__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f").toLowerCase().includes(trimmedSearch)
154
- || __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f").toLowerCase().includes(trimmedSearch)
155
- || __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f").toLowerCase().includes(trimmedSearch));
156
- }
157
- /**
158
- * Verifica si el subsegmento es de un tipo específico basado en su nombre.
159
- * Útil para categorizar subsegmentos de etapa (técnico, comercial, logístico, etc.).
160
- */
161
- isSubsegmentType(subsegmentType) {
162
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f").toLowerCase().includes(subsegmentType.toLowerCase().trim());
163
- }
164
- /**
165
- * Verifica si es un subsegmento crítico para la etapa.
166
- * Basado en palabras clave que indican criticidad.
167
- */
168
- isCriticalSubsegment() {
169
- const criticalKeywords = ['crítico', 'critical', 'esencial', 'essential', 'prioritario', 'priority', 'urgente', 'urgent'];
170
- const lowerSubsegmentName = __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f").toLowerCase();
171
- return criticalKeywords.some((keyword) => lowerSubsegmentName.includes(keyword));
172
- }
173
- /**
174
- * Ejecuta una función con el código y nombre del subsegmento.
175
- * Útil para operaciones funcionales.
176
- */
177
- apply(callback) {
178
- callback(__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f"), __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f"), __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f"));
179
- }
180
- /**
181
- * Transforma el subsegmento aplicando una función.
182
- * Útil para transformaciones funcionales.
183
- */
184
- map(transform) {
185
- return transform(__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f"), __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f"), __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f"));
186
- }
187
71
  /**
188
72
  * Compara la igualdad semántica con otra referencia de subsegmento.
189
- * Dos referencias son iguales si tienen el mismo código y nombre.
190
73
  */
191
74
  equals(other) {
192
75
  if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
193
76
  return false;
194
77
  }
195
- return (__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f")
196
- && __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f")
197
- && __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f"));
78
+ return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f");
198
79
  }
199
80
  /**
200
- * Compara si dos referencias apuntan al mismo subsegmento
201
- * basándose únicamente en el código (identificador único).
81
+ * Compara si dos referencias apuntan al mismo subsegmento.
202
82
  */
203
83
  hasSameSubsegment(other) {
204
84
  if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
@@ -206,30 +86,11 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
206
86
  }
207
87
  return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f");
208
88
  }
209
- /**
210
- * Compara si dos subsegmentos tienen el mismo código.
211
- */
212
- hasSameCode(other) {
213
- if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
214
- return false;
215
- }
216
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f");
217
- }
218
- /**
219
- * Compara si dos subsegmentos tienen el mismo nombre.
220
- */
221
- hasSameName(other) {
222
- if (!(other instanceof EventEditionConfigurationCarbonFootprintSubsegmentReference)) {
223
- return false;
224
- }
225
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f") === __classPrivateFieldGet(other, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f");
226
- }
227
89
  /**
228
90
  * Genera un hash code para usar en colecciones.
229
- * Basado en el código de subsegmento y nombre.
230
91
  */
231
92
  hashCode() {
232
- return `${__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f")}_${__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f")}_${__classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f")}`;
93
+ return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f");
233
94
  }
234
95
  /**
235
96
  * Convierte a representación primitiva para persistencia.
@@ -237,15 +98,13 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
237
98
  toPrimitives() {
238
99
  return {
239
100
  id: __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f"),
240
- code: __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f"),
241
- name: __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_name, "f"),
242
101
  };
243
102
  }
244
103
  /**
245
- * Representación como string (nombre del subsegmento).
104
+ * Representación como string (id del subsegmento).
246
105
  */
247
106
  toString() {
248
- return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_code, "f");
107
+ return __classPrivateFieldGet(this, _EventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f");
249
108
  }
250
109
  /**
251
110
  * Representación JSON para serialización.
@@ -255,6 +114,5 @@ class EventEditionConfigurationCarbonFootprintSubsegmentReference extends Object
255
114
  }
256
115
  }
257
116
  exports.EventEditionConfigurationCarbonFootprintSubsegmentReference = EventEditionConfigurationCarbonFootprintSubsegmentReference;
258
- _EventEditionConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _EventEditionConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _EventEditionConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap();
117
+ _EventEditionConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap();
259
118
  EventEditionConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'eventEditionStageSubsegmentReference';
260
- EventEditionConfigurationCarbonFootprintSubsegmentReference.MAX_NAME_LENGTH = 255;