@carbonbox/domain 0.4.8 → 0.4.9

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 (220) hide show
  1. package/build/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.js +97 -61
  2. package/build/carbonbox/shared/domain/value-objects/Address.js +63 -52
  3. package/build/carbonbox/shared/domain/value-objects/AggregateId.js +13 -18
  4. package/build/carbonbox/shared/domain/value-objects/Boolean.js +29 -30
  5. package/build/carbonbox/shared/domain/value-objects/CalculationProcessReference.js +36 -32
  6. package/build/carbonbox/shared/domain/value-objects/CalculationVariableReferences.js +82 -62
  7. package/build/carbonbox/shared/domain/value-objects/CarbonClientReference.js +181 -114
  8. package/build/carbonbox/shared/domain/value-objects/CarbonClientReferences.js +109 -74
  9. package/build/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.js +37 -27
  10. package/build/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.js +101 -68
  11. package/build/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.js +95 -60
  12. package/build/carbonbox/shared/domain/value-objects/CodeList.js +57 -41
  13. package/build/carbonbox/shared/domain/value-objects/CollectionFieldReference.js +74 -49
  14. package/build/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.js +171 -116
  15. package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.js +70 -43
  16. package/build/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.js +70 -43
  17. package/build/carbonbox/shared/domain/value-objects/Currency.js +10 -15
  18. package/build/carbonbox/shared/domain/value-objects/DateString.js +15 -20
  19. package/build/carbonbox/shared/domain/value-objects/DateTimeString.js +17 -22
  20. package/build/carbonbox/shared/domain/value-objects/Email.js +9 -14
  21. package/build/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.js +46 -31
  22. package/build/carbonbox/shared/domain/value-objects/EmissionCalculationReference.js +102 -77
  23. package/build/carbonbox/shared/domain/value-objects/EmissionFactorReference.js +56 -40
  24. package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.js +58 -38
  25. package/build/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.js +95 -60
  26. package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.js +171 -116
  27. package/build/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.js +43 -30
  28. package/build/carbonbox/shared/domain/value-objects/EventEditionReference.js +49 -33
  29. package/build/carbonbox/shared/domain/value-objects/EventEditionReferences.js +65 -49
  30. package/build/carbonbox/shared/domain/value-objects/EventReference.js +41 -31
  31. package/build/carbonbox/shared/domain/value-objects/ExecutionPeriod.js +95 -79
  32. package/build/carbonbox/shared/domain/value-objects/FacilityReference.js +34 -24
  33. package/build/carbonbox/shared/domain/value-objects/Gender.js +11 -16
  34. package/build/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.js +72 -53
  35. package/build/carbonbox/shared/domain/value-objects/Image.js +46 -38
  36. package/build/carbonbox/shared/domain/value-objects/Integer.js +13 -18
  37. package/build/carbonbox/shared/domain/value-objects/NullableCode.js +17 -22
  38. package/build/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.js +49 -31
  39. package/build/carbonbox/shared/domain/value-objects/NullableDate.js +25 -27
  40. package/build/carbonbox/shared/domain/value-objects/NullableDateTimeString.js +34 -37
  41. package/build/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.js +49 -31
  42. package/build/carbonbox/shared/domain/value-objects/NullableNumeric.js +60 -63
  43. package/build/carbonbox/shared/domain/value-objects/NullablePositiveInteger.js +4 -11
  44. package/build/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.js +49 -31
  45. package/build/carbonbox/shared/domain/value-objects/NullableStakeholderReference.js +8 -8
  46. package/build/carbonbox/shared/domain/value-objects/NullableString.js +22 -25
  47. package/build/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.js +43 -35
  48. package/build/carbonbox/shared/domain/value-objects/Numeric.js +72 -69
  49. package/build/carbonbox/shared/domain/value-objects/Phone.js +66 -47
  50. package/build/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.js +176 -121
  51. package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.js +101 -61
  52. package/build/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.js +101 -61
  53. package/build/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.js +60 -40
  54. package/build/carbonbox/shared/domain/value-objects/ProductReference.js +46 -31
  55. package/build/carbonbox/shared/domain/value-objects/ServiceCatalogReference.js +60 -40
  56. package/build/carbonbox/shared/domain/value-objects/StakeholderReference.js +123 -75
  57. package/build/carbonbox/shared/domain/value-objects/StakeholderReferences.js +124 -81
  58. package/build/carbonbox/shared/domain/value-objects/String.js +13 -17
  59. package/build/carbonbox/shared/domain/value-objects/StringList.js +35 -35
  60. package/build/carbonbox/shared/domain/value-objects/TaxIdentification.js +121 -85
  61. package/build/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.js +57 -52
  62. package/build/carbonbox/shared/domain/value-objects/Url.js +14 -19
  63. package/build/carbonbox/shared/domain/value-objects/UrlList.js +57 -41
  64. package/build/carbonbox/shared/domain/value-objects/UserBusinessStatus.js +17 -22
  65. package/build/carbonbox/shared/domain/value-objects/UserEmail.js +48 -40
  66. package/build/carbonbox/shared/domain/value-objects/UserPassword.js +29 -32
  67. package/build/carbonbox/shared/domain/value-objects/UserPermissions.js +47 -46
  68. package/build/carbonbox/shared/domain/value-objects/UserType.js +17 -22
  69. package/build/carbonbox/shared/domain/value-objects/ValueObject.js +17 -16
  70. package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts +37 -1
  71. package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts.map +1 -1
  72. package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts +22 -4
  73. package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts.map +1 -1
  74. package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts +4 -3
  75. package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts.map +1 -1
  76. package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts +2 -2
  77. package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts.map +1 -1
  78. package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts +5 -1
  79. package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts.map +1 -1
  80. package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts +5 -1
  81. package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts.map +1 -1
  82. package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts +24 -4
  83. package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts.map +1 -1
  84. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts +70 -2
  85. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts.map +1 -1
  86. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts +39 -2
  87. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts.map +1 -1
  88. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts +11 -1
  89. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts.map +1 -1
  90. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts +35 -1
  91. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts.map +1 -1
  92. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts +38 -2
  93. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts.map +1 -1
  94. package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts +1 -1
  95. package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts.map +1 -1
  96. package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts +18 -2
  97. package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts.map +1 -1
  98. package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts +26 -1
  99. package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts.map +1 -1
  100. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts +64 -2
  101. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  102. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +30 -2
  103. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  104. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +30 -2
  105. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  106. package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts +3 -2
  107. package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts.map +1 -1
  108. package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts +5 -3
  109. package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts.map +1 -1
  110. package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts +5 -3
  111. package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts.map +1 -1
  112. package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts +3 -2
  113. package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts.map +1 -1
  114. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts +16 -1
  115. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts.map +1 -1
  116. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts +26 -1
  117. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts.map +1 -1
  118. package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts +17 -1
  119. package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts.map +1 -1
  120. package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts +1 -1
  121. package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts.map +1 -1
  122. package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts +3 -3
  123. package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts.map +1 -1
  124. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +22 -2
  125. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  126. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts +38 -2
  127. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts.map +1 -1
  128. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts +64 -2
  129. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts.map +1 -1
  130. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts +14 -1
  131. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts.map +1 -1
  132. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts +17 -1
  133. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts.map +1 -1
  134. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts +20 -4
  135. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts.map +1 -1
  136. package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts +11 -1
  137. package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts.map +1 -1
  138. package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts +16 -1
  139. package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts.map +1 -1
  140. package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts +11 -1
  141. package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts.map +1 -1
  142. package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts +4 -3
  143. package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts.map +1 -1
  144. package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts +21 -2
  145. package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts.map +1 -1
  146. package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts +12 -0
  147. package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts.map +1 -1
  148. package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts +4 -2
  149. package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts.map +1 -1
  150. package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts +4 -2
  151. package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts.map +1 -1
  152. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
  153. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  154. package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts +6 -1
  155. package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts.map +1 -1
  156. package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts +5 -1
  157. package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts.map +1 -1
  158. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
  159. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  160. package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts +6 -2
  161. package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts.map +1 -1
  162. package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts +3 -2
  163. package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts.map +1 -1
  164. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
  165. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  166. package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts +2 -1
  167. package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts.map +1 -1
  168. package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts +5 -1
  169. package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts.map +1 -1
  170. package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts +20 -5
  171. package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts.map +1 -1
  172. package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts +11 -2
  173. package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts.map +1 -1
  174. package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts +21 -2
  175. package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts.map +1 -1
  176. package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts +2 -1
  177. package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts.map +1 -1
  178. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts +60 -2
  179. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  180. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts +45 -4
  181. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  182. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +45 -4
  183. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  184. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts +21 -1
  185. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts.map +1 -1
  186. package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts +16 -1
  187. package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts.map +1 -1
  188. package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts +21 -1
  189. package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts.map +1 -1
  190. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts +51 -2
  191. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts.map +1 -1
  192. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts +46 -2
  193. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts.map +1 -1
  194. package/build/types/carbonbox/shared/domain/value-objects/String.d.ts +3 -1
  195. package/build/types/carbonbox/shared/domain/value-objects/String.d.ts.map +1 -1
  196. package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts +7 -1
  197. package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts.map +1 -1
  198. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts +41 -3
  199. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts.map +1 -1
  200. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts +4 -4
  201. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts.map +1 -1
  202. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts +16 -4
  203. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts.map +1 -1
  204. package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts +2 -1
  205. package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts.map +1 -1
  206. package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts +18 -2
  207. package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts.map +1 -1
  208. package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts +4 -2
  209. package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts.map +1 -1
  210. package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts +10 -1
  211. package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts.map +1 -1
  212. package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts +7 -3
  213. package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts.map +1 -1
  214. package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts +11 -3
  215. package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts.map +1 -1
  216. package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts +4 -2
  217. package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts.map +1 -1
  218. package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts +2 -0
  219. package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts.map +1 -1
  220. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- 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");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
2
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
3
  if (kind === "m") throw new TypeError("Private method is not writable");
9
4
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
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");
11
6
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
7
  };
13
- var _Image_instances, _Image_fullSizeUrl, _Image_thumbnailUrl, _Image_altText, _Image_uploadedAt, _Image_dimensions, _Image_guardAgainstInvalidImageProperties, _Image_guardAgainstInvalidUploadedAt, _Image_guardAgainstInvalidFullSizeUrl, _Image_guardAgainstInvalidAltText, _Image_guardAgainstInvalidDimensions, _Image_guardAgainstInvalidWidth, _Image_guardAgainstInvalidHeight, _Image_guardAgainstInvalidThumbnailUrl, _Image_thumbnailUrlIsProvided;
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 _Image_fullSizeUrl, _Image_thumbnailUrl, _Image_altText, _Image_uploadedAt, _Image_dimensions;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.Image = void 0;
16
16
  const DateString_1 = require("./DateString");
@@ -22,14 +22,13 @@ const InvalidPropertyValueError_1 = require("../exceptions/InvalidPropertyValueE
22
22
  class Image extends ObjectValueObject_1.ObjectValueObject {
23
23
  constructor(value, skipDomainValidation, propertyName) {
24
24
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type Image from the domain layer', { allowNull: false, allowUndefined: false });
25
- _Image_instances.add(this);
26
25
  _Image_fullSizeUrl.set(this, void 0);
27
26
  _Image_thumbnailUrl.set(this, void 0);
28
27
  _Image_altText.set(this, void 0);
29
28
  _Image_uploadedAt.set(this, void 0);
30
29
  _Image_dimensions.set(this, void 0);
31
30
  if (skipDomainValidation === false) {
32
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidImageProperties).call(this, value);
31
+ this.guardAgainstInvalidImageProperties(value);
33
32
  }
34
33
  __classPrivateFieldSet(this, _Image_fullSizeUrl, value.fullSizeUrl, "f");
35
34
  __classPrivateFieldSet(this, _Image_thumbnailUrl, value.thumbnailUrl, "f");
@@ -40,6 +39,44 @@ class Image extends ObjectValueObject_1.ObjectValueObject {
40
39
  height: value.dimensions.height,
41
40
  }, "f");
42
41
  }
42
+ guardAgainstInvalidImageProperties(value) {
43
+ this.guardAgainstInvalidUploadedAt(value.uploadedAt);
44
+ this.guardAgainstInvalidFullSizeUrl(value.fullSizeUrl);
45
+ this.guardAgainstInvalidAltText(value.altText);
46
+ this.guardAgainstInvalidDimensions(value.dimensions);
47
+ this.guardAgainstInvalidThumbnailUrl(value.thumbnailUrl);
48
+ }
49
+ guardAgainstInvalidUploadedAt(value) {
50
+ DateString_1.DateString.guardAgainstInvalidDateFormat(value);
51
+ }
52
+ guardAgainstInvalidFullSizeUrl(value) {
53
+ Url_1.Url.guardAgainstInvalidUrl(value, 'fullSizeUrl');
54
+ }
55
+ guardAgainstInvalidAltText(value) {
56
+ String_1.String.guardAgainstInvalidType(value, 'altText');
57
+ }
58
+ guardAgainstInvalidDimensions(value) {
59
+ this.guardAgainstInvalidWidth(value.width);
60
+ this.guardAgainstInvalidHeight(value.height);
61
+ }
62
+ guardAgainstInvalidWidth(width) {
63
+ if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(width)) {
64
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.width', 'positive integer', width.toString());
65
+ }
66
+ }
67
+ guardAgainstInvalidHeight(height) {
68
+ if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(height)) {
69
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.height', 'positive integer', height.toString());
70
+ }
71
+ }
72
+ guardAgainstInvalidThumbnailUrl(thumbnailUrl) {
73
+ if (this.thumbnailUrlIsProvided(thumbnailUrl)) {
74
+ Url_1.Url.guardAgainstInvalidUrl(thumbnailUrl, 'thumbnailUrl');
75
+ }
76
+ }
77
+ thumbnailUrlIsProvided(thumbnailUrl) {
78
+ return thumbnailUrl !== undefined && thumbnailUrl !== null;
79
+ }
43
80
  get fullSizeUrl() {
44
81
  return __classPrivateFieldGet(this, _Image_fullSizeUrl, "f");
45
82
  }
@@ -63,33 +100,4 @@ class Image extends ObjectValueObject_1.ObjectValueObject {
63
100
  }
64
101
  }
65
102
  exports.Image = Image;
66
- _Image_fullSizeUrl = new WeakMap(), _Image_thumbnailUrl = new WeakMap(), _Image_altText = new WeakMap(), _Image_uploadedAt = new WeakMap(), _Image_dimensions = new WeakMap(), _Image_instances = new WeakSet(), _Image_guardAgainstInvalidImageProperties = function _Image_guardAgainstInvalidImageProperties(value) {
67
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidUploadedAt).call(this, value.uploadedAt);
68
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidFullSizeUrl).call(this, value.fullSizeUrl);
69
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidAltText).call(this, value.altText);
70
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidDimensions).call(this, value.dimensions);
71
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidThumbnailUrl).call(this, value.thumbnailUrl);
72
- }, _Image_guardAgainstInvalidUploadedAt = function _Image_guardAgainstInvalidUploadedAt(value) {
73
- DateString_1.DateString.guardAgainstInvalidDateFormat(value);
74
- }, _Image_guardAgainstInvalidFullSizeUrl = function _Image_guardAgainstInvalidFullSizeUrl(value) {
75
- Url_1.Url.guardAgainstInvalidUrl(value, 'fullSizeUrl');
76
- }, _Image_guardAgainstInvalidAltText = function _Image_guardAgainstInvalidAltText(value) {
77
- String_1.String.guardAgainstInvalidType(value, 'altText');
78
- }, _Image_guardAgainstInvalidDimensions = function _Image_guardAgainstInvalidDimensions(value) {
79
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidWidth).call(this, value.width);
80
- __classPrivateFieldGet(this, _Image_instances, "m", _Image_guardAgainstInvalidHeight).call(this, value.height);
81
- }, _Image_guardAgainstInvalidWidth = function _Image_guardAgainstInvalidWidth(width) {
82
- if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(width)) {
83
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.width', 'positive integer', width.toString());
84
- }
85
- }, _Image_guardAgainstInvalidHeight = function _Image_guardAgainstInvalidHeight(height) {
86
- if (!PositiveInteger_1.PositiveInteger.isValidPositiveInteger(height)) {
87
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('dimensions.height', 'positive integer', height.toString());
88
- }
89
- }, _Image_guardAgainstInvalidThumbnailUrl = function _Image_guardAgainstInvalidThumbnailUrl(thumbnailUrl) {
90
- if (__classPrivateFieldGet(this, _Image_instances, "m", _Image_thumbnailUrlIsProvided).call(this, thumbnailUrl)) {
91
- Url_1.Url.guardAgainstInvalidUrl(thumbnailUrl, 'thumbnailUrl');
92
- }
93
- }, _Image_thumbnailUrlIsProvided = function _Image_thumbnailUrlIsProvided(thumbnailUrl) {
94
- return thumbnailUrl !== undefined && thumbnailUrl !== null;
95
- };
103
+ _Image_fullSizeUrl = new WeakMap(), _Image_thumbnailUrl = new WeakMap(), _Image_altText = new WeakMap(), _Image_uploadedAt = new WeakMap(), _Image_dimensions = new WeakMap();
@@ -1,37 +1,32 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- 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");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
- var _Integer_instances, _a, _Integer_guardAgainstNonIntegerValue, _Integer_valueIsNotInteger, _Integer_valueIsInteger;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.Integer = void 0;
10
4
  const NotIntegerError_1 = require("../exceptions/NotIntegerError");
11
5
  const PrimitiveValueObject_1 = require("./PrimitiveValueObject");
12
6
  class Integer extends PrimitiveValueObject_1.PrimitiveValueObject {
13
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
7
+ constructor(value, skipDomainValidation, propertyName = Integer.DEFAULT_PROPERTY_NAME) {
14
8
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type Integer from the domain layer', { allowNull: false, allowUndefined: false });
15
- _Integer_instances.add(this);
16
9
  if (skipDomainValidation === false) {
17
- __classPrivateFieldGet(this, _Integer_instances, "m", _Integer_guardAgainstNonIntegerValue).call(this, value, propertyName);
10
+ this.guardAgainstNonIntegerValue(value, propertyName);
18
11
  }
19
12
  }
20
13
  static guardAgainstInvalidInteger(value, propertyName) {
21
- if (__classPrivateFieldGet(this, _a, "m", _Integer_valueIsNotInteger).call(this, value)) {
14
+ if (this.valueIsNotInteger(value)) {
22
15
  throw NotIntegerError_1.NotIntegerError.create(propertyName, value);
23
16
  }
24
17
  }
18
+ guardAgainstNonIntegerValue(value, propertyName) {
19
+ Integer.guardAgainstInvalidInteger(value, propertyName);
20
+ }
21
+ static valueIsNotInteger(value) {
22
+ return this.valueIsInteger(value) === false;
23
+ }
24
+ static valueIsInteger(value) {
25
+ return Number.isInteger(value);
26
+ }
25
27
  static isValidInteger(value) {
26
- return __classPrivateFieldGet(this, _a, "m", _Integer_valueIsInteger).call(this, value);
28
+ return this.valueIsInteger(value);
27
29
  }
28
30
  }
29
31
  exports.Integer = Integer;
30
- _a = Integer, _Integer_instances = new WeakSet(), _Integer_guardAgainstNonIntegerValue = function _Integer_guardAgainstNonIntegerValue(value, propertyName) {
31
- _a.guardAgainstInvalidInteger(value, propertyName);
32
- }, _Integer_valueIsNotInteger = function _Integer_valueIsNotInteger(value) {
33
- return __classPrivateFieldGet(this, _a, "m", _Integer_valueIsInteger).call(this, value) === false;
34
- }, _Integer_valueIsInteger = function _Integer_valueIsInteger(value) {
35
- return Number.isInteger(value);
36
- };
37
32
  Integer.DEFAULT_PROPERTY_NAME = 'integer';
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- 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");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
- var _NullableCode_instances, _NullableCode_guardAgainstInvalidNullableCode, _NullableCode_guardAgainstInvalidCodeValue, _NullableCode_valueIsNotNull;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.NullableCode = void 0;
10
4
  const ValueObject_1 = require("./ValueObject");
@@ -13,14 +7,24 @@ const InvalidCodeError_1 = require("../exceptions/InvalidCodeError");
13
7
  class NullableCode extends ValueObject_1.ValueObject {
14
8
  constructor(value, skipDomainValidation, propertyName = NullableCode.DEFAULT_PROPERTY_NAME) {
15
9
  super(value, skipDomainValidation, propertyName, 'string | null', { allowNull: true, allowUndefined: false });
16
- _NullableCode_instances.add(this);
17
10
  if (skipDomainValidation === false) {
18
- __classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_guardAgainstInvalidNullableCode).call(this, value, propertyName);
11
+ this.guardAgainstInvalidNullableCode(value, propertyName);
19
12
  }
20
13
  }
14
+ guardAgainstInvalidNullableCode(value, propertyName) {
15
+ if (this.valueIsNotNull(value)) {
16
+ this.guardAgainstInvalidCodeValue(value, propertyName);
17
+ }
18
+ }
19
+ guardAgainstInvalidCodeValue(value, propertyName) {
20
+ Code_1.Code.guardAgainstInvalidCode(value, propertyName);
21
+ }
22
+ valueIsNotNull(value) {
23
+ return value !== null;
24
+ }
21
25
  // Métodos de consulta públicos
22
26
  hasValue() {
23
- return __classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_valueIsNotNull).call(this, this.value);
27
+ return this.valueIsNotNull(this.value);
24
28
  }
25
29
  getValue() {
26
30
  return this.value;
@@ -136,12 +140,12 @@ class NullableCode extends ValueObject_1.ValueObject {
136
140
  }
137
141
  // Métodos de guardas para casos específicos
138
142
  guardAgainstEmptyCode(value, propertyName) {
139
- if (__classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_valueIsNotNull).call(this, value) && value.trim() === '') {
143
+ if (this.valueIsNotNull(value) && value.trim() === '') {
140
144
  throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
141
145
  }
142
146
  }
143
147
  guardAgainstCodeLength(value, propertyName, minLength, maxLength) {
144
- if (__classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_valueIsNotNull).call(this, value)) {
148
+ if (this.valueIsNotNull(value)) {
145
149
  const { length } = value;
146
150
  if (length < minLength || length > maxLength) {
147
151
  throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
@@ -149,12 +153,12 @@ class NullableCode extends ValueObject_1.ValueObject {
149
153
  }
150
154
  }
151
155
  guardAgainstInvalidPrefix(value, propertyName, requiredPrefix) {
152
- if (__classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_valueIsNotNull).call(this, value) && !value.startsWith(requiredPrefix)) {
156
+ if (this.valueIsNotNull(value) && !value.startsWith(requiredPrefix)) {
153
157
  throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
154
158
  }
155
159
  }
156
160
  guardAgainstInvalidSuffix(value, propertyName, requiredSuffix) {
157
- if (__classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_valueIsNotNull).call(this, value) && !value.endsWith(requiredSuffix)) {
161
+ if (this.valueIsNotNull(value) && !value.endsWith(requiredSuffix)) {
158
162
  throw InvalidCodeError_1.InvalidCodeError.create(value, propertyName);
159
163
  }
160
164
  }
@@ -169,14 +173,5 @@ class NullableCode extends ValueObject_1.ValueObject {
169
173
  }
170
174
  }
171
175
  exports.NullableCode = NullableCode;
172
- _NullableCode_instances = new WeakSet(), _NullableCode_guardAgainstInvalidNullableCode = function _NullableCode_guardAgainstInvalidNullableCode(value, propertyName) {
173
- if (__classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_valueIsNotNull).call(this, value)) {
174
- __classPrivateFieldGet(this, _NullableCode_instances, "m", _NullableCode_guardAgainstInvalidCodeValue).call(this, value, propertyName);
175
- }
176
- }, _NullableCode_guardAgainstInvalidCodeValue = function _NullableCode_guardAgainstInvalidCodeValue(value, propertyName) {
177
- Code_1.Code.guardAgainstInvalidCode(value, propertyName);
178
- }, _NullableCode_valueIsNotNull = function _NullableCode_valueIsNotNull(value) {
179
- return value !== null;
180
- };
181
176
  NullableCode.DEFAULT_PROPERTY_NAME = 'code';
182
177
  NullableCode.DEFAULT_CODE_REGEX = /^[A-Za-z0-9][A-Za-z0-9_.-]*$/;
@@ -10,7 +10,7 @@ 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, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_name, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName;
13
+ var _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_name, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.NullableCorporateConfigurationCarbonFootprintSubsegmentReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -24,7 +24,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
24
24
  * Aplica todas las validaciones de dominio al momento de construcción.
25
25
  * Permite valores null para representar la ausencia de subsegmento corporativo.
26
26
  */
27
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
27
+ constructor(value, skipDomainValidation, propertyName = NullableCorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
28
28
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type CorporateConfigurationCarbonFootprintSubsegmentReference from the domain layer or null', { allowNull: true, allowUndefined: false });
29
29
  _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
30
30
  _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
@@ -38,7 +38,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
38
38
  }
39
39
  else {
40
40
  if (skipDomainValidation === false) {
41
- _a
41
+ NullableCorporateConfigurationCarbonFootprintSubsegmentReference
42
42
  .validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
43
43
  }
44
44
  __classPrivateFieldSet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
@@ -51,10 +51,49 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
51
51
  * Validación estática para reutilización en factory methods y constructores.
52
52
  */
53
53
  static validateCorporateConfigurationCarbonFootprintSubsegmentReference(value, propertyName) {
54
- __classPrivateFieldGet(this, _a, "m", _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType).call(this, value, propertyName);
55
- __classPrivateFieldGet(this, _a, "m", _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId).call(this, value.id);
56
- __classPrivateFieldGet(this, _a, "m", _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode).call(this, value.code);
57
- __classPrivateFieldGet(this, _a, "m", _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName).call(this, value.name);
54
+ this.guardAgainstInvalidType(value, propertyName);
55
+ this.guardAgainstInvalidId(value.id);
56
+ this.guardAgainstInvalidSubsegmentCode(value.code);
57
+ this.guardAgainstInvalidSubsegmentName(value.name);
58
+ }
59
+ /**
60
+ * Valida que el objeto tenga la estructura correcta.
61
+ */
62
+ static guardAgainstInvalidType(value, propertyName) {
63
+ if (!value || typeof value !== 'object') {
64
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CorporateConfigurationCarbonFootprintSubsegmentReference object', typeof value);
65
+ }
66
+ if (typeof value.id !== 'string') {
67
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
68
+ }
69
+ if (typeof value.code !== 'string') {
70
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
71
+ }
72
+ if (typeof value.name !== 'string') {
73
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
74
+ }
75
+ }
76
+ /**
77
+ * Valida el ID usando las validaciones de AggregateId.
78
+ */
79
+ static guardAgainstInvalidId(id) {
80
+ String_1.String.guardAgainstEmptyValue(id, 'id');
81
+ AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
82
+ }
83
+ /**
84
+ * Valida el código de subsegmento corporativo usando las validaciones de Code.
85
+ * El código debe ser un UUID válido.
86
+ */
87
+ static guardAgainstInvalidSubsegmentCode(code) {
88
+ String_1.String.guardAgainstEmptyValue(code, 'code');
89
+ Code_1.Code.guardAgainstInvalidCode(code);
90
+ }
91
+ /**
92
+ * Valida el nombre del subsegmento corporativo.
93
+ * No debe ser vacío después de aplicar trim.
94
+ */
95
+ static guardAgainstInvalidSubsegmentName(name) {
96
+ String_1.String.guardAgainstEmptyValue(name, 'name');
58
97
  }
59
98
  get id() {
60
99
  return __classPrivateFieldGet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id, "f");
@@ -171,7 +210,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
171
210
  * Dos referencias son iguales si ambas son null o si tienen el mismo código y nombre.
172
211
  */
173
212
  equals(other) {
174
- if (!(other instanceof _a)) {
213
+ if (!(other instanceof NullableCorporateConfigurationCarbonFootprintSubsegmentReference)) {
175
214
  return false;
176
215
  }
177
216
  if (__classPrivateFieldGet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
@@ -188,7 +227,7 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
188
227
  * basándose únicamente en el código (identificador único).
189
228
  */
190
229
  hasSameSubsegment(other) {
191
- if (!(other instanceof _a)) {
230
+ if (!(other instanceof NullableCorporateConfigurationCarbonFootprintSubsegmentReference)) {
192
231
  return false;
193
232
  }
194
233
  if (__classPrivateFieldGet(this, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
@@ -236,26 +275,5 @@ class NullableCorporateConfigurationCarbonFootprintSubsegmentReference extends V
236
275
  }
237
276
  }
238
277
  exports.NullableCorporateConfigurationCarbonFootprintSubsegmentReference = NullableCorporateConfigurationCarbonFootprintSubsegmentReference;
239
- _a = NullableCorporateConfigurationCarbonFootprintSubsegmentReference, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType = function _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType(value, propertyName) {
240
- if (!value || typeof value !== 'object') {
241
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CorporateConfigurationCarbonFootprintSubsegmentReference object', typeof value);
242
- }
243
- if (typeof value.id !== 'string') {
244
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
245
- }
246
- if (typeof value.code !== 'string') {
247
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
248
- }
249
- if (typeof value.name !== 'string') {
250
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
251
- }
252
- }, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId = function _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId(id) {
253
- String_1.String.guardAgainstEmptyValue(id, 'id');
254
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
255
- }, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode = function _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode(code) {
256
- String_1.String.guardAgainstEmptyValue(code, 'code');
257
- Code_1.Code.guardAgainstInvalidCode(code);
258
- }, _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName = function _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName(name) {
259
- String_1.String.guardAgainstEmptyValue(name, 'name');
260
- };
278
+ _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap(), _NullableCorporateConfigurationCarbonFootprintSubsegmentReference_isNull = new WeakMap();
261
279
  NullableCorporateConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'corporateSubsegmentReference';
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- 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");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
- var _NullableDate_instances, _NullableDate_guardAgainstInvalidNullableDate, _NullableDate_guardAgainstInvalidDateString, _NullableDate_guardAgainstEmptyDateString, _NullableDate_guardAgainstInvalidStringType, _NullableDate_guardAgainstInvalidDateFormat, _NullableDate_valueIsNotNull;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.NullableDate = void 0;
10
4
  const DateString_1 = require("./DateString");
@@ -13,16 +7,37 @@ const String_1 = require("./String");
13
7
  class NullableDate extends NullableString_1.NullableString {
14
8
  constructor(value, skipDomainValidation, propertyName) {
15
9
  super(value, skipDomainValidation, propertyName);
16
- _NullableDate_instances.add(this);
17
10
  if (skipDomainValidation === false) {
18
- __classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstInvalidNullableDate).call(this, value, propertyName);
11
+ this.guardAgainstInvalidNullableDate(value, propertyName);
19
12
  }
20
13
  }
14
+ guardAgainstInvalidNullableDate(value, propertyName) {
15
+ if (this.valueIsNotNull(value)) {
16
+ this.guardAgainstInvalidDateString(value, propertyName);
17
+ }
18
+ }
19
+ guardAgainstInvalidDateString(value, propertyName) {
20
+ this.guardAgainstEmptyDateString(value, propertyName);
21
+ this.guardAgainstInvalidStringType(value, propertyName);
22
+ this.guardAgainstInvalidDateFormat(value);
23
+ }
24
+ guardAgainstEmptyDateString(value, propertyName) {
25
+ String_1.String.guardAgainstEmptyValue(value, propertyName);
26
+ }
27
+ guardAgainstInvalidStringType(value, propertyName) {
28
+ String_1.String.guardAgainstInvalidType(value, propertyName);
29
+ }
30
+ guardAgainstInvalidDateFormat(value) {
31
+ DateString_1.DateString.guardAgainstInvalidDateFormat(value);
32
+ }
33
+ valueIsNotNull(value) {
34
+ return value !== null;
35
+ }
21
36
  hasValue() {
22
- return __classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_valueIsNotNull).call(this, this.value);
37
+ return this.valueIsNotNull(this.value);
23
38
  }
24
39
  toDate() {
25
- if (__classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_valueIsNotNull).call(this, this.value)) {
40
+ if (this.valueIsNotNull(this.value)) {
26
41
  const [day, month, year] = this.value.split('/').map(Number);
27
42
  return new Date(year, month - 1, day);
28
43
  }
@@ -44,20 +59,3 @@ class NullableDate extends NullableString_1.NullableString {
44
59
  }
45
60
  }
46
61
  exports.NullableDate = NullableDate;
47
- _NullableDate_instances = new WeakSet(), _NullableDate_guardAgainstInvalidNullableDate = function _NullableDate_guardAgainstInvalidNullableDate(value, propertyName) {
48
- if (__classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_valueIsNotNull).call(this, value)) {
49
- __classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstInvalidDateString).call(this, value, propertyName);
50
- }
51
- }, _NullableDate_guardAgainstInvalidDateString = function _NullableDate_guardAgainstInvalidDateString(value, propertyName) {
52
- __classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstEmptyDateString).call(this, value, propertyName);
53
- __classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstInvalidStringType).call(this, value, propertyName);
54
- __classPrivateFieldGet(this, _NullableDate_instances, "m", _NullableDate_guardAgainstInvalidDateFormat).call(this, value);
55
- }, _NullableDate_guardAgainstEmptyDateString = function _NullableDate_guardAgainstEmptyDateString(value, propertyName) {
56
- String_1.String.guardAgainstEmptyValue(value, propertyName);
57
- }, _NullableDate_guardAgainstInvalidStringType = function _NullableDate_guardAgainstInvalidStringType(value, propertyName) {
58
- String_1.String.guardAgainstInvalidType(value, propertyName);
59
- }, _NullableDate_guardAgainstInvalidDateFormat = function _NullableDate_guardAgainstInvalidDateFormat(value) {
60
- DateString_1.DateString.guardAgainstInvalidDateFormat(value);
61
- }, _NullableDate_valueIsNotNull = function _NullableDate_valueIsNotNull(value) {
62
- return value !== null;
63
- };
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- 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");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
- var _NullableDateTimeString_instances, _NullableDateTimeString_guardAgainstInvalidNullableDateTimeString, _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue, _NullableDateTimeString_valueIsNotNull, _NullableDateTimeString_parseDateTimeComponents, _NullableDateTimeString_parseStringToDate;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.NullableDateTimeString = void 0;
10
4
  const DateTimeString_1 = require("./DateTimeString");
@@ -12,30 +6,40 @@ const ValueObject_1 = require("./ValueObject");
12
6
  class NullableDateTimeString extends ValueObject_1.ValueObject {
13
7
  constructor(value, skipDomainValidation, propertyName) {
14
8
  super(value, skipDomainValidation, propertyName, 'string | null', { allowNull: true, allowUndefined: false });
15
- _NullableDateTimeString_instances.add(this);
16
9
  if (skipDomainValidation === false) {
17
- __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_guardAgainstInvalidNullableDateTimeString).call(this, value);
10
+ this.guardAgainstInvalidNullableDateTimeString(value);
18
11
  }
19
12
  }
13
+ guardAgainstInvalidNullableDateTimeString(value) {
14
+ if (this.valueIsNotNull(value)) {
15
+ this.guardAgainstInvalidDateTimeStringValue(value);
16
+ }
17
+ }
18
+ guardAgainstInvalidDateTimeStringValue(value) {
19
+ DateTimeString_1.DateTimeString.guardAgainstInvalidDateTimeFormat(value);
20
+ }
21
+ valueIsNotNull(value) {
22
+ return value !== null;
23
+ }
20
24
  // Métodos de consulta públicos
21
25
  hasValue() {
22
- return __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_valueIsNotNull).call(this, this.value);
26
+ return this.valueIsNotNull(this.value);
23
27
  }
24
28
  toDate() {
25
- if (__classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_valueIsNotNull).call(this, this.value)) {
26
- const [day, month, year, hours, minutes, seconds] = __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_parseDateTimeComponents).call(this, this.value);
29
+ if (this.valueIsNotNull(this.value)) {
30
+ const [day, month, year, hours, minutes, seconds] = this.parseDateTimeComponents(this.value);
27
31
  return new Date(year, month - 1, day, hours, minutes, seconds);
28
32
  }
29
33
  return null;
30
34
  }
31
35
  getDatePart() {
32
- if (__classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_valueIsNotNull).call(this, this.value)) {
36
+ if (this.valueIsNotNull(this.value)) {
33
37
  return this.value.split(' ')[0];
34
38
  }
35
39
  return null;
36
40
  }
37
41
  getTimePart() {
38
- if (__classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_valueIsNotNull).call(this, this.value)) {
42
+ if (this.valueIsNotNull(this.value)) {
39
43
  return this.value.split(' ')[1];
40
44
  }
41
45
  return null;
@@ -55,7 +59,7 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
55
59
  return null;
56
60
  }
57
61
  const thisDate = this.toDate();
58
- const otherDate = __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_parseStringToDate).call(this, compareValue);
62
+ const otherDate = this.parseStringToDate(compareValue);
59
63
  if (thisDate === null || otherDate === null) {
60
64
  return null;
61
65
  }
@@ -76,7 +80,7 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
76
80
  return null;
77
81
  }
78
82
  const thisDate = this.toDate();
79
- const otherDate = __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_parseStringToDate).call(this, compareValue);
83
+ const otherDate = this.parseStringToDate(compareValue);
80
84
  if (thisDate === null || otherDate === null) {
81
85
  return null;
82
86
  }
@@ -98,6 +102,21 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
98
102
  }
99
103
  return this.value === compareValue;
100
104
  }
105
+ parseDateTimeComponents(value) {
106
+ const [datePart, timePart] = value.split(' ');
107
+ const [day, month, year] = datePart.split('/').map(Number);
108
+ const [hours, minutes, seconds] = timePart.split(':').map(Number);
109
+ return [day, month, year, hours, minutes, seconds];
110
+ }
111
+ parseStringToDate(value) {
112
+ try {
113
+ const [day, month, year, hours, minutes, seconds] = this.parseDateTimeComponents(value);
114
+ return new Date(year, month - 1, day, hours, minutes, seconds);
115
+ }
116
+ catch {
117
+ return null;
118
+ }
119
+ }
101
120
  // Métodos estáticos de validación
102
121
  static isValidNullableDateTimeString(value) {
103
122
  if (value === null) {
@@ -119,25 +138,3 @@ class NullableDateTimeString extends ValueObject_1.ValueObject {
119
138
  }
120
139
  }
121
140
  exports.NullableDateTimeString = NullableDateTimeString;
122
- _NullableDateTimeString_instances = new WeakSet(), _NullableDateTimeString_guardAgainstInvalidNullableDateTimeString = function _NullableDateTimeString_guardAgainstInvalidNullableDateTimeString(value) {
123
- if (__classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_valueIsNotNull).call(this, value)) {
124
- __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue).call(this, value);
125
- }
126
- }, _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue = function _NullableDateTimeString_guardAgainstInvalidDateTimeStringValue(value) {
127
- DateTimeString_1.DateTimeString.guardAgainstInvalidDateTimeFormat(value);
128
- }, _NullableDateTimeString_valueIsNotNull = function _NullableDateTimeString_valueIsNotNull(value) {
129
- return value !== null;
130
- }, _NullableDateTimeString_parseDateTimeComponents = function _NullableDateTimeString_parseDateTimeComponents(value) {
131
- const [datePart, timePart] = value.split(' ');
132
- const [day, month, year] = datePart.split('/').map(Number);
133
- const [hours, minutes, seconds] = timePart.split(':').map(Number);
134
- return [day, month, year, hours, minutes, seconds];
135
- }, _NullableDateTimeString_parseStringToDate = function _NullableDateTimeString_parseStringToDate(value) {
136
- try {
137
- const [day, month, year, hours, minutes, seconds] = __classPrivateFieldGet(this, _NullableDateTimeString_instances, "m", _NullableDateTimeString_parseDateTimeComponents).call(this, value);
138
- return new Date(year, month - 1, day, hours, minutes, seconds);
139
- }
140
- catch {
141
- return null;
142
- }
143
- };