| Line 7... |
Line 7... |
| 7 |
enum PaymentStatus{
|
7 |
enum PaymentStatus{
|
| 8 |
FAILURE,
|
8 |
FAILURE,
|
| 9 |
SUCCESS
|
9 |
SUCCESS
|
| 10 |
}
|
10 |
}
|
| 11 |
|
11 |
|
| - |
|
12 |
enum OrderStatus{
|
| - |
|
13 |
INIT,
|
| - |
|
14 |
SUBMITTED_FOR_PROCESSING,
|
| - |
|
15 |
ACCEPTED,
|
| - |
|
16 |
INVENTORY_LOW,
|
| - |
|
17 |
REJECT,
|
| - |
|
18 |
BILLED,
|
| - |
|
19 |
READY_FOR_SHIPPING,
|
| - |
|
20 |
SHIPPED_FROM_WH,
|
| - |
|
21 |
SHIPPED_TO_LOGST,
|
| - |
|
22 |
IN_TRANSIT,
|
| - |
|
23 |
DELIVERY_SUCCESS,
|
| - |
|
24 |
DELIVERY_FAILED_FIRST_ATTEMPT,
|
| - |
|
25 |
DELIVERY_FAILED_SECOND_ATTEMPT,
|
| - |
|
26 |
DELIVERY_FAILED_THIRD_ATTEMPT,
|
| - |
|
27 |
DELIVERY_FAILED_WORNG_ADDRESS
|
| - |
|
28 |
COMPLETED,
|
| - |
|
29 |
CANCELED,
|
| - |
|
30 |
FAILED
|
| - |
|
31 |
}
|
| - |
|
32 |
|
| - |
|
33 |
enum TransactionStatus{
|
| - |
|
34 |
INIT,
|
| - |
|
35 |
IN_PROCESS,
|
| - |
|
36 |
COMPLETED,
|
| - |
|
37 |
FAILED
|
| - |
|
38 |
}
|
| - |
|
39 |
|
| - |
|
40 |
|
| - |
|
41 |
struct Payment{
|
| - |
|
42 |
1:i64 id,
|
| - |
|
43 |
2:string merchant_tx_id,
|
| - |
|
44 |
3:string bank_tx_id,
|
| - |
|
45 |
4:string mode,
|
| - |
|
46 |
5:double amount,
|
| - |
|
47 |
6:PaymentStatus status,
|
| - |
|
48 |
7:string description,
|
| - |
|
49 |
9:i64 submissionTimestamp,
|
| - |
|
50 |
10:i64 completionTimestamp
|
| - |
|
51 |
}
|
| - |
|
52 |
|
| - |
|
53 |
struct PaymentInfo{
|
| - |
|
54 |
1:i64 id,
|
| - |
|
55 |
2:map<i64,Payment> payments
|
| - |
|
56 |
}
|
| - |
|
57 |
|
| - |
|
58 |
struct LineItem{
|
| - |
|
59 |
1:i64 id,
|
| - |
|
60 |
2:string sku_id,
|
| - |
|
61 |
3:string brand,
|
| - |
|
62 |
4:string model_number,
|
| - |
|
63 |
5:string model_name,
|
| - |
|
64 |
6:string extra_info,
|
| - |
|
65 |
7:double quantity,
|
| - |
|
66 |
8:double unit_price,
|
| - |
|
67 |
9:double unit_weight,
|
| - |
|
68 |
10:double total_price,
|
| - |
|
69 |
11:double total_weight
|
| - |
|
70 |
}
|
| - |
|
71 |
|
| - |
|
72 |
|
| - |
|
73 |
struct Order{
|
| - |
|
74 |
1:i64 id,
|
| - |
|
75 |
2:i64 warehouse_id,
|
| - |
|
76 |
/**
|
| - |
|
77 |
transaction_id is not required here. relationship will be stored in db
|
| - |
|
78 |
3:i64 transaction_id,
|
| - |
|
79 |
**/
|
| - |
|
80 |
|
| - |
|
81 |
/**
|
| - |
|
82 |
item info
|
| - |
|
83 |
**/
|
| - |
|
84 |
3:list<LineItem> lineitems,
|
| - |
|
85 |
/**
|
| - |
|
86 |
logistics info
|
| - |
|
87 |
**/
|
| - |
|
88 |
4:i64 logistics_provider_id,
|
| - |
|
89 |
5:string airwaybill_no,
|
| - |
|
90 |
6:string tracking_id,
|
| - |
|
91 |
7:i64 expected_delivery_time,
|
| - |
|
92 |
/**
|
| - |
|
93 |
customer info
|
| - |
|
94 |
**/
|
| - |
|
95 |
8:i64 customer_id,
|
| - |
|
96 |
9:string customer_name,
|
| - |
|
97 |
10:string customer_mobilenumber,
|
| - |
|
98 |
11:string customer_pincode,
|
| - |
|
99 |
12:string customer_address,
|
| - |
|
100 |
13:string customer_email,
|
| - |
|
101 |
|
| - |
|
102 |
|
| - |
|
103 |
/**
|
| - |
|
104 |
status and misc info
|
| - |
|
105 |
**/
|
| - |
|
106 |
14:OrderStatus status,
|
| - |
|
107 |
15:string statusDescription
|
| - |
|
108 |
16:double total_amount,
|
| - |
|
109 |
17:double total_weight,
|
| - |
|
110 |
/**
|
| - |
|
111 |
billing info
|
| - |
|
112 |
**/
|
| - |
|
113 |
18:string invoice_number,
|
| - |
|
114 |
19:string billed_by,
|
| - |
|
115 |
/**
|
| - |
|
116 |
timestamps
|
| - |
|
117 |
**/
|
| - |
|
118 |
20:i64 created_timestamp,
|
| - |
|
119 |
21:i64 accepted_timestamp,
|
| - |
|
120 |
22:i64 billing_timestamp,
|
| - |
|
121 |
23:i64 shipping_timestamp,
|
| - |
|
122 |
24:i64 delivery_timestamp,
|
| - |
|
123 |
}
|
| - |
|
124 |
|
| - |
|
125 |
struct Transaction{
|
| - |
|
126 |
1:i64 id,
|
| - |
|
127 |
2:list<Order> orders,
|
| - |
|
128 |
3:PaymentInfo paymentInfo,
|
| - |
|
129 |
4:i64 createdOn,
|
| - |
|
130 |
5:TransactionStatus transactionStatus,
|
| - |
|
131 |
6:string statusDescription,
|
| - |
|
132 |
7:i64 shoppingCartid,
|
| - |
|
133 |
8:i64 customer_id
|
| - |
|
134 |
}
|
| - |
|
135 |
|
| - |
|
136 |
struct Alert{
|
| - |
|
137 |
1:i64 id,
|
| - |
|
138 |
2:i64 order_id,
|
| - |
|
139 |
3:i64 type,
|
| - |
|
140 |
4:i64 time_set,
|
| - |
|
141 |
5:string comment,
|
| - |
|
142 |
6:i64 time_unset
|
| - |
|
143 |
}
|
| - |
|
144 |
|
| - |
|
145 |
exception TransactionServiceException{
|
| - |
|
146 |
1:i32 errorCode,
|
| - |
|
147 |
2:string message
|
| - |
|
148 |
}
|
| - |
|
149 |
|
| - |
|
150 |
service TransactionService{
|
| - |
|
151 |
|
| - |
|
152 |
i64 createTransaction(1:Transaction transaction) throws (1:TransactionServiceException ex),
|
| - |
|
153 |
|
| - |
|
154 |
// Get transaction methods.
|
| - |
|
155 |
Transaction getTransaction(1:i64 id) throws (1:TransactionServiceException ex),
|
| - |
|
156 |
list<Transaction> getTransactionsForCustomer(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:TransactionStatus status) throws (1:TransactionServiceException ex),
|
| - |
|
157 |
list<Transaction> getTransactionsForShoppingCartId(1:i64 shoppingCartId) throws (1:TransactionServiceException ex),
|
| - |
|
158 |
TransactionStatus getTransactionStatus(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
| - |
|
159 |
bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
|
| - |
|
160 |
|
| - |
|
161 |
// Order getter and setters
|
| - |
|
162 |
|
| - |
|
163 |
/*
|
| - |
|
164 |
list<Transaction> getTransactionsForShipmentStatus(1:ShipmentStatus status, 2:i64 from_date, 3:i64 to_date) throws (1:TransactionServiceException ex),
|
| - |
|
165 |
list<Transaction> getTransactionsForCustomer(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:TransactionStatus status) throws (1:TransactionServiceException ex),
|
| - |
|
166 |
list<Transaction> getTransactionsForCustomerAndShipmentStatus(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:ShipmentStatus status) throws (1:TransactionServiceException ex),
|
| - |
|
167 |
list<Transaction> getTransactionsForShoppingCartId(1:i64 shoppingCartId) throws (1:TransactionServiceException ex),
|
| - |
|
168 |
TransactionStatus getTransactionStatus(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
| - |
|
169 |
bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
|
| - |
|
170 |
*/
|
| - |
|
171 |
|
| - |
|
172 |
list<Order> getAllOrders(1:OrderStatus status, 2:i64 from_date, 3:i64 to_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
|
| - |
|
173 |
bool changeOrderStatus(1:i64 orderId, 2:OrderStatus status, 3:string description) throws (1:TransactionServiceException ex),
|
| - |
|
174 |
|
| - |
|
175 |
list<Order> getOrdersForTransaction(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
| - |
|
176 |
list<Order> getOrdersForCustomer(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:OrderStatus status) throws (1:TransactionServiceException ex),
|
| - |
|
177 |
i64 createOrder(1:Order order) throws (1:TransactionServiceException ex),
|
| - |
|
178 |
Order getOrder(1:i64 id) throws (1:TransactionServiceException ex),
|
| - |
|
179 |
list<LineItem> getLineItemsForOrder(1:i64 orderId) throws (1:TransactionServiceException ex),
|
| - |
|
180 |
|
| - |
|
181 |
//Alerts apis
|
| - |
|
182 |
list<Alert> getAlerts(1:i64 orderId, 2:bool valid),
|
| - |
|
183 |
void setAlert(1:i64 orderId, 2:bool unset, 3:i64 type, 4: string comment),
|
| - |
|
184 |
}
|
| - |
|
185 |
|
| - |
|
186 |
|
| - |
|
187 |
/*
|
| - |
|
188 |
|
| - |
|
189 |
enum PaymentStatus{
|
| - |
|
190 |
FAILURE,
|
| - |
|
191 |
SUCCESS
|
| - |
|
192 |
}
|
| - |
|
193 |
|
| 12 |
enum ShipmentStatus{
|
194 |
enum ShipmentStatus{
|
| 13 |
YET_TO_SHIP,
|
195 |
YET_TO_SHIP,
|
| 14 |
SHIPPED,
|
196 |
SHIPPED,
|
| 15 |
IN_TRANSIT,
|
197 |
IN_TRANSIT,
|
| 16 |
DELIVERY_SUCCESS,
|
198 |
DELIVERY_SUCCESS,
|
| Line 31... |
Line 213... |
| 31 |
CANCELED,
|
213 |
CANCELED,
|
| 32 |
FAILED,
|
214 |
FAILED,
|
| 33 |
BILLED
|
215 |
BILLED
|
| 34 |
}
|
216 |
}
|
| 35 |
|
217 |
|
| - |
|
218 |
|
| 36 |
struct Item{
|
219 |
struct Item{
|
| 37 |
1:i64 id,
|
220 |
1:i64 id,
|
| 38 |
2:double price,
|
221 |
2:double price,
|
| 39 |
3:double weight
|
222 |
3:double weight
|
| 40 |
}
|
223 |
}
|
| Line 132... |
Line 315... |
| 132 |
4:string model_name,
|
315 |
4:string model_name,
|
| 133 |
5:string vendor_info,
|
316 |
5:string vendor_info,
|
| 134 |
6:string colour
|
317 |
6:string colour
|
| 135 |
}
|
318 |
}
|
| 136 |
|
319 |
|
| - |
|
320 |
|
| - |
|
321 |
|
| 137 |
exception TransactionServiceException{
|
322 |
exception TransactionServiceException{
|
| 138 |
1:i32 errorCode,
|
323 |
1:i32 errorCode,
|
| 139 |
2:string message
|
324 |
2:string message
|
| 140 |
}
|
325 |
}
|
| 141 |
|
326 |
|
| 142 |
service TransactionService{
|
327 |
service TransactionService{
|
| 143 |
|
328 |
|
| 144 |
i64 createTransaction(1:Transaction transaction) throws (1:TransactionServiceException ex),
|
329 |
i64 createTransaction(1:Transaction transaction) throws (1:TransactionServiceException ex),
|
| 145 |
/**
|
330 |
|
| 146 |
Get transaction methods.
|
331 |
// Get transaction methods.
|
| 147 |
**/
|
332 |
|
| 148 |
Transaction getTransaction(1:i64 id) throws (1:TransactionServiceException ex),
|
333 |
Transaction getTransaction(1:i64 id) throws (1:TransactionServiceException ex),
|
| 149 |
list<Transaction> getAllTransactions(1:TransactionStatus status, 2:i64 from_date, 3:i64 to_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
|
334 |
list<Transaction> getAllTransactions(1:TransactionStatus status, 2:i64 from_date, 3:i64 to_date, 4:i64 warehouse_id) throws (1:TransactionServiceException ex),
|
| 150 |
list<Transaction> getTransactionsForShipmentStatus(1:ShipmentStatus status, 2:i64 from_date, 3:i64 to_date) throws (1:TransactionServiceException ex),
|
335 |
list<Transaction> getTransactionsForShipmentStatus(1:ShipmentStatus status, 2:i64 from_date, 3:i64 to_date) throws (1:TransactionServiceException ex),
|
| 151 |
list<Transaction> getTransactionsForCustomer(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:TransactionStatus status) throws (1:TransactionServiceException ex),
|
336 |
list<Transaction> getTransactionsForCustomer(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:TransactionStatus status) throws (1:TransactionServiceException ex),
|
| 152 |
list<Transaction> getTransactionsForCustomerAndShipmentStatus(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:ShipmentStatus status) throws (1:TransactionServiceException ex),
|
337 |
list<Transaction> getTransactionsForCustomerAndShipmentStatus(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:ShipmentStatus status) throws (1:TransactionServiceException ex),
|
| 153 |
list<Transaction> getTransactionsForShoppingCartId(1:i64 shoppingCartId) throws (1:TransactionServiceException ex),
|
338 |
list<Transaction> getTransactionsForShoppingCartId(1:i64 shoppingCartId) throws (1:TransactionServiceException ex),
|
| 154 |
TransactionStatus getTransactionStatus(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
339 |
TransactionStatus getTransactionStatus(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
| 155 |
bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
|
340 |
bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
|
| 156 |
/**
|
341 |
|
| 157 |
Get and set individual objects in it
|
342 |
// Get and set individual objects in it
|
| 158 |
**/
|
343 |
|
| 159 |
OrderInfo getOrderInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
344 |
OrderInfo getOrderInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
| 160 |
ShipmentInfo getShippingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
345 |
ShipmentInfo getShippingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
| 161 |
BillingInfo getBillingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
346 |
BillingInfo getBillingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
|
| 162 |
bool addBilling(1:i64 tranactionId,2: Billing billing) throws (1:TransactionServiceException ex),
|
347 |
bool addBilling(1:i64 tranactionId,2: Billing billing) throws (1:TransactionServiceException ex),
|
| 163 |
bool setShippingTracker(1:i64 transactionId, 2:i64 shippingId, 3:string trackingId, 4:string airwayBillNo, 5:string provider) throws (1:TransactionServiceException ex),
|
348 |
bool setShippingTracker(1:i64 transactionId, 2:i64 shippingId, 3:string trackingId, 4:string airwayBillNo, 5:string provider) throws (1:TransactionServiceException ex),
|
| Line 169... |
Line 354... |
| 169 |
list<Alert> getAlerts(1:i64 transactionId, 2:bool valid),
|
354 |
list<Alert> getAlerts(1:i64 transactionId, 2:bool valid),
|
| 170 |
void setAlert(1:i64 transactionId, 2:bool unset, 3:i64 type, 4: string comment),
|
355 |
void setAlert(1:i64 transactionId, 2:bool unset, 3:i64 type, 4: string comment),
|
| 171 |
//extra order info apis. added for demo
|
356 |
//extra order info apis. added for demo
|
| 172 |
ExtraOrderInfo getExtraInfo(1:i64 transaction_id),
|
357 |
ExtraOrderInfo getExtraInfo(1:i64 transaction_id),
|
| 173 |
void setExtraInfo(1:i64 transaction_id, 2:i64 sku_id, 3:string model, 4:string colour, 5:string vendor)
|
358 |
void setExtraInfo(1:i64 transaction_id, 2:i64 sku_id, 3:string model, 4:string colour, 5:string vendor)
|
| 174 |
}
|
- |
|
| 175 |
|
359 |
}
|
| - |
|
360 |
*/
|
| - |
|
361 |
|
| 176 |
|
362 |
|