@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
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
2
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
3
  if (kind === "m") throw new TypeError("Private method is not writable");
9
4
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
5
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
6
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
7
  };
13
- var _ExecutionPeriod_instances, _ExecutionPeriod_startDate, _ExecutionPeriod_endDate, _ExecutionPeriod_description, _ExecutionPeriod_guardAgainstInvalidExecutionPeriod, _ExecutionPeriod_guardAgainstInvalidStartDate, _ExecutionPeriod_guardAgainstInvalidEndDate, _ExecutionPeriod_guardAgainstInvalidDescription, _ExecutionPeriod_guardAgainstInvalidDateRange, _ExecutionPeriod_guardAgainstNullOrUndefinedValue, _ExecutionPeriod_valueIsNullOrUndefined, _ExecutionPeriod_endDateIsNotNull, _ExecutionPeriod_descriptionIsNotNull, _ExecutionPeriod_startDateIsAfterOrEqualToEndDate, _ExecutionPeriod_parseDate, _ExecutionPeriod_isSameDay, _ExecutionPeriod_startDatesAreEqual, _ExecutionPeriod_endDatesAreEqual, _ExecutionPeriod_descriptionsAreEqual;
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _ExecutionPeriod_startDate, _ExecutionPeriod_endDate, _ExecutionPeriod_description;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.ExecutionPeriod = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -25,17 +25,72 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
25
25
  */
26
26
  constructor(value, skipDomainValidation, propertyName = ExecutionPeriod.DEFAULT_PROPERTY_NAME) {
27
27
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type ExecutionPeriod from the domain layer', { allowNull: false, allowUndefined: false });
28
- _ExecutionPeriod_instances.add(this);
29
28
  _ExecutionPeriod_startDate.set(this, void 0);
30
29
  _ExecutionPeriod_endDate.set(this, void 0);
31
30
  _ExecutionPeriod_description.set(this, void 0);
32
31
  if (skipDomainValidation === false) {
33
- __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_guardAgainstInvalidExecutionPeriod).call(this, value);
32
+ this.guardAgainstInvalidExecutionPeriod(value);
34
33
  }
35
34
  __classPrivateFieldSet(this, _ExecutionPeriod_startDate, value.startDate, "f");
36
35
  __classPrivateFieldSet(this, _ExecutionPeriod_endDate, value.endDate, "f");
37
36
  __classPrivateFieldSet(this, _ExecutionPeriod_description, value.description, "f");
38
37
  }
38
+ guardAgainstInvalidExecutionPeriod(value) {
39
+ this.guardAgainstInvalidStartDate(value.startDate);
40
+ this.guardAgainstInvalidEndDate(value.endDate);
41
+ this.guardAgainstInvalidDescription(value.description);
42
+ this.guardAgainstInvalidDateRange(value.startDate, value.endDate);
43
+ }
44
+ guardAgainstInvalidStartDate(startDate) {
45
+ this.guardAgainstNullOrUndefinedValue(startDate, 'startDate');
46
+ String_1.String.guardAgainstInvalidType(startDate, 'startDate');
47
+ String_1.String.guardAgainstEmptyValue(startDate, 'startDate');
48
+ DateString_1.DateString.guardAgainstInvalidDateFormat(startDate);
49
+ }
50
+ guardAgainstInvalidEndDate(endDate) {
51
+ if (this.endDateIsNotNull(endDate)) {
52
+ String_1.String.guardAgainstInvalidType(endDate, 'endDate');
53
+ String_1.String.guardAgainstEmptyValue(endDate, 'endDate');
54
+ DateString_1.DateString.guardAgainstInvalidDateFormat(endDate);
55
+ }
56
+ }
57
+ guardAgainstInvalidDescription(description) {
58
+ if (this.descriptionIsNotNull(description)) {
59
+ String_1.String.guardAgainstInvalidType(description, 'description');
60
+ String_1.String.guardAgainstEmptyValue(description, 'description');
61
+ }
62
+ }
63
+ guardAgainstInvalidDateRange(startDate, endDate) {
64
+ if (this.endDateIsNotNull(endDate)) {
65
+ const start = this.parseDate(startDate);
66
+ const end = this.parseDate(endDate);
67
+ if (this.startDateIsAfterOrEqualToEndDate(start, end)) {
68
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('endDate', 'date after start date', `start: ${startDate}, end: ${endDate}`);
69
+ }
70
+ }
71
+ }
72
+ guardAgainstNullOrUndefinedValue(value, propertyName) {
73
+ if (this.valueIsNullOrUndefined(value)) {
74
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'non-null value', typeof value);
75
+ }
76
+ }
77
+ // Helper methods for explicit boolean checks
78
+ valueIsNullOrUndefined(value) {
79
+ return value === null || value === undefined;
80
+ }
81
+ endDateIsNotNull(endDate) {
82
+ return endDate !== null;
83
+ }
84
+ descriptionIsNotNull(description) {
85
+ return description !== null;
86
+ }
87
+ startDateIsAfterOrEqualToEndDate(startDate, endDate) {
88
+ return startDate >= endDate;
89
+ }
90
+ parseDate(dateString) {
91
+ const [day, month, year] = dateString.split('/').map(Number);
92
+ return new Date(year, month - 1, day);
93
+ }
39
94
  // Getters
40
95
  get startDate() {
41
96
  return __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f");
@@ -55,10 +110,10 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
55
110
  }
56
111
  // Domain methods for execution period analysis
57
112
  hasEndDate() {
58
- return __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_endDateIsNotNull).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
113
+ return this.endDateIsNotNull(__classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
59
114
  }
60
115
  hasDescription() {
61
- return __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_descriptionIsNotNull).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_description, "f"));
116
+ return this.descriptionIsNotNull(__classPrivateFieldGet(this, _ExecutionPeriod_description, "f"));
62
117
  }
63
118
  isOngoingPeriod() {
64
119
  return this.hasEndDate() === false;
@@ -70,9 +125,9 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
70
125
  if (this.hasEndDate() === false) {
71
126
  return true; // Si no hay fecha de fin, se considera un solo día
72
127
  }
73
- const startDate = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
74
- const endDate = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
75
- return __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_isSameDay).call(this, startDate, endDate) === true;
128
+ const startDate = this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
129
+ const endDate = this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
130
+ return this.isSameDay(startDate, endDate) === true;
76
131
  }
77
132
  isMultiDayPeriod() {
78
133
  return this.isSingleDayPeriod() === false && this.hasEndDate() === true;
@@ -81,8 +136,8 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
81
136
  if (this.hasEndDate() === false) {
82
137
  return null; // Período ongoing, duración indefinida
83
138
  }
84
- const startDate = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
85
- const endDate = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
139
+ const startDate = this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
140
+ const endDate = this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
86
141
  const diffTime = endDate.getTime() - startDate.getTime();
87
142
  return Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + 1; // +1 to include both start and end dates
88
143
  }
@@ -97,20 +152,20 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
97
152
  if (this.hasEndDate() === false) {
98
153
  return null;
99
154
  }
100
- const startDate = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
101
- const endDate = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
155
+ const startDate = this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
156
+ const endDate = this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
102
157
  const yearDiff = endDate.getFullYear() - startDate.getFullYear();
103
158
  const monthDiff = endDate.getMonth() - startDate.getMonth();
104
159
  return yearDiff * 12 + monthDiff + 1;
105
160
  }
106
161
  getStartDateAsDate() {
107
- return __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
162
+ return this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"));
108
163
  }
109
164
  getEndDateAsDate() {
110
165
  if (this.hasEndDate() === false) {
111
166
  return null;
112
167
  }
113
- return __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, __classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
168
+ return this.parseDate(__classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f"));
114
169
  }
115
170
  // Domain methods for temporal analysis
116
171
  isInThePast() {
@@ -203,8 +258,8 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
203
258
  dayAfterThisEnd.setDate(dayAfterThisEnd.getDate() + 1);
204
259
  const dayAfterOtherEnd = new Date(otherEnd);
205
260
  dayAfterOtherEnd.setDate(dayAfterOtherEnd.getDate() + 1);
206
- return __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_isSameDay).call(this, dayAfterThisEnd, otherStart) === true
207
- || __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_isSameDay).call(this, dayAfterOtherEnd, thisStart) === true;
261
+ return this.isSameDay(dayAfterThisEnd, otherStart) === true
262
+ || this.isSameDay(dayAfterOtherEnd, thisStart) === true;
208
263
  }
209
264
  // Domain methods for formatting
210
265
  getFormattedRange(locale = 'en-US') {
@@ -248,6 +303,12 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
248
303
  }
249
304
  return 'COMPLETED';
250
305
  }
306
+ // Private utility methods
307
+ isSameDay(date1, date2) {
308
+ return date1.getFullYear() === date2.getFullYear()
309
+ && date1.getMonth() === date2.getMonth()
310
+ && date1.getDate() === date2.getDate();
311
+ }
251
312
  toEnums() {
252
313
  return {
253
314
  startDate: __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f"),
@@ -256,65 +317,20 @@ class ExecutionPeriod extends ObjectValueObject_1.ObjectValueObject {
256
317
  };
257
318
  }
258
319
  equals(other) {
259
- return __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_startDatesAreEqual).call(this, other) === true
260
- && __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_endDatesAreEqual).call(this, other) === true
261
- && __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_descriptionsAreEqual).call(this, other) === true;
320
+ return this.startDatesAreEqual(other) === true
321
+ && this.endDatesAreEqual(other) === true
322
+ && this.descriptionsAreEqual(other) === true;
323
+ }
324
+ startDatesAreEqual(other) {
325
+ return __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f") === __classPrivateFieldGet(other, _ExecutionPeriod_startDate, "f");
326
+ }
327
+ endDatesAreEqual(other) {
328
+ return __classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f") === __classPrivateFieldGet(other, _ExecutionPeriod_endDate, "f");
329
+ }
330
+ descriptionsAreEqual(other) {
331
+ return __classPrivateFieldGet(this, _ExecutionPeriod_description, "f") === __classPrivateFieldGet(other, _ExecutionPeriod_description, "f");
262
332
  }
263
333
  }
264
334
  exports.ExecutionPeriod = ExecutionPeriod;
265
- _ExecutionPeriod_startDate = new WeakMap(), _ExecutionPeriod_endDate = new WeakMap(), _ExecutionPeriod_description = new WeakMap(), _ExecutionPeriod_instances = new WeakSet(), _ExecutionPeriod_guardAgainstInvalidExecutionPeriod = function _ExecutionPeriod_guardAgainstInvalidExecutionPeriod(value) {
266
- __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_guardAgainstInvalidStartDate).call(this, value.startDate);
267
- __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_guardAgainstInvalidEndDate).call(this, value.endDate);
268
- __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_guardAgainstInvalidDescription).call(this, value.description);
269
- __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_guardAgainstInvalidDateRange).call(this, value.startDate, value.endDate);
270
- }, _ExecutionPeriod_guardAgainstInvalidStartDate = function _ExecutionPeriod_guardAgainstInvalidStartDate(startDate) {
271
- __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_guardAgainstNullOrUndefinedValue).call(this, startDate, 'startDate');
272
- String_1.String.guardAgainstInvalidType(startDate, 'startDate');
273
- String_1.String.guardAgainstEmptyValue(startDate, 'startDate');
274
- DateString_1.DateString.guardAgainstInvalidDateFormat(startDate);
275
- }, _ExecutionPeriod_guardAgainstInvalidEndDate = function _ExecutionPeriod_guardAgainstInvalidEndDate(endDate) {
276
- if (__classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_endDateIsNotNull).call(this, endDate)) {
277
- String_1.String.guardAgainstInvalidType(endDate, 'endDate');
278
- String_1.String.guardAgainstEmptyValue(endDate, 'endDate');
279
- DateString_1.DateString.guardAgainstInvalidDateFormat(endDate);
280
- }
281
- }, _ExecutionPeriod_guardAgainstInvalidDescription = function _ExecutionPeriod_guardAgainstInvalidDescription(description) {
282
- if (__classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_descriptionIsNotNull).call(this, description)) {
283
- String_1.String.guardAgainstInvalidType(description, 'description');
284
- String_1.String.guardAgainstEmptyValue(description, 'description');
285
- }
286
- }, _ExecutionPeriod_guardAgainstInvalidDateRange = function _ExecutionPeriod_guardAgainstInvalidDateRange(startDate, endDate) {
287
- if (__classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_endDateIsNotNull).call(this, endDate)) {
288
- const start = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, startDate);
289
- const end = __classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_parseDate).call(this, endDate);
290
- if (__classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_startDateIsAfterOrEqualToEndDate).call(this, start, end)) {
291
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('endDate', 'date after start date', `start: ${startDate}, end: ${endDate}`);
292
- }
293
- }
294
- }, _ExecutionPeriod_guardAgainstNullOrUndefinedValue = function _ExecutionPeriod_guardAgainstNullOrUndefinedValue(value, propertyName) {
295
- if (__classPrivateFieldGet(this, _ExecutionPeriod_instances, "m", _ExecutionPeriod_valueIsNullOrUndefined).call(this, value)) {
296
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'non-null value', typeof value);
297
- }
298
- }, _ExecutionPeriod_valueIsNullOrUndefined = function _ExecutionPeriod_valueIsNullOrUndefined(value) {
299
- return value === null || value === undefined;
300
- }, _ExecutionPeriod_endDateIsNotNull = function _ExecutionPeriod_endDateIsNotNull(endDate) {
301
- return endDate !== null;
302
- }, _ExecutionPeriod_descriptionIsNotNull = function _ExecutionPeriod_descriptionIsNotNull(description) {
303
- return description !== null;
304
- }, _ExecutionPeriod_startDateIsAfterOrEqualToEndDate = function _ExecutionPeriod_startDateIsAfterOrEqualToEndDate(startDate, endDate) {
305
- return startDate >= endDate;
306
- }, _ExecutionPeriod_parseDate = function _ExecutionPeriod_parseDate(dateString) {
307
- const [day, month, year] = dateString.split('/').map(Number);
308
- return new Date(year, month - 1, day);
309
- }, _ExecutionPeriod_isSameDay = function _ExecutionPeriod_isSameDay(date1, date2) {
310
- return date1.getFullYear() === date2.getFullYear()
311
- && date1.getMonth() === date2.getMonth()
312
- && date1.getDate() === date2.getDate();
313
- }, _ExecutionPeriod_startDatesAreEqual = function _ExecutionPeriod_startDatesAreEqual(other) {
314
- return __classPrivateFieldGet(this, _ExecutionPeriod_startDate, "f") === __classPrivateFieldGet(other, _ExecutionPeriod_startDate, "f");
315
- }, _ExecutionPeriod_endDatesAreEqual = function _ExecutionPeriod_endDatesAreEqual(other) {
316
- return __classPrivateFieldGet(this, _ExecutionPeriod_endDate, "f") === __classPrivateFieldGet(other, _ExecutionPeriod_endDate, "f");
317
- }, _ExecutionPeriod_descriptionsAreEqual = function _ExecutionPeriod_descriptionsAreEqual(other) {
318
- return __classPrivateFieldGet(this, _ExecutionPeriod_description, "f") === __classPrivateFieldGet(other, _ExecutionPeriod_description, "f");
319
- };
335
+ _ExecutionPeriod_startDate = new WeakMap(), _ExecutionPeriod_endDate = new WeakMap(), _ExecutionPeriod_description = new WeakMap();
320
336
  ExecutionPeriod.DEFAULT_PROPERTY_NAME = 'executionPeriod';
@@ -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, _FacilityReference_id, _FacilityReference_commercialBranchName, _FacilityReference_guardAgainstInvalidType, _FacilityReference_guardAgainstInvalidId, _FacilityReference_guardAgainstInvalidCommercialBranchName;
13
+ var _FacilityReference_id, _FacilityReference_commercialBranchName;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.FacilityReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -22,12 +22,12 @@ class FacilityReference extends ObjectValueObject_1.ObjectValueObject {
22
22
  * Constructor protegido para que solo clases hijas puedan instanciar.
23
23
  * Aplica todas las validaciones de dominio al momento de construcción.
24
24
  */
25
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
25
+ constructor(value, skipDomainValidation, propertyName = FacilityReference.DEFAULT_PROPERTY_NAME) {
26
26
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type FacilityReference from the domain layer', { allowNull: false, allowUndefined: false });
27
27
  _FacilityReference_id.set(this, void 0);
28
28
  _FacilityReference_commercialBranchName.set(this, void 0);
29
29
  if (skipDomainValidation === false) {
30
- _a.validateFacilityReference(value, propertyName);
30
+ FacilityReference.validateFacilityReference(value, propertyName);
31
31
  }
32
32
  __classPrivateFieldSet(this, _FacilityReference_id, value.id.trim(), "f");
33
33
  __classPrivateFieldSet(this, _FacilityReference_commercialBranchName, value.commercialBranchName.trim(), "f");
@@ -36,9 +36,34 @@ class FacilityReference extends ObjectValueObject_1.ObjectValueObject {
36
36
  * Validación estática para reutilización en factory methods y constructores.
37
37
  */
38
38
  static validateFacilityReference(value, propertyName) {
39
- __classPrivateFieldGet(this, _a, "m", _FacilityReference_guardAgainstInvalidType).call(this, value, propertyName);
40
- __classPrivateFieldGet(this, _a, "m", _FacilityReference_guardAgainstInvalidId).call(this, value.id);
41
- __classPrivateFieldGet(this, _a, "m", _FacilityReference_guardAgainstInvalidCommercialBranchName).call(this, value.commercialBranchName);
39
+ this.guardAgainstInvalidType(value, propertyName);
40
+ this.guardAgainstInvalidId(value.id);
41
+ this.guardAgainstInvalidCommercialBranchName(value.commercialBranchName);
42
+ }
43
+ /**
44
+ * Valida que el objeto tenga la estructura correcta.
45
+ */
46
+ static guardAgainstInvalidType(value, propertyName) {
47
+ if (!value || typeof value !== 'object') {
48
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'FacilityReference object', typeof value);
49
+ }
50
+ if (typeof value.id !== 'string') {
51
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
52
+ }
53
+ if (typeof value.commercialBranchName !== 'string') {
54
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('commercialBranchName', 'string', typeof value.commercialBranchName);
55
+ }
56
+ }
57
+ static guardAgainstInvalidId(id) {
58
+ String_1.String.guardAgainstEmptyValue(id, 'id');
59
+ AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
60
+ }
61
+ /**
62
+ * Valida el nombre comercial de la sucursal.
63
+ * No debe ser vacío después de aplicar trim.
64
+ */
65
+ static guardAgainstInvalidCommercialBranchName(name) {
66
+ String_1.String.guardAgainstEmptyValue(name, 'commercialBranchName');
42
67
  }
43
68
  get id() {
44
69
  return __classPrivateFieldGet(this, _FacilityReference_id, "f");
@@ -82,7 +107,7 @@ class FacilityReference extends ObjectValueObject_1.ObjectValueObject {
82
107
  * Dos referencias son iguales si tienen el mismo código y nombre de sucursal.
83
108
  */
84
109
  equals(other) {
85
- if (!(other instanceof _a)) {
110
+ if (!(other instanceof FacilityReference)) {
86
111
  return false;
87
112
  }
88
113
  return (__classPrivateFieldGet(this, _FacilityReference_id, "f") === __classPrivateFieldGet(other, _FacilityReference_id, "f")
@@ -93,7 +118,7 @@ class FacilityReference extends ObjectValueObject_1.ObjectValueObject {
93
118
  * basándose únicamente en el código (identificador único).
94
119
  */
95
120
  hasSameFacility(other) {
96
- if (!(other instanceof _a)) {
121
+ if (!(other instanceof FacilityReference)) {
97
122
  return false;
98
123
  }
99
124
  return __classPrivateFieldGet(this, _FacilityReference_id, "f") === __classPrivateFieldGet(other, _FacilityReference_id, "f");
@@ -128,20 +153,5 @@ class FacilityReference extends ObjectValueObject_1.ObjectValueObject {
128
153
  }
129
154
  }
130
155
  exports.FacilityReference = FacilityReference;
131
- _a = FacilityReference, _FacilityReference_id = new WeakMap(), _FacilityReference_commercialBranchName = new WeakMap(), _FacilityReference_guardAgainstInvalidType = function _FacilityReference_guardAgainstInvalidType(value, propertyName) {
132
- if (!value || typeof value !== 'object') {
133
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'FacilityReference object', typeof value);
134
- }
135
- if (typeof value.id !== 'string') {
136
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
137
- }
138
- if (typeof value.commercialBranchName !== 'string') {
139
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('commercialBranchName', 'string', typeof value.commercialBranchName);
140
- }
141
- }, _FacilityReference_guardAgainstInvalidId = function _FacilityReference_guardAgainstInvalidId(id) {
142
- String_1.String.guardAgainstEmptyValue(id, 'id');
143
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
144
- }, _FacilityReference_guardAgainstInvalidCommercialBranchName = function _FacilityReference_guardAgainstInvalidCommercialBranchName(name) {
145
- String_1.String.guardAgainstEmptyValue(name, 'commercialBranchName');
146
- };
156
+ _FacilityReference_id = new WeakMap(), _FacilityReference_commercialBranchName = new WeakMap();
147
157
  FacilityReference.DEFAULT_PROPERTY_NAME = 'facilityReference';
@@ -1,39 +1,34 @@
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 _a, _Gender_genderIsInvalid, _Gender_genderIsValid;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.Gender = void 0;
10
4
  const Gender_1 = require("../enums/Gender");
11
5
  const InvalidGenderError_1 = require("../exceptions/InvalidGenderError");
12
6
  const String_1 = require("./String");
13
7
  class Gender extends String_1.String {
14
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
8
+ constructor(value, skipDomainValidation, propertyName = Gender.DEFAULT_PROPERTY_NAME) {
15
9
  super(value, skipDomainValidation, propertyName);
16
10
  if (skipDomainValidation === false) {
17
- _a.guardAgainstInvalidGender(value);
11
+ Gender.guardAgainstInvalidGender(value);
18
12
  }
19
13
  }
20
14
  static guardAgainstInvalidGender(gender) {
21
- if (__classPrivateFieldGet(this, _a, "m", _Gender_genderIsInvalid).call(this, gender)) {
22
- throw InvalidGenderError_1.InvalidGenderError.create(gender, _a.VALID_GENDERS);
15
+ if (this.genderIsInvalid(gender)) {
16
+ throw InvalidGenderError_1.InvalidGenderError.create(gender, Gender.VALID_GENDERS);
23
17
  }
24
18
  }
25
19
  toEnum() {
26
20
  return this.value;
27
21
  }
22
+ static genderIsInvalid(gender) {
23
+ return this.genderIsValid(gender) === false;
24
+ }
25
+ static genderIsValid(gender) {
26
+ return Gender.VALID_GENDERS.includes(gender);
27
+ }
28
28
  static getValidGenders() {
29
- return _a.VALID_GENDERS;
29
+ return Gender.VALID_GENDERS;
30
30
  }
31
31
  }
32
32
  exports.Gender = Gender;
33
- _a = Gender, _Gender_genderIsInvalid = function _Gender_genderIsInvalid(gender) {
34
- return __classPrivateFieldGet(this, _a, "m", _Gender_genderIsValid).call(this, gender) === false;
35
- }, _Gender_genderIsValid = function _Gender_genderIsValid(gender) {
36
- return _a.VALID_GENDERS.includes(gender);
37
- };
38
33
  Gender.DEFAULT_PROPERTY_NAME = 'gender';
39
34
  Gender.VALID_GENDERS = Object.values(Gender_1.Gender);
@@ -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, _GlobalWarmingPotentialReference_id, _GlobalWarmingPotentialReference_referenceName, _GlobalWarmingPotentialReference_protocolVersion, _GlobalWarmingPotentialReference_timeHorizonYears, _GlobalWarmingPotentialReference_guardAgainstInvalidType, _GlobalWarmingPotentialReference_guardAgainstInvalidId, _GlobalWarmingPotentialReference_guardAgainstInvalidReferenceName, _GlobalWarmingPotentialReference_guardAgainstInvalidProtocolVersion, _GlobalWarmingPotentialReference_guardAgainstInvalidTimeHorizon;
13
+ var _GlobalWarmingPotentialReference_id, _GlobalWarmingPotentialReference_referenceName, _GlobalWarmingPotentialReference_protocolVersion, _GlobalWarmingPotentialReference_timeHorizonYears;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.GlobalWarmingPotentialReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -23,14 +23,14 @@ class GlobalWarmingPotentialReference extends ObjectValueObject_1.ObjectValueObj
23
23
  * Constructor protegido para que solo clases hijas puedan instanciar.
24
24
  * Aplica todas las validaciones de dominio al momento de construcción.
25
25
  */
26
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
26
+ constructor(value, skipDomainValidation, propertyName = GlobalWarmingPotentialReference.DEFAULT_PROPERTY_NAME) {
27
27
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type GlobalWarmingPotentialReference from the domain layer', { allowNull: false, allowUndefined: false });
28
28
  _GlobalWarmingPotentialReference_id.set(this, void 0);
29
29
  _GlobalWarmingPotentialReference_referenceName.set(this, void 0);
30
30
  _GlobalWarmingPotentialReference_protocolVersion.set(this, void 0);
31
31
  _GlobalWarmingPotentialReference_timeHorizonYears.set(this, void 0);
32
32
  if (skipDomainValidation === false) {
33
- _a
33
+ GlobalWarmingPotentialReference
34
34
  .validateGlobalWarmingPotentialReference(value, propertyName);
35
35
  }
36
36
  __classPrivateFieldSet(this, _GlobalWarmingPotentialReference_id, value.id.trim(), "f");
@@ -42,11 +42,72 @@ class GlobalWarmingPotentialReference extends ObjectValueObject_1.ObjectValueObj
42
42
  * Validación estática para reutilización en factory methods y constructores.
43
43
  */
44
44
  static validateGlobalWarmingPotentialReference(value, propertyName) {
45
- __classPrivateFieldGet(this, _a, "m", _GlobalWarmingPotentialReference_guardAgainstInvalidType).call(this, value, propertyName);
46
- __classPrivateFieldGet(this, _a, "m", _GlobalWarmingPotentialReference_guardAgainstInvalidId).call(this, value.id);
47
- __classPrivateFieldGet(this, _a, "m", _GlobalWarmingPotentialReference_guardAgainstInvalidReferenceName).call(this, value.referenceName);
48
- __classPrivateFieldGet(this, _a, "m", _GlobalWarmingPotentialReference_guardAgainstInvalidProtocolVersion).call(this, value.protocolVersion);
49
- __classPrivateFieldGet(this, _a, "m", _GlobalWarmingPotentialReference_guardAgainstInvalidTimeHorizon).call(this, value.timeHorizonYears);
45
+ this.guardAgainstInvalidType(value, propertyName);
46
+ this.guardAgainstInvalidId(value.id);
47
+ this.guardAgainstInvalidReferenceName(value.referenceName);
48
+ this.guardAgainstInvalidProtocolVersion(value.protocolVersion);
49
+ this.guardAgainstInvalidTimeHorizon(value.timeHorizonYears);
50
+ }
51
+ /**
52
+ * Valida que el objeto tenga la estructura correcta.
53
+ */
54
+ static guardAgainstInvalidType(value, propertyName) {
55
+ if (!value || typeof value !== 'object') {
56
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'GlobalWarmingPotentialReference object', typeof value);
57
+ }
58
+ if (typeof value.id !== 'string') {
59
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
60
+ }
61
+ if (typeof value.referenceName !== 'string') {
62
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('referenceName', 'string', typeof value.referenceName);
63
+ }
64
+ if (typeof value.protocolVersion !== 'string') {
65
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('protocolVersion', 'string', typeof value.protocolVersion);
66
+ }
67
+ if (typeof value.timeHorizonYears !== 'number') {
68
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('timeHorizonYears', 'number', typeof value.timeHorizonYears);
69
+ }
70
+ }
71
+ static guardAgainstInvalidId(id) {
72
+ String_1.String.guardAgainstEmptyValue(id, 'id');
73
+ AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
74
+ }
75
+ /**
76
+ * Valida el nombre de referencia.
77
+ * No debe ser vacío después de aplicar trim.
78
+ */
79
+ static guardAgainstInvalidReferenceName(name) {
80
+ String_1.String.guardAgainstEmptyValue(name, 'referenceName');
81
+ if (name.trim().length < 3) {
82
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('referenceName', 'at least 3 characters', `${name.trim().length} characters: "${name.trim()}"`);
83
+ }
84
+ if (name.trim().length > 200) {
85
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('referenceName', 'at most 200 characters', `${name.trim().length} characters: "${name.substring(0, 50)}${name.length > 50 ? '...' : ''}"`);
86
+ }
87
+ }
88
+ /**
89
+ * Valida la versión del protocolo.
90
+ */
91
+ static guardAgainstInvalidProtocolVersion(version) {
92
+ String_1.String.guardAgainstEmptyValue(version, 'protocolVersion');
93
+ if (version.trim().length < 2) {
94
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('protocolVersion', 'at least 2 characters', `${version.trim().length} characters: "${version.trim()}"`);
95
+ }
96
+ if (version.trim().length > 50) {
97
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('protocolVersion', 'at most 50 characters', `${version.trim().length} characters: "${version.substring(0, 20)}${version.length > 20 ? '...' : ''}"`);
98
+ }
99
+ }
100
+ /**
101
+ * Valida el horizonte temporal del GWP.
102
+ * Solo se permiten horizontes de 20, 100 y 500 años.
103
+ */
104
+ static guardAgainstInvalidTimeHorizon(timeHorizonYears) {
105
+ if (!Number.isInteger(timeHorizonYears)) {
106
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('timeHorizonYears', 'integer number', `${timeHorizonYears} (not an integer)`);
107
+ }
108
+ if (!GlobalWarmingPotentialReference.VALID_TIME_HORIZONS.includes(timeHorizonYears)) {
109
+ throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('timeHorizonYears', `one of: ${GlobalWarmingPotentialReference.VALID_TIME_HORIZONS.join(', ')} years`, `${timeHorizonYears} years`);
110
+ }
50
111
  }
51
112
  get id() {
52
113
  return __classPrivateFieldGet(this, _GlobalWarmingPotentialReference_id, "f");
@@ -115,7 +176,7 @@ class GlobalWarmingPotentialReference extends ObjectValueObject_1.ObjectValueObj
115
176
  * Verifica si es compatible con otra referencia basándose en protocolo y horizonte temporal.
116
177
  */
117
178
  isCompatibleWith(other) {
118
- if (!(other instanceof _a)) {
179
+ if (!(other instanceof GlobalWarmingPotentialReference)) {
119
180
  return false;
120
181
  }
121
182
  return __classPrivateFieldGet(this, _GlobalWarmingPotentialReference_protocolVersion, "f") === __classPrivateFieldGet(other, _GlobalWarmingPotentialReference_protocolVersion, "f")
@@ -148,52 +209,10 @@ class GlobalWarmingPotentialReference extends ObjectValueObject_1.ObjectValueObj
148
209
  * Obtiene los horizontes temporales válidos.
149
210
  */
150
211
  static getValidTimeHorizons() {
151
- return Object.freeze([..._a.VALID_TIME_HORIZONS]);
212
+ return Object.freeze([...GlobalWarmingPotentialReference.VALID_TIME_HORIZONS]);
152
213
  }
153
214
  }
154
215
  exports.GlobalWarmingPotentialReference = GlobalWarmingPotentialReference;
155
- _a = GlobalWarmingPotentialReference, _GlobalWarmingPotentialReference_id = new WeakMap(), _GlobalWarmingPotentialReference_referenceName = new WeakMap(), _GlobalWarmingPotentialReference_protocolVersion = new WeakMap(), _GlobalWarmingPotentialReference_timeHorizonYears = new WeakMap(), _GlobalWarmingPotentialReference_guardAgainstInvalidType = function _GlobalWarmingPotentialReference_guardAgainstInvalidType(value, propertyName) {
156
- if (!value || typeof value !== 'object') {
157
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'GlobalWarmingPotentialReference object', typeof value);
158
- }
159
- if (typeof value.id !== 'string') {
160
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
161
- }
162
- if (typeof value.referenceName !== 'string') {
163
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('referenceName', 'string', typeof value.referenceName);
164
- }
165
- if (typeof value.protocolVersion !== 'string') {
166
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('protocolVersion', 'string', typeof value.protocolVersion);
167
- }
168
- if (typeof value.timeHorizonYears !== 'number') {
169
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('timeHorizonYears', 'number', typeof value.timeHorizonYears);
170
- }
171
- }, _GlobalWarmingPotentialReference_guardAgainstInvalidId = function _GlobalWarmingPotentialReference_guardAgainstInvalidId(id) {
172
- String_1.String.guardAgainstEmptyValue(id, 'id');
173
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
174
- }, _GlobalWarmingPotentialReference_guardAgainstInvalidReferenceName = function _GlobalWarmingPotentialReference_guardAgainstInvalidReferenceName(name) {
175
- String_1.String.guardAgainstEmptyValue(name, 'referenceName');
176
- if (name.trim().length < 3) {
177
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('referenceName', 'at least 3 characters', `${name.trim().length} characters: "${name.trim()}"`);
178
- }
179
- if (name.trim().length > 200) {
180
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('referenceName', 'at most 200 characters', `${name.trim().length} characters: "${name.substring(0, 50)}${name.length > 50 ? '...' : ''}"`);
181
- }
182
- }, _GlobalWarmingPotentialReference_guardAgainstInvalidProtocolVersion = function _GlobalWarmingPotentialReference_guardAgainstInvalidProtocolVersion(version) {
183
- String_1.String.guardAgainstEmptyValue(version, 'protocolVersion');
184
- if (version.trim().length < 2) {
185
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('protocolVersion', 'at least 2 characters', `${version.trim().length} characters: "${version.trim()}"`);
186
- }
187
- if (version.trim().length > 50) {
188
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('protocolVersion', 'at most 50 characters', `${version.trim().length} characters: "${version.substring(0, 20)}${version.length > 20 ? '...' : ''}"`);
189
- }
190
- }, _GlobalWarmingPotentialReference_guardAgainstInvalidTimeHorizon = function _GlobalWarmingPotentialReference_guardAgainstInvalidTimeHorizon(timeHorizonYears) {
191
- if (!Number.isInteger(timeHorizonYears)) {
192
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('timeHorizonYears', 'integer number', `${timeHorizonYears} (not an integer)`);
193
- }
194
- if (!_a.VALID_TIME_HORIZONS.includes(timeHorizonYears)) {
195
- throw InvalidPropertyValueError_1.InvalidPropertyValueError.create('timeHorizonYears', `one of: ${_a.VALID_TIME_HORIZONS.join(', ')} years`, `${timeHorizonYears} years`);
196
- }
197
- };
216
+ _GlobalWarmingPotentialReference_id = new WeakMap(), _GlobalWarmingPotentialReference_referenceName = new WeakMap(), _GlobalWarmingPotentialReference_protocolVersion = new WeakMap(), _GlobalWarmingPotentialReference_timeHorizonYears = new WeakMap();
198
217
  GlobalWarmingPotentialReference.DEFAULT_PROPERTY_NAME = 'formulaGlobalWarmingPotentialReference';
199
218
  GlobalWarmingPotentialReference.VALID_TIME_HORIZONS = [20, 100, 500];