|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of the Spryker Commerce OS. |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace Pyz\Zed\Sales; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Zed\CommentSalesConnector\Communication\Plugin\Sales\CommentThreadAttachedCommentOrderPostSavePlugin; |
|
11
|
|
|
use Spryker\Zed\CommentSalesConnector\Communication\Plugin\Sales\CommentThreadOrderExpanderPlugin; |
|
12
|
|
|
use Spryker\Zed\CompanyBusinessUnitSalesConnector\Communication\Plugin\Sales\CompanyBusinessUnitCustomerFilterOrderSearchQueryExpanderPlugin; |
|
13
|
|
|
use Spryker\Zed\CompanyBusinessUnitSalesConnector\Communication\Plugin\Sales\CompanyBusinessUnitCustomerOrderAccessCheckPlugin; |
|
14
|
|
|
use Spryker\Zed\CompanyBusinessUnitSalesConnector\Communication\Plugin\Sales\CompanyBusinessUnitCustomerSortingOrderSearchQueryExpanderPlugin; |
|
15
|
|
|
use Spryker\Zed\CompanyBusinessUnitSalesConnector\Communication\Plugin\Sales\CompanyBusinessUnitFilterOrderSearchQueryExpanderPlugin; |
|
16
|
|
|
use Spryker\Zed\CompanyBusinessUnitSalesConnector\Communication\Plugin\Sales\SaveCompanyBusinessUnitUuidOrderPostSavePlugin; |
|
17
|
|
|
use Spryker\Zed\CompanySalesConnector\Communication\Plugin\Sales\CompanyCustomerFilterOrderSearchQueryExpanderPlugin; |
|
18
|
|
|
use Spryker\Zed\CompanySalesConnector\Communication\Plugin\Sales\CompanyCustomerOrderAccessCheckPlugin; |
|
19
|
|
|
use Spryker\Zed\CompanySalesConnector\Communication\Plugin\Sales\CompanyCustomerSortingOrderSearchQueryExpanderPlugin; |
|
20
|
|
|
use Spryker\Zed\CompanySalesConnector\Communication\Plugin\Sales\CompanyFilterOrderSearchQueryExpanderPlugin; |
|
21
|
|
|
use Spryker\Zed\CompanySalesConnector\Communication\Plugin\Sales\SaveCompanyUuidOrderPostSavePlugin; |
|
22
|
|
|
use Spryker\Zed\Currency\Communication\Plugin\Sales\CurrencyOrderExpanderPlugin; |
|
23
|
|
|
use Spryker\Zed\Customer\Communication\Plugin\Sales\CustomerOrderHydratePlugin; |
|
24
|
|
|
use Spryker\Zed\Discount\Communication\Plugin\Sales\DiscountOrderHydratePlugin; |
|
25
|
|
|
use Spryker\Zed\MerchantOmsGui\Communication\Plugin\Sales\MerchantOmsStateOrderItemsTableExpanderPlugin; |
|
26
|
|
|
use Spryker\Zed\MerchantProfile\Communication\Plugin\Sales\MerchantDataOrderHydratePlugin; |
|
27
|
|
|
use Spryker\Zed\MerchantSalesOrder\Communication\Plugin\Sales\MerchantOrderDataOrderExpanderPlugin; |
|
28
|
|
|
use Spryker\Zed\MerchantSalesOrder\Communication\Plugin\Sales\MerchantReferenceOrderItemExpanderPreSavePlugin; |
|
29
|
|
|
use Spryker\Zed\MerchantSalesOrder\Communication\Plugin\Sales\MerchantReferencesOrderExpanderPlugin; |
|
30
|
|
|
use Spryker\Zed\Oms\Communication\Plugin\Sales\IsCancellableOrderExpanderPlugin; |
|
31
|
|
|
use Spryker\Zed\Oms\Communication\Plugin\Sales\IsCancellableSearchOrderExpanderPlugin; |
|
32
|
|
|
use Spryker\Zed\Oms\Communication\Plugin\Sales\ItemStateOrderItemExpanderPlugin; |
|
33
|
|
|
use Spryker\Zed\Oms\Communication\Plugin\Sales\OmsStatesOrderExpanderPlugin; |
|
34
|
|
|
use Spryker\Zed\Oms\Communication\Plugin\Sales\OrderAggregatedItemStateSearchOrderExpanderPlugin; |
|
35
|
|
|
use Spryker\Zed\Oms\Communication\Plugin\Sales\StateHistoryOrderItemExpanderPlugin; |
|
36
|
|
|
use Spryker\Zed\OmsMultiThread\Communication\Plugin\Sales\OmsMultiThreadProcessorIdentifierOrderExpanderPreSavePlugin; |
|
37
|
|
|
use Spryker\Zed\OrderCustomReference\Communication\Plugin\Sales\OrderCustomReferenceOrderPostSavePlugin; |
|
38
|
|
|
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleIdHydratorPlugin; |
|
39
|
|
|
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOptionItemExpanderPlugin; |
|
40
|
|
|
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOptionOrderExpanderPlugin; |
|
41
|
|
|
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOrderHydratePlugin; |
|
42
|
|
|
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOrderItemExpanderPlugin; |
|
43
|
|
|
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\UniqueOrderBundleItemsExpanderPlugin; |
|
44
|
|
|
use Spryker\Zed\ProductMeasurementUnit\Communication\Plugin\Sales\QuantitySalesUnitOrderItemExpanderPlugin; |
|
45
|
|
|
use Spryker\Zed\ProductMeasurementUnit\Communication\Plugin\SalesExtension\QuantitySalesUnitOrderItemExpanderPreSavePlugin; |
|
46
|
|
|
use Spryker\Zed\ProductOfferSales\Communication\Plugin\Sales\ProductOfferReferenceOrderItemExpanderPreSavePlugin; |
|
47
|
|
|
use Spryker\Zed\ProductOption\Communication\Plugin\Sales\ProductOptionGroupIdHydratorPlugin; |
|
48
|
|
|
use Spryker\Zed\ProductOption\Communication\Plugin\Sales\ProductOptionsOrderItemExpanderPlugin; |
|
49
|
|
|
use Spryker\Zed\ProductPackagingUnit\Communication\Plugin\Checkout\PackagingUnitSplittableItemTransformerStrategyPlugin; |
|
50
|
|
|
use Spryker\Zed\ProductPackagingUnit\Communication\Plugin\Sales\AmountLeadProductOrderItemExpanderPlugin; |
|
51
|
|
|
use Spryker\Zed\ProductPackagingUnit\Communication\Plugin\Sales\AmountSalesUnitOrderItemExpanderPlugin; |
|
52
|
|
|
use Spryker\Zed\ProductPackagingUnit\Communication\Plugin\SalesExtension\AmountSalesUnitOrderItemExpanderPreSavePlugin; |
|
53
|
|
|
use Spryker\Zed\ProductPackagingUnit\Communication\Plugin\SalesExtension\ProductPackagingUnitOrderItemExpanderPreSavePlugin; |
|
54
|
|
|
use Spryker\Zed\Sales\Communication\Plugin\Sales\CurrencyIsoCodeOrderItemExpanderPlugin; |
|
55
|
|
|
use Spryker\Zed\Sales\SalesDependencyProvider as SprykerSalesDependencyProvider; |
|
56
|
|
|
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\ConfiguredBundleItemPreTransformerPlugin; |
|
57
|
|
|
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\ConfiguredBundleOrderItemExpanderPlugin; |
|
58
|
|
|
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\ConfiguredBundlesOrderItemsPostSavePlugin; |
|
59
|
|
|
use Spryker\Zed\SalesMerchantCommission\Communication\Plugin\Sales\MerchantCommissionOrderPostCancelPlugin; |
|
60
|
|
|
use Spryker\Zed\SalesOms\Communication\Plugin\OrderItemReferenceExpanderPreSavePlugin; |
|
61
|
|
|
use Spryker\Zed\SalesPayment\Communication\Plugin\Sales\SalesPaymentOrderExpanderPlugin; |
|
62
|
|
|
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\ProductConfigurationOrderItemExpanderPlugin; |
|
63
|
|
|
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\ProductConfigurationOrderItemsPostSavePlugin; |
|
64
|
|
|
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ItemMetadataOrderItemsPostSavePlugin; |
|
65
|
|
|
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ItemMetadataSearchOrderExpanderPlugin; |
|
66
|
|
|
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\MetadataOrderItemExpanderPlugin; |
|
67
|
|
|
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ProductIdOrderItemExpanderPlugin; |
|
68
|
|
|
use Spryker\Zed\SalesQuantity\Communication\Plugin\SalesExtension\IsQuantitySplittableOrderItemExpanderPreSavePlugin; |
|
69
|
|
|
use Spryker\Zed\SalesQuantity\Communication\Plugin\SalesExtension\NonSplittableItemTransformerStrategyPlugin; |
|
70
|
|
|
use Spryker\Zed\SalesReclamationGui\Communication\Plugin\Sales\ReclamationSalesTablePlugin; |
|
71
|
|
|
use Spryker\Zed\SalesReturn\Communication\Plugin\Sales\RemunerationTotalOrderExpanderPlugin; |
|
72
|
|
|
use Spryker\Zed\SalesReturn\Communication\Plugin\Sales\UpdateOrderItemIsReturnableByGlobalReturnableNumberOfDaysPlugin; |
|
73
|
|
|
use Spryker\Zed\SalesReturn\Communication\Plugin\Sales\UpdateOrderItemIsReturnableByItemStatePlugin; |
|
74
|
|
|
use Spryker\Zed\Shipment\Communication\Plugin\ShipmentOrderHydratePlugin; |
|
75
|
|
|
|
|
76
|
|
|
class SalesDependencyProvider extends SprykerSalesDependencyProvider |
|
77
|
|
|
{ |
|
78
|
|
|
/** |
|
79
|
|
|
* @return array<\Spryker\Zed\Sales\Dependency\Plugin\OrderExpanderPreSavePluginInterface> |
|
80
|
|
|
*/ |
|
81
|
|
|
protected function getOrderExpanderPreSavePlugins(): array |
|
82
|
|
|
{ |
|
83
|
|
|
return [ |
|
84
|
|
|
new OmsMultiThreadProcessorIdentifierOrderExpanderPreSavePlugin(), |
|
85
|
|
|
]; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderExpanderPluginInterface> |
|
90
|
|
|
*/ |
|
91
|
|
|
protected function getOrderHydrationPlugins(): array |
|
92
|
|
|
{ |
|
93
|
|
|
return [ |
|
94
|
|
|
new ProductBundleOrderHydratePlugin(), |
|
95
|
|
|
new DiscountOrderHydratePlugin(), |
|
96
|
|
|
new ShipmentOrderHydratePlugin(), |
|
97
|
|
|
new SalesPaymentOrderExpanderPlugin(), |
|
98
|
|
|
new CustomerOrderHydratePlugin(), |
|
99
|
|
|
new ProductBundleIdHydratorPlugin(), |
|
100
|
|
|
new ProductOptionGroupIdHydratorPlugin(), |
|
101
|
|
|
new CommentThreadOrderExpanderPlugin(), |
|
102
|
|
|
new ProductBundleOptionOrderExpanderPlugin(), |
|
103
|
|
|
new RemunerationTotalOrderExpanderPlugin(), |
|
104
|
|
|
new OmsStatesOrderExpanderPlugin(), |
|
105
|
|
|
new IsCancellableOrderExpanderPlugin(), |
|
106
|
|
|
new CurrencyOrderExpanderPlugin(), |
|
107
|
|
|
new MerchantOrderDataOrderExpanderPlugin(), |
|
108
|
|
|
new MerchantReferencesOrderExpanderPlugin(), |
|
109
|
|
|
new MerchantDataOrderHydratePlugin(), |
|
110
|
|
|
]; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemExpanderPreSavePluginInterface> |
|
115
|
|
|
*/ |
|
116
|
|
|
protected function getOrderItemExpanderPreSavePlugins(): array |
|
117
|
|
|
{ |
|
118
|
|
|
return [ |
|
119
|
|
|
new QuantitySalesUnitOrderItemExpanderPreSavePlugin(), |
|
120
|
|
|
new ProductPackagingUnitOrderItemExpanderPreSavePlugin(), |
|
121
|
|
|
new AmountSalesUnitOrderItemExpanderPreSavePlugin(), |
|
122
|
|
|
new IsQuantitySplittableOrderItemExpanderPreSavePlugin(), |
|
123
|
|
|
new OrderItemReferenceExpanderPreSavePlugin(), |
|
124
|
|
|
new MerchantReferenceOrderItemExpanderPreSavePlugin(), |
|
125
|
|
|
new ProductOfferReferenceOrderItemExpanderPreSavePlugin(), |
|
126
|
|
|
]; |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\ItemTransformerStrategyPluginInterface> |
|
131
|
|
|
*/ |
|
132
|
|
|
public function getItemTransformerStrategyPlugins(): array |
|
133
|
|
|
{ |
|
134
|
|
|
return [ |
|
135
|
|
|
new PackagingUnitSplittableItemTransformerStrategyPlugin(), #ProductPackagingUnit |
|
136
|
|
|
new NonSplittableItemTransformerStrategyPlugin(), |
|
137
|
|
|
]; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\SalesTablePluginInterface> |
|
142
|
|
|
*/ |
|
143
|
|
|
protected function getSalesTablePlugins(): array |
|
144
|
|
|
{ |
|
145
|
|
|
return [ |
|
146
|
|
|
new ReclamationSalesTablePlugin(), |
|
147
|
|
|
]; |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
/** |
|
151
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderPostSavePluginInterface> |
|
152
|
|
|
*/ |
|
153
|
|
|
protected function getOrderPostSavePlugins(): array |
|
154
|
|
|
{ |
|
155
|
|
|
return [ |
|
156
|
|
|
new CommentThreadAttachedCommentOrderPostSavePlugin(), |
|
157
|
|
|
new OrderCustomReferenceOrderPostSavePlugin(), |
|
158
|
|
|
new SaveCompanyBusinessUnitUuidOrderPostSavePlugin(), |
|
159
|
|
|
new SaveCompanyUuidOrderPostSavePlugin(), |
|
160
|
|
|
]; |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
/** |
|
164
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\ItemPreTransformerPluginInterface> |
|
165
|
|
|
*/ |
|
166
|
|
|
protected function getItemPreTransformerPlugins(): array |
|
167
|
|
|
{ |
|
168
|
|
|
return [ |
|
169
|
|
|
new ConfiguredBundleItemPreTransformerPlugin(), |
|
170
|
|
|
]; |
|
171
|
|
|
} |
|
172
|
|
|
|
|
173
|
|
|
/** |
|
174
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\UniqueOrderItemsExpanderPluginInterface> |
|
175
|
|
|
*/ |
|
176
|
|
|
protected function getUniqueOrderItemsExpanderPlugins(): array |
|
177
|
|
|
{ |
|
178
|
|
|
return [ |
|
179
|
|
|
new UniqueOrderBundleItemsExpanderPlugin(), |
|
180
|
|
|
]; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
/** |
|
184
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemExpanderPluginInterface> |
|
185
|
|
|
*/ |
|
186
|
|
|
protected function getOrderItemExpanderPlugins(): array |
|
187
|
|
|
{ |
|
188
|
|
|
return [ |
|
189
|
|
|
new StateHistoryOrderItemExpanderPlugin(), |
|
190
|
|
|
new ProductIdOrderItemExpanderPlugin(), |
|
191
|
|
|
new ProductOptionsOrderItemExpanderPlugin(), |
|
192
|
|
|
new MetadataOrderItemExpanderPlugin(), |
|
193
|
|
|
new UpdateOrderItemIsReturnableByItemStatePlugin(), |
|
194
|
|
|
new UpdateOrderItemIsReturnableByGlobalReturnableNumberOfDaysPlugin(), |
|
195
|
|
|
new CurrencyIsoCodeOrderItemExpanderPlugin(), |
|
196
|
|
|
new ConfiguredBundleOrderItemExpanderPlugin(), |
|
197
|
|
|
new ProductBundleOrderItemExpanderPlugin(), |
|
198
|
|
|
new ProductBundleOptionItemExpanderPlugin(), |
|
199
|
|
|
new QuantitySalesUnitOrderItemExpanderPlugin(), |
|
200
|
|
|
new AmountLeadProductOrderItemExpanderPlugin(), |
|
201
|
|
|
new AmountSalesUnitOrderItemExpanderPlugin(), |
|
202
|
|
|
new ItemStateOrderItemExpanderPlugin(), |
|
203
|
|
|
new ProductConfigurationOrderItemExpanderPlugin(), |
|
204
|
|
|
]; |
|
205
|
|
|
} |
|
206
|
|
|
|
|
207
|
|
|
/** |
|
208
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\SearchOrderExpanderPluginInterface> |
|
209
|
|
|
*/ |
|
210
|
|
|
protected function getSearchOrderExpanderPlugins(): array |
|
211
|
|
|
{ |
|
212
|
|
|
return [ |
|
213
|
|
|
new ItemMetadataSearchOrderExpanderPlugin(), |
|
214
|
|
|
new OrderAggregatedItemStateSearchOrderExpanderPlugin(), |
|
215
|
|
|
new IsCancellableSearchOrderExpanderPlugin(), |
|
216
|
|
|
]; |
|
217
|
|
|
} |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\SearchOrderQueryExpanderPluginInterface> |
|
221
|
|
|
*/ |
|
222
|
|
|
protected function getOrderSearchQueryExpanderPlugins(): array |
|
223
|
|
|
{ |
|
224
|
|
|
return [ |
|
225
|
|
|
new CompanyBusinessUnitFilterOrderSearchQueryExpanderPlugin(), |
|
226
|
|
|
new CompanyFilterOrderSearchQueryExpanderPlugin(), |
|
227
|
|
|
new CompanyBusinessUnitCustomerFilterOrderSearchQueryExpanderPlugin(), |
|
228
|
|
|
new CompanyBusinessUnitCustomerSortingOrderSearchQueryExpanderPlugin(), |
|
229
|
|
|
new CompanyCustomerFilterOrderSearchQueryExpanderPlugin(), |
|
230
|
|
|
new CompanyCustomerSortingOrderSearchQueryExpanderPlugin(), |
|
231
|
|
|
]; |
|
232
|
|
|
} |
|
233
|
|
|
|
|
234
|
|
|
/** |
|
235
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\CustomerOrderAccessCheckPluginInterface> |
|
236
|
|
|
*/ |
|
237
|
|
|
protected function getCustomerOrderAccessCheckPlugins(): array |
|
238
|
|
|
{ |
|
239
|
|
|
return [ |
|
240
|
|
|
new CompanyBusinessUnitCustomerOrderAccessCheckPlugin(), |
|
241
|
|
|
new CompanyCustomerOrderAccessCheckPlugin(), |
|
242
|
|
|
]; |
|
243
|
|
|
} |
|
244
|
|
|
|
|
245
|
|
|
/** |
|
246
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemsTableExpanderPluginInterface> |
|
247
|
|
|
*/ |
|
248
|
|
|
protected function getOrderItemsTableExpanderPlugins(): array |
|
249
|
|
|
{ |
|
250
|
|
|
return [ |
|
251
|
|
|
new MerchantOmsStateOrderItemsTableExpanderPlugin(), |
|
252
|
|
|
]; |
|
253
|
|
|
} |
|
254
|
|
|
|
|
255
|
|
|
/** |
|
256
|
|
|
* @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemsPostSavePluginInterface> |
|
257
|
|
|
*/ |
|
258
|
|
|
protected function getOrderItemsPostSavePlugins(): array |
|
259
|
|
|
{ |
|
260
|
|
|
return [ |
|
261
|
|
|
new ConfiguredBundlesOrderItemsPostSavePlugin(), |
|
262
|
|
|
new ItemMetadataOrderItemsPostSavePlugin(), |
|
263
|
|
|
new ProductConfigurationOrderItemsPostSavePlugin(), |
|
264
|
|
|
]; |
|
265
|
|
|
} |
|
266
|
|
|
|
|
267
|
|
|
/** |
|
268
|
|
|
* @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderPostCancelPluginInterface> |
|
269
|
|
|
*/ |
|
270
|
|
|
protected function getOrderPostCancelPlugins(): array |
|
271
|
|
|
{ |
|
272
|
|
|
return [ |
|
|
|
|
|
|
273
|
|
|
new MerchantCommissionOrderPostCancelPlugin(), |
|
274
|
|
|
]; |
|
275
|
|
|
} |
|
276
|
|
|
} |
|
277
|
|
|
|