Subversion Repositories SmartDukaan

Rev

Rev 85 | Rev 121 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
68 ashish 1
namespace java in.shop2020.model.v1.order
95 ashish 2
namespace py shop2020.thriftpy.model.v1.order
68 ashish 3
/***
4
	Order objects.
5
*/
6
 
7
enum PaymentStatus{
8
	FAILURE,
9
	SUCCESS
10
}
11
 
12
enum ShipmentStatus{
13
	SHIPPED,
14
	IN_TRANSIT,
15
	DELIVERED
16
}
17
 
18
enum TransactionStatus{
19
	INIT,
20
	SUBMITTED_FOR_PROCESSING,
21
	ORDER_FULFILLMENT,
22
	COMPLETED		
23
}
24
 
25
struct Item{
85 ashish 26
	1:i64 id,
68 ashish 27
	2:double price
28
}
29
 
30
struct LineItem{
31
	1:Item item,
32
	2:i64 id,
33
	3:i64 addedOn,
34
	4:map<string,string> additionalInfo
35
}
36
 
37
struct OrderInfo{
38
	1:i64 id,
39
	2:list<LineItem> lineitems
40
}
41
 
42
struct Billing{
43
	1:i64 id,
44
	2:string billNumber,
45
	3:LineItem lineItem,
46
	4:i64 generatedTimestamp,
47
	5:string generatedBy
48
}
49
 
50
struct BillingInfo{
51
	1:i64 id,
52
	2:list<Billing> billings
53
}
54
 
55
struct Shipment{
56
	1:i64 id,
57
	2:string address,
58
	3:string trackingId,
59
	4:list<LineItem> lineItems,
60
	5:ShipmentStatus status,
61
	6:i64 shipmentTimestamp,
62
	7:i64 deliveryTimestamp,
63
	8:double value,
64
	9:double insurance,
65
	10:double weight,
66
	11:string airwayBillNo,
67
	12:string provider
68
}
69
 
70
struct ShipmentInfo{
71
	1:list<Shipment> shipments,
72
	2:i64 id
73
}
74
 
75
struct Payment{
76
	1:i64 id,
77
	2:string merchant_tx_id,
78
	3:string bank_tx_id,
79
	4:string mode,
80
	5:double amount,
81
	6:PaymentStatus status,
82
	7:string description,
83
	9:i64 submissionTimestamp,
84
	10:i64 completionTimestamp
85
}
86
 
87
struct PaymentInfo{
88
	1:i64 id,
89
	2:map<i64,Payment> payments
90
}
91
 
92
struct Transaction{
93
	1:i64 id,
94
	2:OrderInfo orderInfo,
95
	3:ShipmentInfo shipmentInfo,
96
	4:BillingInfo billingInfo,
97
	5:PaymentInfo paymentInfo,
98
	6:i64 createdOn,
99
	7:i64 expectedDeliveryTime,
100
	8:TransactionStatus transactionStatus,
101
	9:string statusDescription,
102
	10:i64 customer_id
103
}
104
 
105
exception TransactionServiceException{
106
	1:i32 errorCode,
107
	2:string message
108
}
109
 
110
service TransactionService{
111
 
112
	void createTransaction(1:Transaction transaction) throws (1:TransactionServiceException ex),
113
	/**
114
		Get transaction methods.
115
	**/
116
	Transaction getTransaction(1:i64 id) throws (1:TransactionServiceException ex),
95 ashish 117
	list<Transaction> getAllTransactions(1:TransactionStatus status, 2:i64 from_date, 3:i64 to_date) throws (1:TransactionServiceException ex),
118
	list<Transaction> getTransactionsForShipmentStatus(1:ShipmentStatus status, 2:i64 from_date, 3:i64 to_date) throws (1:TransactionServiceException ex),
119
	list<Transaction> getTransactionsForCustomer(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:TransactionStatus status) throws (1:TransactionServiceException ex),
120
	list<Transaction> getTransactionsForCustomerAndShipmentStatus(1:i64 customerId, 2:i64 from_date, 3:i64 to_date, 4:ShipmentStatus status) throws (1:TransactionServiceException ex),
68 ashish 121
	TransactionStatus getTransactionStatus(1:i64 transactionId) throws (1:TransactionServiceException ex),
122
	bool changeTransactionStatus(1:i64 transactionId, 2:TransactionStatus status, 3:string description) throws (1:TransactionServiceException ex),
123
	/**
124
		Get and set individual objects in it
125
	**/
126
	OrderInfo getOrderInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
127
	ShipmentInfo getShippingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
128
	BillingInfo getBillingInfo(1:i64 transactionId) throws (1:TransactionServiceException ex),
129
	bool addBilling(1:i64 tranactionId,2: Billing billing) throws (1:TransactionServiceException ex),
130
	bool setShippingTracker(1:i64 transactionId, 2:i64 shippingId, 3:string trackingId, 4:string airwayBillNo, 5:string provider) throws (1:TransactionServiceException ex),
131
	bool setShippingDate(1:i64 transactionId, 2:i64 shippingId, 3:i64 timestamp) throws (1:TransactionServiceException ex),
132
	bool setDeliveryDate(1:i64 transactionId, 2:i64 shippingid, 3:i64 timestamp) throws (1:TransactionServiceException ex),
133
	bool changeShippingStatus(1:i64 transactionId, 2:i64 shippingId, 3:ShipmentStatus status, 4:string description) throws (1:TransactionServiceException ex),
134
	bool addTrail(1:i64 transactionId, 2:string description)throws (1:TransactionServiceException ex)
135
}