@daffodil/order 0.43.1 → 0.45.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/esm2020/driver/in-memory/backend/order.service.mjs +3 -3
  2. package/esm2020/driver/in-memory/drivers/order-driver.module.mjs +4 -4
  3. package/esm2020/driver/in-memory/drivers/order.service.mjs +3 -3
  4. package/esm2020/driver/magento/2.4.0/order-driver.module.mjs +4 -4
  5. package/esm2020/driver/magento/2.4.0/order.service.mjs +3 -3
  6. package/esm2020/driver/magento/2.4.1/order-driver.module.mjs +4 -4
  7. package/esm2020/driver/magento/2.4.1/order.service.mjs +3 -3
  8. package/esm2020/driver/testing/drivers/order-driver.module.mjs +4 -4
  9. package/esm2020/driver/testing/drivers/order.service.mjs +3 -3
  10. package/esm2020/routing/guards/placed-order/placed-order.guard.mjs +3 -3
  11. package/esm2020/routing/order-routing.module.mjs +4 -4
  12. package/esm2020/state/effects/order.effects.mjs +3 -3
  13. package/esm2020/state/facades/order/order.facade.mjs +3 -3
  14. package/esm2020/state/order-state.module.mjs +4 -4
  15. package/esm2020/state/testing/mock-order-facade.mjs +3 -3
  16. package/esm2020/state/testing/order-testing.module.mjs +4 -4
  17. package/esm2020/testing/factories/composite-order-item.factory.mjs +3 -3
  18. package/esm2020/testing/factories/configurable-order-item.factory.mjs +3 -3
  19. package/esm2020/testing/factories/order-address.factory.mjs +3 -3
  20. package/esm2020/testing/factories/order-coupon.factory.mjs +3 -3
  21. package/esm2020/testing/factories/order-invoice.factory.mjs +3 -3
  22. package/esm2020/testing/factories/order-item.factory.mjs +3 -3
  23. package/esm2020/testing/factories/order-payment.factory.mjs +3 -3
  24. package/esm2020/testing/factories/order-shipment-item.factory.mjs +3 -3
  25. package/esm2020/testing/factories/order-shipment-tracking.factory.mjs +3 -3
  26. package/esm2020/testing/factories/order-shipment.factory.mjs +3 -3
  27. package/esm2020/testing/factories/order-shipping-rate.factory.mjs +3 -3
  28. package/esm2020/testing/factories/order-total.factory.mjs +3 -3
  29. package/esm2020/testing/factories/order.factory.mjs +3 -3
  30. package/fesm2015/daffodil-order-driver-in-memory.mjs +7 -7
  31. package/fesm2015/daffodil-order-driver-in-memory.mjs.map +1 -1
  32. package/fesm2015/daffodil-order-driver-magento-2.4.0.mjs +5 -5
  33. package/fesm2015/daffodil-order-driver-magento-2.4.0.mjs.map +1 -1
  34. package/fesm2015/daffodil-order-driver-magento-2.4.1.mjs +5 -5
  35. package/fesm2015/daffodil-order-driver-magento-2.4.1.mjs.map +1 -1
  36. package/fesm2015/daffodil-order-driver-testing.mjs +5 -5
  37. package/fesm2015/daffodil-order-driver-testing.mjs.map +1 -1
  38. package/fesm2015/daffodil-order-routing.mjs +5 -5
  39. package/fesm2015/daffodil-order-routing.mjs.map +1 -1
  40. package/fesm2015/daffodil-order-state-testing.mjs +5 -5
  41. package/fesm2015/daffodil-order-state-testing.mjs.map +1 -1
  42. package/fesm2015/daffodil-order-state.mjs +7 -7
  43. package/fesm2015/daffodil-order-state.mjs.map +1 -1
  44. package/fesm2015/daffodil-order-testing.mjs +26 -26
  45. package/fesm2015/daffodil-order-testing.mjs.map +1 -1
  46. package/fesm2020/daffodil-order-driver-in-memory.mjs +7 -7
  47. package/fesm2020/daffodil-order-driver-in-memory.mjs.map +1 -1
  48. package/fesm2020/daffodil-order-driver-magento-2.4.0.mjs +5 -5
  49. package/fesm2020/daffodil-order-driver-magento-2.4.0.mjs.map +1 -1
  50. package/fesm2020/daffodil-order-driver-magento-2.4.1.mjs +5 -5
  51. package/fesm2020/daffodil-order-driver-magento-2.4.1.mjs.map +1 -1
  52. package/fesm2020/daffodil-order-driver-testing.mjs +5 -5
  53. package/fesm2020/daffodil-order-driver-testing.mjs.map +1 -1
  54. package/fesm2020/daffodil-order-routing.mjs +5 -5
  55. package/fesm2020/daffodil-order-routing.mjs.map +1 -1
  56. package/fesm2020/daffodil-order-state-testing.mjs +5 -5
  57. package/fesm2020/daffodil-order-state-testing.mjs.map +1 -1
  58. package/fesm2020/daffodil-order-state.mjs +7 -7
  59. package/fesm2020/daffodil-order-state.mjs.map +1 -1
  60. package/fesm2020/daffodil-order-testing.mjs +26 -26
  61. package/fesm2020/daffodil-order-testing.mjs.map +1 -1
  62. package/package.json +5 -5
@@ -412,8 +412,8 @@ class DaffOrderMagentoService {
412
412
  }));
413
413
  }
414
414
  }
415
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, deps: [{ token: i1.Apollo }, { token: DaffMagentoExtraOrderFragments }], target: i0.ɵɵFactoryTarget.Injectable });
416
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, providedIn: 'root' });
415
+ /** @nocollapse */ DaffOrderMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, deps: [{ token: i1.Apollo }, { token: DaffMagentoExtraOrderFragments }], target: i0.ɵɵFactoryTarget.Injectable });
416
+ /** @nocollapse */ DaffOrderMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, providedIn: 'root' });
417
417
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, decorators: [{
418
418
  type: Injectable,
419
419
  args: [{
@@ -437,9 +437,9 @@ class DaffOrderMagentoDriverModule {
437
437
  };
438
438
  }
439
439
  }
440
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
441
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [CommonModule] });
442
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [[
440
+ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
441
+ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [CommonModule] });
442
+ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [[
443
443
  CommonModule,
444
444
  ]] });
445
445
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-order-driver-magento-2.4.0.mjs","sources":["../../../libs/order/driver/magento/2.4.0/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.0/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.0/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.0/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.0/src/errors/map.ts","../../../libs/order/driver/magento/2.4.0/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.0/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.0/src/order.service.ts","../../../libs/order/driver/magento/2.4.0/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.0/src/daffodil-order-driver-magento-2.4.0.ts"],"sourcesContent":["import {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffOrderItemType,\n} from '@daffodil/order';\n\nimport {\n MagentoGraycoreOrder,\n MagentoGraycoreOrderItem,\n MagentoGraycoreOrderShipment,\n MagentoGraycoreOrderAddress,\n MagentoGraycoreOrderShipmentItem,\n MagentoGraycoreOrderShipmentTracking,\n MagentoGraycoreOrderPayment,\n MagentoGraycoreOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: {\n grand_total: number;\n subtotal: number;\n shipping: number;\n discount: number;\n tax: number;\n}): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.shipping,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.tax,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discount,\n sort_order: 4,\n },\n ];\n}\n\nfunction transformItem(item: MagentoGraycoreOrderItem): DaffOrderItem {\n return {\n id: null,\n item_id: null,\n type: DaffOrderItemType.Simple,\n qty_ordered: item.qty_ordered,\n qty_canceled: item.qty_canceled,\n qty_fulfilled: item.qty_fulfilled,\n qty: item.qty,\n image: {\n url: item.image,\n id: null,\n label: null,\n },\n order_id: item.order_id,\n created_at: item.created_at,\n updated_at: item.updated_at,\n product_id: String(item.product_id),\n parent_item_id: null,\n sku: item.sku,\n name: item.name,\n weight: item.weight,\n price: item.price,\n discount_percent: item.discount_percent,\n discount_amount: item.discount_amount,\n tax_percent: item.tax_percent,\n tax_amount: item.tax_amount,\n row_total: item.row_total,\n row_total_with_discount: item.row_total_with_discount,\n row_weight: item.row_weight,\n tax_before_discount: item.tax_before_discount,\n };\n}\n\nfunction transformAddress(address: MagentoGraycoreOrderAddress): DaffOrderAddress {\n return {\n order_id: String(address.order_id),\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: address.email,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_id,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoGraycoreOrderShipmentItem): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.item),\n qty: shipmentItem.qty,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoGraycoreOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.tracking_number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoGraycoreOrderShipment): DaffOrderShipment {\n return {\n carrier: null,\n carrier_title: null,\n code: null,\n method: null,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(transformShipmentItem),\n };\n}\n\nfunction transformPayment(payment: MagentoGraycoreOrderPayment): DaffOrderPayment {\n return {\n id: String(payment.payment_id),\n payment_id: String(payment.payment_id),\n order_id: String(payment.order_id),\n created_at: null,\n updated_at: null,\n method: payment.method,\n cc_type: payment.cc_type,\n cc_last4: payment.cc_last4,\n cc_owner: payment.cc_owner,\n cc_exp_month: payment.cc_exp_month,\n cc_exp_year: payment.cc_exp_year,\n };\n}\n\nfunction transformInvoice(invoice: MagentoGraycoreOrderInvoice): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice),\n billing_address: transformAddress(invoice.billing_address),\n shipping_address: transformAddress(invoice.shipping_address),\n payment: transformPayment(invoice.payment),\n items: invoice.items.map(transformShipmentItem),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoGraycoreOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoGraycoreOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: String(order.order_number),\n customer_id: String(order.customer_id),\n created_at: order.created_at,\n updated_at: order.updated_at,\n status: order.status,\n\n totals: transformTotals(order),\n applied_codes: order.applied_codes.map(code => ({ code })),\n items: order.items.map(transformItem),\n billing_addresses: [\n transformAddress(order.billing_address),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address),\n ],\n shipments: order.shipments.map(transformShipment),\n payment: transformPayment(order.payment),\n invoices: order.invoices.map(transformInvoice),\n credits: order.credits.map(transformInvoice),\n };\n}\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on GraycoreOrderAddress {\n order_id\n prefix\n suffix\n firstname\n middlename\n lastname\n telephone\n email\n street\n city\n region\n region_id\n country_code\n postcode\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on GraycoreOrderPayment {\n payment_id\n order_id\n method\n cc_type\n cc_last4\n cc_owner\n cc_exp_month\n cc_exp_year\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderItemFragment = gql`\n fragment orderItem on GraycoreOrderItem {\n qty_ordered\n image\n qty_canceled\n qty_fulfilled\n order_id\n created_at\n updated_at\n product_id\n sku\n name\n weight\n qty\n price\n discount_percent\n discount_amount\n tax_percent\n tax_amount\n row_total\n row_total_with_discount\n row_weight\n tax_before_discount\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on GraycoreOrderShipmentItem {\n qty\n item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentItemFragment } from './order-shipment-item';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on GraycoreOrderInvoice {\n items {\n ...orderShipmentItem\n }\n grand_total\n subtotal\n shipping\n discount\n tax\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n\t\t}\n\t\tpayment {\n\t\t\t...orderPayment\n\t\t}\n }\n ${orderShipmentItemFragment}\n ${orderAddressFragment}\n ${orderPaymentFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on GraycoreOrderShipmentTracking {\n tracking_number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on GraycoreOrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\n\nexport const orderFragment = gql`\n fragment order on GraycoreOrder {\n id\n order_number\n customer_id\n created_at\n updated_at\n grand_total\n subtotal\n shipping\n discount\n tax\n status\n applied_codes\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credits {\n ...orderInvoice\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderAddressFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n orders {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n CART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.orders) {\n if (response.data.graycoreGuestOrders.orders.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.orders.map(daffMagentoTransformOrder)),\n catchError(err => throwError(() => transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyBA,SAAS,eAAe,CAAC,MAMxB,EAAA;IACC,OAAO;AACL,QAAA;AACE,YAAA,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,sBAAsB,CAAC,UAAU;YACvC,KAAK,EAAE,MAAM,CAAC,WAAW;AACzB,YAAA,UAAU,EAAE,CAAC;AACd,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,sBAAsB,CAAC,QAAQ;YACrC,KAAK,EAAE,MAAM,CAAC,QAAQ;AACtB,YAAA,UAAU,EAAE,CAAC;AACd,SAAA;AACD,QAAA;AACE,YAAA,KA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YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;0BAII,MAAM;2BAAC,8BAA8B,CAAA;;;MC3B7B,4BAA4B,CAAA;AACvC,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,4BAA4B;AACtC,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,eAAe;AACxB,oBAAA,WAAW,EAAE,uBAAuB;AACrC,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;+JAXU,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA5B,sCAAA,4BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,YAHrC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,sCAAA,4BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,EAJ9B,OAAA,EAAA,CAAA;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBALxC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-order-driver-magento-2.4.0.mjs","sources":["../../../libs/order/driver/magento/2.4.0/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.0/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.0/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.0/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.0/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.0/src/errors/map.ts","../../../libs/order/driver/magento/2.4.0/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.0/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.0/src/order.service.ts","../../../libs/order/driver/magento/2.4.0/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.0/src/daffodil-order-driver-magento-2.4.0.ts"],"sourcesContent":["import {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffOrderItemType,\n} from '@daffodil/order';\n\nimport {\n MagentoGraycoreOrder,\n MagentoGraycoreOrderItem,\n MagentoGraycoreOrderShipment,\n MagentoGraycoreOrderAddress,\n MagentoGraycoreOrderShipmentItem,\n MagentoGraycoreOrderShipmentTracking,\n MagentoGraycoreOrderPayment,\n MagentoGraycoreOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: {\n grand_total: number;\n subtotal: number;\n shipping: number;\n discount: number;\n tax: number;\n}): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.shipping,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.tax,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discount,\n sort_order: 4,\n },\n ];\n}\n\nfunction transformItem(item: MagentoGraycoreOrderItem): DaffOrderItem {\n return {\n id: null,\n item_id: null,\n type: DaffOrderItemType.Simple,\n qty_ordered: item.qty_ordered,\n qty_canceled: item.qty_canceled,\n qty_fulfilled: item.qty_fulfilled,\n qty: item.qty,\n image: {\n url: item.image,\n id: null,\n label: null,\n },\n order_id: item.order_id,\n created_at: item.created_at,\n updated_at: item.updated_at,\n product_id: String(item.product_id),\n parent_item_id: null,\n sku: item.sku,\n name: item.name,\n weight: item.weight,\n price: item.price,\n discount_percent: item.discount_percent,\n discount_amount: item.discount_amount,\n tax_percent: item.tax_percent,\n tax_amount: item.tax_amount,\n row_total: item.row_total,\n row_total_with_discount: item.row_total_with_discount,\n row_weight: item.row_weight,\n tax_before_discount: item.tax_before_discount,\n };\n}\n\nfunction transformAddress(address: MagentoGraycoreOrderAddress): DaffOrderAddress {\n return {\n order_id: String(address.order_id),\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: address.email,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_id,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoGraycoreOrderShipmentItem): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.item),\n qty: shipmentItem.qty,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoGraycoreOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.tracking_number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoGraycoreOrderShipment): DaffOrderShipment {\n return {\n carrier: null,\n carrier_title: null,\n code: null,\n method: null,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(transformShipmentItem),\n };\n}\n\nfunction transformPayment(payment: MagentoGraycoreOrderPayment): DaffOrderPayment {\n return {\n id: String(payment.payment_id),\n payment_id: String(payment.payment_id),\n order_id: String(payment.order_id),\n created_at: null,\n updated_at: null,\n method: payment.method,\n cc_type: payment.cc_type,\n cc_last4: payment.cc_last4,\n cc_owner: payment.cc_owner,\n cc_exp_month: payment.cc_exp_month,\n cc_exp_year: payment.cc_exp_year,\n };\n}\n\nfunction transformInvoice(invoice: MagentoGraycoreOrderInvoice): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice),\n billing_address: transformAddress(invoice.billing_address),\n shipping_address: transformAddress(invoice.shipping_address),\n payment: transformPayment(invoice.payment),\n items: invoice.items.map(transformShipmentItem),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoGraycoreOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoGraycoreOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: String(order.order_number),\n customer_id: String(order.customer_id),\n created_at: order.created_at,\n updated_at: order.updated_at,\n status: order.status,\n\n totals: transformTotals(order),\n applied_codes: order.applied_codes.map(code => ({ code })),\n items: order.items.map(transformItem),\n billing_addresses: [\n transformAddress(order.billing_address),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address),\n ],\n shipments: order.shipments.map(transformShipment),\n payment: transformPayment(order.payment),\n invoices: order.invoices.map(transformInvoice),\n credits: order.credits.map(transformInvoice),\n };\n}\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on GraycoreOrderAddress {\n order_id\n prefix\n suffix\n firstname\n middlename\n lastname\n telephone\n email\n street\n city\n region\n region_id\n country_code\n postcode\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on GraycoreOrderPayment {\n payment_id\n order_id\n method\n cc_type\n cc_last4\n cc_owner\n cc_exp_month\n cc_exp_year\n }\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderItemFragment = gql`\n fragment orderItem on GraycoreOrderItem {\n qty_ordered\n image\n qty_canceled\n qty_fulfilled\n order_id\n created_at\n updated_at\n product_id\n sku\n name\n weight\n qty\n price\n discount_percent\n discount_amount\n tax_percent\n tax_amount\n row_total\n row_total_with_discount\n row_weight\n tax_before_discount\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on GraycoreOrderShipmentItem {\n qty\n item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentItemFragment } from './order-shipment-item';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on GraycoreOrderInvoice {\n items {\n ...orderShipmentItem\n }\n grand_total\n subtotal\n shipping\n discount\n tax\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n\t\t}\n\t\tpayment {\n\t\t\t...orderPayment\n\t\t}\n }\n ${orderShipmentItemFragment}\n ${orderAddressFragment}\n ${orderPaymentFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on GraycoreOrderShipmentTracking {\n tracking_number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on GraycoreOrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\n\nexport const orderFragment = gql`\n fragment order on GraycoreOrder {\n id\n order_number\n customer_id\n created_at\n updated_at\n grand_total\n subtotal\n shipping\n discount\n tax\n status\n applied_codes\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credits {\n ...orderInvoice\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderAddressFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n orders {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n CART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.orders) {\n if (response.data.graycoreGuestOrders.orders.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.orders.map(daffMagentoTransformOrder)),\n catchError(err => throwError(() => transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAyBA,SAAS,eAAe,CAAC,MAMxB,EAAA;IACC,OAAO;AACL,QAAA;AACE,YAAA,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,sBAAsB,CAAC,UA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AAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
@@ -599,8 +599,8 @@ class DaffOrderMagentoService {
599
599
  }));
600
600
  }
601
601
  }
602
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, deps: [{ token: i1.Apollo }, { token: DaffMagentoExtraOrderFragments }], target: i0.ɵɵFactoryTarget.Injectable });
603
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, providedIn: 'root' });
602
+ /** @nocollapse */ DaffOrderMagentoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, deps: [{ token: i1.Apollo }, { token: DaffMagentoExtraOrderFragments }], target: i0.ɵɵFactoryTarget.Injectable });
603
+ /** @nocollapse */ DaffOrderMagentoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, providedIn: 'root' });
604
604
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoService, decorators: [{
605
605
  type: Injectable,
606
606
  args: [{
@@ -624,9 +624,9 @@ class DaffOrderMagentoDriverModule {
624
624
  };
625
625
  }
626
626
  }
627
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
628
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [CommonModule] });
629
- /** @nocollapse */ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [[
627
+ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
628
+ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [CommonModule] });
629
+ /** @nocollapse */ DaffOrderMagentoDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, imports: [[
630
630
  CommonModule,
631
631
  ]] });
632
632
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderMagentoDriverModule, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-order-driver-magento-2.4.1.mjs","sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.1/src/daffodil-order-driver-magento-2.4.1.ts"],"sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_code,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\n}\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderInvoiceItemTypenames =\n 'InvoiceItem' |\n 'BundleInvoiceItem' |\n 'GiftCardInvoiceItem' |\n 'DownloadableInvoiceItem';\n\nexport interface MagentoOrderInvoiceItem {\n __typename?: MagentoOrderInvoiceItemTypenames;\n order_item: MagentoOrderItem;\n quantity_invoiced: number;\n};\n\nexport interface MagentoOrderInvoiceBundleItem extends MagentoOrderInvoiceItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderShipmentItemTypenames =\n 'ShipmentItem' |\n 'BundleShipmentItem' |\n 'GiftCardShipmentItem';\n\nexport interface MagentoOrderShipmentItem {\n __typename?: MagentoOrderShipmentItemTypenames;\n order_item: MagentoOrderItem;\n quantity_shipped: number;\n};\n\nexport interface MagentoOrderShipmentBundleItem extends MagentoOrderShipmentItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n CART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(() => transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAIY,qBAIX;AAJD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,oBAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA,CAAA;AAAA,CAAC;AAYD,CAAC;AAyBD,CAAC;AAOD,CAAC;AAID;;ACbD,SAAS,eAAe,CAAC,MAAyB,EAAA;IAChD,OAAO;AACL,QAAA;AACE,YAAA,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,sBAAsB,CAAC,UAAU;AACvC,YAAA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A,CAAA,CAAA;AAGH,sCAAA,4BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,EAJ9B,OAAA,EAAA,CAAA;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBALxC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-order-driver-magento-2.4.1.mjs","sources":["../../../libs/order/driver/magento/2.4.1/src/models/responses/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/transforms/responses/order.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/models/responses/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-address.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-credit.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-invoice.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-payment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-item.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment-tracking.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-shipment.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order-total.ts","../../../libs/order/driver/magento/2.4.1/src/queries/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/queries/get-guest-orders.ts","../../../libs/order/driver/magento/2.4.1/src/injection-tokens/fragments/order.ts","../../../libs/order/driver/magento/2.4.1/src/errors/codes.ts","../../../libs/order/driver/magento/2.4.1/src/errors/map.ts","../../../libs/order/driver/magento/2.4.1/src/errors/transform.ts","../../../libs/order/driver/magento/2.4.1/src/validators/get-orders.ts","../../../libs/order/driver/magento/2.4.1/src/order.service.ts","../../../libs/order/driver/magento/2.4.1/src/order-driver.module.ts","../../../libs/order/driver/magento/2.4.1/src/daffodil-order-driver-magento-2.4.1.ts"],"sourcesContent":["import { MagentoMoney } from '@daffodil/driver/magento';\n\nimport { MagentoDiscount } from './discount';\n\nexport enum MagentoOrderItemType {\n Simple = 'simple',\n Configurable = 'configurable',\n Bundle = 'bundle'\n};\n\nexport type MagentoOrderItemTypenames =\n 'OrderItem' |\n 'BundleOrderItem' |\n 'GiftCardOrderItem' |\n 'DownloadableOrderItem';\n\nexport interface MagentoOrderItemOption {\n __typename?: string;\n label: string;\n value: string;\n};\n\nexport interface MagentoOrderItem {\n __typename?: MagentoOrderItemTypenames;\n discounts: MagentoDiscount[];\n product_name: string;\n product_sale_price: MagentoMoney;\n product_sku: string;\n product_type: MagentoOrderItemType;\n product_url_key: string;\n quantity_canceled: number;\n quantity_invoiced: number;\n quantity_ordered: number;\n quantity_refunded: number;\n quantity_returned: number;\n quantity_shipped: number;\n selected_options: MagentoOrderItemOption[];\n entered_options: MagentoOrderItemOption[];\n status: string;\n}\n\nexport interface MagentoOrderBundleItemSelectedOption {\n __typename?: string;\n label: string;\n values: MagentoOrderBundleItemSelectedOptionValue[];\n};\n\nexport interface MagentoOrderBundleItemSelectedOptionValue {\n price: MagentoMoney;\n product_name: string;\n product_sku: string;\n quantity: number;\n};\n\nexport interface MagentoOrderBundleItem extends MagentoOrderItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n daffAdd,\n daffSubtract,\n} from '@daffodil/core';\nimport {\n DaffOrder,\n DaffOrderTotal,\n DaffOrderItem,\n DaffOrderAddress,\n DaffOrderShipment,\n DaffOrderShipmentItem,\n DaffOrderShipmentTracking,\n DaffOrderPayment,\n DaffOrderInvoice,\n DaffOrderTotalTypeEnum,\n DaffCompositeOrderItemOption,\n DaffOrderItemType,\n DaffConfigurableOrderItemAttribute,\n DaffOrderCoupon,\n} from '@daffodil/order';\n\nimport { MagentoDiscount } from '../../models/responses/discount';\nimport { MagentoOrderCredit } from '../../models/responses/order-credit';\nimport { MagentoOrderCreditItem } from '../../models/responses/order-credit-item';\nimport { MagentoOrderInvoiceItem } from '../../models/responses/order-invoice-item';\nimport {\n MagentoOrderBundleItem,\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItemOption,\n MagentoOrderItemType,\n} from '../../models/responses/order-item';\nimport { MagentoOrderTotal } from '../../models/responses/order-total';\nimport {\n MagentoOrder,\n MagentoOrderItem,\n MagentoOrderShipment,\n MagentoOrderAddress,\n MagentoOrderShipmentItem,\n MagentoOrderShipmentTracking,\n MagentoOrderPayment,\n MagentoOrderInvoice,\n} from '../../models/responses/public_api';\n\nfunction transformTotals(totals: MagentoOrderTotal): DaffOrderTotal[] {\n return [\n {\n label: 'Grand Total',\n type: DaffOrderTotalTypeEnum.GrandTotal,\n value: totals.grand_total.value,\n sort_order: 1,\n },\n {\n label: 'Subtotal',\n type: DaffOrderTotalTypeEnum.Subtotal,\n value: totals.subtotal.value,\n sort_order: 0,\n },\n {\n label: 'Shipping',\n type: DaffOrderTotalTypeEnum.Shipping,\n value: totals.total_shipping.value,\n sort_order: 2,\n },\n {\n label: 'Tax',\n type: DaffOrderTotalTypeEnum.Tax,\n value: totals.total_tax.value,\n sort_order: 3,\n },\n {\n label: 'Discount',\n type: DaffOrderTotalTypeEnum.Discount,\n value: totals.discounts.reduce((acc, discount) => daffAdd(acc, discount.amount.value), 0),\n sort_order: 4,\n },\n ];\n}\n\nfunction transformCouponDiscount(discount: MagentoDiscount): DaffOrderCoupon {\n return {\n code: discount.label,\n };\n}\n\nfunction transformConfigurableOption(option: MagentoOrderItemOption): DaffConfigurableOrderItemAttribute {\n return {\n attribute_label: option.label,\n\t value_label: option.value,\n };\n}\n\nfunction transformBundleOption(option: MagentoOrderBundleItemSelectedOption): DaffCompositeOrderItemOption {\n return {\n option_label: option.label,\n\t value_label: option.values && option.values[0] && option.values[0].product_name,\n };\n}\n\nfunction transformAdditionalItemFields(item: MagentoOrderItem) {\n switch (item.product_type) {\n case MagentoOrderItemType.Bundle:\n return {\n type: DaffOrderItemType.Composite,\n options: (<MagentoOrderBundleItem>item).bundle_options.map(transformBundleOption),\n };\n case MagentoOrderItemType.Configurable:\n return {\n type: DaffOrderItemType.Configurable,\n attributes: item.selected_options.map(transformConfigurableOption),\n };\n case MagentoOrderItemType.Simple:\n return {\n type: DaffOrderItemType.Simple,\n };\n default:\n return {};\n }\n}\n\nfunction transformItem(item: MagentoOrderItem, order: MagentoOrder, qty: number): DaffOrderItem {\n const discount = item.discounts.reduce((acc, d) => daffAdd(acc, d.amount.value), 0);\n const rowTotal = qty * item.product_sale_price.value;\n const rowTotalWithDiscount = qty * daffSubtract(item.product_sale_price.value, discount);\n\n return {\n type: DaffOrderItemType.Simple,\n id: null,\n item_id: null,\n qty_ordered: item.quantity_ordered,\n qty_canceled: item.quantity_canceled,\n qty_fulfilled: item.quantity_shipped,\n qty,\n image: {\n url: item.product_url_key,\n id: null,\n label: null,\n },\n order_id: order.id,\n created_at: null,\n updated_at: null,\n product_id: null,\n parent_item_id: null,\n sku: item.product_sku,\n name: item.product_name,\n weight: null,\n price: item.product_sale_price.value,\n discount_percent: Math.floor(discount / item.product_sale_price.value * 100),\n discount_amount: discount,\n tax_percent: null,\n tax_amount: null,\n row_total: rowTotal,\n row_total_with_discount: rowTotalWithDiscount,\n row_weight: null,\n tax_before_discount: null,\n ...transformAdditionalItemFields(item),\n };\n}\n\nfunction transformAddress(address: MagentoOrderAddress, order: MagentoOrder): DaffOrderAddress {\n return {\n order_id: order.id,\n prefix: address.prefix,\n suffix: address.suffix,\n firstname: address.firstname,\n middlename: address.middlename,\n lastname: address.lastname,\n telephone: address.telephone,\n email: null,\n street: address.street[0],\n street2: address.street[1],\n city: address.city,\n region: address.region_code,\n country: address.country_code,\n postcode: address.postcode,\n };\n}\n\nfunction transformShipmentItem(shipmentItem: MagentoOrderShipmentItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(shipmentItem.order_item, order, shipmentItem.quantity_shipped),\n qty: shipmentItem.quantity_shipped,\n };\n}\n\nfunction transformShipmentTracking(tracking: MagentoOrderShipmentTracking): DaffOrderShipmentTracking {\n return {\n tracking_number: tracking.number,\n tracking_url: null,\n carrier: tracking.carrier,\n title: tracking.title,\n carrier_logo: null,\n };\n}\n\nfunction transformShipment(shipment: MagentoOrderShipment, order: MagentoOrder): DaffOrderShipment {\n return {\n carrier: order.carrier,\n carrier_title: null,\n code: null,\n method: order.shipping_method,\n method_description: null,\n tracking: shipment.tracking.map(transformShipmentTracking),\n items: shipment.items.map(item => transformShipmentItem(item, order)),\n };\n}\n\nfunction transformPayment(payment: MagentoOrderPayment, order: MagentoOrder): DaffOrderPayment {\n const findAdditionalData = key => {\n const index = payment.additional_data.findIndex(({ name }) => name === key);\n\n return index > -1 ? payment.additional_data[index].value : null;\n };\n return {\n id: null,\n payment_id: null,\n order_id: order.id,\n created_at: null,\n updated_at: null,\n method: payment.type,\n cc_type: findAdditionalData('cc_type'),\n cc_last4: findAdditionalData('cc_last4'),\n cc_owner: findAdditionalData('cc_owner'),\n cc_exp_month: findAdditionalData('cc_exp_month'),\n cc_exp_year: findAdditionalData('cc_exp_year'),\n };\n}\n\nfunction transformInvoiceItem(invoiceItem: MagentoOrderInvoiceItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(invoiceItem.order_item, order, invoiceItem.quantity_invoiced),\n qty: invoiceItem.quantity_invoiced,\n };\n}\n\nfunction transformInvoice(invoice: MagentoOrderInvoice, order: MagentoOrder, payment: MagentoOrderPayment): DaffOrderInvoice {\n return {\n totals: transformTotals(invoice.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(payment, order),\n items: invoice.items.map(item => transformInvoiceItem(item, order)),\n shipping_method: null,\n };\n}\n\nfunction transformCreditItem(creditItem: MagentoOrderCreditItem, order: MagentoOrder): DaffOrderShipmentItem {\n return {\n item: transformItem(creditItem.order_item, order, creditItem.quantity_refunded),\n qty: creditItem.quantity_refunded,\n };\n}\n\nfunction transformCredit(credit: MagentoOrderCredit, order: MagentoOrder): DaffOrderInvoice {\n return {\n totals: transformTotals(credit.total),\n billing_address: transformAddress(order.billing_address, order),\n shipping_address: transformAddress(order.shipping_address, order),\n payment: transformPayment(order.payment_methods[0], order),\n items: credit.items.map(item => transformCreditItem(item, order)),\n shipping_method: null,\n };\n}\n\n/**\n * Transforms the MagentoOrder from the magento order query into a DaffOrder.\n */\nexport function daffMagentoTransformOrder(order: MagentoOrder): DaffOrder {\n return {\n extra_attributes: order,\n\n id: order.number,\n customer_id: null,\n updated_at: null,\n created_at: order.order_date,\n status: order.status,\n\n totals: transformTotals(order.total),\n applied_codes: order.total.discounts.map(transformCouponDiscount),\n items: order.items.map(item => transformItem(item, order, item.quantity_ordered)),\n billing_addresses: [\n transformAddress(order.billing_address, order),\n ],\n shipping_addresses: [\n transformAddress(order.shipping_address, order),\n ],\n shipments: order.shipments.map(shipment => transformShipment(shipment, order)),\n payment: transformPayment(order.payment_methods[0], order),\n // TODO: find out if the index is the correct payment for invoice\n invoices: order.invoices.map((invoice, index) => transformInvoice(invoice, order, order.payment_methods[index])),\n credits: order.credit_memos.map(credit => transformCredit(credit, order)),\n };\n}\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderInvoiceItemTypenames =\n 'InvoiceItem' |\n 'BundleInvoiceItem' |\n 'GiftCardInvoiceItem' |\n 'DownloadableInvoiceItem';\n\nexport interface MagentoOrderInvoiceItem {\n __typename?: MagentoOrderInvoiceItemTypenames;\n order_item: MagentoOrderItem;\n quantity_invoiced: number;\n};\n\nexport interface MagentoOrderInvoiceBundleItem extends MagentoOrderInvoiceItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import {\n MagentoOrderBundleItemSelectedOption,\n MagentoOrderItem,\n} from './order-item';\n\nexport type MagentoOrderShipmentItemTypenames =\n 'ShipmentItem' |\n 'BundleShipmentItem' |\n 'GiftCardShipmentItem';\n\nexport interface MagentoOrderShipmentItem {\n __typename?: MagentoOrderShipmentItemTypenames;\n order_item: MagentoOrderItem;\n quantity_shipped: number;\n};\n\nexport interface MagentoOrderShipmentBundleItem extends MagentoOrderShipmentItem {\n bundle_options: MagentoOrderBundleItemSelectedOption[];\n};\n","import { gql } from 'apollo-angular';\n\n\nexport const orderAddressFragment = gql`\n fragment orderAddress on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n middlename\n lastname\n postcode\n prefix\n region\n region_code\n street\n suffix\n telephone\n }\n`;\n","import { gql } from 'apollo-angular';\n\nexport const orderBundleItemSelectedOptionFragment = gql`\n fragment orderBundleItemSelectedOption on ItemSelectedBundleOption {\n label\n values {\n product_name\n }\n }\n`;\n\nexport const orderItemFragment = gql`\n fragment orderItem on OrderItemInterface {\n quantity_ordered\n quantity_canceled\n quantity_shipped\n quantity_invoiced\n product_url_key\n product_sku\n product_name\n product_type\n product_sale_price {\n value\n }\n discounts {\n amount {\n value\n }\n }\n selected_options {\n label\n value\n }\n ... on BundleOrderItem {\n bundle_options {\n ...orderBundleItemSelectedOption\n }\n }\n }\n ${orderBundleItemSelectedOptionFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderCreditItemFragment = gql`\n fragment orderCreditItem on CreditMemoItemInterface {\n quantity_refunded\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderCreditTotalFragment = gql`\n fragment orderCreditTotal on CreditMemoTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderCreditItemFragment } from './order-credit-item';\nimport { orderCreditTotalFragment } from './order-credit-total';\n\nexport const orderCreditFragment = gql`\n fragment orderCredit on CreditMemo {\n items {\n ...orderCreditItem\n }\n total {\n ...orderCreditTotal\n }\n }\n ${orderCreditItemFragment}\n ${orderCreditTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderInvoiceItemFragment = gql`\n fragment orderInvoiceItem on InvoiceItemInterface {\n quantity_invoiced\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderInvoiceTotalFragment = gql`\n fragment orderInvoiceTotal on InvoiceTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderInvoiceItemFragment } from './order-invoice-item';\nimport { orderInvoiceTotalFragment } from './order-invoice-total';\n\nexport const orderInvoiceFragment = gql`\n fragment orderInvoice on Invoice {\n items {\n ...orderInvoiceItem\n }\n total {\n ...orderInvoiceTotal\n }\n }\n ${orderInvoiceItemFragment}\n ${orderInvoiceTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderPaymentFragment = gql`\n fragment orderPayment on OrderPaymentMethod {\n name\n type\n additional_data {\n name\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderItemFragment } from './order-item';\n\nexport const orderShipmentItemFragment = gql`\n fragment orderShipmentItem on ShipmentItemInterface {\n quantity_shipped\n order_item {\n ...orderItem\n }\n }\n ${orderItemFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderShipmentTrackingFragment = gql`\n fragment orderShipmentTracking on ShipmentTracking {\n number\n carrier\n title\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderShipmentItemFragment } from './order-shipment-item';\nimport { orderShipmentTrackingFragment } from './order-shipment-tracking';\n\nexport const orderShipmentFragment = gql`\n fragment orderShipment on OrderShipment {\n tracking {\n ...orderShipmentTracking\n }\n items {\n ...orderShipmentItem\n }\n }\n ${orderShipmentItemFragment}\n ${orderShipmentTrackingFragment}\n`;\n","import { gql } from 'apollo-angular';\n\n\nexport const orderTotalFragment = gql`\n fragment orderTotal on OrderTotal {\n discounts {\n amount {\n value\n }\n label\n }\n grand_total {\n value\n }\n subtotal {\n value\n }\n total_tax {\n value\n }\n total_shipping {\n value\n }\n }\n`;\n","import { gql } from 'apollo-angular';\n\nimport { orderAddressFragment } from './order-address';\nimport { orderCreditFragment } from './order-credit';\nimport { orderInvoiceFragment } from './order-invoice';\nimport { orderItemFragment } from './order-item';\nimport { orderPaymentFragment } from './order-payment';\nimport { orderShipmentFragment } from './order-shipment';\nimport { orderTotalFragment } from './order-total';\n\nexport const orderFragment = gql`\n fragment order on GraycoreGuestOrder {\n id\n order_date\n status\n carrier\n number\n shipping_method\n items {\n ...orderItem\n }\n billing_address {\n ...orderAddress\n }\n shipping_address {\n ...orderAddress\n }\n shipments {\n ...orderShipment\n }\n payment_methods {\n ...orderPayment\n }\n invoices {\n ...orderInvoice\n }\n credit_memos {\n ...orderCredit\n }\n total {\n ...orderTotal\n }\n }\n ${orderItemFragment}\n ${orderShipmentFragment}\n ${orderPaymentFragment}\n ${orderInvoiceFragment}\n ${orderCreditFragment}\n ${orderAddressFragment}\n ${orderTotalFragment}\n`;\n","import { gql } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\n\nimport {\n daffBuildFragmentNameSpread,\n daffBuildFragmentDefinition,\n} from '@daffodil/core/graphql';\n\nimport { orderFragment } from './fragments/public_api';\n\nexport const getGuestOrders = (extraOrderFragments: DocumentNode[] = []) => gql`\n query MagentoGetGuestOrders($cartId: String!) {\n graycoreGuestOrders(cartId: $cartId) {\n items {\n ...order\n ${daffBuildFragmentNameSpread(...extraOrderFragments)}\n }\n }\n }\n ${orderFragment}\n ${daffBuildFragmentDefinition(...extraOrderFragments)}\n`;\n","import { InjectionToken } from '@angular/core';\nimport { DocumentNode } from 'graphql';\n\n/**\n * An multi-provider injection token for providing extra GraphQL fragments that will be spread into order queries.\n * This can be used to retrieve additional data that is not covered by the standard Daffodil interfaces.\n * The data will appear in DaffOrder#extra_attributes.\n *\n * Fragment structure is platform-specific and this feature should be used with care.\n */\nexport const DaffMagentoExtraOrderFragments = new InjectionToken<DocumentNode[]>('DaffMagentoExtraOrderFragments', { factory: () => []});\n","export enum MagentoOrderGraphQlErrorCode {\n CART_NOT_FOUND = 'graphql-no-such-entity',\n}\n","import { DaffCartNotFoundError } from '@daffodil/cart/driver';\nimport { DaffErrorCodeMap } from '@daffodil/core';\n\nimport { MagentoOrderGraphQlErrorCode } from './codes';\n\nexport const DaffOrderMagentoErrorMap: DaffErrorCodeMap = {\n [MagentoOrderGraphQlErrorCode.CART_NOT_FOUND]: DaffCartNotFoundError,\n};\n","import { daffTransformMagentoError } from '@daffodil/driver/magento';\n\nimport { DaffOrderMagentoErrorMap } from './map';\n\nexport function transformMagentoOrderError(error: any) {\n return daffTransformMagentoError(error, DaffOrderMagentoErrorMap);\n}\n","import { ApolloQueryResult } from '@apollo/client/core';\n\nimport { DaffOrderInvalidAPIResponseError } from '@daffodil/order/driver';\n\nimport { MagentoGetGuestOrdersResponse } from '../queries/public_api';\n\nexport const validateGetOrdersResponse = (response: ApolloQueryResult<MagentoGetGuestOrdersResponse>) => {\n if (response.data?.graycoreGuestOrders?.items) {\n if (response.data.graycoreGuestOrders.items.reduce((acc, order) => acc && !!(\n order.billing_address\n && order.shipping_address\n && order.payment_methods\n ), true)) {\n return response;\n } else {\n throw new DaffOrderInvalidAPIResponseError('One of the orders does not contain required fields.');\n }\n } else {\n throw new DaffOrderInvalidAPIResponseError('Get orders response does not contain a valid list of orders.');\n }\n};\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { DocumentNode } from 'graphql';\nimport {\n Observable,\n throwError,\n} from 'rxjs';\nimport {\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffCart } from '@daffodil/cart';\nimport { DaffOrder } from '@daffodil/order';\nimport {\n DaffOrderServiceInterface,\n DaffOrderNotFoundError,\n} from '@daffodil/order/driver';\n\nimport { transformMagentoOrderError } from './errors/transform';\nimport { DaffMagentoExtraOrderFragments } from './injection-tokens/public_api';\nimport {\n getGuestOrders,\n MagentoGetGuestOrdersResponse,\n} from './queries/public_api';\nimport { daffMagentoTransformOrder } from './transforms/responses/order';\nimport { validateGetOrdersResponse } from './validators/public_api';\n\n/**\n * A service for making Magento GraphQL queries for orders.\n *\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffOrderMagentoService implements DaffOrderServiceInterface {\n constructor(\n private apollo: Apollo,\n @Inject(DaffMagentoExtraOrderFragments) public extraOrderFragments: DocumentNode[],\n ) {}\n\n list(cartId?: DaffCart['id']): Observable<DaffOrder[]> {\n return this.apollo.query<MagentoGetGuestOrdersResponse>({\n query: getGuestOrders(this.extraOrderFragments),\n variables: {\n cartId,\n },\n }).pipe(\n map(validateGetOrdersResponse),\n map(result => result.data.graycoreGuestOrders.items.map(daffMagentoTransformOrder)),\n catchError(err => throwError(() => transformMagentoOrderError(err))),\n );\n }\n\n get(orderId: DaffOrder['id'], cartId?: DaffCart['id']): Observable<DaffOrder> {\n return this.list(cartId).pipe(\n map(orders => {\n for (const order of orders) {\n if (order.id === orderId) {\n return order;\n }\n }\n\n // order not found\n throw new DaffOrderNotFoundError(`Could not find an order with ID ${orderId}`);\n }),\n );\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffOrderMagentoService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderMagentoDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderMagentoDriverModule> {\n return {\n ngModule: DaffOrderMagentoDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffOrderMagentoService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;IAIY,qBAIX;AAJD,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,oBAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,GAI/B,EAAA,CAAA,CAAA,CAAA;AAAA,CAAC;AAYD,CAAC;AAyBD,CAAC;AAOD,CAAC;AAID;;ACbD,SAAS,eAAe,CAAC,MAAyB,EAAA;IAChD,OAAO;AACL,QAAA;AACE,YAAA,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,sBAAsB,CAAC,UAAU;AACvC,YAAA,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK;AAC/B,YAAA,UAAU,EAAE,CAAC;AACd,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,sBAAsB,CAAC,QAAQ;AACrC,YAAA,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK;AAC5B,YAAA,UAAU,EAAE,CAAC;AACd,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,sBAAsB,CAAC,QAAQ;AACrC,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AO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
@@ -19,8 +19,8 @@ class DaffTestingOrderService {
19
19
  return of(this.orderFactory.createMany(5));
20
20
  }
21
21
  }
22
- /** @nocollapse */ /** @nocollapse */ DaffTestingOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingOrderService, deps: [{ token: i1.DaffOrderFactory }], target: i0.ɵɵFactoryTarget.Injectable });
23
- /** @nocollapse */ /** @nocollapse */ DaffTestingOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingOrderService, providedIn: 'root' });
22
+ /** @nocollapse */ DaffTestingOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingOrderService, deps: [{ token: i1.DaffOrderFactory }], target: i0.ɵɵFactoryTarget.Injectable });
23
+ /** @nocollapse */ DaffTestingOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingOrderService, providedIn: 'root' });
24
24
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffTestingOrderService, decorators: [{
25
25
  type: Injectable,
26
26
  args: [{
@@ -41,9 +41,9 @@ class DaffOrderTestingDriverModule {
41
41
  };
42
42
  }
43
43
  }
44
- /** @nocollapse */ /** @nocollapse */ DaffOrderTestingDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
45
- /** @nocollapse */ /** @nocollapse */ DaffOrderTestingDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingDriverModule, imports: [CommonModule] });
46
- /** @nocollapse */ /** @nocollapse */ DaffOrderTestingDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingDriverModule, imports: [[
44
+ /** @nocollapse */ DaffOrderTestingDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
45
+ /** @nocollapse */ DaffOrderTestingDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingDriverModule, imports: [CommonModule] });
46
+ /** @nocollapse */ DaffOrderTestingDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingDriverModule, imports: [[
47
47
  CommonModule,
48
48
  ]] });
49
49
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingDriverModule, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-order-driver-testing.mjs","sources":["../../../libs/order/driver/testing/src/drivers/order.service.ts","../../../libs/order/driver/testing/src/drivers/order-driver.module.ts","../../../libs/order/driver/testing/src/daffodil-order-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffOrder } from '@daffodil/order';\nimport { DaffOrderServiceInterface } from '@daffodil/order/driver';\nimport { DaffOrderFactory } from '@daffodil/order/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingOrderService implements DaffOrderServiceInterface {\n\n constructor(\n private orderFactory: DaffOrderFactory,\n ) {}\n\n get(orderId: DaffOrder['id']): Observable<DaffOrder> {\n return of(this.orderFactory.create({ id: orderId }));\n }\n\n list(): Observable<DaffOrder[]> {\n return of(this.orderFactory.createMany(5));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffTestingOrderService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderTestingDriverModule> {\n return {\n ngModule: DaffOrderTestingDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffTestingOrderService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;AAEG;MAIU,uBAAuB,CAAA;AAElC,IAAA,WAAA,CACU,YAA8B,EAAA;QAA9B,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAkB;KACpC;AAEJ,IAAA,GAAG,CAAC,OAAwB,EAAA;AAC1B,QAAA,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;KACtD;IAED,IAAI,GAAA;QACF,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5C;;0JAZU,uBAAuB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,sCAAA,uBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFtB,MAAM,EAAA,CAAA,CAAA;2FAEP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCAY,4BAA4B,CAAA;AACvC,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,4BAA4B;AACtC,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,eAAe;AACxB,oBAAA,WAAW,EAAE,uBAAuB;AACrC,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;+JAXU,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAA5B,sCAAA,4BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,YAHrC,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,sCAAA,4BAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,EAJ9B,OAAA,EAAA,CAAA;YACP,YAAY;AACb,SAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBALxC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-order-driver-testing.mjs","sources":["../../../libs/order/driver/testing/src/drivers/order.service.ts","../../../libs/order/driver/testing/src/drivers/order-driver.module.ts","../../../libs/order/driver/testing/src/daffodil-order-driver-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n} from 'rxjs';\n\nimport { DaffOrder } from '@daffodil/order';\nimport { DaffOrderServiceInterface } from '@daffodil/order/driver';\nimport { DaffOrderFactory } from '@daffodil/order/testing';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffTestingOrderService implements DaffOrderServiceInterface {\n\n constructor(\n private orderFactory: DaffOrderFactory,\n ) {}\n\n get(orderId: DaffOrder['id']): Observable<DaffOrder> {\n return of(this.orderFactory.create({ id: orderId }));\n }\n\n list(): Observable<DaffOrder[]> {\n return of(this.orderFactory.createMany(5));\n }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n NgModule,\n ModuleWithProviders,\n} from '@angular/core';\n\nimport { DaffOrderDriver } from '@daffodil/order/driver';\n\nimport { DaffTestingOrderService } from './order.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n})\nexport class DaffOrderTestingDriverModule {\n static forRoot(): ModuleWithProviders<DaffOrderTestingDriverModule> {\n return {\n ngModule: DaffOrderTestingDriverModule,\n providers: [\n {\n provide: DaffOrderDriver,\n useExisting: DaffTestingOrderService,\n },\n ],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAUA;;AAEG;MAIU,uBAAuB,CAAA;AAElC,IAAA,WAAA,CACU,YAA8B,EAAA;QAA9B,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAkB;KACpC;AAEJ,IAAA,GAAG,CAAC,OAAwB,EAAA;AAC1B,QAAA,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;KACtD;IAED,IAAI,GAAA;QACF,OAAO,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5C;;uIAZU,uBAAuB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,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;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
@@ -24,8 +24,8 @@ class DaffPlacedOrderGuard {
24
24
  }));
25
25
  }
26
26
  }
27
- /** @nocollapse */ /** @nocollapse */ DaffPlacedOrderGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPlacedOrderGuard, deps: [{ token: i1.DaffOrderFacade }, { token: i2.Router }, { token: DaffPlacedOrderGuardRedirectUrl }], target: i0.ɵɵFactoryTarget.Injectable });
28
- /** @nocollapse */ /** @nocollapse */ DaffPlacedOrderGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPlacedOrderGuard, providedIn: 'root' });
27
+ /** @nocollapse */ DaffPlacedOrderGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPlacedOrderGuard, deps: [{ token: i1.DaffOrderFacade }, { token: i2.Router }, { token: DaffPlacedOrderGuardRedirectUrl }], target: i0.ɵɵFactoryTarget.Injectable });
28
+ /** @nocollapse */ DaffPlacedOrderGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPlacedOrderGuard, providedIn: 'root' });
29
29
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPlacedOrderGuard, decorators: [{
30
30
  type: Injectable,
31
31
  args: [{
@@ -38,9 +38,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
38
38
 
39
39
  class DaffOrderRoutingModule {
40
40
  }
41
- /** @nocollapse */ /** @nocollapse */ DaffOrderRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
42
- /** @nocollapse */ /** @nocollapse */ DaffOrderRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderRoutingModule });
43
- /** @nocollapse */ /** @nocollapse */ DaffOrderRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderRoutingModule, providers: [
41
+ /** @nocollapse */ DaffOrderRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
42
+ /** @nocollapse */ DaffOrderRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderRoutingModule });
43
+ /** @nocollapse */ DaffOrderRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderRoutingModule, providers: [
44
44
  { provide: DaffPlacedOrderGuardRedirectUrl, useValue: '/' },
45
45
  ] });
46
46
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderRoutingModule, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-order-routing.mjs","sources":["../../../libs/order/routing/src/guards/placed-order/placed-order-guard-redirect.token.ts","../../../libs/order/routing/src/guards/placed-order/placed-order.guard.ts","../../../libs/order/routing/src/order-routing.module.ts","../../../libs/order/routing/src/daffodil-order-routing.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const DaffPlacedOrderGuardRedirectUrl = new InjectionToken<string>('DaffPlacedOrderGuardRedirectUrl');\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n CanActivate,\n Router,\n} from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\nimport { DaffOrderFacade } from '@daffodil/order/state';\n\nimport { DaffPlacedOrderGuardRedirectUrl } from './placed-order-guard-redirect.token';\n\n/**\n * A routing guard that will redirect to a given url if the placed order is not defined.\n * The url is `/` by default, but can be overridden with the DaffPlacedOrderGuardRedirectUrl injection token.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPlacedOrderGuard implements CanActivate {\n constructor(\n private facade: DaffOrderFacade,\n private router: Router,\n @Inject(DaffPlacedOrderGuardRedirectUrl) private redirectUrl: string,\n ) {}\n\n canActivate(): Observable<boolean> {\n return this.facade.hasPlacedOrder$.pipe(\n tap(hasPlacedOrder => {\n if (!hasPlacedOrder) {\n this.router.navigateByUrl(this.redirectUrl);\n }\n }),\n );\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffPlacedOrderGuardRedirectUrl } from './guards/public_api';\n\n@NgModule({\n providers: [\n { provide: DaffPlacedOrderGuardRedirectUrl, useValue: '/' },\n ],\n})\nexport class DaffOrderRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAEa,+BAA+B,GAAG,IAAI,cAAc,CAAS,iCAAiC;;ACa3G;;;AAGG;MAIU,oBAAoB,CAAA;AAC/B,IAAA,WAAA,CACU,MAAuB,EACvB,MAAc,EAC2B,WAAmB,EAAA;QAF5D,IAAM,CAAA,MAAA,GAAN,MAAM,CAAiB;QACvB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QAC2B,IAAW,CAAA,WAAA,GAAX,WAAW,CAAQ;KAClE;IAEJ,WAAW,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CACrC,GAAG,CAAC,cAAc,IAAG;YACnB,IAAI,CAAC,cAAc,EAAE;gBACnB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;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AA,EAAE,OAAO,EAAE,+BAA+B,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC5D,qBAAA;AACF,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-order-routing.mjs","sources":["../../../libs/order/routing/src/guards/placed-order/placed-order-guard-redirect.token.ts","../../../libs/order/routing/src/guards/placed-order/placed-order.guard.ts","../../../libs/order/routing/src/order-routing.module.ts","../../../libs/order/routing/src/daffodil-order-routing.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const DaffPlacedOrderGuardRedirectUrl = new InjectionToken<string>('DaffPlacedOrderGuardRedirectUrl');\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n CanActivate,\n Router,\n} from '@angular/router';\nimport { Observable } from 'rxjs';\nimport { tap } from 'rxjs/operators';\n\nimport { DaffOrderFacade } from '@daffodil/order/state';\n\nimport { DaffPlacedOrderGuardRedirectUrl } from './placed-order-guard-redirect.token';\n\n/**\n * A routing guard that will redirect to a given url if the placed order is not defined.\n * The url is `/` by default, but can be overridden with the DaffPlacedOrderGuardRedirectUrl injection token.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPlacedOrderGuard implements CanActivate {\n constructor(\n private facade: DaffOrderFacade,\n private router: Router,\n @Inject(DaffPlacedOrderGuardRedirectUrl) private redirectUrl: string,\n ) {}\n\n canActivate(): Observable<boolean> {\n return this.facade.hasPlacedOrder$.pipe(\n tap(hasPlacedOrder => {\n if (!hasPlacedOrder) {\n this.router.navigateByUrl(this.redirectUrl);\n }\n }),\n );\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffPlacedOrderGuardRedirectUrl } from './guards/public_api';\n\n@NgModule({\n providers: [\n { provide: DaffPlacedOrderGuardRedirectUrl, useValue: '/' },\n ],\n})\nexport class DaffOrderRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAEa,+BAA+B,GAAG,IA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AAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;uIAAtB,sBAAsB,EAAA,CAAA,CAAA;AAAtB,mBAAA,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,EAJtB,SAAA,EAAA;AACT,QAAA,EAAE,OAAO,EAAE,+BAA+B,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC5D,KAAA,EAAA,CAAA,CAAA;2FAEU,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBALlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,+BAA+B,EAAE,QAAQ,EAAE,GAAG,EAAE;AAC5D,qBAAA;AACF,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
@@ -74,8 +74,8 @@ class MockDaffOrderFacade {
74
74
  dispatch(action) { }
75
75
  ;
76
76
  }
77
- /** @nocollapse */ /** @nocollapse */ MockDaffOrderFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffOrderFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
78
- /** @nocollapse */ /** @nocollapse */ MockDaffOrderFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffOrderFacade, providedIn: 'root' });
77
+ /** @nocollapse */ MockDaffOrderFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffOrderFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
78
+ /** @nocollapse */ MockDaffOrderFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffOrderFacade, providedIn: 'root' });
79
79
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffOrderFacade, decorators: [{
80
80
  type: Injectable,
81
81
  args: [{ providedIn: 'root' }]
@@ -83,9 +83,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
83
83
 
84
84
  class DaffOrderTestingModule {
85
85
  }
86
- /** @nocollapse */ /** @nocollapse */ DaffOrderTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
87
- /** @nocollapse */ /** @nocollapse */ DaffOrderTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingModule });
88
- /** @nocollapse */ /** @nocollapse */ DaffOrderTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingModule, providers: [
86
+ /** @nocollapse */ DaffOrderTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
87
+ /** @nocollapse */ DaffOrderTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingModule });
88
+ /** @nocollapse */ DaffOrderTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingModule, providers: [
89
89
  { provide: DaffOrderFacade, useExisting: MockDaffOrderFacade },
90
90
  ] });
91
91
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderTestingModule, decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-order-state-testing.mjs","sources":["../../../libs/order/state/testing/src/mock-order-facade.ts","../../../libs/order/state/testing/src/order-testing.module.ts","../../../libs/order/state/testing/src/daffodil-order-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport {\n DaffOrder,\n DaffOrderTotal,\n} from '@daffodil/order';\nimport { DaffOrderFacadeInterface } from '@daffodil/order/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffOrderFacade implements DaffOrderFacadeInterface {\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(null);\n errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject([]);\n\n orders$: BehaviorSubject<DaffOrder[]> = new BehaviorSubject([]);\n orderIds$: BehaviorSubject<DaffOrder['id'][]> = new BehaviorSubject([]);\n orderCount$: BehaviorSubject<number> = new BehaviorSubject(null);\n orderEntities$: BehaviorSubject<Dictionary<DaffOrder>> = new BehaviorSubject({});\n\n placedOrder$: BehaviorSubject<DaffOrder> = new BehaviorSubject(null);\n hasPlacedOrder$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n\n getOrder$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder> {\n return new BehaviorSubject(null);\n }\n\n getTotals$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['totals']> {\n return new BehaviorSubject([]);\n }\n\n getAppliedCodes$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['applied_codes']> {\n return new BehaviorSubject([]);\n }\n\n getItems$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['items']> {\n return new BehaviorSubject([]);\n }\n\n getBillingAddresses$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['billing_addresses']> {\n return new BehaviorSubject([]);\n }\n\n getShippingAddresses$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['shipping_addresses']> {\n return new BehaviorSubject([]);\n }\n\n getShipments$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['shipments']> {\n return new BehaviorSubject([]);\n }\n\n getPayment$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['payment']> {\n return new BehaviorSubject(null);\n }\n\n getInvoices$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['invoices']> {\n return new BehaviorSubject([]);\n }\n\n getCredits$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['credits']> {\n return new BehaviorSubject([]);\n }\n getGrandTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n getSubtotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n getShippingTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n getDiscountTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n hasDiscount$(orderId: DaffOrder['id']): BehaviorSubject<boolean> {\n return new BehaviorSubject(false);\n };\n getTaxTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffOrderFacade } from '@daffodil/order/state';\n\nimport { MockDaffOrderFacade } from './mock-order-facade';\n\n@NgModule({\n providers: [\n { provide: DaffOrderFacade, useExisting: MockDaffOrderFacade },\n ],\n})\nexport class DaffOrderTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAYA;;AAEG;MAEU,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/D,QAAA,IAAA,CAAA,OAAO,GAAsC,IAAI,eAAe,CAAC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EAAE,CAAA;;;MCJrB,sBAAsB,CAAA;;yJAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;0JAAtB,sBAAsB,EAAA,CAAA,CAAA;AAAtB,sCAAA,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,EAJtB,SAAA,EAAA;AACT,QAAA,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE;AAC/D,KAAA,EAAA,CAAA,CAAA;2FAEU,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBALlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE;AAC/D,qBAAA;AACF,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-order-state-testing.mjs","sources":["../../../libs/order/state/testing/src/mock-order-facade.ts","../../../libs/order/state/testing/src/order-testing.module.ts","../../../libs/order/state/testing/src/daffodil-order-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport {\n DaffOrder,\n DaffOrderTotal,\n} from '@daffodil/order';\nimport { DaffOrderFacadeInterface } from '@daffodil/order/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffOrderFacade implements DaffOrderFacadeInterface {\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(null);\n errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject([]);\n\n orders$: BehaviorSubject<DaffOrder[]> = new BehaviorSubject([]);\n orderIds$: BehaviorSubject<DaffOrder['id'][]> = new BehaviorSubject([]);\n orderCount$: BehaviorSubject<number> = new BehaviorSubject(null);\n orderEntities$: BehaviorSubject<Dictionary<DaffOrder>> = new BehaviorSubject({});\n\n placedOrder$: BehaviorSubject<DaffOrder> = new BehaviorSubject(null);\n hasPlacedOrder$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n\n getOrder$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder> {\n return new BehaviorSubject(null);\n }\n\n getTotals$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['totals']> {\n return new BehaviorSubject([]);\n }\n\n getAppliedCodes$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['applied_codes']> {\n return new BehaviorSubject([]);\n }\n\n getItems$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['items']> {\n return new BehaviorSubject([]);\n }\n\n getBillingAddresses$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['billing_addresses']> {\n return new BehaviorSubject([]);\n }\n\n getShippingAddresses$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['shipping_addresses']> {\n return new BehaviorSubject([]);\n }\n\n getShipments$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['shipments']> {\n return new BehaviorSubject([]);\n }\n\n getPayment$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['payment']> {\n return new BehaviorSubject(null);\n }\n\n getInvoices$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['invoices']> {\n return new BehaviorSubject([]);\n }\n\n getCredits$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrder['credits']> {\n return new BehaviorSubject([]);\n }\n getGrandTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n getSubtotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n getShippingTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n getDiscountTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n hasDiscount$(orderId: DaffOrder['id']): BehaviorSubject<boolean> {\n return new BehaviorSubject(false);\n };\n getTaxTotal$(orderId: DaffOrder['id']): BehaviorSubject<DaffOrderTotal> {\n return new BehaviorSubject(null);\n };\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffOrderFacade } from '@daffodil/order/state';\n\nimport { MockDaffOrderFacade } from './mock-order-facade';\n\n@NgModule({\n providers: [\n { provide: DaffOrderFacade, useExisting: MockDaffOrderFacade },\n ],\n})\nexport class DaffOrderTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAYA;;AAEG;MAEU,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/D,QAAA,IAAA,CAAA,OAAO,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;AAErE,QAAA,IAAA,CAAA,OAAO,GAAiC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;AAChE,QAAA,IAAA,CAAA,SAAS,GAAuC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;AACxE,QAAA,IAAA,CAAA,WAAW,GAA4B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AACjE,QAAA,IAAA,CAAA,cAAc,GAA2C,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;AAEjF,QAAA,IAAA,CAAA,YAAY,GAA+B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AACrE,QAAA,IAAA,CAAA,eAAe,GAA6B,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;AA6DxE,KAAA;AA3DC,IAAA,SAAS,CAAC,OAAwB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,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,mBAAmB,EAAE;AAC/D,qBAAA;AACF,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
@@ -332,8 +332,8 @@ class DaffOrderFacade {
332
332
  this.store.dispatch(action);
333
333
  }
334
334
  }
335
- /** @nocollapse */ /** @nocollapse */ DaffOrderFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
336
- /** @nocollapse */ /** @nocollapse */ DaffOrderFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderFacade, providedIn: 'root' });
335
+ /** @nocollapse */ DaffOrderFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
336
+ /** @nocollapse */ DaffOrderFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderFacade, providedIn: 'root' });
337
337
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderFacade, decorators: [{
338
338
  type: Injectable,
339
339
  args: [{
@@ -356,8 +356,8 @@ class DaffOrderEffects {
356
356
  this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffOrderActionTypes.OrderListAction), switchMap((action) => this.driver.list(action.payload).pipe(map(resp => new DaffOrderListSuccess(resp)), catchError((error) => of(new DaffOrderListFailure(this.errorMatcher(error))))))));
357
357
  }
358
358
  }
359
- /** @nocollapse */ /** @nocollapse */ DaffOrderEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderEffects, deps: [{ token: i1$1.Actions }, { token: DaffOrderDriver }, { token: DAFF_ORDER_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable });
360
- /** @nocollapse */ /** @nocollapse */ DaffOrderEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderEffects });
359
+ /** @nocollapse */ DaffOrderEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderEffects, deps: [{ token: i1$1.Actions }, { token: DaffOrderDriver }, { token: DAFF_ORDER_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable });
360
+ /** @nocollapse */ DaffOrderEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderEffects });
361
361
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderEffects, decorators: [{
362
362
  type: Injectable
363
363
  }], ctorParameters: function () { return [{ type: i1$1.Actions }, { type: undefined, decorators: [{
@@ -370,9 +370,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImpor
370
370
 
371
371
  class DaffOrderStateModule {
372
372
  }
373
- /** @nocollapse */ /** @nocollapse */ DaffOrderStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
374
- /** @nocollapse */ /** @nocollapse */ DaffOrderStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderStateModule, imports: [DaffCartStateModule, i1$1.EffectsFeatureModule, i1.StoreFeatureModule] });
375
- /** @nocollapse */ /** @nocollapse */ DaffOrderStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderStateModule, imports: [[
373
+ /** @nocollapse */ DaffOrderStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
374
+ /** @nocollapse */ DaffOrderStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderStateModule, imports: [DaffCartStateModule, i1$1.EffectsFeatureModule, i1.StoreFeatureModule] });
375
+ /** @nocollapse */ DaffOrderStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffOrderStateModule, imports: [[
376
376
  DaffCartStateModule,
377
377
  EffectsModule.forFeature([
378
378
  DaffOrderEffects,