1 <?php
2 /* --------------------------------------------------------------
3 OrderWriteServiceInterface.php 2016-01-26
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2016 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Interface OrderWriteServiceInterface
14 *
15 * @category System
16 * @package Order
17 * @subpackage Interfaces
18 */
19 interface OrderWriteServiceInterface
20 {
21 /**
22 * Creates a new customer order and returns the order ID as an integer.
23 *
24 * @param IdType $customerId Customer ID.
25 * @param CustomerStatusInformation $customerStatusInfo Customer Status Information.
26 * @param StringType $customerNumber Customer Number.
27 * @param EmailStringType $customerEmail Customer Email.
28 * @param StringType $customerTelephone Customer Telephone.
29 * @param StringType $vatIdNumber VAT ID Number.
30 * @param AddressBlockInterface $customerAddress Address of the customer.
31 * @param AddressBlockInterface $billingAddress Billing address of the customer.
32 * @param AddressBlockInterface $deliveryAddress Delivery address of the customer.
33 * @param OrderItemCollection $orderItemCollection Collection of the order items.
34 * @param OrderTotalCollection $orderTotalCollection Total collection of the order.
35 * @param OrderShippingType $shippingType Shipping type of the order.
36 * @param OrderPaymentType $paymentType Payment type of the order.
37 * @param CurrencyCode $currencyCode Currency code of the order.
38 * @param LanguageCode $languageCode Language code of the order.
39 * @param StringType $comment Optional comment of the order (default = null).
40 * @param IdType $orderStatusId Optional id of the initial order status (default = null).
41 * @param KeyValueCollection $addonValues Optional key => value collection of addon values - e.g.
42 * cookies (default = null).
43 *
44 * @return int Order ID.
45 */
46 public function createNewCustomerOrder(IdType $customerId,
47 CustomerStatusInformation $customerStatusInfo,
48 StringType $customerNumber,
49 EmailStringType $customerEmail,
50 StringType $customerTelephone,
51 StringType $vatIdNumber,
52 AddressBlockInterface $customerAddress,
53 AddressBlockInterface $billingAddress,
54 AddressBlockInterface $deliveryAddress,
55 OrderItemCollection $orderItemCollection,
56 OrderTotalCollection $orderTotalCollection,
57 OrderShippingType $shippingType,
58 OrderPaymentType $paymentType,
59 CurrencyCode $currencyCode,
60 LanguageCode $languageCode,
61 StringType $comment = null,
62 IdType $orderStatusId = null,
63 KeyValueCollection $addonValues = null);
64
65
66 /**
67 * Creates a new standalone order (e.g. for guests) and returns the order ID as an integer.
68 *
69 * @param StringType $customerNumber Customer Number.
70 * @param EmailStringType $customerEmail Customer Email.
71 * @param StringType $customerTelephone Customer Telephone.
72 * @param StringTYpe $vatIdNumber VAT ID number of the customer.
73 * @param AddressBlockInterface $customerAddress Address of the customer.
74 * @param AddressBlockInterface $billingAddress Billing address of the customer.
75 * @param AddressBlockInterface $deliveryAddress Delivery address of the customer.
76 * @param OrderItemCollection $orderItemCollection Collection of the order items.
77 * @param OrderTotalCollection $orderTotalCollection Total collection of the order.
78 * @param OrderShippingType $shippingType Shipping type of the order.
79 * @param OrderPaymentType $paymentType Payment type of the order.
80 * @param CurrencyCode $currencyCode Currency code of the order.
81 * @param LanguageCode $languageCode Language code of the order.
82 * @param StringType $comment Optional comment of the order (default = null).
83 * @param IdType $orderStatusId Optional id of the initial order status (default = null).
84 * @param KeyValueCollection $addonValues Optional key => value collection of addon values - e.g.
85 * cookies (default = null).
86 *
87 * @return int Order ID.
88 */
89 public function createNewStandaloneOrder(StringType $customerNumber,
90 EmailStringType $customerEmail,
91 StringType $customerTelephone,
92 StringType $vatIdNumber,
93 AddressBlockInterface $customerAddress,
94 AddressBlockInterface $billingAddress,
95 AddressBlockInterface $deliveryAddress,
96 OrderItemCollection $orderItemCollection,
97 OrderTotalCollection $orderTotalCollection,
98 OrderShippingType $shippingType,
99 OrderPaymentType $paymentType,
100 CurrencyCode $currencyCode,
101 LanguageCode $languageCode,
102 StringType $comment = null,
103 IdType $orderStatusId = null,
104 KeyValueCollection $addonValues = null);
105
106
107 /**
108 * Updates the customers address.
109 *
110 * @param IdType $orderId Order ID which holds the current address.
111 * @param AddressBlockInterface $newAddress New address of the customer.
112 */
113 public function updateCustomerAddress(IdType $orderId, AddressBlockInterface $newAddress);
114
115
116 /**
117 * Updates the customers billing address.
118 *
119 * @param IdType $orderId Order ID which holds the current address.
120 * @param AddressBlockInterface $newAddress New billing address.
121 */
122 public function updateBillingAddress(IdType $orderId, AddressBlockInterface $newAddress);
123
124
125 /**
126 * Updates the customers delivery address.
127 *
128 * @param IdType $orderId Order ID which holds the current address.
129 * @param AddressBlockInterface $newAddress New delivery address.
130 */
131 public function updateDeliveryAddress(IdType $orderId, AddressBlockInterface $newAddress);
132
133
134 /**
135 * Adds an item to the order.
136 *
137 * @param IdType $orderId Order ID of the order to add the item.
138 * @param OrderItemInterface $orderItem The order item to add.
139 *
140 * @return int ID of the StoredOrderItem.
141 */
142 public function addOrderItem(IdType $orderId, OrderItemInterface $orderItem);
143
144
145 /**
146 * Updates an order item.
147 *
148 * @param StoredOrderItemInterface $orderItem The order item to update.
149 */
150 public function updateOrderItem(StoredOrderItemInterface $orderItem);
151
152
153 /**
154 * Removes an item from an order.
155 *
156 * @param StoredOrderItemInterface $orderItem The order item to remove.
157 */
158 public function removeOrderItem(StoredOrderItemInterface $orderItem);
159
160
161 /**
162 * Adds an order item attribute to the order.
163 *
164 * @param IdType $orderItemId Order ID of the order item to add the attribute.
165 * @param OrderItemAttributeInterface $orderItemAttribute The order item attribute to add.
166 *
167 * @return int ID of stored order item attribute.
168 */
169 public function addOrderItemAttribute(IdType $orderItemId, OrderItemAttributeInterface $orderItemAttribute);
170
171
172 /**
173 * Updates an item attribute of an order.
174 *
175 * @param StoredOrderItemAttributeInterface $orderItemAttribute The order item attribute to update.
176 */
177 public function updateOrderItemAttribute(StoredOrderItemAttributeInterface $orderItemAttribute);
178
179
180 /**
181 * Removes an item attribute of an order.
182 *
183 * @param StoredOrderItemAttributeInterface $orderItemAttribute The order item attribute to remove.
184 */
185 public function removeOrderItemAttribute(StoredOrderItemAttributeInterface $orderItemAttribute);
186
187
188 /**
189 * Adds a total price to an order.
190 *
191 * @param IdType $orderId Order ID of the order to add the total price.
192 * @param OrderTotalInterface $orderTotal Total price to add to the order.
193 *
194 * @return int ID of stored order total.
195 */
196 public function addOrderTotal(IdType $orderId, OrderTotalInterface $orderTotal);
197
198
199 /**
200 * Updates a total price of an order.
201 *
202 * @param StoredOrderTotalInterface $orderTotal The total price of an order to update.
203 */
204 public function updateOrderTotal(StoredOrderTotalInterface $orderTotal);
205
206
207 /**
208 * Removes a total price of an order.
209 *
210 * @param StoredOrderTotalInterface $orderTotal The total price of an order to remove.
211 */
212 public function removeOrderTotal(StoredOrderTotalInterface $orderTotal);
213
214
215 /**
216 * Updates the shipping type of an order.
217 *
218 * @param IdType $orderId Order ID of the order to update.
219 * @param OrderShippingType $newShippingType The new shipping type.
220 */
221 public function updateShippingType(IdType $orderId, OrderShippingType $newShippingType);
222
223
224 /**
225 * Updates the payment type of an order.
226 *
227 * @param IdType $orderId Order ID of the order to update.
228 * @param OrderPaymentType $newPaymentType The new payment type.
229 */
230 public function updatePaymentType(IdType $orderId, OrderPaymentType $newPaymentType);
231
232
233 /**
234 * Updates the comment of an order.
235 *
236 * @param IdType $orderId Order ID of the order to update.
237 * @param StringType $newComment The new comment.
238 */
239 public function updateComment(IdType $orderId, StringType $newComment);
240
241
242 /**
243 * Updates the order status of an order.
244 *
245 * @param IdType $orderId Order ID of the order to update.
246 * @param IdType $newOrderStatusId The new status ID.
247 * @param StringType $comment Comment of the order status history item.
248 * @param BoolType $customerNotified Customer notified flag.
249 */
250 public function updateOrderStatus(IdType $orderId,
251 IdType $newOrderStatusId,
252 StringType $comment,
253 BoolType $customerNotified);
254
255
256 /**
257 * Updates the provided order.
258 *
259 * @param OrderInterface $order Order to update.
260 */
261 public function updateOrder(OrderInterface $order);
262
263
264 /**
265 * Removes a specific order, depending on the provided order ID.
266 *
267 * @param IdType $orderId Order ID of the order to remove.
268 */
269 public function removeOrderById(IdType $orderId);
270 }