@daffodil/order 0.94.1 → 0.95.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/fesm2022/daffodil-order-driver-in-memory.mjs +191 -159
  2. package/fesm2022/daffodil-order-driver-in-memory.mjs.map +1 -1
  3. package/fesm2022/daffodil-order-driver-magento-2.4.0-testing.mjs +0 -4
  4. package/fesm2022/daffodil-order-driver-magento-2.4.0.mjs +288 -297
  5. package/fesm2022/daffodil-order-driver-magento-2.4.0.mjs.map +1 -1
  6. package/fesm2022/daffodil-order-driver-magento-2.4.1-testing.mjs +813 -424
  7. package/fesm2022/daffodil-order-driver-magento-2.4.1-testing.mjs.map +1 -1
  8. package/fesm2022/daffodil-order-driver-magento-2.4.1.mjs +370 -428
  9. package/fesm2022/daffodil-order-driver-magento-2.4.1.mjs.map +1 -1
  10. package/fesm2022/daffodil-order-driver-magento-auto-testing.mjs +7 -0
  11. package/fesm2022/daffodil-order-driver-magento-auto-testing.mjs.map +1 -0
  12. package/fesm2022/daffodil-order-driver-magento-auto.mjs +7 -0
  13. package/fesm2022/daffodil-order-driver-magento-auto.mjs.map +1 -0
  14. package/fesm2022/daffodil-order-driver-testing.mjs +113 -74
  15. package/fesm2022/daffodil-order-driver-testing.mjs.map +1 -1
  16. package/fesm2022/daffodil-order-driver.mjs +18 -29
  17. package/fesm2022/daffodil-order-driver.mjs.map +1 -1
  18. package/fesm2022/daffodil-order-state-testing.mjs +147 -111
  19. package/fesm2022/daffodil-order-state-testing.mjs.map +1 -1
  20. package/fesm2022/daffodil-order-state.mjs +547 -546
  21. package/fesm2022/daffodil-order-state.mjs.map +1 -1
  22. package/fesm2022/daffodil-order-testing.mjs +841 -470
  23. package/fesm2022/daffodil-order-testing.mjs.map +1 -1
  24. package/fesm2022/daffodil-order.mjs +12 -17
  25. package/fesm2022/daffodil-order.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/types/daffodil-order-driver-in-memory.d.ts +53 -51
  28. package/types/daffodil-order-driver-magento-2.4.0-testing.d.ts +1 -2
  29. package/types/daffodil-order-driver-magento-2.4.0.d.ts +142 -158
  30. package/types/daffodil-order-driver-magento-2.4.1-testing.d.ts +238 -258
  31. package/types/daffodil-order-driver-magento-2.4.1.d.ts +205 -234
  32. package/types/daffodil-order-driver-magento-auto-testing.d.ts +1 -0
  33. package/types/daffodil-order-driver-magento-auto.d.ts +1 -0
  34. package/types/daffodil-order-driver-testing.d.ts +27 -24
  35. package/types/daffodil-order-driver.d.ts +23 -31
  36. package/types/daffodil-order-state-testing.d.ts +52 -47
  37. package/types/daffodil-order-state.d.ts +293 -317
  38. package/types/daffodil-order-testing.d.ts +228 -246
  39. package/types/daffodil-order.d.ts +141 -158
  40. package/fesm2022/daffodil-order-driver-magento-2.4.0-testing.mjs.map +0 -1
@@ -1,425 +1,814 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable } from '@angular/core';
3
- import { faker } from '@faker-js/faker/locale/en_US';
4
- import { DaffModelFactory, enforceUnique } from '@daffodil/core/testing';
5
- import * as i1 from '@daffodil/driver/magento/testing';
6
- import { MagentoOrderItemTypenames, MagentoOrderItemType } from '@daffodil/order/driver/magento/2.4.1';
7
-
8
- class MockMagentoOrderBundleItemSelectedOptionValue {
9
- constructor(moneyFactory) {
10
- this.moneyFactory = moneyFactory;
11
- this.product_name = faker.lorem.word();
12
- this.product_sku = faker.string.uuid();
13
- this.quantity = faker.number.int({ min: 1, max: 1000 });
14
- this.price = this.moneyFactory.create();
15
- }
16
- }
17
- class MagentoOrderBundleItemSelectedOptionValueFactory extends DaffModelFactory {
18
- constructor(moneyFactory) {
19
- super(MockMagentoOrderBundleItemSelectedOptionValue, moneyFactory);
20
- }
21
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemSelectedOptionValueFactory, deps: [{ token: i1.MagentoMoneyFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
22
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemSelectedOptionValueFactory, providedIn: 'root' }); }
23
- }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemSelectedOptionValueFactory, decorators: [{
25
- type: Injectable,
26
- args: [{
27
- providedIn: 'root',
28
- }]
29
- }], ctorParameters: () => [{ type: i1.MagentoMoneyFactory }] });
30
-
31
- class MockMagentoOrderBundleItemSelectedOption {
32
- constructor(valueFactory) {
33
- this.valueFactory = valueFactory;
34
- this.label = faker.lorem.word();
35
- this.values = this.valueFactory.createMany(faker.number.int({ min: 1, max: 5 }));
36
- }
37
- }
38
- class MagentoOrderBundleItemSelectedOptionFactory extends DaffModelFactory {
39
- constructor(valueFactory) {
40
- super(MockMagentoOrderBundleItemSelectedOption, valueFactory);
41
- }
42
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemSelectedOptionFactory, deps: [{ token: MagentoOrderBundleItemSelectedOptionValueFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
43
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemSelectedOptionFactory, providedIn: 'root' }); }
44
- }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemSelectedOptionFactory, decorators: [{
46
- type: Injectable,
47
- args: [{
48
- providedIn: 'root',
49
- }]
50
- }], ctorParameters: () => [{ type: MagentoOrderBundleItemSelectedOptionValueFactory }] });
51
-
52
- class MockOrderItem {
53
- constructor(discountFactory, moneyFactory) {
54
- this.discountFactory = discountFactory;
55
- this.moneyFactory = moneyFactory;
56
- this.__typename = MagentoOrderItemTypenames.OrderItem;
57
- this.quantity_canceled = faker.number.int({ min: 1, max: 1000 });
58
- this.quantity_invoiced = faker.number.int({ min: 1, max: 1000 });
59
- this.quantity_ordered = faker.number.int({ min: 1, max: 1000 });
60
- this.quantity_refunded = faker.number.int({ min: 1, max: 1000 });
61
- this.quantity_returned = faker.number.int({ min: 1, max: 1000 });
62
- this.quantity_shipped = faker.number.int({ min: 1, max: 1000 });
63
- this.product_sku = faker.string.alphanumeric(20);
64
- this.product_type = MagentoOrderItemType.Simple;
65
- this.selected_options = [];
66
- this.entered_options = [];
67
- this.status = faker.lorem.word();
68
- this.product_sale_price = this.moneyFactory.create();
69
- this.product_name = faker.lorem.word();
70
- this.product_url_key = faker.lorem.word();
71
- this.discounts = this.createDiscounts();
72
- }
73
- createDiscounts() {
74
- return this.discountFactory.createMany(faker.number.int({ min: 1, max: 3 }));
75
- }
76
- }
77
- class MagentoOrderItemFactory extends DaffModelFactory {
78
- constructor(discountFactory, moneyFactory) {
79
- super(MockOrderItem, discountFactory, moneyFactory);
80
- }
81
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderItemFactory, deps: [{ token: i1.MagentoDiscountFactory }, { token: i1.MagentoMoneyFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
82
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderItemFactory, providedIn: 'root' }); }
83
- }
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderItemFactory, decorators: [{
85
- type: Injectable,
86
- args: [{
87
- providedIn: 'root',
88
- }]
89
- }], ctorParameters: () => [{ type: i1.MagentoDiscountFactory }, { type: i1.MagentoMoneyFactory }] });
90
-
91
- class MockBundleOrderItem extends MockOrderItem {
92
- constructor(optionFactory, discountFactory, moneyFactory) {
93
- super(discountFactory, moneyFactory);
94
- this.optionFactory = optionFactory;
95
- this.__typename = MagentoOrderItemTypenames.BundleOrderItem;
96
- this.type = MagentoOrderItemType.Bundle;
97
- this.bundle_options = this.optionFactory.createMany(faker.number.int({ min: 1, max: 5 }));
98
- }
99
- }
100
- class MagentoOrderBundleItemFactory extends DaffModelFactory {
101
- constructor(optionFactory, discountFactory, moneyFactory) {
102
- super(MockBundleOrderItem, optionFactory, discountFactory, moneyFactory);
103
- }
104
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemFactory, deps: [{ token: MagentoOrderBundleItemSelectedOptionFactory }, { token: i1.MagentoDiscountFactory }, { token: i1.MagentoMoneyFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
105
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemFactory, providedIn: 'root' }); }
106
- }
107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderBundleItemFactory, decorators: [{
108
- type: Injectable,
109
- args: [{
110
- providedIn: 'root',
111
- }]
112
- }], ctorParameters: () => [{ type: MagentoOrderBundleItemSelectedOptionFactory }, { type: i1.MagentoDiscountFactory }, { type: i1.MagentoMoneyFactory }] });
113
-
114
- class MockOrderAddress {
115
- constructor() {
116
- this.__typename = 'OrderAddress';
117
- this.street = [faker.location.street()];
118
- this.city = faker.location.city();
119
- this.region_id = enforceUnique(faker.number.int);
120
- this.region_code = faker.location.state({ abbreviated: true });
121
- this.postcode = faker.location.zipCode();
122
- this.country = faker.location.countryCode();
123
- this.country_code = faker.location.countryCode();
124
- this.prefix = faker.person.prefix();
125
- this.suffix = faker.person.suffix();
126
- this.firstname = faker.person.firstName();
127
- this.middlename = faker.person.firstName();
128
- this.lastname = faker.person.lastName();
129
- this.telephone = faker.phone.number();
130
- this.fax = faker.phone.number();
131
- this.company = faker.company.name();
132
- }
133
- }
134
- class MagentoOrderAddressFactory extends DaffModelFactory {
135
- constructor() {
136
- super(MockOrderAddress);
137
- }
138
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
139
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderAddressFactory, providedIn: 'root' }); }
140
- }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderAddressFactory, decorators: [{
142
- type: Injectable,
143
- args: [{
144
- providedIn: 'root',
145
- }]
146
- }], ctorParameters: () => [] });
147
-
148
- class MockOrderCreditItem {
149
- constructor(itemFactory) {
150
- this.itemFactory = itemFactory;
151
- this.__typename = 'CreditMemoItem';
152
- this.order_item = this.itemFactory.create();
153
- this.quantity_refunded = faker.number.int({ min: 1, max: 100 });
154
- }
155
- }
156
- ;
157
- class MagentoOrderCreditItemFactory extends DaffModelFactory {
158
- constructor(itemFactory) {
159
- super(MockOrderCreditItem, itemFactory);
160
- }
161
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderCreditItemFactory, deps: [{ token: MagentoOrderItemFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
162
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderCreditItemFactory, providedIn: 'root' }); }
163
- }
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderCreditItemFactory, decorators: [{
165
- type: Injectable,
166
- args: [{
167
- providedIn: 'root',
168
- }]
169
- }], ctorParameters: () => [{ type: MagentoOrderItemFactory }] });
170
-
171
- class MockOrderTotal {
172
- constructor(moneyFactory, discountFactory) {
173
- this.moneyFactory = moneyFactory;
174
- this.discountFactory = discountFactory;
175
- this.discounts = this.createDiscounts();
176
- this.grand_total = this.createMoney();
177
- this.subtotal = this.createMoney();
178
- this.total_shipping = this.createMoney();
179
- this.total_tax = this.createMoney();
180
- }
181
- createMoney() {
182
- return this.moneyFactory.create();
183
- }
184
- createDiscounts() {
185
- return this.discountFactory.createMany(faker.number.int({ min: 1, max: 3 }));
186
- }
187
- }
188
- ;
189
- class MagentoOrderTotalFactory extends DaffModelFactory {
190
- constructor(moneyFactory, discountFactory) {
191
- super(MockOrderTotal, moneyFactory, discountFactory);
192
- }
193
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderTotalFactory, deps: [{ token: i1.MagentoMoneyFactory }, { token: i1.MagentoDiscountFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
194
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderTotalFactory, providedIn: 'root' }); }
195
- }
196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderTotalFactory, decorators: [{
197
- type: Injectable,
198
- args: [{
199
- providedIn: 'root',
200
- }]
201
- }], ctorParameters: () => [{ type: i1.MagentoMoneyFactory }, { type: i1.MagentoDiscountFactory }] });
202
-
203
- class MockOrderCredit {
204
- constructor(itemFactory, totalFactory) {
205
- this.itemFactory = itemFactory;
206
- this.totalFactory = totalFactory;
207
- this.__typename = 'CreditMemo';
208
- this.items = this.itemFactory.createMany(faker.number.int({ min: 1, max: 3 }));
209
- this.total = this.totalFactory.create({
210
- __typename: 'CreditMemoTotal',
211
- });
212
- }
213
- }
214
- ;
215
- class MagentoOrderCreditFactory extends DaffModelFactory {
216
- constructor(itemFactory, totalFactory) {
217
- super(MockOrderCredit, itemFactory, totalFactory);
218
- }
219
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderCreditFactory, deps: [{ token: MagentoOrderCreditItemFactory }, { token: MagentoOrderTotalFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
220
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderCreditFactory, providedIn: 'root' }); }
221
- }
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderCreditFactory, decorators: [{
223
- type: Injectable,
224
- args: [{
225
- providedIn: 'root',
226
- }]
227
- }], ctorParameters: () => [{ type: MagentoOrderCreditItemFactory }, { type: MagentoOrderTotalFactory }] });
228
-
229
- class MockOrderInvoiceItem {
230
- constructor(itemFactory) {
231
- this.itemFactory = itemFactory;
232
- this.__typename = 'InvoiceItem';
233
- this.order_item = this.itemFactory.create();
234
- this.quantity_invoiced = faker.number.int({ min: 1, max: 100 });
235
- }
236
- }
237
- ;
238
- class MagentoOrderInvoiceItemFactory extends DaffModelFactory {
239
- constructor(itemFactory) {
240
- super(MockOrderInvoiceItem, itemFactory);
241
- }
242
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderInvoiceItemFactory, deps: [{ token: MagentoOrderItemFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
243
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderInvoiceItemFactory, providedIn: 'root' }); }
244
- }
245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderInvoiceItemFactory, decorators: [{
246
- type: Injectable,
247
- args: [{
248
- providedIn: 'root',
249
- }]
250
- }], ctorParameters: () => [{ type: MagentoOrderItemFactory }] });
251
-
252
- class MockOrderInvoice {
253
- constructor(itemFactory, totalFactory) {
254
- this.itemFactory = itemFactory;
255
- this.totalFactory = totalFactory;
256
- this.__typename = 'Invoice';
257
- this.items = this.itemFactory.createMany(faker.number.int({ min: 1, max: 3 }));
258
- this.total = this.totalFactory.create({
259
- __typename: 'InvoiceTotal',
260
- });
261
- }
262
- }
263
- ;
264
- class MagentoOrderInvoiceFactory extends DaffModelFactory {
265
- constructor(itemFactory, totalFactory) {
266
- super(MockOrderInvoice, itemFactory, totalFactory);
267
- }
268
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderInvoiceFactory, deps: [{ token: MagentoOrderInvoiceItemFactory }, { token: MagentoOrderTotalFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
269
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderInvoiceFactory, providedIn: 'root' }); }
270
- }
271
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderInvoiceFactory, decorators: [{
272
- type: Injectable,
273
- args: [{
274
- providedIn: 'root',
275
- }]
276
- }], ctorParameters: () => [{ type: MagentoOrderInvoiceItemFactory }, { type: MagentoOrderTotalFactory }] });
277
-
278
- class MockOrderPayment {
279
- constructor() {
280
- this.__typename = 'OrderPaymentMethod';
281
- this.name = 'card';
282
- this.type = 'visa';
283
- this.additional_data = [];
284
- }
285
- }
286
- class MagentoOrderPaymentFactory extends DaffModelFactory {
287
- constructor() {
288
- super(MockOrderPayment);
289
- }
290
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderPaymentFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
291
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderPaymentFactory, providedIn: 'root' }); }
292
- }
293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderPaymentFactory, decorators: [{
294
- type: Injectable,
295
- args: [{
296
- providedIn: 'root',
297
- }]
298
- }], ctorParameters: () => [] });
299
-
300
- class MockOrderShipmentItem {
301
- constructor(itemFactory) {
302
- this.itemFactory = itemFactory;
303
- this.__typename = 'ShipmentItem';
304
- this.order_item = this.itemFactory.create();
305
- this.quantity_shipped = faker.number.int({ min: 1, max: 100 });
306
- }
307
- }
308
- ;
309
- class MagentoOrderShipmentItemFactory extends DaffModelFactory {
310
- constructor(itemFactory) {
311
- super(MockOrderShipmentItem, itemFactory);
312
- }
313
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentItemFactory, deps: [{ token: MagentoOrderItemFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
314
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentItemFactory, providedIn: 'root' }); }
315
- }
316
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentItemFactory, decorators: [{
317
- type: Injectable,
318
- args: [{
319
- providedIn: 'root',
320
- }]
321
- }], ctorParameters: () => [{ type: MagentoOrderItemFactory }] });
322
-
323
- class MockOrderShipmentTracking {
324
- constructor() {
325
- this.__typename = 'ShipmentTracking';
326
- // eslint-disable-next-line id-blacklist
327
- this.number = faker.string.alphanumeric(16);
328
- this.carrier = faker.lorem.word();
329
- this.title = faker.lorem.word();
330
- }
331
- }
332
- ;
333
- class MagentoOrderShipmentTrackingFactory extends DaffModelFactory {
334
- constructor() {
335
- super(MockOrderShipmentTracking);
336
- }
337
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentTrackingFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
338
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentTrackingFactory, providedIn: 'root' }); }
339
- }
340
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentTrackingFactory, decorators: [{
341
- type: Injectable,
342
- args: [{
343
- providedIn: 'root',
344
- }]
345
- }], ctorParameters: () => [] });
346
-
347
- class MockOrderShipment {
348
- constructor(trackingFactory, itemFactory) {
349
- this.trackingFactory = trackingFactory;
350
- this.itemFactory = itemFactory;
351
- this.__typename = 'OrderShipment';
352
- this.tracking = this.createTracking();
353
- this.items = this.createItems();
354
- }
355
- createTracking() {
356
- return this.trackingFactory.createMany(faker.number.int({ min: 1, max: 3 }));
357
- }
358
- createItems() {
359
- return this.itemFactory.createMany(faker.number.int({ min: 1, max: 3 }));
360
- }
361
- }
362
- ;
363
- class MagentoOrderShipmentFactory extends DaffModelFactory {
364
- constructor(trackingFactory, itemFactory) {
365
- super(MockOrderShipment, trackingFactory, itemFactory);
366
- }
367
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentFactory, deps: [{ token: MagentoOrderShipmentTrackingFactory }, { token: MagentoOrderShipmentItemFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
368
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentFactory, providedIn: 'root' }); }
369
- }
370
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderShipmentFactory, decorators: [{
371
- type: Injectable,
372
- args: [{
373
- providedIn: 'root',
374
- }]
375
- }], ctorParameters: () => [{ type: MagentoOrderShipmentTrackingFactory }, { type: MagentoOrderShipmentItemFactory }] });
376
-
377
- class MockOrder {
378
- constructor(totalFactory, itemFactory, addressFactory, shipmentFactory, paymentFactory, invoiceFactory, creditFactory) {
379
- this.totalFactory = totalFactory;
380
- this.itemFactory = itemFactory;
381
- this.addressFactory = addressFactory;
382
- this.shipmentFactory = shipmentFactory;
383
- this.paymentFactory = paymentFactory;
384
- this.invoiceFactory = invoiceFactory;
385
- this.creditFactory = creditFactory;
386
- this.__typename = 'GraycoreGuestOrder';
387
- this.id = faker.string.uuid();
388
- // eslint-disable-next-line id-blacklist
389
- this.number = faker.string.uuid();
390
- this.email = faker.internet.email();
391
- this.order_date = faker.date.past().toString();
392
- this.status = faker.lorem.word();
393
- this.carrier = faker.lorem.word();
394
- this.shipping_method = faker.lorem.word();
395
- this.total = this.totalFactory.create();
396
- this.items = this.itemFactory.createMany(faker.number.int({ min: 1, max: 5 }));
397
- this.billing_address = this.addressFactory.create();
398
- this.shipping_address = this.addressFactory.create();
399
- this.shipments = this.shipmentFactory.createMany(faker.number.int({ min: 1, max: 3 }));
400
- this.payment_methods = this.paymentFactory.createMany(faker.number.int({ min: 1, max: 3 }));
401
- this.invoices = this.invoiceFactory.createMany(faker.number.int({ min: 1, max: 3 }));
402
- this.credit_memos = this.creditFactory.createMany(faker.number.int({ min: 1, max: 3 }));
403
- }
404
- }
405
- ;
406
- class MagentoOrderFactory extends DaffModelFactory {
407
- constructor(totalFactory, itemFactory, addressFactory, shipmentFactory, paymentFactory, invoiceFactory, creditFactory) {
408
- super(MockOrder, totalFactory, itemFactory, addressFactory, shipmentFactory, paymentFactory, invoiceFactory, creditFactory);
409
- }
410
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderFactory, deps: [{ token: MagentoOrderTotalFactory }, { token: MagentoOrderItemFactory }, { token: MagentoOrderAddressFactory }, { token: MagentoOrderShipmentFactory }, { token: MagentoOrderPaymentFactory }, { token: MagentoOrderInvoiceFactory }, { token: MagentoOrderCreditFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
411
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderFactory, providedIn: 'root' }); }
412
- }
413
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MagentoOrderFactory, decorators: [{
414
- type: Injectable,
415
- args: [{
416
- providedIn: 'root',
417
- }]
418
- }], ctorParameters: () => [{ type: MagentoOrderTotalFactory }, { type: MagentoOrderItemFactory }, { type: MagentoOrderAddressFactory }, { type: MagentoOrderShipmentFactory }, { type: MagentoOrderPaymentFactory }, { type: MagentoOrderInvoiceFactory }, { type: MagentoOrderCreditFactory }] });
419
-
420
- /**
421
- * Generated bundle index. Do not edit.
422
- */
423
-
1
+ import * as i0 from "@angular/core";
2
+ import { Injectable } from "@angular/core";
3
+ import { faker } from "@faker-js/faker/locale/en_US";
4
+ import { DaffModelFactory, enforceUnique } from "@daffodil/core/testing";
5
+ import * as i1 from "@daffodil/driver/magento/2.4.7/testing";
6
+ import { MagentoOrderItemType, MagentoOrderItemTypenames } from "@daffodil/order/driver/magento/2.4.1";
7
+ var MockMagentoOrderBundleItemSelectedOptionValue = class {
8
+ constructor(moneyFactory) {
9
+ this.moneyFactory = moneyFactory;
10
+ this.product_name = faker.lorem.word();
11
+ this.product_sku = faker.string.uuid();
12
+ this.quantity = faker.number.int({
13
+ min: 1,
14
+ max: 1e3
15
+ });
16
+ this.price = this.moneyFactory.create();
17
+ }
18
+ };
19
+ var MagentoOrderBundleItemSelectedOptionValueFactory = class MagentoOrderBundleItemSelectedOptionValueFactory extends DaffModelFactory {
20
+ constructor(moneyFactory) {
21
+ super(MockMagentoOrderBundleItemSelectedOptionValue, moneyFactory);
22
+ }
23
+ static {
24
+ this.ɵfac = i0.ɵɵngDeclareFactory({
25
+ minVersion: "12.0.0",
26
+ version: "22.2.4",
27
+ ngImport: i0,
28
+ type: MagentoOrderBundleItemSelectedOptionValueFactory,
29
+ deps: [{ token: i1.MagentoMoneyFactory }],
30
+ target: i0.ɵɵFactoryTarget.Injectable
31
+ });
32
+ }
33
+ static {
34
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
35
+ minVersion: "12.0.0",
36
+ version: "22.2.4",
37
+ ngImport: i0,
38
+ type: MagentoOrderBundleItemSelectedOptionValueFactory,
39
+ providedIn: "root"
40
+ });
41
+ }
42
+ };
43
+ i0.ɵɵngDeclareClassMetadata({
44
+ minVersion: "12.0.0",
45
+ version: "22.2.4",
46
+ ngImport: i0,
47
+ type: MagentoOrderBundleItemSelectedOptionValueFactory,
48
+ decorators: [{
49
+ type: Injectable,
50
+ args: [{ providedIn: "root" }]
51
+ }],
52
+ ctorParameters: () => [{ type: i1.MagentoMoneyFactory }]
53
+ });
54
+ var MockMagentoOrderBundleItemSelectedOption = class {
55
+ constructor(valueFactory) {
56
+ this.valueFactory = valueFactory;
57
+ this.label = faker.lorem.word();
58
+ this.values = this.valueFactory.createMany(faker.number.int({
59
+ min: 1,
60
+ max: 5
61
+ }));
62
+ }
63
+ };
64
+ var MagentoOrderBundleItemSelectedOptionFactory = class MagentoOrderBundleItemSelectedOptionFactory extends DaffModelFactory {
65
+ constructor(valueFactory) {
66
+ super(MockMagentoOrderBundleItemSelectedOption, valueFactory);
67
+ }
68
+ static {
69
+ this.ɵfac = i0.ɵɵngDeclareFactory({
70
+ minVersion: "12.0.0",
71
+ version: "22.2.4",
72
+ ngImport: i0,
73
+ type: MagentoOrderBundleItemSelectedOptionFactory,
74
+ deps: [{ token: MagentoOrderBundleItemSelectedOptionValueFactory }],
75
+ target: i0.ɵɵFactoryTarget.Injectable
76
+ });
77
+ }
78
+ static {
79
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
80
+ minVersion: "12.0.0",
81
+ version: "22.2.4",
82
+ ngImport: i0,
83
+ type: MagentoOrderBundleItemSelectedOptionFactory,
84
+ providedIn: "root"
85
+ });
86
+ }
87
+ };
88
+ i0.ɵɵngDeclareClassMetadata({
89
+ minVersion: "12.0.0",
90
+ version: "22.2.4",
91
+ ngImport: i0,
92
+ type: MagentoOrderBundleItemSelectedOptionFactory,
93
+ decorators: [{
94
+ type: Injectable,
95
+ args: [{ providedIn: "root" }]
96
+ }],
97
+ ctorParameters: () => [{ type: MagentoOrderBundleItemSelectedOptionValueFactory }]
98
+ });
99
+ var MockOrderItem = class {
100
+ constructor(discountFactory, moneyFactory) {
101
+ this.discountFactory = discountFactory;
102
+ this.moneyFactory = moneyFactory;
103
+ this.__typename = MagentoOrderItemTypenames.OrderItem;
104
+ this.quantity_canceled = faker.number.int({
105
+ min: 1,
106
+ max: 1e3
107
+ });
108
+ this.quantity_invoiced = faker.number.int({
109
+ min: 1,
110
+ max: 1e3
111
+ });
112
+ this.quantity_ordered = faker.number.int({
113
+ min: 1,
114
+ max: 1e3
115
+ });
116
+ this.quantity_refunded = faker.number.int({
117
+ min: 1,
118
+ max: 1e3
119
+ });
120
+ this.quantity_returned = faker.number.int({
121
+ min: 1,
122
+ max: 1e3
123
+ });
124
+ this.quantity_shipped = faker.number.int({
125
+ min: 1,
126
+ max: 1e3
127
+ });
128
+ this.product_sku = faker.string.alphanumeric(20);
129
+ this.product_type = MagentoOrderItemType.Simple;
130
+ this.selected_options = [];
131
+ this.entered_options = [];
132
+ this.status = faker.lorem.word();
133
+ this.product_sale_price = this.moneyFactory.create();
134
+ this.product_name = faker.lorem.word();
135
+ this.product_url_key = faker.lorem.word();
136
+ this.discounts = this.createDiscounts();
137
+ }
138
+ createDiscounts() {
139
+ return this.discountFactory.createMany(faker.number.int({
140
+ min: 1,
141
+ max: 3
142
+ }));
143
+ }
144
+ };
145
+ var MagentoOrderItemFactory = class MagentoOrderItemFactory extends DaffModelFactory {
146
+ constructor(discountFactory, moneyFactory) {
147
+ super(MockOrderItem, discountFactory, moneyFactory);
148
+ }
149
+ static {
150
+ this.ɵfac = i0.ɵɵngDeclareFactory({
151
+ minVersion: "12.0.0",
152
+ version: "22.2.4",
153
+ ngImport: i0,
154
+ type: MagentoOrderItemFactory,
155
+ deps: [{ token: i1.MagentoDiscountFactory }, { token: i1.MagentoMoneyFactory }],
156
+ target: i0.ɵɵFactoryTarget.Injectable
157
+ });
158
+ }
159
+ static {
160
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
161
+ minVersion: "12.0.0",
162
+ version: "22.2.4",
163
+ ngImport: i0,
164
+ type: MagentoOrderItemFactory,
165
+ providedIn: "root"
166
+ });
167
+ }
168
+ };
169
+ i0.ɵɵngDeclareClassMetadata({
170
+ minVersion: "12.0.0",
171
+ version: "22.2.4",
172
+ ngImport: i0,
173
+ type: MagentoOrderItemFactory,
174
+ decorators: [{
175
+ type: Injectable,
176
+ args: [{ providedIn: "root" }]
177
+ }],
178
+ ctorParameters: () => [{ type: i1.MagentoDiscountFactory }, { type: i1.MagentoMoneyFactory }]
179
+ });
180
+ var MockBundleOrderItem = class extends MockOrderItem {
181
+ constructor(optionFactory, discountFactory, moneyFactory) {
182
+ super(discountFactory, moneyFactory);
183
+ this.optionFactory = optionFactory;
184
+ this.__typename = MagentoOrderItemTypenames.BundleOrderItem;
185
+ this.type = MagentoOrderItemType.Bundle;
186
+ this.bundle_options = this.optionFactory.createMany(faker.number.int({
187
+ min: 1,
188
+ max: 5
189
+ }));
190
+ }
191
+ };
192
+ var MagentoOrderBundleItemFactory = class MagentoOrderBundleItemFactory extends DaffModelFactory {
193
+ constructor(optionFactory, discountFactory, moneyFactory) {
194
+ super(MockBundleOrderItem, optionFactory, discountFactory, moneyFactory);
195
+ }
196
+ static {
197
+ this.ɵfac = i0.ɵɵngDeclareFactory({
198
+ minVersion: "12.0.0",
199
+ version: "22.2.4",
200
+ ngImport: i0,
201
+ type: MagentoOrderBundleItemFactory,
202
+ deps: [
203
+ { token: MagentoOrderBundleItemSelectedOptionFactory },
204
+ { token: i1.MagentoDiscountFactory },
205
+ { token: i1.MagentoMoneyFactory }
206
+ ],
207
+ target: i0.ɵɵFactoryTarget.Injectable
208
+ });
209
+ }
210
+ static {
211
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
212
+ minVersion: "12.0.0",
213
+ version: "22.2.4",
214
+ ngImport: i0,
215
+ type: MagentoOrderBundleItemFactory,
216
+ providedIn: "root"
217
+ });
218
+ }
219
+ };
220
+ i0.ɵɵngDeclareClassMetadata({
221
+ minVersion: "12.0.0",
222
+ version: "22.2.4",
223
+ ngImport: i0,
224
+ type: MagentoOrderBundleItemFactory,
225
+ decorators: [{
226
+ type: Injectable,
227
+ args: [{ providedIn: "root" }]
228
+ }],
229
+ ctorParameters: () => [
230
+ { type: MagentoOrderBundleItemSelectedOptionFactory },
231
+ { type: i1.MagentoDiscountFactory },
232
+ { type: i1.MagentoMoneyFactory }
233
+ ]
234
+ });
235
+ var MockOrderAddress = class {
236
+ constructor() {
237
+ this.__typename = "OrderAddress";
238
+ this.street = [faker.location.street()];
239
+ this.city = faker.location.city();
240
+ this.region_id = enforceUnique(faker.number.int);
241
+ this.region_code = faker.location.state({ abbreviated: true });
242
+ this.postcode = faker.location.zipCode();
243
+ this.country = faker.location.countryCode();
244
+ this.country_code = faker.location.countryCode();
245
+ this.prefix = faker.person.prefix();
246
+ this.suffix = faker.person.suffix();
247
+ this.firstname = faker.person.firstName();
248
+ this.middlename = faker.person.firstName();
249
+ this.lastname = faker.person.lastName();
250
+ this.telephone = faker.phone.number();
251
+ this.fax = faker.phone.number();
252
+ this.company = faker.company.name();
253
+ }
254
+ };
255
+ var MagentoOrderAddressFactory = class MagentoOrderAddressFactory extends DaffModelFactory {
256
+ constructor() {
257
+ super(MockOrderAddress);
258
+ }
259
+ static {
260
+ this.ɵfac = i0.ɵɵngDeclareFactory({
261
+ minVersion: "12.0.0",
262
+ version: "22.2.4",
263
+ ngImport: i0,
264
+ type: MagentoOrderAddressFactory,
265
+ deps: [],
266
+ target: i0.ɵɵFactoryTarget.Injectable
267
+ });
268
+ }
269
+ static {
270
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
271
+ minVersion: "12.0.0",
272
+ version: "22.2.4",
273
+ ngImport: i0,
274
+ type: MagentoOrderAddressFactory,
275
+ providedIn: "root"
276
+ });
277
+ }
278
+ };
279
+ i0.ɵɵngDeclareClassMetadata({
280
+ minVersion: "12.0.0",
281
+ version: "22.2.4",
282
+ ngImport: i0,
283
+ type: MagentoOrderAddressFactory,
284
+ decorators: [{
285
+ type: Injectable,
286
+ args: [{ providedIn: "root" }]
287
+ }],
288
+ ctorParameters: () => []
289
+ });
290
+ var MockOrderCreditItem = class {
291
+ constructor(itemFactory) {
292
+ this.itemFactory = itemFactory;
293
+ this.__typename = "CreditMemoItem";
294
+ this.order_item = this.itemFactory.create();
295
+ this.quantity_refunded = faker.number.int({
296
+ min: 1,
297
+ max: 100
298
+ });
299
+ }
300
+ };
301
+ var MagentoOrderCreditItemFactory = class MagentoOrderCreditItemFactory extends DaffModelFactory {
302
+ constructor(itemFactory) {
303
+ super(MockOrderCreditItem, itemFactory);
304
+ }
305
+ static {
306
+ this.ɵfac = i0.ɵɵngDeclareFactory({
307
+ minVersion: "12.0.0",
308
+ version: "22.2.4",
309
+ ngImport: i0,
310
+ type: MagentoOrderCreditItemFactory,
311
+ deps: [{ token: MagentoOrderItemFactory }],
312
+ target: i0.ɵɵFactoryTarget.Injectable
313
+ });
314
+ }
315
+ static {
316
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
317
+ minVersion: "12.0.0",
318
+ version: "22.2.4",
319
+ ngImport: i0,
320
+ type: MagentoOrderCreditItemFactory,
321
+ providedIn: "root"
322
+ });
323
+ }
324
+ };
325
+ i0.ɵɵngDeclareClassMetadata({
326
+ minVersion: "12.0.0",
327
+ version: "22.2.4",
328
+ ngImport: i0,
329
+ type: MagentoOrderCreditItemFactory,
330
+ decorators: [{
331
+ type: Injectable,
332
+ args: [{ providedIn: "root" }]
333
+ }],
334
+ ctorParameters: () => [{ type: MagentoOrderItemFactory }]
335
+ });
336
+ var MockOrderTotal = class {
337
+ constructor(moneyFactory, discountFactory) {
338
+ this.moneyFactory = moneyFactory;
339
+ this.discountFactory = discountFactory;
340
+ this.discounts = this.createDiscounts();
341
+ this.grand_total = this.createMoney();
342
+ this.subtotal = this.createMoney();
343
+ this.total_shipping = this.createMoney();
344
+ this.total_tax = this.createMoney();
345
+ }
346
+ createMoney() {
347
+ return this.moneyFactory.create();
348
+ }
349
+ createDiscounts() {
350
+ return this.discountFactory.createMany(faker.number.int({
351
+ min: 1,
352
+ max: 3
353
+ }));
354
+ }
355
+ };
356
+ var MagentoOrderTotalFactory = class MagentoOrderTotalFactory extends DaffModelFactory {
357
+ constructor(moneyFactory, discountFactory) {
358
+ super(MockOrderTotal, moneyFactory, discountFactory);
359
+ }
360
+ static {
361
+ this.ɵfac = i0.ɵɵngDeclareFactory({
362
+ minVersion: "12.0.0",
363
+ version: "22.2.4",
364
+ ngImport: i0,
365
+ type: MagentoOrderTotalFactory,
366
+ deps: [{ token: i1.MagentoMoneyFactory }, { token: i1.MagentoDiscountFactory }],
367
+ target: i0.ɵɵFactoryTarget.Injectable
368
+ });
369
+ }
370
+ static {
371
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
372
+ minVersion: "12.0.0",
373
+ version: "22.2.4",
374
+ ngImport: i0,
375
+ type: MagentoOrderTotalFactory,
376
+ providedIn: "root"
377
+ });
378
+ }
379
+ };
380
+ i0.ɵɵngDeclareClassMetadata({
381
+ minVersion: "12.0.0",
382
+ version: "22.2.4",
383
+ ngImport: i0,
384
+ type: MagentoOrderTotalFactory,
385
+ decorators: [{
386
+ type: Injectable,
387
+ args: [{ providedIn: "root" }]
388
+ }],
389
+ ctorParameters: () => [{ type: i1.MagentoMoneyFactory }, { type: i1.MagentoDiscountFactory }]
390
+ });
391
+ var MockOrderCredit = class {
392
+ constructor(itemFactory, totalFactory) {
393
+ this.itemFactory = itemFactory;
394
+ this.totalFactory = totalFactory;
395
+ this.__typename = "CreditMemo";
396
+ this.items = this.itemFactory.createMany(faker.number.int({
397
+ min: 1,
398
+ max: 3
399
+ }));
400
+ this.total = this.totalFactory.create({ __typename: "CreditMemoTotal" });
401
+ }
402
+ };
403
+ var MagentoOrderCreditFactory = class MagentoOrderCreditFactory extends DaffModelFactory {
404
+ constructor(itemFactory, totalFactory) {
405
+ super(MockOrderCredit, itemFactory, totalFactory);
406
+ }
407
+ static {
408
+ this.ɵfac = i0.ɵɵngDeclareFactory({
409
+ minVersion: "12.0.0",
410
+ version: "22.2.4",
411
+ ngImport: i0,
412
+ type: MagentoOrderCreditFactory,
413
+ deps: [{ token: MagentoOrderCreditItemFactory }, { token: MagentoOrderTotalFactory }],
414
+ target: i0.ɵɵFactoryTarget.Injectable
415
+ });
416
+ }
417
+ static {
418
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
419
+ minVersion: "12.0.0",
420
+ version: "22.2.4",
421
+ ngImport: i0,
422
+ type: MagentoOrderCreditFactory,
423
+ providedIn: "root"
424
+ });
425
+ }
426
+ };
427
+ i0.ɵɵngDeclareClassMetadata({
428
+ minVersion: "12.0.0",
429
+ version: "22.2.4",
430
+ ngImport: i0,
431
+ type: MagentoOrderCreditFactory,
432
+ decorators: [{
433
+ type: Injectable,
434
+ args: [{ providedIn: "root" }]
435
+ }],
436
+ ctorParameters: () => [{ type: MagentoOrderCreditItemFactory }, { type: MagentoOrderTotalFactory }]
437
+ });
438
+ var MockOrderInvoiceItem = class {
439
+ constructor(itemFactory) {
440
+ this.itemFactory = itemFactory;
441
+ this.__typename = "InvoiceItem";
442
+ this.order_item = this.itemFactory.create();
443
+ this.quantity_invoiced = faker.number.int({
444
+ min: 1,
445
+ max: 100
446
+ });
447
+ }
448
+ };
449
+ var MagentoOrderInvoiceItemFactory = class MagentoOrderInvoiceItemFactory extends DaffModelFactory {
450
+ constructor(itemFactory) {
451
+ super(MockOrderInvoiceItem, itemFactory);
452
+ }
453
+ static {
454
+ this.ɵfac = i0.ɵɵngDeclareFactory({
455
+ minVersion: "12.0.0",
456
+ version: "22.2.4",
457
+ ngImport: i0,
458
+ type: MagentoOrderInvoiceItemFactory,
459
+ deps: [{ token: MagentoOrderItemFactory }],
460
+ target: i0.ɵɵFactoryTarget.Injectable
461
+ });
462
+ }
463
+ static {
464
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
465
+ minVersion: "12.0.0",
466
+ version: "22.2.4",
467
+ ngImport: i0,
468
+ type: MagentoOrderInvoiceItemFactory,
469
+ providedIn: "root"
470
+ });
471
+ }
472
+ };
473
+ i0.ɵɵngDeclareClassMetadata({
474
+ minVersion: "12.0.0",
475
+ version: "22.2.4",
476
+ ngImport: i0,
477
+ type: MagentoOrderInvoiceItemFactory,
478
+ decorators: [{
479
+ type: Injectable,
480
+ args: [{ providedIn: "root" }]
481
+ }],
482
+ ctorParameters: () => [{ type: MagentoOrderItemFactory }]
483
+ });
484
+ var MockOrderInvoice = class {
485
+ constructor(itemFactory, totalFactory) {
486
+ this.itemFactory = itemFactory;
487
+ this.totalFactory = totalFactory;
488
+ this.__typename = "Invoice";
489
+ this.items = this.itemFactory.createMany(faker.number.int({
490
+ min: 1,
491
+ max: 3
492
+ }));
493
+ this.total = this.totalFactory.create({ __typename: "InvoiceTotal" });
494
+ }
495
+ };
496
+ var MagentoOrderInvoiceFactory = class MagentoOrderInvoiceFactory extends DaffModelFactory {
497
+ constructor(itemFactory, totalFactory) {
498
+ super(MockOrderInvoice, itemFactory, totalFactory);
499
+ }
500
+ static {
501
+ this.ɵfac = i0.ɵɵngDeclareFactory({
502
+ minVersion: "12.0.0",
503
+ version: "22.2.4",
504
+ ngImport: i0,
505
+ type: MagentoOrderInvoiceFactory,
506
+ deps: [{ token: MagentoOrderInvoiceItemFactory }, { token: MagentoOrderTotalFactory }],
507
+ target: i0.ɵɵFactoryTarget.Injectable
508
+ });
509
+ }
510
+ static {
511
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
512
+ minVersion: "12.0.0",
513
+ version: "22.2.4",
514
+ ngImport: i0,
515
+ type: MagentoOrderInvoiceFactory,
516
+ providedIn: "root"
517
+ });
518
+ }
519
+ };
520
+ i0.ɵɵngDeclareClassMetadata({
521
+ minVersion: "12.0.0",
522
+ version: "22.2.4",
523
+ ngImport: i0,
524
+ type: MagentoOrderInvoiceFactory,
525
+ decorators: [{
526
+ type: Injectable,
527
+ args: [{ providedIn: "root" }]
528
+ }],
529
+ ctorParameters: () => [{ type: MagentoOrderInvoiceItemFactory }, { type: MagentoOrderTotalFactory }]
530
+ });
531
+ var MockOrderPayment = class {
532
+ constructor() {
533
+ this.__typename = "OrderPaymentMethod";
534
+ this.name = "card";
535
+ this.type = "visa";
536
+ this.additional_data = [];
537
+ }
538
+ };
539
+ var MagentoOrderPaymentFactory = class MagentoOrderPaymentFactory extends DaffModelFactory {
540
+ constructor() {
541
+ super(MockOrderPayment);
542
+ }
543
+ static {
544
+ this.ɵfac = i0.ɵɵngDeclareFactory({
545
+ minVersion: "12.0.0",
546
+ version: "22.2.4",
547
+ ngImport: i0,
548
+ type: MagentoOrderPaymentFactory,
549
+ deps: [],
550
+ target: i0.ɵɵFactoryTarget.Injectable
551
+ });
552
+ }
553
+ static {
554
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
555
+ minVersion: "12.0.0",
556
+ version: "22.2.4",
557
+ ngImport: i0,
558
+ type: MagentoOrderPaymentFactory,
559
+ providedIn: "root"
560
+ });
561
+ }
562
+ };
563
+ i0.ɵɵngDeclareClassMetadata({
564
+ minVersion: "12.0.0",
565
+ version: "22.2.4",
566
+ ngImport: i0,
567
+ type: MagentoOrderPaymentFactory,
568
+ decorators: [{
569
+ type: Injectable,
570
+ args: [{ providedIn: "root" }]
571
+ }],
572
+ ctorParameters: () => []
573
+ });
574
+ var MockOrderShipmentItem = class {
575
+ constructor(itemFactory) {
576
+ this.itemFactory = itemFactory;
577
+ this.__typename = "ShipmentItem";
578
+ this.order_item = this.itemFactory.create();
579
+ this.quantity_shipped = faker.number.int({
580
+ min: 1,
581
+ max: 100
582
+ });
583
+ }
584
+ };
585
+ var MagentoOrderShipmentItemFactory = class MagentoOrderShipmentItemFactory extends DaffModelFactory {
586
+ constructor(itemFactory) {
587
+ super(MockOrderShipmentItem, itemFactory);
588
+ }
589
+ static {
590
+ this.ɵfac = i0.ɵɵngDeclareFactory({
591
+ minVersion: "12.0.0",
592
+ version: "22.2.4",
593
+ ngImport: i0,
594
+ type: MagentoOrderShipmentItemFactory,
595
+ deps: [{ token: MagentoOrderItemFactory }],
596
+ target: i0.ɵɵFactoryTarget.Injectable
597
+ });
598
+ }
599
+ static {
600
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
601
+ minVersion: "12.0.0",
602
+ version: "22.2.4",
603
+ ngImport: i0,
604
+ type: MagentoOrderShipmentItemFactory,
605
+ providedIn: "root"
606
+ });
607
+ }
608
+ };
609
+ i0.ɵɵngDeclareClassMetadata({
610
+ minVersion: "12.0.0",
611
+ version: "22.2.4",
612
+ ngImport: i0,
613
+ type: MagentoOrderShipmentItemFactory,
614
+ decorators: [{
615
+ type: Injectable,
616
+ args: [{ providedIn: "root" }]
617
+ }],
618
+ ctorParameters: () => [{ type: MagentoOrderItemFactory }]
619
+ });
620
+ var MockOrderShipmentTracking = class {
621
+ constructor() {
622
+ this.__typename = "ShipmentTracking";
623
+ this.number = faker.string.alphanumeric(16);
624
+ this.carrier = faker.lorem.word();
625
+ this.title = faker.lorem.word();
626
+ }
627
+ };
628
+ var MagentoOrderShipmentTrackingFactory = class MagentoOrderShipmentTrackingFactory extends DaffModelFactory {
629
+ constructor() {
630
+ super(MockOrderShipmentTracking);
631
+ }
632
+ static {
633
+ this.ɵfac = i0.ɵɵngDeclareFactory({
634
+ minVersion: "12.0.0",
635
+ version: "22.2.4",
636
+ ngImport: i0,
637
+ type: MagentoOrderShipmentTrackingFactory,
638
+ deps: [],
639
+ target: i0.ɵɵFactoryTarget.Injectable
640
+ });
641
+ }
642
+ static {
643
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
644
+ minVersion: "12.0.0",
645
+ version: "22.2.4",
646
+ ngImport: i0,
647
+ type: MagentoOrderShipmentTrackingFactory,
648
+ providedIn: "root"
649
+ });
650
+ }
651
+ };
652
+ i0.ɵɵngDeclareClassMetadata({
653
+ minVersion: "12.0.0",
654
+ version: "22.2.4",
655
+ ngImport: i0,
656
+ type: MagentoOrderShipmentTrackingFactory,
657
+ decorators: [{
658
+ type: Injectable,
659
+ args: [{ providedIn: "root" }]
660
+ }],
661
+ ctorParameters: () => []
662
+ });
663
+ var MockOrderShipment = class {
664
+ constructor(trackingFactory, itemFactory) {
665
+ this.trackingFactory = trackingFactory;
666
+ this.itemFactory = itemFactory;
667
+ this.__typename = "OrderShipment";
668
+ this.tracking = this.createTracking();
669
+ this.items = this.createItems();
670
+ }
671
+ createTracking() {
672
+ return this.trackingFactory.createMany(faker.number.int({
673
+ min: 1,
674
+ max: 3
675
+ }));
676
+ }
677
+ createItems() {
678
+ return this.itemFactory.createMany(faker.number.int({
679
+ min: 1,
680
+ max: 3
681
+ }));
682
+ }
683
+ };
684
+ var MagentoOrderShipmentFactory = class MagentoOrderShipmentFactory extends DaffModelFactory {
685
+ constructor(trackingFactory, itemFactory) {
686
+ super(MockOrderShipment, trackingFactory, itemFactory);
687
+ }
688
+ static {
689
+ this.ɵfac = i0.ɵɵngDeclareFactory({
690
+ minVersion: "12.0.0",
691
+ version: "22.2.4",
692
+ ngImport: i0,
693
+ type: MagentoOrderShipmentFactory,
694
+ deps: [{ token: MagentoOrderShipmentTrackingFactory }, { token: MagentoOrderShipmentItemFactory }],
695
+ target: i0.ɵɵFactoryTarget.Injectable
696
+ });
697
+ }
698
+ static {
699
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
700
+ minVersion: "12.0.0",
701
+ version: "22.2.4",
702
+ ngImport: i0,
703
+ type: MagentoOrderShipmentFactory,
704
+ providedIn: "root"
705
+ });
706
+ }
707
+ };
708
+ i0.ɵɵngDeclareClassMetadata({
709
+ minVersion: "12.0.0",
710
+ version: "22.2.4",
711
+ ngImport: i0,
712
+ type: MagentoOrderShipmentFactory,
713
+ decorators: [{
714
+ type: Injectable,
715
+ args: [{ providedIn: "root" }]
716
+ }],
717
+ ctorParameters: () => [{ type: MagentoOrderShipmentTrackingFactory }, { type: MagentoOrderShipmentItemFactory }]
718
+ });
719
+ var MockOrder = class {
720
+ constructor(totalFactory, itemFactory, addressFactory, shipmentFactory, paymentFactory, invoiceFactory, creditFactory) {
721
+ this.totalFactory = totalFactory;
722
+ this.itemFactory = itemFactory;
723
+ this.addressFactory = addressFactory;
724
+ this.shipmentFactory = shipmentFactory;
725
+ this.paymentFactory = paymentFactory;
726
+ this.invoiceFactory = invoiceFactory;
727
+ this.creditFactory = creditFactory;
728
+ this.__typename = "GraycoreGuestOrder";
729
+ this.id = faker.string.uuid();
730
+ this.number = faker.string.uuid();
731
+ this.email = faker.internet.email();
732
+ this.order_date = faker.date.past().toString();
733
+ this.status = faker.lorem.word();
734
+ this.carrier = faker.lorem.word();
735
+ this.shipping_method = faker.lorem.word();
736
+ this.total = this.totalFactory.create();
737
+ this.items = this.itemFactory.createMany(faker.number.int({
738
+ min: 1,
739
+ max: 5
740
+ }));
741
+ this.billing_address = this.addressFactory.create();
742
+ this.shipping_address = this.addressFactory.create();
743
+ this.shipments = this.shipmentFactory.createMany(faker.number.int({
744
+ min: 1,
745
+ max: 3
746
+ }));
747
+ this.payment_methods = this.paymentFactory.createMany(faker.number.int({
748
+ min: 1,
749
+ max: 3
750
+ }));
751
+ this.invoices = this.invoiceFactory.createMany(faker.number.int({
752
+ min: 1,
753
+ max: 3
754
+ }));
755
+ this.credit_memos = this.creditFactory.createMany(faker.number.int({
756
+ min: 1,
757
+ max: 3
758
+ }));
759
+ }
760
+ };
761
+ var MagentoOrderFactory = class MagentoOrderFactory extends DaffModelFactory {
762
+ constructor(totalFactory, itemFactory, addressFactory, shipmentFactory, paymentFactory, invoiceFactory, creditFactory) {
763
+ super(MockOrder, totalFactory, itemFactory, addressFactory, shipmentFactory, paymentFactory, invoiceFactory, creditFactory);
764
+ }
765
+ static {
766
+ this.ɵfac = i0.ɵɵngDeclareFactory({
767
+ minVersion: "12.0.0",
768
+ version: "22.2.4",
769
+ ngImport: i0,
770
+ type: MagentoOrderFactory,
771
+ deps: [
772
+ { token: MagentoOrderTotalFactory },
773
+ { token: MagentoOrderItemFactory },
774
+ { token: MagentoOrderAddressFactory },
775
+ { token: MagentoOrderShipmentFactory },
776
+ { token: MagentoOrderPaymentFactory },
777
+ { token: MagentoOrderInvoiceFactory },
778
+ { token: MagentoOrderCreditFactory }
779
+ ],
780
+ target: i0.ɵɵFactoryTarget.Injectable
781
+ });
782
+ }
783
+ static {
784
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
785
+ minVersion: "12.0.0",
786
+ version: "22.2.4",
787
+ ngImport: i0,
788
+ type: MagentoOrderFactory,
789
+ providedIn: "root"
790
+ });
791
+ }
792
+ };
793
+ i0.ɵɵngDeclareClassMetadata({
794
+ minVersion: "12.0.0",
795
+ version: "22.2.4",
796
+ ngImport: i0,
797
+ type: MagentoOrderFactory,
798
+ decorators: [{
799
+ type: Injectable,
800
+ args: [{ providedIn: "root" }]
801
+ }],
802
+ ctorParameters: () => [
803
+ { type: MagentoOrderTotalFactory },
804
+ { type: MagentoOrderItemFactory },
805
+ { type: MagentoOrderAddressFactory },
806
+ { type: MagentoOrderShipmentFactory },
807
+ { type: MagentoOrderPaymentFactory },
808
+ { type: MagentoOrderInvoiceFactory },
809
+ { type: MagentoOrderCreditFactory }
810
+ ]
811
+ });
424
812
  export { MagentoOrderAddressFactory, MagentoOrderBundleItemFactory, MagentoOrderBundleItemSelectedOptionFactory, MagentoOrderBundleItemSelectedOptionValueFactory, MagentoOrderCreditFactory, MagentoOrderCreditItemFactory, MagentoOrderFactory, MagentoOrderInvoiceFactory, MagentoOrderInvoiceItemFactory, MagentoOrderItemFactory, MagentoOrderPaymentFactory, MagentoOrderShipmentFactory, MagentoOrderShipmentItemFactory, MagentoOrderShipmentTrackingFactory, MagentoOrderTotalFactory, MockBundleOrderItem, MockMagentoOrderBundleItemSelectedOption, MockMagentoOrderBundleItemSelectedOptionValue, MockOrder, MockOrderAddress, MockOrderCredit, MockOrderCreditItem, MockOrderInvoice, MockOrderInvoiceItem, MockOrderItem, MockOrderPayment, MockOrderShipment, MockOrderShipmentItem, MockOrderShipmentTracking, MockOrderTotal };
425
- //# sourceMappingURL=daffodil-order-driver-magento-2.4.1-testing.mjs.map
813
+
814
+ //# sourceMappingURL=daffodil-order-driver-magento-2.4.1-testing.mjs.map