@carbonbox/domain 0.4.7 → 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 (223) 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/main/index.js +4 -2
  71. package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts +37 -1
  72. package/build/types/carbonbox/shared/domain/value-objects/ActivityDataSubmissionReference.d.ts.map +1 -1
  73. package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts +22 -4
  74. package/build/types/carbonbox/shared/domain/value-objects/Address.d.ts.map +1 -1
  75. package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts +4 -3
  76. package/build/types/carbonbox/shared/domain/value-objects/AggregateId.d.ts.map +1 -1
  77. package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts +2 -2
  78. package/build/types/carbonbox/shared/domain/value-objects/AggregateIdList.d.ts.map +1 -1
  79. package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts +5 -1
  80. package/build/types/carbonbox/shared/domain/value-objects/Boolean.d.ts.map +1 -1
  81. package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts +5 -1
  82. package/build/types/carbonbox/shared/domain/value-objects/CalculationProcessReference.d.ts.map +1 -1
  83. package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts +24 -4
  84. package/build/types/carbonbox/shared/domain/value-objects/CalculationVariableReferences.d.ts.map +1 -1
  85. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts +70 -2
  86. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReference.d.ts.map +1 -1
  87. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts +39 -2
  88. package/build/types/carbonbox/shared/domain/value-objects/CarbonClientReferences.d.ts.map +1 -1
  89. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts +11 -1
  90. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintConfigurationReference.d.ts.map +1 -1
  91. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts +35 -1
  92. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintIntensityIndicatorReference.d.ts.map +1 -1
  93. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts +38 -2
  94. package/build/types/carbonbox/shared/domain/value-objects/CarbonFootprintSegmentReferences.d.ts.map +1 -1
  95. package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts +1 -1
  96. package/build/types/carbonbox/shared/domain/value-objects/Code.d.ts.map +1 -1
  97. package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts +18 -2
  98. package/build/types/carbonbox/shared/domain/value-objects/CodeList.d.ts.map +1 -1
  99. package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts +26 -1
  100. package/build/types/carbonbox/shared/domain/value-objects/CollectionFieldReference.d.ts.map +1 -1
  101. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts +64 -2
  102. package/build/types/carbonbox/shared/domain/value-objects/CorporateCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  103. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts +30 -2
  104. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  105. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +30 -2
  106. package/build/types/carbonbox/shared/domain/value-objects/CorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  107. package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts +3 -2
  108. package/build/types/carbonbox/shared/domain/value-objects/Currency.d.ts.map +1 -1
  109. package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts +5 -3
  110. package/build/types/carbonbox/shared/domain/value-objects/DateString.d.ts.map +1 -1
  111. package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts +5 -3
  112. package/build/types/carbonbox/shared/domain/value-objects/DateTimeString.d.ts.map +1 -1
  113. package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts +3 -2
  114. package/build/types/carbonbox/shared/domain/value-objects/Email.d.ts.map +1 -1
  115. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts +16 -1
  116. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationFormulaReference.d.ts.map +1 -1
  117. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts +26 -1
  118. package/build/types/carbonbox/shared/domain/value-objects/EmissionCalculationReference.d.ts.map +1 -1
  119. package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts +17 -1
  120. package/build/types/carbonbox/shared/domain/value-objects/EmissionFactorReference.d.ts.map +1 -1
  121. package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts +1 -1
  122. package/build/types/carbonbox/shared/domain/value-objects/EmissionSource.d.ts.map +1 -1
  123. package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts +3 -3
  124. package/build/types/carbonbox/shared/domain/value-objects/EmissionSources.d.ts.map +1 -1
  125. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +22 -2
  126. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  127. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts +38 -2
  128. package/build/types/carbonbox/shared/domain/value-objects/EventEditionConfigurationCarbonFootprintSubsegmentReferences.d.ts.map +1 -1
  129. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts +64 -2
  130. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageConfigurationReferences.d.ts.map +1 -1
  131. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts +14 -1
  132. package/build/types/carbonbox/shared/domain/value-objects/EventEditionLifecycleStageReference.d.ts.map +1 -1
  133. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts +17 -1
  134. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReference.d.ts.map +1 -1
  135. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts +20 -4
  136. package/build/types/carbonbox/shared/domain/value-objects/EventEditionReferences.d.ts.map +1 -1
  137. package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts +11 -1
  138. package/build/types/carbonbox/shared/domain/value-objects/EventReference.d.ts.map +1 -1
  139. package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts +16 -1
  140. package/build/types/carbonbox/shared/domain/value-objects/ExecutionPeriod.d.ts.map +1 -1
  141. package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts +11 -1
  142. package/build/types/carbonbox/shared/domain/value-objects/FacilityReference.d.ts.map +1 -1
  143. package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts +4 -3
  144. package/build/types/carbonbox/shared/domain/value-objects/Gender.d.ts.map +1 -1
  145. package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts +21 -2
  146. package/build/types/carbonbox/shared/domain/value-objects/GlobalWarmingPotentialReference.d.ts.map +1 -1
  147. package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts +12 -0
  148. package/build/types/carbonbox/shared/domain/value-objects/Image.d.ts.map +1 -1
  149. package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts +4 -2
  150. package/build/types/carbonbox/shared/domain/value-objects/Integer.d.ts.map +1 -1
  151. package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts +4 -2
  152. package/build/types/carbonbox/shared/domain/value-objects/NullableCode.d.ts.map +1 -1
  153. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
  154. package/build/types/carbonbox/shared/domain/value-objects/NullableCorporateConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  155. package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts +6 -1
  156. package/build/types/carbonbox/shared/domain/value-objects/NullableDate.d.ts.map +1 -1
  157. package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts +5 -1
  158. package/build/types/carbonbox/shared/domain/value-objects/NullableDateTimeString.d.ts.map +1 -1
  159. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
  160. package/build/types/carbonbox/shared/domain/value-objects/NullableEventEditionConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  161. package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts +6 -2
  162. package/build/types/carbonbox/shared/domain/value-objects/NullableNumeric.d.ts.map +1 -1
  163. package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts +3 -2
  164. package/build/types/carbonbox/shared/domain/value-objects/NullablePositiveInteger.d.ts.map +1 -1
  165. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts +19 -1
  166. package/build/types/carbonbox/shared/domain/value-objects/NullableProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  167. package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts +2 -1
  168. package/build/types/carbonbox/shared/domain/value-objects/NullableStakeholderReference.d.ts.map +1 -1
  169. package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts +5 -1
  170. package/build/types/carbonbox/shared/domain/value-objects/NullableString.d.ts.map +1 -1
  171. package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts +20 -5
  172. package/build/types/carbonbox/shared/domain/value-objects/NullableTaxIdentificationNumber.d.ts.map +1 -1
  173. package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts +11 -2
  174. package/build/types/carbonbox/shared/domain/value-objects/Numeric.d.ts.map +1 -1
  175. package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts +21 -2
  176. package/build/types/carbonbox/shared/domain/value-objects/Phone.d.ts.map +1 -1
  177. package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts +2 -1
  178. package/build/types/carbonbox/shared/domain/value-objects/PositiveInteger.d.ts.map +1 -1
  179. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts +60 -2
  180. package/build/types/carbonbox/shared/domain/value-objects/ProductCarbonFootprintSegmentConfigurationReferences.d.ts.map +1 -1
  181. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts +45 -4
  182. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSegmentReference.d.ts.map +1 -1
  183. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts +45 -4
  184. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationCarbonFootprintSubsegmentReference.d.ts.map +1 -1
  185. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts +21 -1
  186. package/build/types/carbonbox/shared/domain/value-objects/ProductConfigurationSystemBoundaryReference.d.ts.map +1 -1
  187. package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts +16 -1
  188. package/build/types/carbonbox/shared/domain/value-objects/ProductReference.d.ts.map +1 -1
  189. package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts +21 -1
  190. package/build/types/carbonbox/shared/domain/value-objects/ServiceCatalogReference.d.ts.map +1 -1
  191. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts +51 -2
  192. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReference.d.ts.map +1 -1
  193. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts +46 -2
  194. package/build/types/carbonbox/shared/domain/value-objects/StakeholderReferences.d.ts.map +1 -1
  195. package/build/types/carbonbox/shared/domain/value-objects/String.d.ts +3 -1
  196. package/build/types/carbonbox/shared/domain/value-objects/String.d.ts.map +1 -1
  197. package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts +7 -1
  198. package/build/types/carbonbox/shared/domain/value-objects/StringList.d.ts.map +1 -1
  199. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts +41 -3
  200. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentification.d.ts.map +1 -1
  201. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts +4 -4
  202. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumber.d.ts.map +1 -1
  203. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts +16 -4
  204. package/build/types/carbonbox/shared/domain/value-objects/TaxIdentificationNumberList.d.ts.map +1 -1
  205. package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts +2 -1
  206. package/build/types/carbonbox/shared/domain/value-objects/Url.d.ts.map +1 -1
  207. package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts +18 -2
  208. package/build/types/carbonbox/shared/domain/value-objects/UrlList.d.ts.map +1 -1
  209. package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts +4 -2
  210. package/build/types/carbonbox/shared/domain/value-objects/UserBusinessStatus.d.ts.map +1 -1
  211. package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts +10 -1
  212. package/build/types/carbonbox/shared/domain/value-objects/UserEmail.d.ts.map +1 -1
  213. package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts +7 -3
  214. package/build/types/carbonbox/shared/domain/value-objects/UserPassword.d.ts.map +1 -1
  215. package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts +11 -3
  216. package/build/types/carbonbox/shared/domain/value-objects/UserPermissions.d.ts.map +1 -1
  217. package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts +4 -2
  218. package/build/types/carbonbox/shared/domain/value-objects/UserType.d.ts.map +1 -1
  219. package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts +2 -0
  220. package/build/types/carbonbox/shared/domain/value-objects/ValueObject.d.ts.map +1 -1
  221. package/build/types/main/index.d.ts +1 -0
  222. package/build/types/main/index.d.ts.map +1 -1
  223. 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, _CalculationVariableReferences_formulaVariableReferences, _CalculationVariableReferences_options, _CalculationVariableReferences_guardAgainstInvalidType, _CalculationVariableReferences_guardAgainstInvalidEmptyArray, _CalculationVariableReferences_guardAgainstTooManyVariables, _CalculationVariableReferences_guardAgainstDuplicatedSymbols, _CalculationVariableReferences_guardAgainstInvalidReference;
13
+ var _CalculationVariableReferences_formulaVariableReferences, _CalculationVariableReferences_options;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CalculationVariableReferences = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -24,34 +24,100 @@ class CalculationVariableReferences extends ValueObject_1.ValueObject {
24
24
  * Constructor protegido para que solo clases hijas puedan instanciar.
25
25
  * Aplica todas las validaciones de dominio al momento de construcción.
26
26
  */
27
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME, options = _a.DEFAULT_OPTIONS) {
28
- const finalOptions = { ..._a.DEFAULT_OPTIONS, ...options };
27
+ constructor(value, skipDomainValidation, propertyName = CalculationVariableReferences.DEFAULT_PROPERTY_NAME, options = CalculationVariableReferences.DEFAULT_OPTIONS) {
28
+ const finalOptions = { ...CalculationVariableReferences.DEFAULT_OPTIONS, ...options };
29
29
  // Convertir a array de primitivos para el ValueObject padre
30
- const primitives = _a.toPrimitivesArray(value);
30
+ const primitives = CalculationVariableReferences.toPrimitivesArray(value);
31
31
  super(primitives, skipDomainValidation, propertyName, 'The provided value must be an array of CalculationVariableReference from the domain layer', { allowNull: false, allowUndefined: false });
32
32
  _CalculationVariableReferences_formulaVariableReferences.set(this, void 0);
33
33
  _CalculationVariableReferences_options.set(this, void 0);
34
34
  if (skipDomainValidation === false) {
35
- _a.validateReferences(value, propertyName, finalOptions);
35
+ CalculationVariableReferences.validateReferences(value, propertyName, finalOptions);
36
36
  }
37
37
  // Almacenar las referencias como types
38
- __classPrivateFieldSet(this, _CalculationVariableReferences_formulaVariableReferences, _a.toCleanReferences(value), "f");
38
+ __classPrivateFieldSet(this, _CalculationVariableReferences_formulaVariableReferences, CalculationVariableReferences.toCleanReferences(value), "f");
39
39
  __classPrivateFieldSet(this, _CalculationVariableReferences_options, finalOptions, "f");
40
40
  }
41
41
  /**
42
42
  * Validación estática para reutilización en factory methods y constructores.
43
43
  */
44
44
  static validateReferences(value, propertyName, options) {
45
- __classPrivateFieldGet(this, _a, "m", _CalculationVariableReferences_guardAgainstInvalidType).call(this, value, propertyName);
46
- __classPrivateFieldGet(this, _a, "m", _CalculationVariableReferences_guardAgainstInvalidEmptyArray).call(this, value, options, propertyName);
47
- __classPrivateFieldGet(this, _a, "m", _CalculationVariableReferences_guardAgainstTooManyVariables).call(this, value, options, propertyName);
45
+ this.guardAgainstInvalidType(value, propertyName);
46
+ this.guardAgainstInvalidEmptyArray(value, options, propertyName);
47
+ this.guardAgainstTooManyVariables(value, options, propertyName);
48
48
  if (!options.allowDuplicates) {
49
- __classPrivateFieldGet(this, _a, "m", _CalculationVariableReferences_guardAgainstDuplicatedSymbols).call(this, value, propertyName);
49
+ this.guardAgainstDuplicatedSymbols(value, propertyName);
50
50
  }
51
51
  value.forEach((reference, index) => {
52
- __classPrivateFieldGet(this, _a, "m", _CalculationVariableReferences_guardAgainstInvalidReference).call(this, reference, index, propertyName);
52
+ this.guardAgainstInvalidReference(reference, index, propertyName);
53
53
  });
54
54
  }
55
+ /**
56
+ * Valida que el valor sea un array válido.
57
+ */
58
+ static guardAgainstInvalidType(value, propertyName) {
59
+ if (!Array.isArray(value)) {
60
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'array of CalculationVariableReference', typeof value);
61
+ }
62
+ }
63
+ /**
64
+ * Valida que el array no esté vacío si no se permite.
65
+ */
66
+ static guardAgainstInvalidEmptyArray(value, options, propertyName) {
67
+ if (!options.allowEmpty && value.length === 0) {
68
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-empty array', 'empty array');
69
+ }
70
+ }
71
+ /**
72
+ * Valida que no haya demasiadas variables.
73
+ */
74
+ static guardAgainstTooManyVariables(value, options, propertyName) {
75
+ if (options.maxVariables && value.length > options.maxVariables) {
76
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, `at most ${options.maxVariables} variables`, `${value.length} variables`);
77
+ }
78
+ }
79
+ /**
80
+ * Valida que no haya símbolos duplicados en la lista.
81
+ */
82
+ static guardAgainstDuplicatedSymbols(value, propertyName) {
83
+ const ids = value.map((item) => item.id.trim());
84
+ const uniqueIds = new Set(ids);
85
+ if (ids.length !== uniqueIds.size) {
86
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(`${propertyName}.ids`, 'array with unique variable IDs', 'array with duplicated IDs');
87
+ }
88
+ }
89
+ /**
90
+ * Valida una referencia individual.
91
+ */
92
+ static guardAgainstInvalidReference(reference, index, basePropertyName) {
93
+ const propertyName = `${basePropertyName}[${index}]`;
94
+ if (!reference || typeof reference !== 'object') {
95
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CalculationVariableReference object', typeof reference);
96
+ }
97
+ if (typeof reference.id !== 'string') {
98
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.id`, 'string', typeof reference.id);
99
+ }
100
+ if (typeof reference.code !== 'string') {
101
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.code`, 'string', typeof reference.code);
102
+ }
103
+ if (typeof reference.symbol !== 'string') {
104
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.symbol`, 'string', typeof reference.symbol);
105
+ }
106
+ if (typeof reference.name !== 'string') {
107
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.name`, 'string', typeof reference.name);
108
+ }
109
+ // Validar usando las reglas de dominio
110
+ String_1.String.guardAgainstEmptyValue(reference.id, `${propertyName}.id`);
111
+ AggregateId_1.AggregateId.guardAgainstInvalidId(reference.id, `${propertyName}.id`);
112
+ String_1.String.guardAgainstEmptyValue(reference.code, `${propertyName}.code`);
113
+ Code_1.Code.guardAgainstInvalidCode(reference.code);
114
+ String_1.String.guardAgainstEmptyValue(reference.symbol, `${propertyName}.symbol`);
115
+ String_1.String.guardAgainstEmptyValue(reference.name, `${propertyName}.name`);
116
+ // Validar formato de símbolo de variable (debe ser alfanumérico)
117
+ if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(reference.symbol.trim())) {
118
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(`${propertyName}.symbol`, 'alphanumeric symbol starting with letter', `"${reference.symbol.trim()}"`);
119
+ }
120
+ }
55
121
  /**
56
122
  * Convierte el array a primitivos.
57
123
  */
@@ -298,7 +364,7 @@ class CalculationVariableReferences extends ValueObject_1.ValueObject {
298
364
  * Compara la igualdad semántica con otra lista de referencias.
299
365
  */
300
366
  equals(other) {
301
- if (!(other instanceof _a)) {
367
+ if (!(other instanceof CalculationVariableReferences)) {
302
368
  return false;
303
369
  }
304
370
  if (__classPrivateFieldGet(this, _CalculationVariableReferences_options, "f").allowEmpty !== __classPrivateFieldGet(other, _CalculationVariableReferences_options, "f").allowEmpty) {
@@ -369,10 +435,10 @@ class CalculationVariableReferences extends ValueObject_1.ValueObject {
369
435
  /**
370
436
  * Método estático para validar si un array es válido.
371
437
  */
372
- static isValidReferences(value, options = _a.DEFAULT_OPTIONS) {
438
+ static isValidReferences(value, options = CalculationVariableReferences.DEFAULT_OPTIONS) {
373
439
  try {
374
- const finalOptions = { ..._a.DEFAULT_OPTIONS, ...options };
375
- _a.validateReferences(value, 'test', finalOptions);
440
+ const finalOptions = { ...CalculationVariableReferences.DEFAULT_OPTIONS, ...options };
441
+ CalculationVariableReferences.validateReferences(value, 'test', finalOptions);
376
442
  return true;
377
443
  }
378
444
  catch {
@@ -381,53 +447,7 @@ class CalculationVariableReferences extends ValueObject_1.ValueObject {
381
447
  }
382
448
  }
383
449
  exports.CalculationVariableReferences = CalculationVariableReferences;
384
- _a = CalculationVariableReferences, _CalculationVariableReferences_formulaVariableReferences = new WeakMap(), _CalculationVariableReferences_options = new WeakMap(), _CalculationVariableReferences_guardAgainstInvalidType = function _CalculationVariableReferences_guardAgainstInvalidType(value, propertyName) {
385
- if (!Array.isArray(value)) {
386
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'array of CalculationVariableReference', typeof value);
387
- }
388
- }, _CalculationVariableReferences_guardAgainstInvalidEmptyArray = function _CalculationVariableReferences_guardAgainstInvalidEmptyArray(value, options, propertyName) {
389
- if (!options.allowEmpty && value.length === 0) {
390
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, 'non-empty array', 'empty array');
391
- }
392
- }, _CalculationVariableReferences_guardAgainstTooManyVariables = function _CalculationVariableReferences_guardAgainstTooManyVariables(value, options, propertyName) {
393
- if (options.maxVariables && value.length > options.maxVariables) {
394
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(propertyName, `at most ${options.maxVariables} variables`, `${value.length} variables`);
395
- }
396
- }, _CalculationVariableReferences_guardAgainstDuplicatedSymbols = function _CalculationVariableReferences_guardAgainstDuplicatedSymbols(value, propertyName) {
397
- const ids = value.map((item) => item.id.trim());
398
- const uniqueIds = new Set(ids);
399
- if (ids.length !== uniqueIds.size) {
400
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(`${propertyName}.ids`, 'array with unique variable IDs', 'array with duplicated IDs');
401
- }
402
- }, _CalculationVariableReferences_guardAgainstInvalidReference = function _CalculationVariableReferences_guardAgainstInvalidReference(reference, index, basePropertyName) {
403
- const propertyName = `${basePropertyName}[${index}]`;
404
- if (!reference || typeof reference !== 'object') {
405
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CalculationVariableReference object', typeof reference);
406
- }
407
- if (typeof reference.id !== 'string') {
408
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.id`, 'string', typeof reference.id);
409
- }
410
- if (typeof reference.code !== 'string') {
411
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.code`, 'string', typeof reference.code);
412
- }
413
- if (typeof reference.symbol !== 'string') {
414
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.symbol`, 'string', typeof reference.symbol);
415
- }
416
- if (typeof reference.name !== 'string') {
417
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(`${propertyName}.name`, 'string', typeof reference.name);
418
- }
419
- // Validar usando las reglas de dominio
420
- String_1.String.guardAgainstEmptyValue(reference.id, `${propertyName}.id`);
421
- AggregateId_1.AggregateId.guardAgainstInvalidId(reference.id, `${propertyName}.id`);
422
- String_1.String.guardAgainstEmptyValue(reference.code, `${propertyName}.code`);
423
- Code_1.Code.guardAgainstInvalidCode(reference.code);
424
- String_1.String.guardAgainstEmptyValue(reference.symbol, `${propertyName}.symbol`);
425
- String_1.String.guardAgainstEmptyValue(reference.name, `${propertyName}.name`);
426
- // Validar formato de símbolo de variable (debe ser alfanumérico)
427
- if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(reference.symbol.trim())) {
428
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create(`${propertyName}.symbol`, 'alphanumeric symbol starting with letter', `"${reference.symbol.trim()}"`);
429
- }
430
- };
450
+ _CalculationVariableReferences_formulaVariableReferences = new WeakMap(), _CalculationVariableReferences_options = new WeakMap();
431
451
  CalculationVariableReferences.DEFAULT_PROPERTY_NAME = 'formulaVariableReferences';
432
452
  CalculationVariableReferences.DEFAULT_OPTIONS = {
433
453
  allowEmpty: false,
@@ -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 _CarbonClientReference_instances, _a, _CarbonClientReference_id, _CarbonClientReference_displayName, _CarbonClientReference_taxIdentification, _CarbonClientReference_roleType, _CarbonClientReference_accountType, _CarbonClientReference_guardAgainstInvalidType, _CarbonClientReference_valueIsInvalid, _CarbonClientReference_taxIdentificationIsInvalid, _CarbonClientReference_guardAgainstInvalidId, _CarbonClientReference_guardAgainstInvalidDisplayName, _CarbonClientReference_guardAgainstInvalidTaxIdentification, _CarbonClientReference_taxIdentificationIsNull, _CarbonClientReference_guardAgainstInvalidRoleType, _CarbonClientReference_roleTypeIsEmpty, _CarbonClientReference_roleTypeIsNotCarbonClient, _CarbonClientReference_guardAgainstInvalidAccountType, _CarbonClientReference_accountTypeIsEmpty, _CarbonClientReference_parseDate, _CarbonClientReference_isValidOnDate, _CarbonClientReference_otherIsNotCarbonClientReference, _CarbonClientReference_taxIdentificationsAreEqual, _CarbonClientReference_hasSameIdentifier;
13
+ var _CarbonClientReference_id, _CarbonClientReference_displayName, _CarbonClientReference_taxIdentification, _CarbonClientReference_roleType, _CarbonClientReference_accountType;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CarbonClientReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -27,16 +27,15 @@ class CarbonClientReference extends ObjectValueObject_1.ObjectValueObject {
27
27
  * Constructor protegido para que solo clases hijas puedan instanciar.
28
28
  * Aplica todas las validaciones de dominio al momento de construcción.
29
29
  */
30
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
30
+ constructor(value, skipDomainValidation, propertyName = CarbonClientReference.DEFAULT_PROPERTY_NAME) {
31
31
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type CarbonClientReference from the domain layer', { allowNull: false, allowUndefined: false });
32
- _CarbonClientReference_instances.add(this);
33
32
  _CarbonClientReference_id.set(this, void 0);
34
33
  _CarbonClientReference_displayName.set(this, void 0);
35
34
  _CarbonClientReference_taxIdentification.set(this, void 0);
36
35
  _CarbonClientReference_roleType.set(this, void 0);
37
36
  _CarbonClientReference_accountType.set(this, void 0);
38
37
  if (skipDomainValidation === false) {
39
- _a.validateCarbonClientReference(value, propertyName);
38
+ CarbonClientReference.validateCarbonClientReference(value, propertyName);
40
39
  }
41
40
  __classPrivateFieldSet(this, _CarbonClientReference_id, value.id.trim(), "f");
42
41
  __classPrivateFieldSet(this, _CarbonClientReference_displayName, value.displayName.trim(), "f");
@@ -48,12 +47,125 @@ class CarbonClientReference extends ObjectValueObject_1.ObjectValueObject {
48
47
  * Validación estática para reutilización en factory methods y constructores.
49
48
  */
50
49
  static validateCarbonClientReference(value, propertyName) {
51
- __classPrivateFieldGet(this, _a, "m", _CarbonClientReference_guardAgainstInvalidType).call(this, value, propertyName);
52
- __classPrivateFieldGet(this, _a, "m", _CarbonClientReference_guardAgainstInvalidId).call(this, value.id);
53
- __classPrivateFieldGet(this, _a, "m", _CarbonClientReference_guardAgainstInvalidDisplayName).call(this, value.displayName);
54
- __classPrivateFieldGet(this, _a, "m", _CarbonClientReference_guardAgainstInvalidTaxIdentification).call(this, value.taxIdentification);
55
- __classPrivateFieldGet(this, _a, "m", _CarbonClientReference_guardAgainstInvalidRoleType).call(this, value.roleType);
56
- __classPrivateFieldGet(this, _a, "m", _CarbonClientReference_guardAgainstInvalidAccountType).call(this, value.accountType);
50
+ this.guardAgainstInvalidType(value, propertyName);
51
+ this.guardAgainstInvalidId(value.id);
52
+ this.guardAgainstInvalidDisplayName(value.displayName);
53
+ this.guardAgainstInvalidTaxIdentification(value.taxIdentification);
54
+ this.guardAgainstInvalidRoleType(value.roleType);
55
+ this.guardAgainstInvalidAccountType(value.accountType);
56
+ }
57
+ /**
58
+ * Valida que el objeto tenga la estructura correcta.
59
+ */
60
+ static guardAgainstInvalidType(value, propertyName) {
61
+ if (this.valueIsInvalid(value)) {
62
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CarbonClientReference object', typeof value);
63
+ }
64
+ if (typeof value.id !== 'string') {
65
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
66
+ }
67
+ if (typeof value.displayName !== 'string') {
68
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('displayName', 'string', typeof value.displayName);
69
+ }
70
+ if (this.taxIdentificationIsInvalid(value.taxIdentification)) {
71
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('taxIdentification', 'TaxIdentification object', typeof value.taxIdentification);
72
+ }
73
+ if (typeof value.roleType !== 'string') {
74
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('roleType', 'string', typeof value.roleType);
75
+ }
76
+ if (typeof value.accountType !== 'string') {
77
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('accountType', 'string', typeof value.accountType);
78
+ }
79
+ }
80
+ /**
81
+ * Valida si el valor principal es inválido.
82
+ */
83
+ static valueIsInvalid(value) {
84
+ return value === null || value === undefined || typeof value !== 'object';
85
+ }
86
+ /**
87
+ * Valida si la identificación tributaria es inválida.
88
+ */
89
+ static taxIdentificationIsInvalid(taxIdentification) {
90
+ return taxIdentification === null || taxIdentification === undefined || typeof taxIdentification !== 'object';
91
+ }
92
+ /**
93
+ * Valida el ID usando las validaciones de AggregateId.
94
+ */
95
+ static guardAgainstInvalidId(id) {
96
+ String_1.String.guardAgainstEmptyValue(id, 'id');
97
+ AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
98
+ }
99
+ /**
100
+ * Valida el nombre para mostrar.
101
+ */
102
+ static guardAgainstInvalidDisplayName(displayName) {
103
+ String_1.String.guardAgainstEmptyValue(displayName, 'displayName');
104
+ if (displayName.trim().length === 0) {
105
+ throw EmptyDisplayNameError_1.EmptyDisplayNameError.create('displayName');
106
+ }
107
+ if (displayName.trim().length > 255) {
108
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('displayName', 'string with maximum 255 characters', `string with ${displayName.trim().length} characters`);
109
+ }
110
+ }
111
+ /**
112
+ * Valida la identificación tributaria usando las validaciones del VO TaxIdentification.
113
+ */
114
+ static guardAgainstInvalidTaxIdentification(taxIdentification) {
115
+ if (this.taxIdentificationIsNull(taxIdentification)) {
116
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('taxIdentification', 'TaxIdentification object', 'null or undefined');
117
+ }
118
+ // Usar las validaciones completas del VO TaxIdentification
119
+ TaxIdentification_1.TaxIdentification.validateCompletely(taxIdentification, 'taxIdentification');
120
+ }
121
+ /**
122
+ * Verifica si la identificación tributaria es null o undefined.
123
+ */
124
+ static taxIdentificationIsNull(taxIdentification) {
125
+ return taxIdentification === null || taxIdentification === undefined;
126
+ }
127
+ /**
128
+ * Valida que el tipo de rol sea específicamente CARBON_CLIENT.
129
+ */
130
+ static guardAgainstInvalidRoleType(roleType) {
131
+ if (this.roleTypeIsEmpty(roleType)) {
132
+ throw InvalidStakeholderRoleTypeError_1.InvalidStakeholderRoleTypeError.create('empty role type', [this.VALID_ROLE]);
133
+ }
134
+ const trimmedRoleType = roleType.trim().toUpperCase();
135
+ if (this.roleTypeIsNotCarbonClient(trimmedRoleType)) {
136
+ throw InvalidStakeholderRoleTypeError_1.InvalidStakeholderRoleTypeError.create(trimmedRoleType, [this.VALID_ROLE]);
137
+ }
138
+ }
139
+ /**
140
+ * Verifica si el tipo de rol está vacío.
141
+ */
142
+ static roleTypeIsEmpty(roleType) {
143
+ return roleType === null || roleType === undefined || roleType.trim().length === 0;
144
+ }
145
+ /**
146
+ * Verifica si el tipo de rol no es CARBON_CLIENT.
147
+ */
148
+ static roleTypeIsNotCarbonClient(trimmedRoleType) {
149
+ return trimmedRoleType !== this.VALID_ROLE;
150
+ }
151
+ /**
152
+ * Valida que el tipo de cuenta sea un valor válido del enum CarbonClientAccount.
153
+ */
154
+ static guardAgainstInvalidAccountType(accountType) {
155
+ if (this.accountTypeIsEmpty(accountType)) {
156
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('accountType', 'valid CarbonClientAccount', 'empty');
157
+ }
158
+ const trimmedAccountType = accountType.trim().toUpperCase();
159
+ const validAccountTypes = Object.values(CarbonClientAccount_1.CarbonClientAccount);
160
+ if (!validAccountTypes.includes(trimmedAccountType)) {
161
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('accountType', `one of: ${validAccountTypes.join(', ')}`, trimmedAccountType);
162
+ }
163
+ }
164
+ /**
165
+ * Verifica si el tipo de cuenta está vacío.
166
+ */
167
+ static accountTypeIsEmpty(accountType) {
168
+ return accountType === null || accountType === undefined || accountType.trim().length === 0;
57
169
  }
58
170
  /**
59
171
  * ID único del cliente de carbono.
@@ -122,19 +234,26 @@ class CarbonClientReference extends ObjectValueObject_1.ObjectValueObject {
122
234
  const now = new Date();
123
235
  const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
124
236
  if (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom) {
125
- const fromDate = __classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_parseDate).call(this, __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom);
237
+ const fromDate = this.parseDate(__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom);
126
238
  if (today < fromDate) {
127
239
  return false;
128
240
  }
129
241
  }
130
242
  if (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil) {
131
- const untilDate = __classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_parseDate).call(this, __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil);
243
+ const untilDate = this.parseDate(__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil);
132
244
  if (today > untilDate) {
133
245
  return false;
134
246
  }
135
247
  }
136
248
  return true;
137
249
  }
250
+ /**
251
+ * Método auxiliar para parsear fechas en formato DD/MM/YYYY.
252
+ */
253
+ parseDate(dateString) {
254
+ const [day, month, year] = dateString.split('/').map(Number);
255
+ return new Date(year, month - 1, day);
256
+ }
138
257
  /**
139
258
  * Verifica si pertenece a un país específico.
140
259
  */
@@ -150,7 +269,26 @@ class CarbonClientReference extends ObjectValueObject_1.ObjectValueObject {
150
269
  }
151
270
  const now = new Date();
152
271
  const thirtyDaysFromNow = new Date(now.getTime() + (30 * 24 * 60 * 60 * 1000));
153
- return __classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_isValidOnDate).call(this, thirtyDaysFromNow) === false;
272
+ return this.isValidOnDate(thirtyDaysFromNow) === false;
273
+ }
274
+ /**
275
+ * Verifica si la identificación tributaria será válida en una fecha específica.
276
+ */
277
+ isValidOnDate(date) {
278
+ const checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
279
+ if (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom) {
280
+ const fromDate = this.parseDate(__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom);
281
+ if (checkDate < fromDate) {
282
+ return false;
283
+ }
284
+ }
285
+ if (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil) {
286
+ const untilDate = this.parseDate(__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil);
287
+ if (checkDate > untilDate) {
288
+ return false;
289
+ }
290
+ }
291
+ return true;
154
292
  }
155
293
  /**
156
294
  * Obtiene días restantes hasta el vencimiento.
@@ -186,24 +324,49 @@ class CarbonClientReference extends ObjectValueObject_1.ObjectValueObject {
186
324
  * Compara la igualdad semántica con otro objeto CarbonClientReference.
187
325
  */
188
326
  equals(other) {
189
- if (__classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_otherIsNotCarbonClientReference).call(this, other)) {
327
+ if (this.otherIsNotCarbonClientReference(other)) {
190
328
  return false;
191
329
  }
192
330
  return (__classPrivateFieldGet(this, _CarbonClientReference_id, "f") === __classPrivateFieldGet(other, _CarbonClientReference_id, "f")
193
331
  && __classPrivateFieldGet(this, _CarbonClientReference_displayName, "f") === __classPrivateFieldGet(other, _CarbonClientReference_displayName, "f")
194
- && __classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_taxIdentificationsAreEqual).call(this, __classPrivateFieldGet(other, _CarbonClientReference_taxIdentification, "f"))
332
+ && this.taxIdentificationsAreEqual(__classPrivateFieldGet(other, _CarbonClientReference_taxIdentification, "f"))
195
333
  && __classPrivateFieldGet(this, _CarbonClientReference_roleType, "f") === __classPrivateFieldGet(other, _CarbonClientReference_roleType, "f")
196
334
  && __classPrivateFieldGet(this, _CarbonClientReference_accountType, "f") === __classPrivateFieldGet(other, _CarbonClientReference_accountType, "f"));
197
335
  }
336
+ /**
337
+ * Verifica si el otro objeto no es una instancia de CarbonClientReference.
338
+ */
339
+ otherIsNotCarbonClientReference(other) {
340
+ return (other instanceof CarbonClientReference) === false;
341
+ }
342
+ /**
343
+ * Compara si dos identificaciones tributarias son iguales.
344
+ */
345
+ taxIdentificationsAreEqual(other) {
346
+ return (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").type === other.type
347
+ && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").number === other.number
348
+ && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").country === other.country
349
+ && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").issuedBy === other.issuedBy
350
+ && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom === other.validFrom
351
+ && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil === other.validUntil);
352
+ }
198
353
  /**
199
354
  * Compara si dos clientes representan la misma entidad
200
355
  * independientemente del nombre.
201
356
  */
202
357
  hasSameIdentity(other) {
203
- if (__classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_otherIsNotCarbonClientReference).call(this, other)) {
358
+ if (this.otherIsNotCarbonClientReference(other)) {
204
359
  return false;
205
360
  }
206
- return __classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_hasSameIdentifier).call(this, __classPrivateFieldGet(other, _CarbonClientReference_taxIdentification, "f"));
361
+ return this.hasSameIdentifier(__classPrivateFieldGet(other, _CarbonClientReference_taxIdentification, "f"));
362
+ }
363
+ /**
364
+ * Compara si dos identificaciones tributarias representan el mismo identificador.
365
+ */
366
+ hasSameIdentifier(other) {
367
+ return (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").type === other.type
368
+ && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").number === other.number
369
+ && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").country === other.country);
207
370
  }
208
371
  /**
209
372
  * Genera un hash code para usar en colecciones.
@@ -253,102 +416,6 @@ class CarbonClientReference extends ObjectValueObject_1.ObjectValueObject {
253
416
  }
254
417
  }
255
418
  exports.CarbonClientReference = CarbonClientReference;
256
- _a = CarbonClientReference, _CarbonClientReference_id = new WeakMap(), _CarbonClientReference_displayName = new WeakMap(), _CarbonClientReference_taxIdentification = new WeakMap(), _CarbonClientReference_roleType = new WeakMap(), _CarbonClientReference_accountType = new WeakMap(), _CarbonClientReference_instances = new WeakSet(), _CarbonClientReference_guardAgainstInvalidType = function _CarbonClientReference_guardAgainstInvalidType(value, propertyName) {
257
- if (__classPrivateFieldGet(this, _a, "m", _CarbonClientReference_valueIsInvalid).call(this, value)) {
258
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CarbonClientReference object', typeof value);
259
- }
260
- if (typeof value.id !== 'string') {
261
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
262
- }
263
- if (typeof value.displayName !== 'string') {
264
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('displayName', 'string', typeof value.displayName);
265
- }
266
- if (__classPrivateFieldGet(this, _a, "m", _CarbonClientReference_taxIdentificationIsInvalid).call(this, value.taxIdentification)) {
267
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('taxIdentification', 'TaxIdentification object', typeof value.taxIdentification);
268
- }
269
- if (typeof value.roleType !== 'string') {
270
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('roleType', 'string', typeof value.roleType);
271
- }
272
- if (typeof value.accountType !== 'string') {
273
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('accountType', 'string', typeof value.accountType);
274
- }
275
- }, _CarbonClientReference_valueIsInvalid = function _CarbonClientReference_valueIsInvalid(value) {
276
- return value === null || value === undefined || typeof value !== 'object';
277
- }, _CarbonClientReference_taxIdentificationIsInvalid = function _CarbonClientReference_taxIdentificationIsInvalid(taxIdentification) {
278
- return taxIdentification === null || taxIdentification === undefined || typeof taxIdentification !== 'object';
279
- }, _CarbonClientReference_guardAgainstInvalidId = function _CarbonClientReference_guardAgainstInvalidId(id) {
280
- String_1.String.guardAgainstEmptyValue(id, 'id');
281
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
282
- }, _CarbonClientReference_guardAgainstInvalidDisplayName = function _CarbonClientReference_guardAgainstInvalidDisplayName(displayName) {
283
- String_1.String.guardAgainstEmptyValue(displayName, 'displayName');
284
- if (displayName.trim().length === 0) {
285
- throw EmptyDisplayNameError_1.EmptyDisplayNameError.create('displayName');
286
- }
287
- if (displayName.trim().length > 255) {
288
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('displayName', 'string with maximum 255 characters', `string with ${displayName.trim().length} characters`);
289
- }
290
- }, _CarbonClientReference_guardAgainstInvalidTaxIdentification = function _CarbonClientReference_guardAgainstInvalidTaxIdentification(taxIdentification) {
291
- if (__classPrivateFieldGet(this, _a, "m", _CarbonClientReference_taxIdentificationIsNull).call(this, taxIdentification)) {
292
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('taxIdentification', 'TaxIdentification object', 'null or undefined');
293
- }
294
- // Usar las validaciones completas del VO TaxIdentification
295
- TaxIdentification_1.TaxIdentification.validateCompletely(taxIdentification, 'taxIdentification');
296
- }, _CarbonClientReference_taxIdentificationIsNull = function _CarbonClientReference_taxIdentificationIsNull(taxIdentification) {
297
- return taxIdentification === null || taxIdentification === undefined;
298
- }, _CarbonClientReference_guardAgainstInvalidRoleType = function _CarbonClientReference_guardAgainstInvalidRoleType(roleType) {
299
- if (__classPrivateFieldGet(this, _a, "m", _CarbonClientReference_roleTypeIsEmpty).call(this, roleType)) {
300
- throw InvalidStakeholderRoleTypeError_1.InvalidStakeholderRoleTypeError.create('empty role type', [this.VALID_ROLE]);
301
- }
302
- const trimmedRoleType = roleType.trim().toUpperCase();
303
- if (__classPrivateFieldGet(this, _a, "m", _CarbonClientReference_roleTypeIsNotCarbonClient).call(this, trimmedRoleType)) {
304
- throw InvalidStakeholderRoleTypeError_1.InvalidStakeholderRoleTypeError.create(trimmedRoleType, [this.VALID_ROLE]);
305
- }
306
- }, _CarbonClientReference_roleTypeIsEmpty = function _CarbonClientReference_roleTypeIsEmpty(roleType) {
307
- return roleType === null || roleType === undefined || roleType.trim().length === 0;
308
- }, _CarbonClientReference_roleTypeIsNotCarbonClient = function _CarbonClientReference_roleTypeIsNotCarbonClient(trimmedRoleType) {
309
- return trimmedRoleType !== this.VALID_ROLE;
310
- }, _CarbonClientReference_guardAgainstInvalidAccountType = function _CarbonClientReference_guardAgainstInvalidAccountType(accountType) {
311
- if (__classPrivateFieldGet(this, _a, "m", _CarbonClientReference_accountTypeIsEmpty).call(this, accountType)) {
312
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('accountType', 'valid CarbonClientAccount', 'empty');
313
- }
314
- const trimmedAccountType = accountType.trim().toUpperCase();
315
- const validAccountTypes = Object.values(CarbonClientAccount_1.CarbonClientAccount);
316
- if (!validAccountTypes.includes(trimmedAccountType)) {
317
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('accountType', `one of: ${validAccountTypes.join(', ')}`, trimmedAccountType);
318
- }
319
- }, _CarbonClientReference_accountTypeIsEmpty = function _CarbonClientReference_accountTypeIsEmpty(accountType) {
320
- return accountType === null || accountType === undefined || accountType.trim().length === 0;
321
- }, _CarbonClientReference_parseDate = function _CarbonClientReference_parseDate(dateString) {
322
- const [day, month, year] = dateString.split('/').map(Number);
323
- return new Date(year, month - 1, day);
324
- }, _CarbonClientReference_isValidOnDate = function _CarbonClientReference_isValidOnDate(date) {
325
- const checkDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());
326
- if (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom) {
327
- const fromDate = __classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_parseDate).call(this, __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom);
328
- if (checkDate < fromDate) {
329
- return false;
330
- }
331
- }
332
- if (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil) {
333
- const untilDate = __classPrivateFieldGet(this, _CarbonClientReference_instances, "m", _CarbonClientReference_parseDate).call(this, __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil);
334
- if (checkDate > untilDate) {
335
- return false;
336
- }
337
- }
338
- return true;
339
- }, _CarbonClientReference_otherIsNotCarbonClientReference = function _CarbonClientReference_otherIsNotCarbonClientReference(other) {
340
- return (other instanceof _a) === false;
341
- }, _CarbonClientReference_taxIdentificationsAreEqual = function _CarbonClientReference_taxIdentificationsAreEqual(other) {
342
- return (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").type === other.type
343
- && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").number === other.number
344
- && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").country === other.country
345
- && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").issuedBy === other.issuedBy
346
- && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validFrom === other.validFrom
347
- && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").validUntil === other.validUntil);
348
- }, _CarbonClientReference_hasSameIdentifier = function _CarbonClientReference_hasSameIdentifier(other) {
349
- return (__classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").type === other.type
350
- && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").number === other.number
351
- && __classPrivateFieldGet(this, _CarbonClientReference_taxIdentification, "f").country === other.country);
352
- };
419
+ _CarbonClientReference_id = new WeakMap(), _CarbonClientReference_displayName = new WeakMap(), _CarbonClientReference_taxIdentification = new WeakMap(), _CarbonClientReference_roleType = new WeakMap(), _CarbonClientReference_accountType = new WeakMap();
353
420
  CarbonClientReference.DEFAULT_PROPERTY_NAME = 'carbonClientReference';
354
421
  CarbonClientReference.VALID_ROLE = StakeholderRole_1.StakeholderRole.CARBON_CLIENT;