@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
@@ -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, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_id, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_code, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_name, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName;
13
+ var _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_id, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_code, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_name, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.NullableEventEditionConfigurationCarbonFootprintSubsegmentReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -24,7 +24,7 @@ class NullableEventEditionConfigurationCarbonFootprintSubsegmentReference extend
24
24
  * Aplica todas las validaciones de dominio al momento de construcción.
25
25
  * Permite valores null para representar la ausencia de subsegmento de etapa.
26
26
  */
27
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
27
+ constructor(value, skipDomainValidation, propertyName = NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
28
28
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type EventEditionConfigurationCarbonFootprintSubsegmentReference from the domain layer or null', { allowNull: true, allowUndefined: false });
29
29
  _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
30
30
  _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
@@ -38,7 +38,7 @@ class NullableEventEditionConfigurationCarbonFootprintSubsegmentReference extend
38
38
  }
39
39
  else {
40
40
  if (skipDomainValidation === false) {
41
- _a
41
+ NullableEventEditionConfigurationCarbonFootprintSubsegmentReference
42
42
  .validateEventEditionConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
43
43
  }
44
44
  __classPrivateFieldSet(this, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
@@ -51,10 +51,49 @@ class NullableEventEditionConfigurationCarbonFootprintSubsegmentReference extend
51
51
  * Validación estática para reutilización en factory methods y constructores.
52
52
  */
53
53
  static validateEventEditionConfigurationCarbonFootprintSubsegmentReference(value, propertyName) {
54
- __classPrivateFieldGet(this, _a, "m", _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType).call(this, value, propertyName);
55
- __classPrivateFieldGet(this, _a, "m", _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId).call(this, value.id);
56
- __classPrivateFieldGet(this, _a, "m", _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode).call(this, value.code);
57
- __classPrivateFieldGet(this, _a, "m", _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_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, 'EventEditionConfigurationCarbonFootprintSubsegmentReference 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 de etapa 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 de etapa.
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, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_id, "f");
@@ -203,7 +242,7 @@ class NullableEventEditionConfigurationCarbonFootprintSubsegmentReference extend
203
242
  * Dos referencias son iguales si ambas son null o si tienen el mismo código y nombre.
204
243
  */
205
244
  equals(other) {
206
- if (!(other instanceof _a)) {
245
+ if (!(other instanceof NullableEventEditionConfigurationCarbonFootprintSubsegmentReference)) {
207
246
  return false;
208
247
  }
209
248
  if (__classPrivateFieldGet(this, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
@@ -220,7 +259,7 @@ class NullableEventEditionConfigurationCarbonFootprintSubsegmentReference extend
220
259
  * basándose únicamente en el código (identificador único).
221
260
  */
222
261
  hasSameSubsegment(other) {
223
- if (!(other instanceof _a)) {
262
+ if (!(other instanceof NullableEventEditionConfigurationCarbonFootprintSubsegmentReference)) {
224
263
  return false;
225
264
  }
226
265
  if (__classPrivateFieldGet(this, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
@@ -268,26 +307,5 @@ class NullableEventEditionConfigurationCarbonFootprintSubsegmentReference extend
268
307
  }
269
308
  }
270
309
  exports.NullableEventEditionConfigurationCarbonFootprintSubsegmentReference = NullableEventEditionConfigurationCarbonFootprintSubsegmentReference;
271
- _a = NullableEventEditionConfigurationCarbonFootprintSubsegmentReference, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap(), _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull = new WeakMap(), _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType = function _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType(value, propertyName) {
272
- if (!value || typeof value !== 'object') {
273
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'EventEditionConfigurationCarbonFootprintSubsegmentReference object', typeof value);
274
- }
275
- if (typeof value.id !== 'string') {
276
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
277
- }
278
- if (typeof value.code !== 'string') {
279
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('code', 'string', typeof value.code);
280
- }
281
- if (typeof value.name !== 'string') {
282
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('name', 'string', typeof value.name);
283
- }
284
- }, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId = function _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId(id) {
285
- String_1.String.guardAgainstEmptyValue(id, 'id');
286
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
287
- }, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode = function _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode(code) {
288
- String_1.String.guardAgainstEmptyValue(code, 'code');
289
- Code_1.Code.guardAgainstInvalidCode(code);
290
- }, _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName = function _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName(name) {
291
- String_1.String.guardAgainstEmptyValue(name, 'name');
292
- };
310
+ _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap(), _NullableEventEditionConfigurationCarbonFootprintSubsegmentReference_isNull = new WeakMap();
293
311
  NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'eventEditionStageSubsegmentReference';
@@ -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 _NullableNumeric_instances, _NullableNumeric_guardAgainstInvalidNullableNumeric, _NullableNumeric_guardAgainstInvalidNumericValue, _NullableNumeric_guardAgainstOptionsViolations, _NullableNumeric_hasExcessiveDecimalPlaces, _NullableNumeric_valueIsNotNull;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.NullableNumeric = void 0;
10
4
  const Numeric_1 = require("./Numeric");
@@ -13,53 +7,89 @@ const InvalidPropertyValueError_1 = require("../exceptions/InvalidPropertyValueE
13
7
  class NullableNumeric extends ValueObject_1.ValueObject {
14
8
  constructor(value, skipDomainValidation, propertyName, options = NullableNumeric.DEFAULT_NULLABLE_OPTIONS) {
15
9
  super(value, skipDomainValidation, propertyName, 'number | null', { allowNull: true, allowUndefined: false });
16
- _NullableNumeric_instances.add(this);
17
10
  if (skipDomainValidation === false) {
18
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstInvalidNullableNumeric).call(this, value, propertyName, options);
11
+ this.guardAgainstInvalidNullableNumeric(value, propertyName, options);
12
+ }
13
+ }
14
+ guardAgainstInvalidNullableNumeric(value, propertyName, options) {
15
+ if (this.valueIsNotNull(value)) {
16
+ this.guardAgainstInvalidNumericValue(value, propertyName, options);
19
17
  }
20
18
  }
19
+ guardAgainstInvalidNumericValue(value, propertyName, options) {
20
+ Numeric_1.Numeric.guardAgainstInvalidType(value, propertyName);
21
+ Numeric_1.Numeric.guardAgainstInvalidNumber(value, propertyName);
22
+ this.guardAgainstOptionsViolations(value, propertyName, options);
23
+ }
24
+ guardAgainstOptionsViolations(value, propertyName, options) {
25
+ if (!options.allowNegative && value < 0) {
26
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-negative number', value.toString());
27
+ }
28
+ if (!options.allowZero && value === 0) {
29
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-zero number', '0');
30
+ }
31
+ if (!options.allowDecimals && !Number.isInteger(value)) {
32
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'integer number', value.toString());
33
+ }
34
+ if (options.allowDecimals && this.hasExcessiveDecimalPlaces(value, options.maxDecimalPlaces)) {
35
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, `number with maximum ${options.maxDecimalPlaces} decimal places`, value.toString());
36
+ }
37
+ if (value < options.minValue || value > options.maxValue) {
38
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, `number between ${options.minValue} and ${options.maxValue}`, value.toString());
39
+ }
40
+ }
41
+ hasExcessiveDecimalPlaces(value, maxDecimalPlaces) {
42
+ if (Number.isInteger(value)) {
43
+ return false;
44
+ }
45
+ const decimalPart = value.toString().split('.')[1];
46
+ return decimalPart ? decimalPart.length > maxDecimalPlaces : false;
47
+ }
48
+ valueIsNotNull(value) {
49
+ return value !== null;
50
+ }
21
51
  // Métodos de consulta públicos
22
52
  hasValue() {
23
- return __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value);
53
+ return this.valueIsNotNull(this.value);
24
54
  }
25
55
  isInteger() {
26
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
56
+ if (this.valueIsNotNull(this.value)) {
27
57
  return Number.isInteger(this.value);
28
58
  }
29
59
  return null;
30
60
  }
31
61
  isDecimal() {
32
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
62
+ if (this.valueIsNotNull(this.value)) {
33
63
  return !Number.isInteger(this.value);
34
64
  }
35
65
  return null;
36
66
  }
37
67
  isPositive() {
38
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
68
+ if (this.valueIsNotNull(this.value)) {
39
69
  return this.value > 0;
40
70
  }
41
71
  return null;
42
72
  }
43
73
  isNegative() {
44
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
74
+ if (this.valueIsNotNull(this.value)) {
45
75
  return this.value < 0;
46
76
  }
47
77
  return null;
48
78
  }
49
79
  isZero() {
50
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
80
+ if (this.valueIsNotNull(this.value)) {
51
81
  return this.value === 0;
52
82
  }
53
83
  return null;
54
84
  }
55
85
  isInRange(min, max) {
56
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
86
+ if (this.valueIsNotNull(this.value)) {
57
87
  return this.value >= min && this.value <= max;
58
88
  }
59
89
  return null;
60
90
  }
61
91
  getDecimalPlaces() {
62
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
92
+ if (this.valueIsNotNull(this.value)) {
63
93
  if (Number.isInteger(this.value)) {
64
94
  return 0;
65
95
  }
@@ -69,13 +99,13 @@ class NullableNumeric extends ValueObject_1.ValueObject {
69
99
  return null;
70
100
  }
71
101
  toFixed(decimalPlaces) {
72
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
102
+ if (this.valueIsNotNull(this.value)) {
73
103
  return this.value.toFixed(decimalPlaces);
74
104
  }
75
105
  return null;
76
106
  }
77
107
  absoluteValue() {
78
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, this.value)) {
108
+ if (this.valueIsNotNull(this.value)) {
79
109
  return Math.abs(this.value);
80
110
  }
81
111
  return null;
@@ -145,24 +175,24 @@ class NullableNumeric extends ValueObject_1.ValueObject {
145
175
  }
146
176
  // Métodos de guardas adicionales para casos específicos (mantener para compatibilidad)
147
177
  guardAgainstNegativeValue(value, propertyName) {
148
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, value)) {
149
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstOptionsViolations).call(this, value, propertyName, {
178
+ if (this.valueIsNotNull(value)) {
179
+ this.guardAgainstOptionsViolations(value, propertyName, {
150
180
  ...NullableNumeric.DEFAULT_NULLABLE_OPTIONS,
151
181
  allowNegative: false,
152
182
  });
153
183
  }
154
184
  }
155
185
  guardAgainstZeroValue(value, propertyName) {
156
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, value)) {
157
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstOptionsViolations).call(this, value, propertyName, {
186
+ if (this.valueIsNotNull(value)) {
187
+ this.guardAgainstOptionsViolations(value, propertyName, {
158
188
  ...NullableNumeric.DEFAULT_NULLABLE_OPTIONS,
159
189
  allowZero: false,
160
190
  });
161
191
  }
162
192
  }
163
193
  guardAgainstNonPositiveValue(value, propertyName) {
164
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, value)) {
165
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstOptionsViolations).call(this, value, propertyName, {
194
+ if (this.valueIsNotNull(value)) {
195
+ this.guardAgainstOptionsViolations(value, propertyName, {
166
196
  ...NullableNumeric.DEFAULT_NULLABLE_OPTIONS,
167
197
  allowNegative: false,
168
198
  allowZero: false,
@@ -170,8 +200,8 @@ class NullableNumeric extends ValueObject_1.ValueObject {
170
200
  }
171
201
  }
172
202
  guardAgainstValueOutOfRange(value, propertyName, min, max) {
173
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, value)) {
174
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstOptionsViolations).call(this, value, propertyName, {
203
+ if (this.valueIsNotNull(value)) {
204
+ this.guardAgainstOptionsViolations(value, propertyName, {
175
205
  ...NullableNumeric.DEFAULT_NULLABLE_OPTIONS,
176
206
  minValue: min,
177
207
  maxValue: max,
@@ -179,16 +209,16 @@ class NullableNumeric extends ValueObject_1.ValueObject {
179
209
  }
180
210
  }
181
211
  guardAgainstNonIntegerValue(value, propertyName) {
182
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, value)) {
183
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstOptionsViolations).call(this, value, propertyName, {
212
+ if (this.valueIsNotNull(value)) {
213
+ this.guardAgainstOptionsViolations(value, propertyName, {
184
214
  ...NullableNumeric.DEFAULT_NULLABLE_OPTIONS,
185
215
  allowDecimals: false,
186
216
  });
187
217
  }
188
218
  }
189
219
  guardAgainstExcessiveDecimalPlaces(value, propertyName, maxDecimalPlaces) {
190
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, value)) {
191
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstOptionsViolations).call(this, value, propertyName, {
220
+ if (this.valueIsNotNull(value)) {
221
+ this.guardAgainstOptionsViolations(value, propertyName, {
192
222
  ...NullableNumeric.DEFAULT_NULLABLE_OPTIONS,
193
223
  maxDecimalPlaces,
194
224
  });
@@ -202,39 +232,6 @@ class NullableNumeric extends ValueObject_1.ValueObject {
202
232
  }
203
233
  }
204
234
  exports.NullableNumeric = NullableNumeric;
205
- _NullableNumeric_instances = new WeakSet(), _NullableNumeric_guardAgainstInvalidNullableNumeric = function _NullableNumeric_guardAgainstInvalidNullableNumeric(value, propertyName, options) {
206
- if (__classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_valueIsNotNull).call(this, value)) {
207
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstInvalidNumericValue).call(this, value, propertyName, options);
208
- }
209
- }, _NullableNumeric_guardAgainstInvalidNumericValue = function _NullableNumeric_guardAgainstInvalidNumericValue(value, propertyName, options) {
210
- Numeric_1.Numeric.guardAgainstInvalidType(value, propertyName);
211
- Numeric_1.Numeric.guardAgainstInvalidNumber(value, propertyName);
212
- __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_guardAgainstOptionsViolations).call(this, value, propertyName, options);
213
- }, _NullableNumeric_guardAgainstOptionsViolations = function _NullableNumeric_guardAgainstOptionsViolations(value, propertyName, options) {
214
- if (!options.allowNegative && value < 0) {
215
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-negative number', value.toString());
216
- }
217
- if (!options.allowZero && value === 0) {
218
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-zero number', '0');
219
- }
220
- if (!options.allowDecimals && !Number.isInteger(value)) {
221
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'integer number', value.toString());
222
- }
223
- if (options.allowDecimals && __classPrivateFieldGet(this, _NullableNumeric_instances, "m", _NullableNumeric_hasExcessiveDecimalPlaces).call(this, value, options.maxDecimalPlaces)) {
224
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, `number with maximum ${options.maxDecimalPlaces} decimal places`, value.toString());
225
- }
226
- if (value < options.minValue || value > options.maxValue) {
227
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, `number between ${options.minValue} and ${options.maxValue}`, value.toString());
228
- }
229
- }, _NullableNumeric_hasExcessiveDecimalPlaces = function _NullableNumeric_hasExcessiveDecimalPlaces(value, maxDecimalPlaces) {
230
- if (Number.isInteger(value)) {
231
- return false;
232
- }
233
- const decimalPart = value.toString().split('.')[1];
234
- return decimalPart ? decimalPart.length > maxDecimalPlaces : false;
235
- }, _NullableNumeric_valueIsNotNull = function _NullableNumeric_valueIsNotNull(value) {
236
- return value !== null;
237
- };
238
235
  NullableNumeric.DEFAULT_NULLABLE_OPTIONS = {
239
236
  allowNegative: true,
240
237
  allowZero: true,
@@ -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 _NullablePositiveInteger_instances, _NullablePositiveInteger_valueIsNotNull;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.NullablePositiveInteger = void 0;
10
4
  const NullableNumeric_1 = require("./NullableNumeric");
@@ -12,10 +6,12 @@ const PositiveInteger_1 = require("./PositiveInteger");
12
6
  class NullablePositiveInteger extends NullableNumeric_1.NullableNumeric {
13
7
  constructor(value, skipDomainValidation, propertyName) {
14
8
  super(value, skipDomainValidation, propertyName, NullablePositiveInteger.NULLABLE_POSITIVE_INTEGER_OPTIONS);
15
- _NullablePositiveInteger_instances.add(this);
9
+ }
10
+ valueIsNotNull(value) {
11
+ return value !== null;
16
12
  }
17
13
  hasValue() {
18
- return __classPrivateFieldGet(this, _NullablePositiveInteger_instances, "m", _NullablePositiveInteger_valueIsNotNull).call(this, this.value);
14
+ return this.valueIsNotNull(this.value);
19
15
  }
20
16
  toPositiveInteger() {
21
17
  return this.value;
@@ -43,9 +39,6 @@ class NullablePositiveInteger extends NullableNumeric_1.NullableNumeric {
43
39
  }
44
40
  }
45
41
  exports.NullablePositiveInteger = NullablePositiveInteger;
46
- _NullablePositiveInteger_instances = new WeakSet(), _NullablePositiveInteger_valueIsNotNull = function _NullablePositiveInteger_valueIsNotNull(value) {
47
- return value !== null;
48
- };
49
42
  NullablePositiveInteger.NULLABLE_POSITIVE_INTEGER_OPTIONS = {
50
43
  allowNegative: false,
51
44
  allowZero: true,
@@ -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, _NullableProductConfigurationCarbonFootprintSubsegmentReference_id, _NullableProductConfigurationCarbonFootprintSubsegmentReference_code, _NullableProductConfigurationCarbonFootprintSubsegmentReference_name, _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull, _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType, _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId, _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode, _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName;
13
+ var _NullableProductConfigurationCarbonFootprintSubsegmentReference_id, _NullableProductConfigurationCarbonFootprintSubsegmentReference_code, _NullableProductConfigurationCarbonFootprintSubsegmentReference_name, _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.NullableProductConfigurationCarbonFootprintSubsegmentReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -24,7 +24,7 @@ class NullableProductConfigurationCarbonFootprintSubsegmentReference extends Val
24
24
  * Aplica todas las validaciones de dominio al momento de construcción.
25
25
  * Permite valores null para representar la ausencia de subsegmento de producto.
26
26
  */
27
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
27
+ constructor(value, skipDomainValidation, propertyName = NullableProductConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME) {
28
28
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type ProductConfigurationCarbonFootprintSubsegmentReference from the domain layer or null', { allowNull: true, allowUndefined: false });
29
29
  _NullableProductConfigurationCarbonFootprintSubsegmentReference_id.set(this, void 0);
30
30
  _NullableProductConfigurationCarbonFootprintSubsegmentReference_code.set(this, void 0);
@@ -38,7 +38,7 @@ class NullableProductConfigurationCarbonFootprintSubsegmentReference extends Val
38
38
  }
39
39
  else {
40
40
  if (skipDomainValidation === false) {
41
- _a
41
+ NullableProductConfigurationCarbonFootprintSubsegmentReference
42
42
  .validateProductConfigurationCarbonFootprintSubsegmentReference(value, propertyName);
43
43
  }
44
44
  __classPrivateFieldSet(this, _NullableProductConfigurationCarbonFootprintSubsegmentReference_id, value.id.trim(), "f");
@@ -51,10 +51,49 @@ class NullableProductConfigurationCarbonFootprintSubsegmentReference extends Val
51
51
  * Validación estática para reutilización en factory methods y constructores.
52
52
  */
53
53
  static validateProductConfigurationCarbonFootprintSubsegmentReference(value, propertyName) {
54
- __classPrivateFieldGet(this, _a, "m", _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType).call(this, value, propertyName);
55
- __classPrivateFieldGet(this, _a, "m", _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId).call(this, value.id);
56
- __classPrivateFieldGet(this, _a, "m", _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode).call(this, value.code);
57
- __classPrivateFieldGet(this, _a, "m", _NullableProductConfigurationCarbonFootprintSubsegmentReference_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, 'ProductConfigurationCarbonFootprintSubsegmentReference 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 de producto 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 de producto.
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, _NullableProductConfigurationCarbonFootprintSubsegmentReference_id, "f");
@@ -171,7 +210,7 @@ class NullableProductConfigurationCarbonFootprintSubsegmentReference extends Val
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 NullableProductConfigurationCarbonFootprintSubsegmentReference)) {
175
214
  return false;
176
215
  }
177
216
  if (__classPrivateFieldGet(this, _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
@@ -188,7 +227,7 @@ class NullableProductConfigurationCarbonFootprintSubsegmentReference extends Val
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 NullableProductConfigurationCarbonFootprintSubsegmentReference)) {
192
231
  return false;
193
232
  }
194
233
  if (__classPrivateFieldGet(this, _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull, "f") && __classPrivateFieldGet(other, _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull, "f")) {
@@ -236,26 +275,5 @@ class NullableProductConfigurationCarbonFootprintSubsegmentReference extends Val
236
275
  }
237
276
  }
238
277
  exports.NullableProductConfigurationCarbonFootprintSubsegmentReference = NullableProductConfigurationCarbonFootprintSubsegmentReference;
239
- _a = NullableProductConfigurationCarbonFootprintSubsegmentReference, _NullableProductConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _NullableProductConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _NullableProductConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap(), _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull = new WeakMap(), _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType = function _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidType(value, propertyName) {
240
- if (!value || typeof value !== 'object') {
241
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'ProductConfigurationCarbonFootprintSubsegmentReference 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
- }, _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId = function _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidId(id) {
253
- String_1.String.guardAgainstEmptyValue(id, 'id');
254
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
255
- }, _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode = function _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentCode(code) {
256
- String_1.String.guardAgainstEmptyValue(code, 'code');
257
- Code_1.Code.guardAgainstInvalidCode(code);
258
- }, _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName = function _NullableProductConfigurationCarbonFootprintSubsegmentReference_guardAgainstInvalidSubsegmentName(name) {
259
- String_1.String.guardAgainstEmptyValue(name, 'name');
260
- };
278
+ _NullableProductConfigurationCarbonFootprintSubsegmentReference_id = new WeakMap(), _NullableProductConfigurationCarbonFootprintSubsegmentReference_code = new WeakMap(), _NullableProductConfigurationCarbonFootprintSubsegmentReference_name = new WeakMap(), _NullableProductConfigurationCarbonFootprintSubsegmentReference_isNull = new WeakMap();
261
279
  NullableProductConfigurationCarbonFootprintSubsegmentReference.DEFAULT_PROPERTY_NAME = 'productSubsegmentReference';
@@ -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 _NullableStakeholderReference_instances, _NullableStakeholderReference_id, _NullableStakeholderReference_displayName, _NullableStakeholderReference_taxIdentification, _NullableStakeholderReference_roleType, _NullableStakeholderReference_isNull, _NullableStakeholderReference_parseDate;
13
+ var _NullableStakeholderReference_id, _NullableStakeholderReference_displayName, _NullableStakeholderReference_taxIdentification, _NullableStakeholderReference_roleType, _NullableStakeholderReference_isNull;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.NullableStakeholderReference = void 0;
16
16
  const ValueObject_1 = require("./ValueObject");
@@ -19,7 +19,6 @@ const StakeholderRole_1 = require("../enums/StakeholderRole");
19
19
  class NullableStakeholderReference extends ValueObject_1.ValueObject {
20
20
  constructor(value, skipDomainValidation, propertyName = NullableStakeholderReference.DEFAULT_PROPERTY_NAME) {
21
21
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type StakeholderReference from the domain layer or null', { allowNull: true, allowUndefined: false });
22
- _NullableStakeholderReference_instances.add(this);
23
22
  _NullableStakeholderReference_id.set(this, void 0);
24
23
  _NullableStakeholderReference_displayName.set(this, void 0);
25
24
  _NullableStakeholderReference_taxIdentification.set(this, void 0);
@@ -101,19 +100,23 @@ class NullableStakeholderReference extends ValueObject_1.ValueObject {
101
100
  const now = new Date();
102
101
  const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
103
102
  if (__classPrivateFieldGet(this, _NullableStakeholderReference_taxIdentification, "f").validFrom) {
104
- const fromDate = __classPrivateFieldGet(this, _NullableStakeholderReference_instances, "m", _NullableStakeholderReference_parseDate).call(this, __classPrivateFieldGet(this, _NullableStakeholderReference_taxIdentification, "f").validFrom);
103
+ const fromDate = this.parseDate(__classPrivateFieldGet(this, _NullableStakeholderReference_taxIdentification, "f").validFrom);
105
104
  if (today < fromDate) {
106
105
  return false;
107
106
  }
108
107
  }
109
108
  if (__classPrivateFieldGet(this, _NullableStakeholderReference_taxIdentification, "f").validUntil) {
110
- const untilDate = __classPrivateFieldGet(this, _NullableStakeholderReference_instances, "m", _NullableStakeholderReference_parseDate).call(this, __classPrivateFieldGet(this, _NullableStakeholderReference_taxIdentification, "f").validUntil);
109
+ const untilDate = this.parseDate(__classPrivateFieldGet(this, _NullableStakeholderReference_taxIdentification, "f").validUntil);
111
110
  if (today > untilDate) {
112
111
  return false;
113
112
  }
114
113
  }
115
114
  return true;
116
115
  }
116
+ parseDate(dateString) {
117
+ const [day, month, year] = dateString.split('/').map(Number);
118
+ return new Date(year, month - 1, day);
119
+ }
117
120
  getDisplayName() {
118
121
  if (__classPrivateFieldGet(this, _NullableStakeholderReference_isNull, "f") || __classPrivateFieldGet(this, _NullableStakeholderReference_displayName, "f") === null) {
119
122
  return 'No stakeholder assigned';
@@ -234,8 +237,5 @@ class NullableStakeholderReference extends ValueObject_1.ValueObject {
234
237
  }
235
238
  }
236
239
  exports.NullableStakeholderReference = NullableStakeholderReference;
237
- _NullableStakeholderReference_id = new WeakMap(), _NullableStakeholderReference_displayName = new WeakMap(), _NullableStakeholderReference_taxIdentification = new WeakMap(), _NullableStakeholderReference_roleType = new WeakMap(), _NullableStakeholderReference_isNull = new WeakMap(), _NullableStakeholderReference_instances = new WeakSet(), _NullableStakeholderReference_parseDate = function _NullableStakeholderReference_parseDate(dateString) {
238
- const [day, month, year] = dateString.split('/').map(Number);
239
- return new Date(year, month - 1, day);
240
- };
240
+ _NullableStakeholderReference_id = new WeakMap(), _NullableStakeholderReference_displayName = new WeakMap(), _NullableStakeholderReference_taxIdentification = new WeakMap(), _NullableStakeholderReference_roleType = new WeakMap(), _NullableStakeholderReference_isNull = new WeakMap();
241
241
  NullableStakeholderReference.DEFAULT_PROPERTY_NAME = 'stakeholderReference';