@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 _ActivityDataSubmissionReference_instances, _a, _ActivityDataSubmissionReference_id, _ActivityDataSubmissionReference_dynamicFormCode, _ActivityDataSubmissionReference_carbonClient, _ActivityDataSubmissionReference_footprintType, _ActivityDataSubmissionReference_guardAgainstInvalidType, _ActivityDataSubmissionReference_valueIsInvalid, _ActivityDataSubmissionReference_carbonClientIsInvalid, _ActivityDataSubmissionReference_guardAgainstInvalidId, _ActivityDataSubmissionReference_guardAgainstInvalidDynamicFormCode, _ActivityDataSubmissionReference_guardAgainstInvalidCarbonClient, _ActivityDataSubmissionReference_carbonClientIsNull, _ActivityDataSubmissionReference_guardAgainstInvalidFootprintType, _ActivityDataSubmissionReference_footprintTypeIsEmpty, _ActivityDataSubmissionReference_otherIsNotActivityDataSubmissionReference;
13
+ var _ActivityDataSubmissionReference_instances, _a, _ActivityDataSubmissionReference_id, _ActivityDataSubmissionReference_dynamicFormCode, _ActivityDataSubmissionReference_carbonClient, _ActivityDataSubmissionReference_footprintType, _ActivityDataSubmissionReference_otherIsNotActivityDataSubmissionReference;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.ActivityDataSubmissionReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -45,11 +45,101 @@ class ActivityDataSubmissionReference extends ObjectValueObject_1.ObjectValueObj
45
45
  * Validación estática para reutilización en factory methods y constructores.
46
46
  */
47
47
  static validateActivityDataSubmissionReference(value, propertyName) {
48
- __classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_guardAgainstInvalidType).call(this, value, propertyName);
49
- __classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_guardAgainstInvalidId).call(this, value.id);
50
- __classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_guardAgainstInvalidDynamicFormCode).call(this, value.dynamicFormCode);
51
- __classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_guardAgainstInvalidCarbonClient).call(this, value.carbonClient);
52
- __classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_guardAgainstInvalidFootprintType).call(this, value.footprintType);
48
+ this.guardAgainstInvalidType(value, propertyName);
49
+ this.guardAgainstInvalidId(value.id);
50
+ this.guardAgainstInvalidDynamicFormCode(value.dynamicFormCode);
51
+ this.guardAgainstInvalidCarbonClient(value.carbonClient);
52
+ this.guardAgainstInvalidFootprintType(value.footprintType);
53
+ }
54
+ /**
55
+ * Valida que el objeto tenga la estructura correcta.
56
+ */
57
+ static guardAgainstInvalidType(value, propertyName) {
58
+ if (this.valueIsInvalid(value)) {
59
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'ActivityDataSubmissionReference object', typeof value);
60
+ }
61
+ if (typeof value.id !== 'string') {
62
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
63
+ }
64
+ if (typeof value.dynamicFormCode !== 'string') {
65
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('dynamicFormCode', 'string', typeof value.dynamicFormCode);
66
+ }
67
+ if (this.carbonClientIsInvalid(value.carbonClient)) {
68
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', typeof value.carbonClient);
69
+ }
70
+ if (typeof value.footprintType !== 'string') {
71
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintType', 'string', typeof value.footprintType);
72
+ }
73
+ }
74
+ /**
75
+ * Valida si el valor principal es inválido.
76
+ */
77
+ static valueIsInvalid(value) {
78
+ return value === null || value === undefined || typeof value !== 'object';
79
+ }
80
+ /**
81
+ * Valida si el carbon client es inválido.
82
+ */
83
+ static carbonClientIsInvalid(carbonClient) {
84
+ return carbonClient === null || carbonClient === undefined || typeof carbonClient !== 'object';
85
+ }
86
+ /**
87
+ * Valida el ID usando las validaciones de AggregateId.
88
+ */
89
+ static guardAgainstInvalidId(id) {
90
+ String_1.String.guardAgainstEmptyValue(id, 'id');
91
+ AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
92
+ }
93
+ /**
94
+ * Valida el código del formulario dinámico.
95
+ */
96
+ static guardAgainstInvalidDynamicFormCode(dynamicFormCode) {
97
+ String_1.String.guardAgainstEmptyValue(dynamicFormCode, 'dynamicFormCode');
98
+ if (dynamicFormCode.trim().length === 0) {
99
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('dynamicFormCode', 'non-empty string', 'empty string');
100
+ }
101
+ if (dynamicFormCode.trim().length > 100) {
102
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('dynamicFormCode', 'string with maximum 100 characters', `string with ${dynamicFormCode.trim().length} characters`);
103
+ }
104
+ }
105
+ /**
106
+ * Valida el carbon client como tipo/interfaz.
107
+ */
108
+ static guardAgainstInvalidCarbonClient(carbonClient) {
109
+ if (this.carbonClientIsNull(carbonClient)) {
110
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', 'null or undefined');
111
+ }
112
+ if (typeof carbonClient.id !== 'string') {
113
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.id', 'string', typeof carbonClient.id);
114
+ }
115
+ if (typeof carbonClient.displayName !== 'string') {
116
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.displayName', 'string', typeof carbonClient.displayName);
117
+ }
118
+ }
119
+ /**
120
+ * Verifica si el carbon client es null o undefined.
121
+ */
122
+ static carbonClientIsNull(carbonClient) {
123
+ return carbonClient === null || carbonClient === undefined;
124
+ }
125
+ /**
126
+ * Valida que el tipo de footprint sea un valor válido del enum CarbonFootprint.
127
+ */
128
+ static guardAgainstInvalidFootprintType(footprintType) {
129
+ if (this.footprintTypeIsEmpty(footprintType)) {
130
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintType', 'valid CarbonFootprint', 'empty');
131
+ }
132
+ const trimmedFootprintType = footprintType.trim().toUpperCase();
133
+ const validFootprintTypes = Object.values(CarbonFootprint_1.CarbonFootprint);
134
+ if (!validFootprintTypes.includes(trimmedFootprintType)) {
135
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintType', `one of: ${validFootprintTypes.join(', ')}`, trimmedFootprintType);
136
+ }
137
+ }
138
+ /**
139
+ * Verifica si el tipo de footprint está vacío.
140
+ */
141
+ static footprintTypeIsEmpty(footprintType) {
142
+ return footprintType === null || footprintType === undefined || footprintType.trim().length === 0;
53
143
  }
54
144
  /**
55
145
  * ID único del activity data submission.
@@ -224,61 +314,7 @@ class ActivityDataSubmissionReference extends ObjectValueObject_1.ObjectValueObj
224
314
  }
225
315
  }
226
316
  exports.ActivityDataSubmissionReference = ActivityDataSubmissionReference;
227
- _a = ActivityDataSubmissionReference, _ActivityDataSubmissionReference_id = new WeakMap(), _ActivityDataSubmissionReference_dynamicFormCode = new WeakMap(), _ActivityDataSubmissionReference_carbonClient = new WeakMap(), _ActivityDataSubmissionReference_footprintType = new WeakMap(), _ActivityDataSubmissionReference_instances = new WeakSet(), _ActivityDataSubmissionReference_guardAgainstInvalidType = function _ActivityDataSubmissionReference_guardAgainstInvalidType(value, propertyName) {
228
- if (__classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_valueIsInvalid).call(this, value)) {
229
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'ActivityDataSubmissionReference object', typeof value);
230
- }
231
- if (typeof value.id !== 'string') {
232
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
233
- }
234
- if (typeof value.dynamicFormCode !== 'string') {
235
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('dynamicFormCode', 'string', typeof value.dynamicFormCode);
236
- }
237
- if (__classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_carbonClientIsInvalid).call(this, value.carbonClient)) {
238
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', typeof value.carbonClient);
239
- }
240
- if (typeof value.footprintType !== 'string') {
241
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintType', 'string', typeof value.footprintType);
242
- }
243
- }, _ActivityDataSubmissionReference_valueIsInvalid = function _ActivityDataSubmissionReference_valueIsInvalid(value) {
244
- return value === null || value === undefined || typeof value !== 'object';
245
- }, _ActivityDataSubmissionReference_carbonClientIsInvalid = function _ActivityDataSubmissionReference_carbonClientIsInvalid(carbonClient) {
246
- return carbonClient === null || carbonClient === undefined || typeof carbonClient !== 'object';
247
- }, _ActivityDataSubmissionReference_guardAgainstInvalidId = function _ActivityDataSubmissionReference_guardAgainstInvalidId(id) {
248
- String_1.String.guardAgainstEmptyValue(id, 'id');
249
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
250
- }, _ActivityDataSubmissionReference_guardAgainstInvalidDynamicFormCode = function _ActivityDataSubmissionReference_guardAgainstInvalidDynamicFormCode(dynamicFormCode) {
251
- String_1.String.guardAgainstEmptyValue(dynamicFormCode, 'dynamicFormCode');
252
- if (dynamicFormCode.trim().length === 0) {
253
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('dynamicFormCode', 'non-empty string', 'empty string');
254
- }
255
- if (dynamicFormCode.trim().length > 100) {
256
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('dynamicFormCode', 'string with maximum 100 characters', `string with ${dynamicFormCode.trim().length} characters`);
257
- }
258
- }, _ActivityDataSubmissionReference_guardAgainstInvalidCarbonClient = function _ActivityDataSubmissionReference_guardAgainstInvalidCarbonClient(carbonClient) {
259
- if (__classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_carbonClientIsNull).call(this, carbonClient)) {
260
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'CarbonClientReference object', 'null or undefined');
261
- }
262
- if (typeof carbonClient.id !== 'string') {
263
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.id', 'string', typeof carbonClient.id);
264
- }
265
- if (typeof carbonClient.displayName !== 'string') {
266
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient.displayName', 'string', typeof carbonClient.displayName);
267
- }
268
- }, _ActivityDataSubmissionReference_carbonClientIsNull = function _ActivityDataSubmissionReference_carbonClientIsNull(carbonClient) {
269
- return carbonClient === null || carbonClient === undefined;
270
- }, _ActivityDataSubmissionReference_guardAgainstInvalidFootprintType = function _ActivityDataSubmissionReference_guardAgainstInvalidFootprintType(footprintType) {
271
- if (__classPrivateFieldGet(this, _a, "m", _ActivityDataSubmissionReference_footprintTypeIsEmpty).call(this, footprintType)) {
272
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintType', 'valid CarbonFootprint', 'empty');
273
- }
274
- const trimmedFootprintType = footprintType.trim().toUpperCase();
275
- const validFootprintTypes = Object.values(CarbonFootprint_1.CarbonFootprint);
276
- if (!validFootprintTypes.includes(trimmedFootprintType)) {
277
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintType', `one of: ${validFootprintTypes.join(', ')}`, trimmedFootprintType);
278
- }
279
- }, _ActivityDataSubmissionReference_footprintTypeIsEmpty = function _ActivityDataSubmissionReference_footprintTypeIsEmpty(footprintType) {
280
- return footprintType === null || footprintType === undefined || footprintType.trim().length === 0;
281
- }, _ActivityDataSubmissionReference_otherIsNotActivityDataSubmissionReference = function _ActivityDataSubmissionReference_otherIsNotActivityDataSubmissionReference(other) {
317
+ _a = ActivityDataSubmissionReference, _ActivityDataSubmissionReference_id = new WeakMap(), _ActivityDataSubmissionReference_dynamicFormCode = new WeakMap(), _ActivityDataSubmissionReference_carbonClient = new WeakMap(), _ActivityDataSubmissionReference_footprintType = new WeakMap(), _ActivityDataSubmissionReference_instances = new WeakSet(), _ActivityDataSubmissionReference_otherIsNotActivityDataSubmissionReference = function _ActivityDataSubmissionReference_otherIsNotActivityDataSubmissionReference(other) {
282
318
  return (other instanceof _a) === false;
283
319
  };
284
320
  ActivityDataSubmissionReference.DEFAULT_PROPERTY_NAME = 'activityDataSubmissionReference';
@@ -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 _Address_instances, _a, _Address_streetAddress, _Address_city, _Address_stateProvince, _Address_postalCode, _Address_country, _Address_coordinates, _Address_guardAgainstInvalidLocationProperties, _Address_guardAgainstInvalidStringProperty, _Address_guardAgainstInvalidPostalCode, _Address_postalCodeIsNotNull, _Address_guardAgainstInvalidCoordinates, _Address_coordinatesAreNullOrUndefined, _Address_guardAgainstInvalidLatitude, _Address_latitudeIsInvalid, _Address_latitudeIsValid, _Address_guardAgainstInvalidLongitude, _Address_longitudeIsInvalid, _Address_longitudeIsValid;
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 _Address_streetAddress, _Address_city, _Address_stateProvince, _Address_postalCode, _Address_country, _Address_coordinates;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.Address = void 0;
16
16
  const InvalidCoordinatesError_1 = require("../exceptions/InvalidCoordinatesError");
@@ -22,7 +22,6 @@ class Address extends ObjectValueObject_1.ObjectValueObject {
22
22
  allowNull: false,
23
23
  allowUndefined: false,
24
24
  });
25
- _Address_instances.add(this);
26
25
  _Address_streetAddress.set(this, void 0);
27
26
  _Address_city.set(this, void 0);
28
27
  _Address_stateProvince.set(this, void 0);
@@ -30,7 +29,7 @@ class Address extends ObjectValueObject_1.ObjectValueObject {
30
29
  _Address_country.set(this, void 0);
31
30
  _Address_coordinates.set(this, void 0);
32
31
  if (skipDomainValidation === false) {
33
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidLocationProperties).call(this, value);
32
+ this.guardAgainstInvalidLocationProperties(value);
34
33
  }
35
34
  __classPrivateFieldSet(this, _Address_streetAddress, value.streetAddress.trim(), "f");
36
35
  __classPrivateFieldSet(this, _Address_city, value.city.trim(), "f");
@@ -42,6 +41,61 @@ class Address extends ObjectValueObject_1.ObjectValueObject {
42
41
  longitude: value.coordinates.longitude,
43
42
  }, "f");
44
43
  }
44
+ guardAgainstInvalidLocationProperties(value) {
45
+ this.guardAgainstInvalidStringProperty(value.streetAddress, 'streetAddress');
46
+ this.guardAgainstInvalidStringProperty(value.city, 'city');
47
+ this.guardAgainstInvalidStringProperty(value.stateProvince, 'stateProvince');
48
+ this.guardAgainstInvalidStringProperty(value.country, 'country');
49
+ this.guardAgainstInvalidPostalCode(value.postalCode);
50
+ this.guardAgainstInvalidCoordinates(value.coordinates);
51
+ }
52
+ guardAgainstInvalidStringProperty(propertyValue, propertyName) {
53
+ String_1.String.guardAgainstInvalidType(propertyValue, propertyName);
54
+ }
55
+ guardAgainstInvalidPostalCode(postalCode) {
56
+ if (this.postalCodeIsNotNull(postalCode)) {
57
+ String_1.String.guardAgainstInvalidType(postalCode, 'postalCode');
58
+ }
59
+ }
60
+ postalCodeIsNotNull(postalCode) {
61
+ return postalCode !== null;
62
+ }
63
+ guardAgainstInvalidCoordinates(coords) {
64
+ if (this.coordinatesAreNullOrUndefined(coords)) {
65
+ throw InvalidCoordinatesError_1.InvalidCoordinatesError.create('Coordinates cannot be null or undefined');
66
+ }
67
+ this.guardAgainstInvalidLatitude(coords.latitude);
68
+ this.guardAgainstInvalidLongitude(coords.longitude);
69
+ }
70
+ coordinatesAreNullOrUndefined(coords) {
71
+ return coords === null || coords === undefined;
72
+ }
73
+ guardAgainstInvalidLatitude(latitude) {
74
+ if (this.latitudeIsInvalid(latitude)) {
75
+ throw InvalidCoordinatesError_1.InvalidCoordinatesError.create(`Invalid latitude: ${latitude}. Must be between ${Address.LATITUDE_MIN} and ${Address.LATITUDE_MAX}`);
76
+ }
77
+ }
78
+ latitudeIsInvalid(latitude) {
79
+ return this.latitudeIsValid(latitude) === false;
80
+ }
81
+ latitudeIsValid(latitude) {
82
+ return typeof latitude === 'number'
83
+ && latitude >= Address.LATITUDE_MIN
84
+ && latitude <= Address.LATITUDE_MAX;
85
+ }
86
+ guardAgainstInvalidLongitude(longitude) {
87
+ if (this.longitudeIsInvalid(longitude)) {
88
+ throw InvalidCoordinatesError_1.InvalidCoordinatesError.create(`Invalid longitude: ${longitude}. Must be between ${Address.LONGITUDE_MIN} and ${Address.LONGITUDE_MAX}`);
89
+ }
90
+ }
91
+ longitudeIsInvalid(longitude) {
92
+ return this.longitudeIsValid(longitude) === false;
93
+ }
94
+ longitudeIsValid(longitude) {
95
+ return typeof longitude === 'number'
96
+ && longitude >= Address.LONGITUDE_MIN
97
+ && longitude <= Address.LONGITUDE_MAX;
98
+ }
45
99
  get streetAddress() {
46
100
  return __classPrivateFieldGet(this, _Address_streetAddress, "f");
47
101
  }
@@ -62,50 +116,7 @@ class Address extends ObjectValueObject_1.ObjectValueObject {
62
116
  }
63
117
  }
64
118
  exports.Address = Address;
65
- _a = Address, _Address_streetAddress = new WeakMap(), _Address_city = new WeakMap(), _Address_stateProvince = new WeakMap(), _Address_postalCode = new WeakMap(), _Address_country = new WeakMap(), _Address_coordinates = new WeakMap(), _Address_instances = new WeakSet(), _Address_guardAgainstInvalidLocationProperties = function _Address_guardAgainstInvalidLocationProperties(value) {
66
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidStringProperty).call(this, value.streetAddress, 'streetAddress');
67
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidStringProperty).call(this, value.city, 'city');
68
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidStringProperty).call(this, value.stateProvince, 'stateProvince');
69
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidStringProperty).call(this, value.country, 'country');
70
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidPostalCode).call(this, value.postalCode);
71
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidCoordinates).call(this, value.coordinates);
72
- }, _Address_guardAgainstInvalidStringProperty = function _Address_guardAgainstInvalidStringProperty(propertyValue, propertyName) {
73
- String_1.String.guardAgainstInvalidType(propertyValue, propertyName);
74
- }, _Address_guardAgainstInvalidPostalCode = function _Address_guardAgainstInvalidPostalCode(postalCode) {
75
- if (__classPrivateFieldGet(this, _Address_instances, "m", _Address_postalCodeIsNotNull).call(this, postalCode)) {
76
- String_1.String.guardAgainstInvalidType(postalCode, 'postalCode');
77
- }
78
- }, _Address_postalCodeIsNotNull = function _Address_postalCodeIsNotNull(postalCode) {
79
- return postalCode !== null;
80
- }, _Address_guardAgainstInvalidCoordinates = function _Address_guardAgainstInvalidCoordinates(coords) {
81
- if (__classPrivateFieldGet(this, _Address_instances, "m", _Address_coordinatesAreNullOrUndefined).call(this, coords)) {
82
- throw InvalidCoordinatesError_1.InvalidCoordinatesError.create('Coordinates cannot be null or undefined');
83
- }
84
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidLatitude).call(this, coords.latitude);
85
- __classPrivateFieldGet(this, _Address_instances, "m", _Address_guardAgainstInvalidLongitude).call(this, coords.longitude);
86
- }, _Address_coordinatesAreNullOrUndefined = function _Address_coordinatesAreNullOrUndefined(coords) {
87
- return coords === null || coords === undefined;
88
- }, _Address_guardAgainstInvalidLatitude = function _Address_guardAgainstInvalidLatitude(latitude) {
89
- if (__classPrivateFieldGet(this, _Address_instances, "m", _Address_latitudeIsInvalid).call(this, latitude)) {
90
- throw InvalidCoordinatesError_1.InvalidCoordinatesError.create(`Invalid latitude: ${latitude}. Must be between ${_a.LATITUDE_MIN} and ${_a.LATITUDE_MAX}`);
91
- }
92
- }, _Address_latitudeIsInvalid = function _Address_latitudeIsInvalid(latitude) {
93
- return __classPrivateFieldGet(this, _Address_instances, "m", _Address_latitudeIsValid).call(this, latitude) === false;
94
- }, _Address_latitudeIsValid = function _Address_latitudeIsValid(latitude) {
95
- return typeof latitude === 'number'
96
- && latitude >= _a.LATITUDE_MIN
97
- && latitude <= _a.LATITUDE_MAX;
98
- }, _Address_guardAgainstInvalidLongitude = function _Address_guardAgainstInvalidLongitude(longitude) {
99
- if (__classPrivateFieldGet(this, _Address_instances, "m", _Address_longitudeIsInvalid).call(this, longitude)) {
100
- throw InvalidCoordinatesError_1.InvalidCoordinatesError.create(`Invalid longitude: ${longitude}. Must be between ${_a.LONGITUDE_MIN} and ${_a.LONGITUDE_MAX}`);
101
- }
102
- }, _Address_longitudeIsInvalid = function _Address_longitudeIsInvalid(longitude) {
103
- return __classPrivateFieldGet(this, _Address_instances, "m", _Address_longitudeIsValid).call(this, longitude) === false;
104
- }, _Address_longitudeIsValid = function _Address_longitudeIsValid(longitude) {
105
- return typeof longitude === 'number'
106
- && longitude >= _a.LONGITUDE_MIN
107
- && longitude <= _a.LONGITUDE_MAX;
108
- };
119
+ _Address_streetAddress = new WeakMap(), _Address_city = new WeakMap(), _Address_stateProvince = new WeakMap(), _Address_postalCode = new WeakMap(), _Address_country = new WeakMap(), _Address_coordinates = new WeakMap();
109
120
  Address.LATITUDE_MIN = -90;
110
121
  Address.LATITUDE_MAX = 90;
111
122
  Address.LONGITUDE_MIN = -180;
@@ -1,44 +1,39 @@
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, _AggregateId_isInvalid, _AggregateId_isValid;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.AggregateId = void 0;
10
4
  const String_1 = require("./String");
11
5
  const InvalidAggregateIdError_1 = require("../exceptions/InvalidAggregateIdError");
12
6
  class AggregateId extends String_1.String {
13
- constructor(value, skipDomainValidation, propertyName = _a.DEFAULT_PROPERTY_NAME) {
7
+ constructor(value, skipDomainValidation, propertyName = AggregateId.DEFAULT_PROPERTY_NAME) {
14
8
  super(value, skipDomainValidation, propertyName);
15
9
  if (skipDomainValidation === false) {
16
- _a.guardAgainstInvalidId(value, propertyName);
10
+ AggregateId.guardAgainstInvalidId(value, propertyName);
17
11
  }
18
12
  }
19
13
  static create(id) {
20
- return new _a(id, false);
14
+ return new AggregateId(id, false);
21
15
  }
22
16
  static fromPrimitives(id) {
23
- return new _a(id, true);
17
+ return new AggregateId(id, true);
24
18
  }
25
- static guardAgainstInvalidId(id, propertyName = _a.DEFAULT_PROPERTY_NAME) {
26
- if (__classPrivateFieldGet(this, _a, "m", _AggregateId_isInvalid).call(this, id)) {
19
+ static guardAgainstInvalidId(id, propertyName = AggregateId.DEFAULT_PROPERTY_NAME) {
20
+ if (this.isInvalid(id)) {
27
21
  throw InvalidAggregateIdError_1.InvalidAggregateIdError.create(id, propertyName);
28
22
  }
29
23
  }
24
+ static isInvalid(id) {
25
+ return !this.isValid(id);
26
+ }
27
+ static isValid(id) {
28
+ return AggregateId.UUID_REGEX.test(id);
29
+ }
30
30
  static isValidId(id) {
31
- return __classPrivateFieldGet(this, _a, "m", _AggregateId_isValid).call(this, id);
31
+ return this.isValid(id);
32
32
  }
33
33
  toPrimitives() {
34
34
  return this.value;
35
35
  }
36
36
  }
37
37
  exports.AggregateId = AggregateId;
38
- _a = AggregateId, _AggregateId_isInvalid = function _AggregateId_isInvalid(id) {
39
- return !__classPrivateFieldGet(this, _a, "m", _AggregateId_isValid).call(this, id);
40
- }, _AggregateId_isValid = function _AggregateId_isValid(id) {
41
- return _a.UUID_REGEX.test(id);
42
- };
43
38
  AggregateId.DEFAULT_PROPERTY_NAME = 'id';
44
39
  AggregateId.UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
- var _a, _Boolean_typeIsInvalid, _Boolean_isTruthy, _Boolean_isFalsy, _Boolean_isTruthyString, _Boolean_isFalsyString;
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.Boolean = void 0;
10
4
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -13,23 +7,23 @@ class Boolean extends PrimitiveValueObject_1.PrimitiveValueObject {
13
7
  constructor(value, skipDomainValidation, propertyName) {
14
8
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type boolean from the domain layer', { allowNull: false, allowUndefined: false });
15
9
  if (skipDomainValidation === false) {
16
- _a.guardAgainstInvalidType(value, propertyName);
10
+ Boolean.guardAgainstInvalidType(value, propertyName);
17
11
  }
18
12
  }
19
13
  static guardAgainstInvalidType(value, propertyName) {
20
- if (__classPrivateFieldGet(this, _a, "m", _Boolean_typeIsInvalid).call(this, value)) {
14
+ if (this.typeIsInvalid(value)) {
21
15
  throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'boolean', typeof value);
22
16
  }
23
17
  }
24
18
  static guardAgainstTruthyValue(value, propertyName) {
25
- _a.guardAgainstInvalidType(value, propertyName);
26
- if (__classPrivateFieldGet(this, _a, "m", _Boolean_isTruthy).call(this, value)) {
19
+ Boolean.guardAgainstInvalidType(value, propertyName);
20
+ if (this.isTruthy(value)) {
27
21
  throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'false', 'true');
28
22
  }
29
23
  }
30
24
  static guardAgainstFalsyValue(value, propertyName) {
31
- _a.guardAgainstInvalidType(value, propertyName);
32
- if (__classPrivateFieldGet(this, _a, "m", _Boolean_isFalsy).call(this, value)) {
25
+ Boolean.guardAgainstInvalidType(value, propertyName);
26
+ if (this.isFalsy(value)) {
33
27
  throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'true', 'false');
34
28
  }
35
29
  }
@@ -45,7 +39,7 @@ class Boolean extends PrimitiveValueObject_1.PrimitiveValueObject {
45
39
  }
46
40
  // Métodos de comparación
47
41
  isEqualTo(other) {
48
- const compareValue = other instanceof _a ? other.value : other;
42
+ const compareValue = other instanceof Boolean ? other.value : other;
49
43
  return this.value === compareValue;
50
44
  }
51
45
  isDifferentFrom(other) {
@@ -72,12 +66,12 @@ class Boolean extends PrimitiveValueObject_1.PrimitiveValueObject {
72
66
  }
73
67
  // Métodos estáticos de utilidad
74
68
  static fromString(value, propertyName) {
75
- _a.guardAgainstInvalidType(value, propertyName);
69
+ Boolean.guardAgainstInvalidType(value, propertyName);
76
70
  const normalizedValue = value.toLowerCase().trim();
77
- if (__classPrivateFieldGet(this, _a, "m", _Boolean_isTruthyString).call(this, normalizedValue)) {
71
+ if (this.isTruthyString(normalizedValue)) {
78
72
  return true;
79
73
  }
80
- if (__classPrivateFieldGet(this, _a, "m", _Boolean_isFalsyString).call(this, normalizedValue)) {
74
+ if (this.isFalsyString(normalizedValue)) {
81
75
  return false;
82
76
  }
83
77
  throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'valid boolean string (true/false, yes/no, 1/0, on/off)', value);
@@ -96,26 +90,31 @@ class Boolean extends PrimitiveValueObject_1.PrimitiveValueObject {
96
90
  }
97
91
  static isValidBooleanString(value) {
98
92
  const normalizedValue = value.toLowerCase().trim();
99
- return __classPrivateFieldGet(this, _a, "m", _Boolean_isTruthyString).call(this, normalizedValue) || __classPrivateFieldGet(this, _a, "m", _Boolean_isFalsyString).call(this, normalizedValue);
93
+ return this.isTruthyString(normalizedValue) || this.isFalsyString(normalizedValue);
100
94
  }
101
95
  static isValidBooleanNumeric(value) {
102
96
  return value === 0 || value === 1;
103
97
  }
98
+ // Métodos privados de validación
99
+ static typeIsInvalid(value) {
100
+ return typeof value !== 'boolean';
101
+ }
102
+ static isTruthy(value) {
103
+ return value === true;
104
+ }
105
+ static isFalsy(value) {
106
+ return value === false;
107
+ }
108
+ static isTruthyString(value) {
109
+ const truthyValues = ['true', 'yes', 'sí', 'si', '1', 'on', 'enabled', 'active'];
110
+ return truthyValues.includes(value);
111
+ }
112
+ static isFalsyString(value) {
113
+ const falsyValues = ['false', 'no', '0', 'off', 'disabled', 'inactive'];
114
+ return falsyValues.includes(value);
115
+ }
104
116
  toPrimitives() {
105
117
  return this.value;
106
118
  }
107
119
  }
108
120
  exports.Boolean = Boolean;
109
- _a = Boolean, _Boolean_typeIsInvalid = function _Boolean_typeIsInvalid(value) {
110
- return typeof value !== 'boolean';
111
- }, _Boolean_isTruthy = function _Boolean_isTruthy(value) {
112
- return value === true;
113
- }, _Boolean_isFalsy = function _Boolean_isFalsy(value) {
114
- return value === false;
115
- }, _Boolean_isTruthyString = function _Boolean_isTruthyString(value) {
116
- const truthyValues = ['true', 'yes', 'sí', 'si', '1', 'on', 'enabled', 'active'];
117
- return truthyValues.includes(value);
118
- }, _Boolean_isFalsyString = function _Boolean_isFalsyString(value) {
119
- const falsyValues = ['false', 'no', '0', 'off', 'disabled', 'inactive'];
120
- return falsyValues.includes(value);
121
- };
@@ -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, _CalculationProcessReference_id, _CalculationProcessReference_carbonClient, _CalculationProcessReference_footprintConfiguration, _CalculationProcessReference_guardAgainstInvalidType, _CalculationProcessReference_guardAgainstInvalidId, _CalculationProcessReference_guardAgainstInvalidCarbonClient, _CalculationProcessReference_guardAgainstInvalidFootprintConfiguration;
13
+ var _CalculationProcessReference_id, _CalculationProcessReference_carbonClient, _CalculationProcessReference_footprintConfiguration;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CalculationProcessReference = void 0;
16
16
  const InvalidPropertyTypeError_1 = require("../exceptions/InvalidPropertyTypeError");
@@ -22,13 +22,13 @@ class CalculationProcessReference 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 = CalculationProcessReference.DEFAULT_PROPERTY_NAME) {
26
26
  super(value, skipDomainValidation, propertyName, 'The provided value must be of type CalculationProcessReference from the domain layer', { allowNull: false, allowUndefined: false });
27
27
  _CalculationProcessReference_id.set(this, void 0);
28
28
  _CalculationProcessReference_carbonClient.set(this, void 0);
29
29
  _CalculationProcessReference_footprintConfiguration.set(this, void 0);
30
30
  if (skipDomainValidation === false) {
31
- _a.validateCalculationProcessReference(value, propertyName);
31
+ CalculationProcessReference.validateCalculationProcessReference(value, propertyName);
32
32
  }
33
33
  __classPrivateFieldSet(this, _CalculationProcessReference_id, value.id.trim(), "f");
34
34
  __classPrivateFieldSet(this, _CalculationProcessReference_carbonClient, value.carbonClient.trim(), "f");
@@ -38,10 +38,36 @@ class CalculationProcessReference extends ObjectValueObject_1.ObjectValueObject
38
38
  * Validación estática para reutilización en factory methods y constructores.
39
39
  */
40
40
  static validateCalculationProcessReference(value, propertyName) {
41
- __classPrivateFieldGet(this, _a, "m", _CalculationProcessReference_guardAgainstInvalidType).call(this, value, propertyName);
42
- __classPrivateFieldGet(this, _a, "m", _CalculationProcessReference_guardAgainstInvalidId).call(this, value.id);
43
- __classPrivateFieldGet(this, _a, "m", _CalculationProcessReference_guardAgainstInvalidCarbonClient).call(this, value.carbonClient);
44
- __classPrivateFieldGet(this, _a, "m", _CalculationProcessReference_guardAgainstInvalidFootprintConfiguration).call(this, value.footprintConfiguration);
41
+ this.guardAgainstInvalidType(value, propertyName);
42
+ this.guardAgainstInvalidId(value.id);
43
+ this.guardAgainstInvalidCarbonClient(value.carbonClient);
44
+ this.guardAgainstInvalidFootprintConfiguration(value.footprintConfiguration);
45
+ }
46
+ static guardAgainstInvalidType(value, propertyName) {
47
+ if (!value || typeof value !== 'object') {
48
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CalculationProcessReference 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.carbonClient !== 'string') {
54
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'string', typeof value.carbonClient);
55
+ }
56
+ if (typeof value.footprintConfiguration !== 'string') {
57
+ throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintConfiguration', 'string', typeof value.footprintConfiguration);
58
+ }
59
+ }
60
+ static guardAgainstInvalidId(id) {
61
+ String_1.String.guardAgainstEmptyValue(id, 'id');
62
+ AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
63
+ }
64
+ static guardAgainstInvalidCarbonClient(carbonClient) {
65
+ String_1.String.guardAgainstEmptyValue(carbonClient, 'carbonClient');
66
+ AggregateId_1.AggregateId.guardAgainstInvalidId(carbonClient, 'carbonClient');
67
+ }
68
+ static guardAgainstInvalidFootprintConfiguration(footprintConfiguration) {
69
+ String_1.String.guardAgainstEmptyValue(footprintConfiguration, 'footprintConfiguration');
70
+ AggregateId_1.AggregateId.guardAgainstInvalidId(footprintConfiguration, 'footprintConfiguration');
45
71
  }
46
72
  get id() {
47
73
  return __classPrivateFieldGet(this, _CalculationProcessReference_id, "f");
@@ -62,7 +88,7 @@ class CalculationProcessReference extends ObjectValueObject_1.ObjectValueObject
62
88
  return __classPrivateFieldGet(this, _CalculationProcessReference_footprintConfiguration, "f") === footprintConfiguration.trim();
63
89
  }
64
90
  equals(other) {
65
- if (!(other instanceof _a)) {
91
+ if (!(other instanceof CalculationProcessReference)) {
66
92
  return false;
67
93
  }
68
94
  return (__classPrivateFieldGet(this, _CalculationProcessReference_id, "f") === __classPrivateFieldGet(other, _CalculationProcessReference_id, "f")
@@ -70,7 +96,7 @@ class CalculationProcessReference extends ObjectValueObject_1.ObjectValueObject
70
96
  && __classPrivateFieldGet(this, _CalculationProcessReference_footprintConfiguration, "f") === __classPrivateFieldGet(other, _CalculationProcessReference_footprintConfiguration, "f"));
71
97
  }
72
98
  hasSameProcess(other) {
73
- if (!(other instanceof _a)) {
99
+ if (!(other instanceof CalculationProcessReference)) {
74
100
  return false;
75
101
  }
76
102
  return __classPrivateFieldGet(this, _CalculationProcessReference_id, "f") === __classPrivateFieldGet(other, _CalculationProcessReference_id, "f");
@@ -106,27 +132,5 @@ class CalculationProcessReference extends ObjectValueObject_1.ObjectValueObject
106
132
  }
107
133
  }
108
134
  exports.CalculationProcessReference = CalculationProcessReference;
109
- _a = CalculationProcessReference, _CalculationProcessReference_id = new WeakMap(), _CalculationProcessReference_carbonClient = new WeakMap(), _CalculationProcessReference_footprintConfiguration = new WeakMap(), _CalculationProcessReference_guardAgainstInvalidType = function _CalculationProcessReference_guardAgainstInvalidType(value, propertyName) {
110
- if (!value || typeof value !== 'object') {
111
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create(propertyName, 'CalculationProcessReference object', typeof value);
112
- }
113
- if (typeof value.id !== 'string') {
114
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('id', 'string', typeof value.id);
115
- }
116
- if (typeof value.carbonClient !== 'string') {
117
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('carbonClient', 'string', typeof value.carbonClient);
118
- }
119
- if (typeof value.footprintConfiguration !== 'string') {
120
- throw InvalidPropertyTypeError_1.InvalidPropertyTypeError.create('footprintConfiguration', 'string', typeof value.footprintConfiguration);
121
- }
122
- }, _CalculationProcessReference_guardAgainstInvalidId = function _CalculationProcessReference_guardAgainstInvalidId(id) {
123
- String_1.String.guardAgainstEmptyValue(id, 'id');
124
- AggregateId_1.AggregateId.guardAgainstInvalidId(id, 'id');
125
- }, _CalculationProcessReference_guardAgainstInvalidCarbonClient = function _CalculationProcessReference_guardAgainstInvalidCarbonClient(carbonClient) {
126
- String_1.String.guardAgainstEmptyValue(carbonClient, 'carbonClient');
127
- AggregateId_1.AggregateId.guardAgainstInvalidId(carbonClient, 'carbonClient');
128
- }, _CalculationProcessReference_guardAgainstInvalidFootprintConfiguration = function _CalculationProcessReference_guardAgainstInvalidFootprintConfiguration(footprintConfiguration) {
129
- String_1.String.guardAgainstEmptyValue(footprintConfiguration, 'footprintConfiguration');
130
- AggregateId_1.AggregateId.guardAgainstInvalidId(footprintConfiguration, 'footprintConfiguration');
131
- };
135
+ _CalculationProcessReference_id = new WeakMap(), _CalculationProcessReference_carbonClient = new WeakMap(), _CalculationProcessReference_footprintConfiguration = new WeakMap();
132
136
  CalculationProcessReference.DEFAULT_PROPERTY_NAME = 'calculationProcessReference';