@daffodil/customer 0.50.0 → 0.51.1

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 (183) hide show
  1. package/README.md +1 -1
  2. package/driver/errors/address-not-found.d.ts +10 -0
  3. package/driver/errors/codes.d.ts +6 -0
  4. package/driver/errors/default-billing-address-deletion.d.ts +10 -0
  5. package/driver/errors/default-shipping-address-deletion.d.ts +10 -0
  6. package/driver/errors/map.d.ts +6 -0
  7. package/driver/errors/public_api.d.ts +4 -0
  8. package/driver/in-memory/backend/address.service.d.ts +37 -0
  9. package/driver/in-memory/driver/address.service.d.ts +26 -0
  10. package/driver/in-memory/public_api.d.ts +2 -0
  11. package/driver/interfaces/address-service.interface.d.ts +33 -0
  12. package/driver/magento/address.service.d.ts +27 -0
  13. package/driver/magento/errors/map.d.ts +3 -0
  14. package/driver/magento/errors/transform.d.ts +9 -1
  15. package/driver/magento/models/requests/address-attribute-input.type.d.ts +4 -0
  16. package/driver/magento/models/requests/address-input.type.d.ts +22 -0
  17. package/driver/magento/models/requests/address-region-input.type.d.ts +8 -0
  18. package/driver/magento/models/requests/public_api.d.ts +3 -0
  19. package/driver/magento/models/responses/create-customer-address.type.d.ts +4 -0
  20. package/driver/magento/models/responses/customer-address.type.d.ts +4 -2
  21. package/driver/magento/models/responses/delete-customer-address.type.d.ts +3 -0
  22. package/driver/magento/models/responses/get-customer-addresses.type.d.ts +4 -0
  23. package/driver/magento/models/responses/public_api.d.ts +4 -0
  24. package/driver/magento/models/responses/update-customer-address.type.d.ts +4 -0
  25. package/driver/magento/queries/create-customer-address.d.ts +1 -0
  26. package/driver/magento/queries/delete-customer-address.d.ts +1 -0
  27. package/driver/magento/queries/get-customer-addresses.d.ts +2 -0
  28. package/driver/magento/queries/public_api.d.ts +4 -0
  29. package/driver/magento/queries/update-customer-address.d.ts +1 -0
  30. package/driver/magento/testing/factories/address.factory.d.ts +3 -1
  31. package/driver/magento/transforms/requests/address-input.d.ts +3 -0
  32. package/driver/magento/transforms/requests/public_api.d.ts +1 -0
  33. package/driver/magento/validators/create-customer-address.d.ts +3 -0
  34. package/driver/magento/validators/delete-customer-address.d.ts +3 -0
  35. package/driver/magento/validators/get-customer-addresses.d.ts +3 -0
  36. package/driver/magento/validators/public_api.d.ts +7 -0
  37. package/driver/magento/validators/update-customer-address.d.ts +3 -0
  38. package/driver/public_api.d.ts +1 -0
  39. package/driver/testing/drivers/address.service.d.ts +23 -0
  40. package/driver/testing/drivers/public_api.d.ts +1 -0
  41. package/esm2020/driver/errors/address-not-found.mjs +13 -0
  42. package/esm2020/driver/errors/codes.mjs +11 -0
  43. package/esm2020/driver/errors/default-billing-address-deletion.mjs +13 -0
  44. package/esm2020/driver/errors/default-shipping-address-deletion.mjs +13 -0
  45. package/esm2020/driver/errors/map.mjs +7 -1
  46. package/esm2020/driver/errors/public_api.mjs +5 -1
  47. package/esm2020/driver/in-memory/backend/address.service.mjs +110 -0
  48. package/esm2020/driver/in-memory/driver/address.service.mjs +42 -0
  49. package/esm2020/driver/in-memory/driver/customer-driver.module.mjs +6 -2
  50. package/esm2020/driver/in-memory/public_api.mjs +3 -1
  51. package/esm2020/driver/interfaces/address-service.interface.mjs +6 -0
  52. package/esm2020/driver/magento/address.service.mjs +91 -0
  53. package/esm2020/driver/magento/customer-driver.module.mjs +13 -3
  54. package/esm2020/driver/magento/errors/map.mjs +6 -0
  55. package/esm2020/driver/magento/errors/transform.mjs +28 -4
  56. package/esm2020/driver/magento/models/requests/address-attribute-input.type.mjs +2 -0
  57. package/esm2020/driver/magento/models/requests/address-input.type.mjs +2 -0
  58. package/esm2020/driver/magento/models/requests/address-region-input.type.mjs +2 -0
  59. package/esm2020/driver/magento/models/requests/public_api.mjs +1 -1
  60. package/esm2020/driver/magento/models/responses/create-customer-address.type.mjs +2 -0
  61. package/esm2020/driver/magento/models/responses/customer-address.type.mjs +1 -1
  62. package/esm2020/driver/magento/models/responses/delete-customer-address.type.mjs +2 -0
  63. package/esm2020/driver/magento/models/responses/get-customer-addresses.type.mjs +2 -0
  64. package/esm2020/driver/magento/models/responses/public_api.mjs +1 -1
  65. package/esm2020/driver/magento/models/responses/update-customer-address.type.mjs +2 -0
  66. package/esm2020/driver/magento/queries/create-customer-address.mjs +11 -0
  67. package/esm2020/driver/magento/queries/delete-customer-address.mjs +7 -0
  68. package/esm2020/driver/magento/queries/fragments/customer-address.mjs +4 -2
  69. package/esm2020/driver/magento/queries/get-customer-addresses.mjs +14 -0
  70. package/esm2020/driver/magento/queries/public_api.mjs +5 -1
  71. package/esm2020/driver/magento/queries/update-customer-address.mjs +11 -0
  72. package/esm2020/driver/magento/testing/factories/address.factory.mjs +4 -2
  73. package/esm2020/driver/magento/transforms/requests/address-input.mjs +22 -0
  74. package/esm2020/driver/magento/transforms/requests/public_api.mjs +2 -1
  75. package/esm2020/driver/magento/transforms/responses/customer-address.mjs +6 -3
  76. package/esm2020/driver/magento/validators/create-customer-address.mjs +10 -0
  77. package/esm2020/driver/magento/validators/delete-customer-address.mjs +10 -0
  78. package/esm2020/driver/magento/validators/get-customer-addresses.mjs +10 -0
  79. package/esm2020/driver/magento/validators/public_api.mjs +8 -1
  80. package/esm2020/driver/magento/validators/update-customer-address.mjs +10 -0
  81. package/esm2020/driver/public_api.mjs +2 -1
  82. package/esm2020/driver/testing/drivers/address.service.mjs +40 -0
  83. package/esm2020/driver/testing/drivers/customer-driver.module.mjs +7 -2
  84. package/esm2020/driver/testing/drivers/public_api.mjs +2 -1
  85. package/esm2020/models/address.type.mjs +1 -1
  86. package/esm2020/state/actions/address.actions.mjs +175 -0
  87. package/esm2020/state/actions/public_api.mjs +3 -0
  88. package/esm2020/state/customer.module.mjs +4 -1
  89. package/esm2020/state/effects/address.effects.mjs +45 -0
  90. package/esm2020/state/facades/address/facade.mjs +41 -0
  91. package/esm2020/state/facades/address/interface.mjs +2 -0
  92. package/esm2020/state/facades/public_api.mjs +2 -1
  93. package/esm2020/state/models/address.type.mjs +2 -0
  94. package/esm2020/state/models/public_api.mjs +2 -0
  95. package/esm2020/state/public_api.mjs +3 -2
  96. package/esm2020/state/reducers/address/initial-state.mjs +6 -0
  97. package/esm2020/state/reducers/address/public_api.mjs +3 -0
  98. package/esm2020/state/reducers/address/reducer.mjs +32 -0
  99. package/esm2020/state/reducers/address/type.mjs +2 -0
  100. package/esm2020/state/reducers/address-entities/adapter.mjs +10 -0
  101. package/esm2020/state/reducers/address-entities/public_api.mjs +3 -0
  102. package/esm2020/state/reducers/address-entities/reducer.mjs +43 -0
  103. package/esm2020/state/reducers/customer/adapter.mjs +15 -1
  104. package/esm2020/state/reducers/customer/reducer.mjs +20 -17
  105. package/esm2020/state/reducers/public_api.mjs +3 -1
  106. package/esm2020/state/reducers/reducers.interface.mjs +1 -1
  107. package/esm2020/state/reducers/token/reducers.token.mjs +5 -1
  108. package/esm2020/state/selectors/address/selector.mjs +23 -0
  109. package/esm2020/state/selectors/customer/selector.mjs +20 -0
  110. package/esm2020/state/selectors/feature.selector.mjs +1 -1
  111. package/esm2020/state/selectors/public_api.mjs +4 -2
  112. package/esm2020/state/testing/customer-testing.module.mjs +5 -2
  113. package/esm2020/state/testing/factories/customer-address.factory.mjs +32 -0
  114. package/esm2020/state/testing/factories/public_api.mjs +2 -0
  115. package/esm2020/state/testing/mock-address-facade.mjs +28 -0
  116. package/esm2020/state/testing/public_api.mjs +3 -1
  117. package/esm2020/testing/factories/customer-address.factory.mjs +3 -1
  118. package/fesm2015/daffodil-customer-driver-in-memory.mjs +145 -2
  119. package/fesm2015/daffodil-customer-driver-in-memory.mjs.map +1 -1
  120. package/fesm2015/daffodil-customer-driver-magento-testing.mjs +3 -1
  121. package/fesm2015/daffodil-customer-driver-magento-testing.mjs.map +1 -1
  122. package/fesm2015/daffodil-customer-driver-magento.mjs +227 -8
  123. package/fesm2015/daffodil-customer-driver-magento.mjs.map +1 -1
  124. package/fesm2015/daffodil-customer-driver-testing.mjs +41 -2
  125. package/fesm2015/daffodil-customer-driver-testing.mjs.map +1 -1
  126. package/fesm2015/daffodil-customer-driver.mjs +52 -1
  127. package/fesm2015/daffodil-customer-driver.mjs.map +1 -1
  128. package/fesm2015/daffodil-customer-state-testing.mjs +59 -3
  129. package/fesm2015/daffodil-customer-state-testing.mjs.map +1 -1
  130. package/fesm2015/daffodil-customer-state.mjs +378 -17
  131. package/fesm2015/daffodil-customer-state.mjs.map +1 -1
  132. package/fesm2015/daffodil-customer-testing.mjs +2 -0
  133. package/fesm2015/daffodil-customer-testing.mjs.map +1 -1
  134. package/fesm2020/daffodil-customer-driver-in-memory.mjs +148 -2
  135. package/fesm2020/daffodil-customer-driver-in-memory.mjs.map +1 -1
  136. package/fesm2020/daffodil-customer-driver-magento-testing.mjs +3 -1
  137. package/fesm2020/daffodil-customer-driver-magento-testing.mjs.map +1 -1
  138. package/fesm2020/daffodil-customer-driver-magento.mjs +223 -8
  139. package/fesm2020/daffodil-customer-driver-magento.mjs.map +1 -1
  140. package/fesm2020/daffodil-customer-driver-testing.mjs +41 -2
  141. package/fesm2020/daffodil-customer-driver-testing.mjs.map +1 -1
  142. package/fesm2020/daffodil-customer-driver.mjs +52 -1
  143. package/fesm2020/daffodil-customer-driver.mjs.map +1 -1
  144. package/fesm2020/daffodil-customer-state-testing.mjs +59 -3
  145. package/fesm2020/daffodil-customer-state-testing.mjs.map +1 -1
  146. package/fesm2020/daffodil-customer-state.mjs +387 -17
  147. package/fesm2020/daffodil-customer-state.mjs.map +1 -1
  148. package/fesm2020/daffodil-customer-testing.mjs +2 -0
  149. package/fesm2020/daffodil-customer-testing.mjs.map +1 -1
  150. package/models/address.type.d.ts +8 -0
  151. package/package.json +4 -4
  152. package/state/actions/address.actions.d.ts +166 -0
  153. package/state/actions/public_api.d.ts +2 -0
  154. package/state/effects/address.effects.d.ts +31 -0
  155. package/state/facades/address/facade.d.ts +28 -0
  156. package/state/facades/address/interface.d.ts +14 -0
  157. package/state/facades/public_api.d.ts +2 -0
  158. package/state/models/address.type.d.ts +3 -0
  159. package/state/models/public_api.d.ts +1 -0
  160. package/state/public_api.d.ts +2 -1
  161. package/state/reducers/address/initial-state.d.ts +5 -0
  162. package/state/reducers/address/public_api.d.ts +3 -0
  163. package/state/reducers/address/reducer.d.ts +7 -0
  164. package/state/reducers/address/type.d.ts +5 -0
  165. package/state/reducers/address-entities/adapter.d.ts +6 -0
  166. package/state/reducers/address-entities/public_api.d.ts +2 -0
  167. package/state/reducers/address-entities/reducer.d.ts +12 -0
  168. package/state/reducers/customer/adapter.d.ts +5 -0
  169. package/state/reducers/customer/reducer.d.ts +2 -2
  170. package/state/reducers/public_api.d.ts +2 -0
  171. package/state/reducers/reducers.interface.d.ts +9 -5
  172. package/state/reducers/token/extra.token.d.ts +1 -1
  173. package/state/reducers/token/reducers.token.d.ts +1 -1
  174. package/state/selectors/address/selector.d.ts +15 -0
  175. package/state/selectors/{customer.selector.d.ts → customer/selector.d.ts} +1 -1
  176. package/state/selectors/feature.selector.d.ts +4 -4
  177. package/state/selectors/public_api.d.ts +3 -1
  178. package/state/testing/factories/customer-address.factory.d.ts +21 -0
  179. package/state/testing/factories/public_api.d.ts +1 -0
  180. package/state/testing/mock-address-facade.d.ts +19 -0
  181. package/state/testing/public_api.d.ts +2 -0
  182. package/testing/factories/customer-address.factory.d.ts +2 -0
  183. package/esm2020/state/selectors/customer.selector.mjs +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-customer-driver.mjs","sources":["../../../libs/customer/driver/src/interfaces/customer-service.interface.ts","../../../libs/customer/driver/src/errors/invalid-api-response.ts","../../../libs/customer/driver/src/errors/map.ts","../../../libs/customer/driver/src/daffodil-customer-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomer } from '@daffodil/customer';\n\n/**\n * An injection token for the customer driver.\n */\nexport const DaffCustomerDriver = new InjectionToken<DaffCustomerDriverInterface>('DaffCustomerDriver');\n\n/**\n * The customer driver is responsible for loading customers.\n */\nexport interface DaffCustomerDriverInterface<\n T extends DaffCustomer = DaffCustomer,\n> {\n /**\n * Get the currently logged-in customer.\n */\n get(): Observable<T>;\n\n /**\n * Update the currently logged-in customer.\n *\n * @param customer The customer info to update.\n */\n update(customer: Partial<T>): Observable<T>;\n\n /**\n * Change the currently logged-in customer's email.\n */\n changeEmail(email: string, password: string): Observable<T>;\n\n /**\n * Change the currently logged-in customer's password.\n */\n changePassword(oldPassword: string, newPassword: string): Observable<void>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffCustomerInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffCustomerInvalidAPIResponseError,\n DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCustomerDriverErrorMap = {\n [DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerInvalidAPIResponseError,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKA;;AAEG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAA8B,oBAAoB;;ACH/F,MAAM,6CAA6C,GAAG,qCAAqC;AAElG;;AAEG;AACG,MAAO,mCAAoC,SAAQ,oBAAoB,CAAA;AAG3E,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,6CAA6C,CAAC;KAI5E;AACF;;ACXD;;AAEG;AACU,MAAA,0BAA0B,GAAG;IACxC,CAAC,6CAA6C,GAAG,mCAAmC;;;ACTtF;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-customer-driver.mjs","sources":["../../../libs/customer/driver/src/interfaces/customer-service.interface.ts","../../../libs/customer/driver/src/interfaces/address-service.interface.ts","../../../libs/customer/driver/src/errors/invalid-api-response.ts","../../../libs/customer/driver/src/errors/address-not-found.ts","../../../libs/customer/driver/src/errors/default-billing-address-deletion.ts","../../../libs/customer/driver/src/errors/default-shipping-address-deletion.ts","../../../libs/customer/driver/src/errors/map.ts","../../../libs/customer/driver/src/errors/codes.ts","../../../libs/customer/driver/src/daffodil-customer-driver.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCustomer } from '@daffodil/customer';\n\n/**\n * An injection token for the customer driver.\n */\nexport const DaffCustomerDriver = new InjectionToken<DaffCustomerDriverInterface>('DaffCustomerDriver');\n\n/**\n * The customer driver is responsible for loading customers.\n */\nexport interface DaffCustomerDriverInterface<\n T extends DaffCustomer = DaffCustomer,\n> {\n /**\n * Get the currently logged-in customer.\n */\n get(): Observable<T>;\n\n /**\n * Update the currently logged-in customer.\n *\n * @param customer The customer info to update.\n */\n update(customer: Partial<T>): Observable<T>;\n\n /**\n * Change the currently logged-in customer's email.\n */\n changeEmail(email: string, password: string): Observable<T>;\n\n /**\n * Change the currently logged-in customer's password.\n */\n changePassword(oldPassword: string, newPassword: string): Observable<void>;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffIdentifiable } from '@daffodil/core';\nimport { DaffCustomerAddress } from '@daffodil/customer';\n\n/**\n * An injection token for the customer driver.\n */\nexport const DaffCustomerAddressDriver = new InjectionToken<DaffCustomerAddressDriverInterface>('DaffCustomerAddressDriver');\n\n/**\n * The customer driver is responsible for loading customers.\n */\nexport interface DaffCustomerAddressDriverInterface<\n T extends DaffCustomerAddress = DaffCustomerAddress,\n> {\n /**\n * Lists the customer's addresses.\n */\n list(): Observable<T[]>;\n\n /**\n * Get the specified address.\n */\n get(addressId: DaffCustomerAddress['id']): Observable<T>;\n\n /**\n * Update the passed address.\n */\n update(address: Partial<T> & DaffIdentifiable): Observable<T[]>;\n\n /**\n * Adds the passed address.\n */\n add(address: T): Observable<T[]>;\n\n /**\n * Deletes the specified address.\n */\n delete(addressId: DaffCustomerAddress['id']): Observable<T[]>;\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE = 'DAFF_CUSTOMER_INVALID_API_RESPONSE';\n\n/**\n * A general error indicating that the platform returned a response which cannot be processed.\n */\nexport class DaffCustomerInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE = 'DAFF_CUSTOMER_ADDRESS_NOT_FOUND';\n\n/**\n * An error indicating that the requested address cannot be found.\n */\nexport class DaffCustomerAddressNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION';\n\n/**\n * An error indicating that a deletion of the customer's default billing address was attempted and failed.\n */\nexport class DaffCustomerDefaultBillingAddressDeletionError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport const DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE = 'DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION';\n\n/**\n * An error indicating that a deletion of the customer's default shipping address was attempted and failed.\n */\nexport class DaffCustomerDefaultShippingAddressDeletionError extends DaffInheritableError implements DaffError {\n public readonly code: string = DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE;\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE,\n DaffCustomerAddressNotFoundError,\n} from './address-not-found';\nimport {\n DaffCustomerDefaultBillingAddressDeletionError,\n DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE,\n} from './default-billing-address-deletion';\nimport {\n DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE,\n DaffCustomerDefaultShippingAddressDeletionError,\n} from './default-shipping-address-deletion';\nimport {\n DaffCustomerInvalidAPIResponseError,\n DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE,\n} from './invalid-api-response';\n\n/**\n * A mapping from error codes to error class constructors.\n */\nexport const DaffCustomerDriverErrorMap = {\n [DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE]: DaffCustomerInvalidAPIResponseError,\n [DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE]: DaffCustomerAddressNotFoundError,\n [DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultBillingAddressDeletionError,\n [DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE]: DaffCustomerDefaultShippingAddressDeletionError,\n};\n","import { DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE } from './address-not-found';\nimport { DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE } from './default-billing-address-deletion';\nimport { DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE } from './default-shipping-address-deletion';\nimport { DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE } from './invalid-api-response';\n\nexport const DaffCustomerDriverErrorCodes = {\n ADDRESS_NOT_FOUND: DAFF_CUSTOMER_ADDRESS_NOT_FOUND_ERROR_CODE,\n DEFAULT_BILLING_ADDRESS_DELETION: DAFF_CUSTOMER_DEFAULT_BILLING_ADDRESS_DELETION_ERROR_CODE,\n DEFAULT_SHIPPING_ADDRESS_DELETION: DAFF_CUSTOMER_DEFAULT_SHIPPING_ADDRESS_DELETION_ERROR_CODE,\n INVALID_API_RESPONSE: DAFF_CUSTOMER_INVALID_API_RESPONSE_ERROR_CODE,\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKA;;AAEG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAA8B,oBAAoB;;ACFtG;;AAEG;MACU,yBAAyB,GAAG,IAAI,cAAc,CAAqC,2BAA2B;;ACJpH,MAAM,6CAA6C,GAAG,qCAAqC;AAElG;;AAEG;AACG,MAAO,mCAAoC,SAAQ,oBAAoB,CAAA;AAG3E,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,6CAA6C,CAAC;KAI5E;AACF;;ACXM,MAAM,0CAA0C,GAAG,kCAAkC;AAE5F;;AAEG;AACG,MAAO,gCAAiC,SAAQ,oBAAoB,CAAA;AAGxE,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,0CAA0C,CAAC;KAIzE;AACF;;ACXM,MAAM,yDAAyD,GAAG,iDAAiD;AAE1H;;AAEG;AACG,MAAO,8CAA+C,SAAQ,oBAAoB,CAAA;AAGtF,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,yDAAyD,CAAC;KAIxF;AACF;;ACXM,MAAM,0DAA0D,GAAG,kDAAkD;AAE5H;;AAEG;AACG,MAAO,+CAAgD,SAAQ,oBAAoB,CAAA;AAGvF,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;QAFlB,IAAI,CAAA,IAAA,GAAW,0DAA0D,CAAC;KAIzF;AACF;;ACCD;;AAEG;AACU,MAAA,0BAA0B,GAAG;IACxC,CAAC,6CAA6C,GAAG,mCAAmC;IACpF,CAAC,0CAA0C,GAAG,gCAAgC;IAC9E,CAAC,yDAAyD,GAAG,8CAA8C;IAC3G,CAAC,0DAA0D,GAAG,+CAA+C;;;ACnBlG,MAAA,4BAA4B,GAAG;AAC1C,IAAA,iBAAiB,EAAE,0CAA0C;AAC7D,IAAA,gCAAgC,EAAE,yDAAyD;AAC3F,IAAA,iCAAiC,EAAE,0DAA0D;AAC7F,IAAA,oBAAoB,EAAE,6CAA6C;;;ACTrE;;AAEG;;;;"}
@@ -1,8 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, NgModule } from '@angular/core';
3
- import { BehaviorSubject } from 'rxjs';
3
+ import { BehaviorSubject, of } from 'rxjs';
4
4
  import { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';
5
- import { DaffCustomerPageFacade } from '@daffodil/customer/state';
5
+ import { DaffCustomerPageFacade, DaffCustomerAddressPageFacade } from '@daffodil/customer/state';
6
+ import { DaffModelFactory } from '@daffodil/core/testing';
7
+ import { MockDaffCustomerAddress } from '@daffodil/customer/testing';
6
8
 
7
9
  /**
8
10
  * Mocks out facade fields and methods for testing purposes.
@@ -26,6 +28,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
26
28
  args: [{ providedIn: 'root' }]
27
29
  }] });
28
30
 
31
+ /**
32
+ * Mocks out facade fields and methods for testing purposes.
33
+ *
34
+ * @inheritdoc
35
+ */
36
+ class MockDaffCustomerAddressPageFacade extends MockDaffOperationStateFacade {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.addresses$ = new BehaviorSubject([]);
40
+ this.errors$ = new BehaviorSubject([]);
41
+ }
42
+ getAddress() {
43
+ return of(null);
44
+ }
45
+ dispatch(action) { }
46
+ ;
47
+ }
48
+ /** @nocollapse */ MockDaffCustomerAddressPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffCustomerAddressPageFacade, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
49
+ /** @nocollapse */ MockDaffCustomerAddressPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffCustomerAddressPageFacade, providedIn: 'root' });
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffCustomerAddressPageFacade, decorators: [{
51
+ type: Injectable,
52
+ args: [{ providedIn: 'root' }]
53
+ }] });
54
+
29
55
  /**
30
56
  * Provides the {@link MockDaffCustomerPageFacade} for {@link DaffCustomerPageFacade}.
31
57
  */
@@ -35,19 +61,49 @@ class DaffCustomerStateTestingModule {
35
61
  /** @nocollapse */ DaffCustomerStateTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerStateTestingModule });
36
62
  /** @nocollapse */ DaffCustomerStateTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerStateTestingModule, providers: [
37
63
  { provide: DaffCustomerPageFacade, useExisting: MockDaffCustomerPageFacade },
64
+ { provide: DaffCustomerAddressPageFacade, useExisting: MockDaffCustomerAddressPageFacade },
38
65
  ] });
39
66
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerStateTestingModule, decorators: [{
40
67
  type: NgModule,
41
68
  args: [{
42
69
  providers: [
43
70
  { provide: DaffCustomerPageFacade, useExisting: MockDaffCustomerPageFacade },
71
+ { provide: DaffCustomerAddressPageFacade, useExisting: MockDaffCustomerAddressPageFacade },
44
72
  ],
45
73
  }]
46
74
  }] });
47
75
 
76
+ /**
77
+ * Mock class for {@link DaffCustomerAddressEntity}.
78
+ */
79
+ class MockDaffCustomerAddressEntity extends MockDaffCustomerAddress {
80
+ constructor() {
81
+ super(...arguments);
82
+ this.daffState = "Stable" /* Stable */;
83
+ this.daffErrors = [];
84
+ this.daffTemp = false;
85
+ }
86
+ }
87
+ /**
88
+ * Model factory for {@link DaffCustomerAddressEntity}.
89
+ */
90
+ class DaffCustomerAddressEntityFactory extends DaffModelFactory {
91
+ constructor() {
92
+ super(MockDaffCustomerAddressEntity);
93
+ }
94
+ }
95
+ /** @nocollapse */ DaffCustomerAddressEntityFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressEntityFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
96
+ /** @nocollapse */ DaffCustomerAddressEntityFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressEntityFactory, providedIn: 'root' });
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressEntityFactory, decorators: [{
98
+ type: Injectable,
99
+ args: [{
100
+ providedIn: 'root',
101
+ }]
102
+ }], ctorParameters: function () { return []; } });
103
+
48
104
  /**
49
105
  * Generated bundle index. Do not edit.
50
106
  */
51
107
 
52
- export { DaffCustomerStateTestingModule, MockDaffCustomerPageFacade };
108
+ export { DaffCustomerAddressEntityFactory, DaffCustomerStateTestingModule, MockDaffCustomerAddressEntity, MockDaffCustomerAddressPageFacade, MockDaffCustomerPageFacade };
53
109
  //# sourceMappingURL=daffodil-customer-state-testing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-customer-state-testing.mjs","sources":["../../../libs/customer/state/testing/src/mock-customer-facade.ts","../../../libs/customer/state/testing/src/customer-testing.module.ts","../../../libs/customer/state/testing/src/daffodil-customer-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';\nimport { DaffCustomer } from '@daffodil/customer';\nimport { DaffCustomerPageFacadeInterface } from '@daffodil/customer/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCustomerPageFacade extends MockDaffOperationStateFacade implements DaffCustomerPageFacadeInterface {\n customer$ = new BehaviorSubject<DaffCustomer>(null);\n loading$ = new BehaviorSubject<boolean>(null);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffCustomerPageFacade } from '@daffodil/customer/state';\n\nimport { MockDaffCustomerPageFacade } from './mock-customer-facade';\n\n/**\n * Provides the {@link MockDaffCustomerPageFacade} for {@link DaffCustomerPageFacade}.\n */\n@NgModule({\n providers: [\n { provide: DaffCustomerPageFacade, useExisting: MockDaffCustomerPageFacade },\n ],\n})\nexport class DaffCustomerStateTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AASA;;;;AAIG;AAEG,MAAO,0BAA2B,SAAQ,4BAA4B,CAAA;AAD5E,IAAA,WAAA,GAAA;;AAEE,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,eAAe,CAAe,IAAI,CAAC,CAAC;AACpD,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC,CAAC;AAC9C,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,eAAe,CAAmB,EAAE,CAAC,CAAC;AAGrD,KAAA;IADC,QAAQ,CAAC,MAAc,EAAA,GAAI;;;0IALhB,0BAA0B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,mBAAA,0BAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACRlC;;AAEG;MAMU,8BAA8B,CAAA;;8IAA9B,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+IAA9B,8BAA8B,EAAA,CAAA,CAAA;AAA9B,mBAAA,8BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,EAJ9B,SAAA,EAAA;AACT,QAAA,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,0BAA0B,EAAE;AAC7E,KAAA,EAAA,CAAA,CAAA;2FAEU,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAL1C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,0BAA0B,EAAE;AAC7E,qBAAA;AACF,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-customer-state-testing.mjs","sources":["../../../libs/customer/state/testing/src/mock-customer-facade.ts","../../../libs/customer/state/testing/src/mock-address-facade.ts","../../../libs/customer/state/testing/src/customer-testing.module.ts","../../../libs/customer/state/testing/src/factories/customer-address.factory.ts","../../../libs/customer/state/testing/src/daffodil-customer-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';\nimport { DaffCustomer } from '@daffodil/customer';\nimport { DaffCustomerPageFacadeInterface } from '@daffodil/customer/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCustomerPageFacade extends MockDaffOperationStateFacade implements DaffCustomerPageFacadeInterface {\n customer$ = new BehaviorSubject<DaffCustomer>(null);\n loading$ = new BehaviorSubject<boolean>(null);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport {\n BehaviorSubject,\n of,\n} from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { MockDaffOperationStateFacade } from '@daffodil/core/state/testing';\nimport {\n DaffCustomerAddressEntity,\n DaffCustomerAddressPageFacadeInterface,\n} from '@daffodil/customer/state';\n\n/**\n * Mocks out facade fields and methods for testing purposes.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCustomerAddressPageFacade extends MockDaffOperationStateFacade implements DaffCustomerAddressPageFacadeInterface {\n addresses$ = new BehaviorSubject<DaffCustomerAddressEntity[]>([]);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n\n getAddress() {\n return of(null);\n }\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport {\n DaffCustomerAddressPageFacade,\n DaffCustomerPageFacade,\n} from '@daffodil/customer/state';\n\nimport { MockDaffCustomerAddressPageFacade } from './mock-address-facade';\nimport { MockDaffCustomerPageFacade } from './mock-customer-facade';\n\n/**\n * Provides the {@link MockDaffCustomerPageFacade} for {@link DaffCustomerPageFacade}.\n */\n@NgModule({\n providers: [\n { provide: DaffCustomerPageFacade, useExisting: MockDaffCustomerPageFacade },\n { provide: DaffCustomerAddressPageFacade, useExisting: MockDaffCustomerAddressPageFacade },\n ],\n})\nexport class DaffCustomerStateTestingModule {}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffState } from '@daffodil/core/state';\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCustomerAddressEntity } from '@daffodil/customer/state';\nimport { MockDaffCustomerAddress } from '@daffodil/customer/testing';\n\n/**\n * Mock class for {@link DaffCustomerAddressEntity}.\n */\nexport class MockDaffCustomerAddressEntity extends MockDaffCustomerAddress implements DaffCustomerAddressEntity {\n daffState = DaffState.Stable;\n daffErrors = [];\n daffTemp = false;\n}\n\n/**\n * Model factory for {@link DaffCustomerAddressEntity}.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCustomerAddressEntityFactory extends DaffModelFactory<DaffCustomerAddressEntity>{\n constructor() {\n super(MockDaffCustomerAddressEntity);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
@@ -1,6 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Inject, inject, NgModule } from '@angular/core';
3
- import { daffCompleteOperation, daffOperationInitialState, daffClearErrors, daffOperationFailed, daffStartMutation, daffStartResolution, daffOperationStateSelectorFactory, daffComposeReducers } from '@daffodil/core/state';
3
+ import { daffCompleteOperation, daffOperationInitialState, daffClearErrors, daffOperationFailed, daffStartMutation, daffStartResolution, daffCreateOperationEntityStateAdapter, daffOperationStateSelectorFactory, daffComposeReducers } from '@daffodil/core/state';
4
+ import { createEntityAdapter } from '@ngrx/entity';
4
5
  import * as i1 from '@ngrx/store';
5
6
  import { createFeatureSelector, createSelector, select, combineReducers, StoreModule } from '@ngrx/store';
6
7
  import * as i1$1 from '@ngrx/effects';
@@ -8,7 +9,182 @@ import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
8
9
  import { of } from 'rxjs';
9
10
  import { switchMap, map, catchError } from 'rxjs/operators';
10
11
  import { DAFF_CUSTOMER_ERROR_MATCHER } from '@daffodil/customer';
11
- import { DaffCustomerDriver } from '@daffodil/customer/driver';
12
+ import { DaffCustomerAddressDriver, DaffCustomerDriver } from '@daffodil/customer/driver';
13
+
14
+ /**
15
+ * The customer address action types enum.
16
+ */
17
+ var DaffCustomerAddressActionTypes;
18
+ (function (DaffCustomerAddressActionTypes) {
19
+ DaffCustomerAddressActionTypes["AddressListAction"] = "[@daffodil/customer] Address List Action";
20
+ DaffCustomerAddressActionTypes["AddressListSuccessAction"] = "[@daffodil/customer] Address List Success Action";
21
+ DaffCustomerAddressActionTypes["AddressListFailureAction"] = "[@daffodil/customer] Address List Failure Action";
22
+ DaffCustomerAddressActionTypes["AddressLoadAction"] = "[@daffodil/customer] Address Load Action";
23
+ DaffCustomerAddressActionTypes["AddressLoadSuccessAction"] = "[@daffodil/customer] Address Load Success Action";
24
+ DaffCustomerAddressActionTypes["AddressLoadFailureAction"] = "[@daffodil/customer] Address Load Failure Action";
25
+ DaffCustomerAddressActionTypes["AddressAddAction"] = "[@daffodil/customer] Address Add Action";
26
+ DaffCustomerAddressActionTypes["AddressAddSuccessAction"] = "[@daffodil/customer] Address Add Success Action";
27
+ DaffCustomerAddressActionTypes["AddressAddFailureAction"] = "[@daffodil/customer] Address Add Failure Action";
28
+ DaffCustomerAddressActionTypes["AddressUpdateAction"] = "[@daffodil/customer] Address Update Action";
29
+ DaffCustomerAddressActionTypes["AddressUpdateSuccessAction"] = "[@daffodil/customer] Address Update Success Action";
30
+ DaffCustomerAddressActionTypes["AddressUpdateFailureAction"] = "[@daffodil/customer] Address Update Failure Action";
31
+ DaffCustomerAddressActionTypes["AddressDeleteAction"] = "[@daffodil/customer] Address Delete Action";
32
+ DaffCustomerAddressActionTypes["AddressDeleteSuccessAction"] = "[@daffodil/customer] Address Delete Success Action";
33
+ DaffCustomerAddressActionTypes["AddressDeleteFailureAction"] = "[@daffodil/customer] Address Delete Failure Action";
34
+ })(DaffCustomerAddressActionTypes || (DaffCustomerAddressActionTypes = {}));
35
+ /**
36
+ * Lists the addresses of the current customer.
37
+ *
38
+ * @param addressId The ID of the address.
39
+ */
40
+ class DaffCustomerAddressList {
41
+ constructor() {
42
+ this.type = DaffCustomerAddressActionTypes.AddressListAction;
43
+ }
44
+ }
45
+ /**
46
+ * Indicates a successful listing of customer addresses.
47
+ */
48
+ class DaffCustomerAddressListSuccess {
49
+ constructor(payload) {
50
+ this.payload = payload;
51
+ this.type = DaffCustomerAddressActionTypes.AddressListSuccessAction;
52
+ }
53
+ }
54
+ /**
55
+ * A failed customer address list with the error message.
56
+ */
57
+ class DaffCustomerAddressListFailure {
58
+ constructor(payload) {
59
+ this.payload = payload;
60
+ this.type = DaffCustomerAddressActionTypes.AddressListFailureAction;
61
+ }
62
+ }
63
+ /**
64
+ * Loads an address of the current customer.
65
+ *
66
+ * @param addressId The ID of the address.
67
+ */
68
+ class DaffCustomerAddressLoad {
69
+ constructor(addressId) {
70
+ this.addressId = addressId;
71
+ this.type = DaffCustomerAddressActionTypes.AddressLoadAction;
72
+ }
73
+ }
74
+ /**
75
+ * Indicates a successful load of a customer address.
76
+ */
77
+ class DaffCustomerAddressLoadSuccess {
78
+ constructor(payload) {
79
+ this.payload = payload;
80
+ this.type = DaffCustomerAddressActionTypes.AddressLoadSuccessAction;
81
+ }
82
+ }
83
+ /**
84
+ * A failed customer address load with the error message.
85
+ */
86
+ class DaffCustomerAddressLoadFailure {
87
+ constructor(payload, id) {
88
+ this.payload = payload;
89
+ this.id = id;
90
+ this.type = DaffCustomerAddressActionTypes.AddressLoadFailureAction;
91
+ }
92
+ }
93
+ /**
94
+ * Updates one of the currently logged-in customer's addresses.
95
+ *
96
+ * @param query The customer query.
97
+ */
98
+ class DaffCustomerAddressUpdate {
99
+ constructor(address) {
100
+ this.address = address;
101
+ this.type = DaffCustomerAddressActionTypes.AddressUpdateAction;
102
+ }
103
+ }
104
+ /**
105
+ * Indicates a successful update of one of the currently logged-in customer's addresses.
106
+ */
107
+ class DaffCustomerAddressUpdateSuccess {
108
+ constructor(payload) {
109
+ this.payload = payload;
110
+ this.type = DaffCustomerAddressActionTypes.AddressUpdateSuccessAction;
111
+ }
112
+ }
113
+ /**
114
+ * A failed address update with the error message.
115
+ */
116
+ class DaffCustomerAddressUpdateFailure {
117
+ constructor(payload, id) {
118
+ this.payload = payload;
119
+ this.id = id;
120
+ this.type = DaffCustomerAddressActionTypes.AddressUpdateFailureAction;
121
+ }
122
+ }
123
+ /**
124
+ * Adds one of the currently logged-in customer's addresses.
125
+ *
126
+ * @param query The customer query.
127
+ */
128
+ class DaffCustomerAddressAdd {
129
+ constructor(address, placeholderId) {
130
+ this.address = address;
131
+ this.placeholderId = placeholderId;
132
+ this.type = DaffCustomerAddressActionTypes.AddressAddAction;
133
+ }
134
+ }
135
+ /**
136
+ * Indicates a successful addition of one of the currently logged-in customer's addresses.
137
+ *
138
+ * @param payload The updated list of customer addresses.
139
+ */
140
+ class DaffCustomerAddressAddSuccess {
141
+ constructor(payload) {
142
+ this.payload = payload;
143
+ this.type = DaffCustomerAddressActionTypes.AddressAddSuccessAction;
144
+ }
145
+ }
146
+ /**
147
+ * A failed address addition with the error message.
148
+ */
149
+ class DaffCustomerAddressAddFailure {
150
+ constructor(payload, id) {
151
+ this.payload = payload;
152
+ this.id = id;
153
+ this.type = DaffCustomerAddressActionTypes.AddressAddFailureAction;
154
+ }
155
+ }
156
+ /**
157
+ * Deletes one of the currently logged-in customer's addresses.
158
+ *
159
+ * @param addressId The ID of the address.
160
+ */
161
+ class DaffCustomerAddressDelete {
162
+ constructor(addressId) {
163
+ this.addressId = addressId;
164
+ this.type = DaffCustomerAddressActionTypes.AddressDeleteAction;
165
+ }
166
+ }
167
+ /**
168
+ * Indicates a successful deletion of one of the currently logged-in customer's addresses.
169
+ *
170
+ * @param payload The updated list of customer addresses.
171
+ */
172
+ class DaffCustomerAddressDeleteSuccess {
173
+ constructor(payload) {
174
+ this.payload = payload;
175
+ this.type = DaffCustomerAddressActionTypes.AddressDeleteSuccessAction;
176
+ }
177
+ }
178
+ /**
179
+ * A failed address deletion with the error message.
180
+ */
181
+ class DaffCustomerAddressDeleteFailure {
182
+ constructor(payload, id) {
183
+ this.payload = payload;
184
+ this.id = id;
185
+ this.type = DaffCustomerAddressActionTypes.AddressDeleteFailureAction;
186
+ }
187
+ }
12
188
 
13
189
  /**
14
190
  * The customer action types enum.
@@ -199,6 +375,20 @@ function daffCustomerStateStoreCustomer(customer, state) {
199
375
  customer,
200
376
  };
201
377
  }
378
+ /**
379
+ * Stores customer addresses.
380
+ * Sets loading to false and resets errors.
381
+ */
382
+ function daffCustomerStateStoreAddresses(addresses, state) {
383
+ return {
384
+ ...state,
385
+ ...daffCompleteOperation(state),
386
+ customer: {
387
+ ...state.customer,
388
+ addresses,
389
+ },
390
+ };
391
+ }
202
392
 
203
393
  /**
204
394
  * The initial state for the main customer state, see {@link DaffCustomerReducerState}.
@@ -212,31 +402,116 @@ const daffCustomerInitialState = {
212
402
  * The reducer for the customer page state, see {@link DaffCustomerReducerState}.
213
403
  */
214
404
  const daffCustomerReducer = (state = daffCustomerInitialState, action) => {
215
- switch (true) {
216
- case action.type === DaffCustomerActionTypes.CustomerLoadAction:
405
+ switch (action.type) {
406
+ case DaffCustomerActionTypes.CustomerLoadAction:
217
407
  return daffStartResolution(state);
218
- case action.type === DaffCustomerActionTypes.CustomerUpdateAction:
219
- case action.type === DaffCustomerActionTypes.CustomerChangeEmailAction:
220
- case action.type === DaffCustomerActionTypes.CustomerChangePasswordAction:
408
+ case DaffCustomerActionTypes.CustomerUpdateAction:
409
+ case DaffCustomerActionTypes.CustomerChangeEmailAction:
410
+ case DaffCustomerActionTypes.CustomerChangePasswordAction:
221
411
  return daffStartMutation(state);
222
- case action.type === DaffCustomerActionTypes.CustomerLoadSuccessAction:
223
- case action.type === DaffCustomerActionTypes.CustomerUpdateSuccessAction:
224
- case action.type === DaffCustomerActionTypes.CustomerChangeEmailSuccessAction:
412
+ case DaffCustomerActionTypes.CustomerLoadSuccessAction:
413
+ case DaffCustomerActionTypes.CustomerUpdateSuccessAction:
414
+ case DaffCustomerActionTypes.CustomerChangeEmailSuccessAction:
225
415
  return daffCustomerStateStoreCustomer(action.payload, state);
226
- case action.type === DaffCustomerActionTypes.CustomerChangePasswordSuccessAction:
416
+ case DaffCustomerActionTypes.CustomerChangePasswordSuccessAction:
227
417
  return daffCompleteOperation(state);
228
- case action.type === DaffCustomerActionTypes.CustomerLoadFailureAction:
229
- case action.type === DaffCustomerActionTypes.CustomerUpdateFailureAction:
230
- case action.type === DaffCustomerActionTypes.CustomerChangeEmailFailureAction:
231
- case action.type === DaffCustomerActionTypes.CustomerChangePasswordFailureAction:
418
+ case DaffCustomerActionTypes.CustomerLoadFailureAction:
419
+ case DaffCustomerActionTypes.CustomerUpdateFailureAction:
420
+ case DaffCustomerActionTypes.CustomerChangeEmailFailureAction:
421
+ case DaffCustomerActionTypes.CustomerChangePasswordFailureAction:
232
422
  return daffOperationFailed([action.payload], state);
233
- case action.type === DaffCustomerActionTypes.CustomerClearErrorsAction:
423
+ case DaffCustomerActionTypes.CustomerClearErrorsAction:
234
424
  return daffClearErrors(state);
425
+ case DaffCustomerAddressActionTypes.AddressDeleteSuccessAction:
426
+ case DaffCustomerAddressActionTypes.AddressAddSuccessAction:
427
+ return daffCustomerStateStoreAddresses(action.payload, state);
235
428
  default:
236
429
  return state;
237
430
  }
238
431
  };
239
432
 
433
+ /**
434
+ * The initial state for the main customer state, see {@link DaffCustomerAddressReducerState}.
435
+ */
436
+ const daffCustomerAddressInitialState = daffOperationInitialState;
437
+
438
+ /**
439
+ * The reducer for the customer page state, see {@link DaffCustomerAddressReducerState}.
440
+ */
441
+ const daffCustomerAddressReducer = (state = daffCustomerAddressInitialState, action) => {
442
+ switch (true) {
443
+ case action.type === DaffCustomerAddressActionTypes.AddressListAction:
444
+ case action.type === DaffCustomerAddressActionTypes.AddressLoadAction:
445
+ return daffStartResolution(state);
446
+ case action.type === DaffCustomerAddressActionTypes.AddressUpdateAction:
447
+ case action.type === DaffCustomerAddressActionTypes.AddressAddAction:
448
+ case action.type === DaffCustomerAddressActionTypes.AddressDeleteAction:
449
+ return daffStartMutation(state);
450
+ case action.type === DaffCustomerAddressActionTypes.AddressListSuccessAction:
451
+ case action.type === DaffCustomerAddressActionTypes.AddressLoadSuccessAction:
452
+ case action.type === DaffCustomerAddressActionTypes.AddressUpdateSuccessAction:
453
+ case action.type === DaffCustomerAddressActionTypes.AddressAddSuccessAction:
454
+ case action.type === DaffCustomerAddressActionTypes.AddressDeleteSuccessAction:
455
+ return daffCompleteOperation(state);
456
+ case action.type === DaffCustomerAddressActionTypes.AddressListFailureAction:
457
+ case action.type === DaffCustomerAddressActionTypes.AddressLoadFailureAction:
458
+ case action.type === DaffCustomerAddressActionTypes.AddressUpdateFailureAction:
459
+ case action.type === DaffCustomerAddressActionTypes.AddressAddFailureAction:
460
+ case action.type === DaffCustomerAddressActionTypes.AddressDeleteFailureAction:
461
+ return daffOperationFailed([action.payload], state);
462
+ default:
463
+ return state;
464
+ }
465
+ };
466
+
467
+ /**
468
+ * Customer Address Entities Adapter for changing/overwriting entity state.
469
+ */
470
+ const daffCustomerAddressEntitiesAdapter = (() => {
471
+ let cache;
472
+ return () => cache = cache || daffCreateOperationEntityStateAdapter(createEntityAdapter({ selectId: item => item.id }));
473
+ })();
474
+
475
+ /**
476
+ * Reducer function that catches actions and changes/overwrites product entities state.
477
+ *
478
+ * @param state current State of the redux store
479
+ * @param action CartItemGrid, BestSellers, or CartItem actions
480
+ * @returns CartItem entities state
481
+ */
482
+ function daffCustomerAddressEntitiesReducer(state = daffCustomerAddressEntitiesAdapter().getInitialState(), action) {
483
+ const adapter = daffCustomerAddressEntitiesAdapter();
484
+ switch (action.type) {
485
+ case DaffCustomerAddressActionTypes.AddressLoadAction:
486
+ return adapter.preload(action.addressId, state);
487
+ case DaffCustomerAddressActionTypes.AddressAddAction:
488
+ return adapter.preadd(action.address, state, action.placeholderId);
489
+ case DaffCustomerAddressActionTypes.AddressDeleteAction:
490
+ return adapter.preremove(action.addressId, state);
491
+ case DaffCustomerAddressActionTypes.AddressUpdateAction:
492
+ return adapter.preupdate(action.address, state);
493
+ case DaffCustomerAddressActionTypes.AddressLoadSuccessAction:
494
+ return adapter.load(action.payload, state);
495
+ case DaffCustomerAddressActionTypes.AddressListSuccessAction:
496
+ return adapter.list(action.payload, state);
497
+ case DaffCustomerActionTypes.CustomerChangeEmailSuccessAction:
498
+ case DaffCustomerActionTypes.CustomerUpdateSuccessAction:
499
+ case DaffCustomerActionTypes.CustomerLoadSuccessAction:
500
+ return adapter.list(action.payload.addresses, state);
501
+ case DaffCustomerAddressActionTypes.AddressUpdateSuccessAction:
502
+ case DaffCustomerAddressActionTypes.AddressDeleteSuccessAction:
503
+ case DaffCustomerAddressActionTypes.AddressAddSuccessAction:
504
+ return adapter.list(action.payload, state);
505
+ case DaffCustomerAddressActionTypes.AddressDeleteFailureAction:
506
+ case DaffCustomerAddressActionTypes.AddressAddFailureAction:
507
+ case DaffCustomerAddressActionTypes.AddressLoadFailureAction:
508
+ case DaffCustomerAddressActionTypes.AddressUpdateFailureAction:
509
+ return adapter.operationFailed(action.id, [action.payload], state);
510
+ default:
511
+ return state;
512
+ }
513
+ }
514
+
240
515
  const getDaffCustomerReducersStateSelector = (() => {
241
516
  let cache;
242
517
  return () => cache = cache || {
@@ -261,6 +536,25 @@ const daffCustomerGetSelectors = (() => {
261
536
  return () => cache = cache || daffCustomerCreateSelectors();
262
537
  })();
263
538
 
539
+ /**
540
+ * Creates a group of selectors for {@link DaffCustomerAddressReducerState} that use the passed state selector as the basis.
541
+ */
542
+ const daffCustomerAddressCreateSelectors = () => {
543
+ const { selectCustomerFeatureState } = getDaffCustomerReducersStateSelector();
544
+ const selectCustomerAddressState = createSelector(selectCustomerFeatureState, state => state.address);
545
+ const selectCustomerAddressEntitiesState = createSelector(selectCustomerFeatureState, state => state.addressEntities);
546
+ const { selectEntity, selectOptimisticList, } = daffCustomerAddressEntitiesAdapter().getSelectors(selectCustomerAddressEntitiesState);
547
+ return {
548
+ ...daffOperationStateSelectorFactory(selectCustomerAddressState),
549
+ selectAddress: selectEntity,
550
+ selectAddresses: selectOptimisticList,
551
+ };
552
+ };
553
+ const daffCustomerAddressGetSelectors = (() => {
554
+ let cache;
555
+ return () => cache = cache || daffCustomerAddressCreateSelectors();
556
+ })();
557
+
264
558
  /**
265
559
  * @inheritdoc
266
560
  *
@@ -292,6 +586,78 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
292
586
  }]
293
587
  }], ctorParameters: function () { return [{ type: i1.Store }]; } });
294
588
 
589
+ // TODO: address entities?
590
+ /**
591
+ * @inheritdoc
592
+ *
593
+ * Serves as the base for a customer facade.
594
+ * Extend this class and pass in the selectors for the specific state you wish to target.
595
+ */
596
+ class DaffCustomerAddressPageFacade {
597
+ constructor(store) {
598
+ this.store = store;
599
+ const { selectAddress, selectAddresses, selectErrors, selectHasErrors, selectLoading, selectLoadingState, selectMutating, selectResolving, } = daffCustomerAddressGetSelectors();
600
+ this._selectAddress = selectAddress;
601
+ this.addresses$ = this.store.pipe(select(selectAddresses));
602
+ this.loadingState$ = this.store.pipe(select(selectLoadingState));
603
+ this.loading$ = this.store.pipe(select(selectLoading));
604
+ this.resolving$ = this.store.pipe(select(selectResolving));
605
+ this.mutating$ = this.store.pipe(select(selectMutating));
606
+ this.errors$ = this.store.pipe(select(selectErrors));
607
+ this.hasErrors$ = this.store.pipe(select(selectHasErrors));
608
+ }
609
+ getAddress(id) {
610
+ return this.store.pipe(select(this._selectAddress(id)));
611
+ }
612
+ dispatch(action) {
613
+ this.store.dispatch(action);
614
+ }
615
+ }
616
+ /** @nocollapse */ DaffCustomerAddressPageFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressPageFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
617
+ /** @nocollapse */ DaffCustomerAddressPageFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressPageFacade, providedIn: 'root' });
618
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressPageFacade, decorators: [{
619
+ type: Injectable,
620
+ args: [{
621
+ providedIn: 'root',
622
+ }]
623
+ }], ctorParameters: function () { return [{ type: i1.Store }]; } });
624
+
625
+ class DaffCustomerAddressEffects {
626
+ constructor(actions$, driver, errorMatcher) {
627
+ this.actions$ = actions$;
628
+ this.driver = driver;
629
+ this.errorMatcher = errorMatcher;
630
+ this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffCustomerAddressActionTypes.AddressListAction), switchMap((action) => this.driver.list().pipe(map(resp => new DaffCustomerAddressListSuccess(resp)), catchError((error) => of(new DaffCustomerAddressListFailure(this.errorMatcher(error))))))));
631
+ /**
632
+ * An effect for loading a customer address.
633
+ */
634
+ this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffCustomerAddressActionTypes.AddressLoadAction), switchMap((action) => this.driver.get(action.addressId).pipe(map(resp => new DaffCustomerAddressLoadSuccess(resp)), catchError((error) => of(new DaffCustomerAddressLoadFailure(this.errorMatcher(error), action.addressId)))))));
635
+ /**
636
+ * An effect for updating a customer address.
637
+ */
638
+ this.update$ = createEffect(() => this.actions$.pipe(ofType(DaffCustomerAddressActionTypes.AddressUpdateAction), switchMap((action) => this.driver.update(action.address).pipe(map(resp => new DaffCustomerAddressUpdateSuccess(resp)), catchError((error) => of(new DaffCustomerAddressUpdateFailure(this.errorMatcher(error), action.address.id)))))));
639
+ /**
640
+ * An effect for adding a new customer address.
641
+ */
642
+ this.add$ = createEffect(() => this.actions$.pipe(ofType(DaffCustomerAddressActionTypes.AddressAddAction), switchMap((action) => this.driver.add(action.address).pipe(map(resp => new DaffCustomerAddressAddSuccess(resp)), catchError((error) => of(new DaffCustomerAddressAddFailure(this.errorMatcher(error), action.placeholderId)))))));
643
+ /**
644
+ * An effect for adding a new customer address.
645
+ */
646
+ this.delete$ = createEffect(() => this.actions$.pipe(ofType(DaffCustomerAddressActionTypes.AddressDeleteAction), switchMap((action) => this.driver.delete(action.addressId).pipe(map(resp => new DaffCustomerAddressDeleteSuccess(resp)), catchError((error) => of(new DaffCustomerAddressDeleteFailure(this.errorMatcher(error), action.addressId)))))));
647
+ }
648
+ }
649
+ /** @nocollapse */ DaffCustomerAddressEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressEffects, deps: [{ token: i1$1.Actions }, { token: DaffCustomerAddressDriver }, { token: DAFF_CUSTOMER_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable });
650
+ /** @nocollapse */ DaffCustomerAddressEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressEffects });
651
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerAddressEffects, decorators: [{
652
+ type: Injectable
653
+ }], ctorParameters: function () { return [{ type: i1$1.Actions }, { type: undefined, decorators: [{
654
+ type: Inject,
655
+ args: [DaffCustomerAddressDriver]
656
+ }] }, { type: undefined, decorators: [{
657
+ type: Inject,
658
+ args: [DAFF_CUSTOMER_ERROR_MATCHER]
659
+ }] }]; } });
660
+
295
661
  class DaffCustomerEffects {
296
662
  constructor(actions$, driver, errorMatcher) {
297
663
  this.actions$ = actions$;
@@ -338,6 +704,8 @@ const DAFF_CUSTOMER_REDUCERS = new InjectionToken('DAFF_CUSTOMER_REDUCERS', {
338
704
  factory: () => daffComposeReducers([
339
705
  combineReducers({
340
706
  customer: daffCustomerReducer,
707
+ address: daffCustomerAddressReducer,
708
+ addressEntities: daffCustomerAddressEntitiesReducer,
341
709
  }),
342
710
  ...inject(DAFF_CUSTOMER_EXTRA_REDUCERS),
343
711
  ]),
@@ -354,6 +722,7 @@ class DaffCustomerStateModule {
354
722
  StoreModule.forFeature(DAFF_CUSTOMER_STORE_FEATURE_KEY, DAFF_CUSTOMER_REDUCERS),
355
723
  EffectsModule.forFeature([
356
724
  DaffCustomerEffects,
725
+ DaffCustomerAddressEffects,
357
726
  ]),
358
727
  ]] });
359
728
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCustomerStateModule, decorators: [{
@@ -363,6 +732,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
363
732
  StoreModule.forFeature(DAFF_CUSTOMER_STORE_FEATURE_KEY, DAFF_CUSTOMER_REDUCERS),
364
733
  EffectsModule.forFeature([
365
734
  DaffCustomerEffects,
735
+ DaffCustomerAddressEffects,
366
736
  ]),
367
737
  ],
368
738
  }]
@@ -372,5 +742,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
372
742
  * Generated bundle index. Do not edit.
373
743
  */
374
744
 
375
- export { DAFF_CUSTOMER_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_FEATURE_KEY, DaffCustomerActionTypes, DaffCustomerChangeEmail, DaffCustomerChangeEmailFailure, DaffCustomerChangeEmailSuccess, DaffCustomerChangePassword, DaffCustomerChangePasswordFailure, DaffCustomerChangePasswordSuccess, DaffCustomerClearErrors, DaffCustomerLoad, DaffCustomerLoadFailure, DaffCustomerLoadSuccess, DaffCustomerPageFacade, DaffCustomerStateModule, DaffCustomerUpdate, DaffCustomerUpdateFailure, DaffCustomerUpdateSuccess, daffCustomerGetSelectors, daffCustomerInitialState, daffCustomerProvideExtraReducers, daffCustomerReducer, daffCustomerStateStoreCustomer };
745
+ export { DAFF_CUSTOMER_EXTRA_REDUCERS, DAFF_CUSTOMER_STORE_FEATURE_KEY, DaffCustomerActionTypes, DaffCustomerAddressActionTypes, DaffCustomerAddressAdd, DaffCustomerAddressAddFailure, DaffCustomerAddressAddSuccess, DaffCustomerAddressDelete, DaffCustomerAddressDeleteFailure, DaffCustomerAddressDeleteSuccess, DaffCustomerAddressList, DaffCustomerAddressListFailure, DaffCustomerAddressListSuccess, DaffCustomerAddressLoad, DaffCustomerAddressLoadFailure, DaffCustomerAddressLoadSuccess, DaffCustomerAddressPageFacade, DaffCustomerAddressUpdate, DaffCustomerAddressUpdateFailure, DaffCustomerAddressUpdateSuccess, DaffCustomerChangeEmail, DaffCustomerChangeEmailFailure, DaffCustomerChangeEmailSuccess, DaffCustomerChangePassword, DaffCustomerChangePasswordFailure, DaffCustomerChangePasswordSuccess, DaffCustomerClearErrors, DaffCustomerLoad, DaffCustomerLoadFailure, DaffCustomerLoadSuccess, DaffCustomerPageFacade, DaffCustomerStateModule, DaffCustomerUpdate, DaffCustomerUpdateFailure, DaffCustomerUpdateSuccess, daffCustomerAddressEntitiesAdapter, daffCustomerAddressEntitiesReducer, daffCustomerAddressGetSelectors, daffCustomerAddressInitialState, daffCustomerAddressReducer, daffCustomerGetSelectors, daffCustomerInitialState, daffCustomerProvideExtraReducers, daffCustomerReducer, daffCustomerStateStoreCustomer, getDaffCustomerReducersStateSelector };
376
746
  //# sourceMappingURL=daffodil-customer-state.mjs.map