@prodoctors/contracts 1.0.3 → 1.0.5
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.
- package/dist/proto/paths.d.ts +5 -0
- package/dist/proto/paths.js +5 -0
- package/gen/account.ts +79 -17
- package/gen/auth.ts +3 -1
- package/gen/branch.ts +43 -57
- package/gen/catalog.ts +302 -0
- package/gen/common.ts +1 -1
- package/gen/google/protobuf/timestamp.ts +11 -10
- package/gen/inventory.ts +312 -137
- package/gen/partner.ts +194 -0
- package/gen/purchase.ts +156 -0
- package/gen/sales.ts +427 -0
- package/package.json +1 -1
- package/proto/account.proto +60 -14
- package/proto/auth.proto +5 -3
- package/proto/branch.proto +44 -44
- package/proto/catalog.proto +124 -0
- package/proto/inventory.proto +228 -93
- package/proto/partner.proto +103 -0
- package/proto/purchase.proto +105 -0
- package/proto/sales.proto +292 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package purchase.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "common.proto";
|
|
7
|
+
import "partner.proto";
|
|
8
|
+
import "inventory.proto";
|
|
9
|
+
|
|
10
|
+
enum PurchaseStatus {
|
|
11
|
+
PURCHASE_STATUS_UNSPECIFIED = 0;
|
|
12
|
+
PURCHASE_STATUS_DRAFT = 1;
|
|
13
|
+
PURCHASE_STATUS_RECEIVED = 2;
|
|
14
|
+
PURCHASE_STATUS_CANCELLED = 3;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message PurchaseItem {
|
|
18
|
+
string id = 1;
|
|
19
|
+
string purchase_id = 2;
|
|
20
|
+
string product_id = 3;
|
|
21
|
+
string batch_number = 4;
|
|
22
|
+
google.protobuf.Timestamp expiry_date = 5;
|
|
23
|
+
optional google.protobuf.Timestamp manufacture_date = 6;
|
|
24
|
+
string purchase_price = 7;
|
|
25
|
+
string selling_price = 8;
|
|
26
|
+
int32 quantity = 9;
|
|
27
|
+
string total_amount = 10;
|
|
28
|
+
optional string batch_id = 11;
|
|
29
|
+
optional inventory.v1.Product product = 12;
|
|
30
|
+
google.protobuf.Timestamp created_at = 13;
|
|
31
|
+
google.protobuf.Timestamp updated_at = 14;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message Purchase {
|
|
35
|
+
string id = 1;
|
|
36
|
+
optional string invoice_number = 2;
|
|
37
|
+
PurchaseStatus status = 3;
|
|
38
|
+
string branch_id = 4;
|
|
39
|
+
string supplier_id = 5;
|
|
40
|
+
optional string received_by_id = 6;
|
|
41
|
+
google.protobuf.Timestamp purchase_date = 7;
|
|
42
|
+
string total_amount = 8;
|
|
43
|
+
optional string note = 9;
|
|
44
|
+
optional partner.v1.Supplier supplier = 10;
|
|
45
|
+
repeated PurchaseItem items = 11;
|
|
46
|
+
google.protobuf.Timestamp created_at = 12;
|
|
47
|
+
google.protobuf.Timestamp updated_at = 13;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message CreatePurchaseItemInput {
|
|
51
|
+
string product_id = 1;
|
|
52
|
+
string batch_number = 2;
|
|
53
|
+
google.protobuf.Timestamp expiry_date = 3;
|
|
54
|
+
optional google.protobuf.Timestamp manufacture_date = 4;
|
|
55
|
+
string purchase_price = 5;
|
|
56
|
+
string selling_price = 6;
|
|
57
|
+
int32 quantity = 7;
|
|
58
|
+
string total_amount = 8;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message CreatePurchaseRequest {
|
|
62
|
+
optional string invoice_number = 1;
|
|
63
|
+
optional PurchaseStatus status = 2;
|
|
64
|
+
string branch_id = 3;
|
|
65
|
+
string supplier_id = 4;
|
|
66
|
+
optional string received_by_id = 5;
|
|
67
|
+
optional google.protobuf.Timestamp purchase_date = 6;
|
|
68
|
+
optional string total_amount = 7;
|
|
69
|
+
optional string note = 8;
|
|
70
|
+
repeated CreatePurchaseItemInput items = 9;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message UpdatePurchaseRequest {
|
|
74
|
+
string id = 1;
|
|
75
|
+
optional string invoice_number = 2;
|
|
76
|
+
optional PurchaseStatus status = 3;
|
|
77
|
+
optional string branch_id = 4;
|
|
78
|
+
optional string supplier_id = 5;
|
|
79
|
+
optional string received_by_id = 6;
|
|
80
|
+
optional google.protobuf.Timestamp purchase_date = 7;
|
|
81
|
+
optional string total_amount = 8;
|
|
82
|
+
optional string note = 9;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message ListPurchasesRequest {
|
|
86
|
+
common.v1.PaginationRequest pagination = 1;
|
|
87
|
+
optional string branch_id = 2;
|
|
88
|
+
optional string supplier_id = 3;
|
|
89
|
+
optional string received_by_id = 4;
|
|
90
|
+
optional PurchaseStatus status = 5;
|
|
91
|
+
optional string search = 6;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message ListPurchasesResponse {
|
|
95
|
+
repeated Purchase items = 1;
|
|
96
|
+
common.v1.PaginationMeta meta = 2;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
service PurchaseService {
|
|
100
|
+
rpc CreatePurchase(CreatePurchaseRequest) returns (Purchase);
|
|
101
|
+
rpc UpdatePurchase(UpdatePurchaseRequest) returns (Purchase);
|
|
102
|
+
rpc GetPurchaseById(common.v1.IdRequest) returns (Purchase);
|
|
103
|
+
rpc ListPurchases(ListPurchasesRequest) returns (ListPurchasesResponse);
|
|
104
|
+
rpc DeletePurchase(common.v1.IdRequest) returns (common.v1.BoolResponse);
|
|
105
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package sales.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "common.proto";
|
|
7
|
+
import "inventory.proto";
|
|
8
|
+
import "partner.proto";
|
|
9
|
+
|
|
10
|
+
enum SaleStatus {
|
|
11
|
+
SALE_STATUS_UNSPECIFIED = 0;
|
|
12
|
+
SALE_STATUS_DRAFT = 1;
|
|
13
|
+
SALE_STATUS_COMPLETED = 2;
|
|
14
|
+
SALE_STATUS_CANCELLED = 3;
|
|
15
|
+
SALE_STATUS_REFUNDED = 4;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
enum PaymentMethod {
|
|
19
|
+
PAYMENT_METHOD_UNSPECIFIED = 0;
|
|
20
|
+
PAYMENT_METHOD_CASH = 1;
|
|
21
|
+
PAYMENT_METHOD_CARD = 2;
|
|
22
|
+
PAYMENT_METHOD_MIXED = 3;
|
|
23
|
+
PAYMENT_METHOD_BANK_TRANSFER = 4;
|
|
24
|
+
PAYMENT_METHOD_ONLINE = 5;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
enum WriteOffReason {
|
|
28
|
+
WRITE_OFF_REASON_UNSPECIFIED = 0;
|
|
29
|
+
WRITE_OFF_REASON_EXPIRED = 1;
|
|
30
|
+
WRITE_OFF_REASON_DAMAGED = 2;
|
|
31
|
+
WRITE_OFF_REASON_LOST = 3;
|
|
32
|
+
WRITE_OFF_REASON_INTERNAL_USE = 4;
|
|
33
|
+
WRITE_OFF_REASON_OTHER = 5;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message SaleItem {
|
|
37
|
+
string id = 1;
|
|
38
|
+
string sale_order_id = 2;
|
|
39
|
+
string product_id = 3;
|
|
40
|
+
string product_batch_id = 4;
|
|
41
|
+
int32 quantity = 5;
|
|
42
|
+
string unit_price = 6;
|
|
43
|
+
string discount_amount = 7;
|
|
44
|
+
string total_amount = 8;
|
|
45
|
+
optional inventory.v1.Product product = 9;
|
|
46
|
+
optional inventory.v1.ProductBatch product_batch = 10;
|
|
47
|
+
google.protobuf.Timestamp created_at = 11;
|
|
48
|
+
google.protobuf.Timestamp updated_at = 12;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message SaleOrder {
|
|
52
|
+
string id = 1;
|
|
53
|
+
string receipt_number = 2;
|
|
54
|
+
SaleStatus status = 3;
|
|
55
|
+
string branch_id = 4;
|
|
56
|
+
optional string cashier_id = 5;
|
|
57
|
+
optional string customer_id = 6;
|
|
58
|
+
PaymentMethod payment_method = 7;
|
|
59
|
+
string subtotal = 8;
|
|
60
|
+
string discount_amount = 9;
|
|
61
|
+
string tax_amount = 10;
|
|
62
|
+
string total_amount = 11;
|
|
63
|
+
string paid_amount = 12;
|
|
64
|
+
string change_amount = 13;
|
|
65
|
+
optional string note = 14;
|
|
66
|
+
optional partner.v1.Customer customer = 15;
|
|
67
|
+
repeated SaleItem items = 16;
|
|
68
|
+
google.protobuf.Timestamp sold_at = 17;
|
|
69
|
+
google.protobuf.Timestamp created_at = 18;
|
|
70
|
+
google.protobuf.Timestamp updated_at = 19;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message SaleReturnItem {
|
|
74
|
+
string id = 1;
|
|
75
|
+
string sale_return_id = 2;
|
|
76
|
+
string product_id = 3;
|
|
77
|
+
string product_batch_id = 4;
|
|
78
|
+
int32 quantity = 5;
|
|
79
|
+
string unit_price = 6;
|
|
80
|
+
string total_amount = 7;
|
|
81
|
+
optional inventory.v1.Product product = 8;
|
|
82
|
+
optional inventory.v1.ProductBatch product_batch = 9;
|
|
83
|
+
google.protobuf.Timestamp created_at = 10;
|
|
84
|
+
google.protobuf.Timestamp updated_at = 11;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message SaleReturn {
|
|
88
|
+
string id = 1;
|
|
89
|
+
string return_number = 2;
|
|
90
|
+
string sale_order_id = 3;
|
|
91
|
+
string branch_id = 4;
|
|
92
|
+
optional string customer_id = 5;
|
|
93
|
+
optional string processed_by_id = 6;
|
|
94
|
+
string total_amount = 7;
|
|
95
|
+
optional string reason = 8;
|
|
96
|
+
repeated SaleReturnItem items = 9;
|
|
97
|
+
optional partner.v1.Customer customer = 10;
|
|
98
|
+
google.protobuf.Timestamp returned_at = 11;
|
|
99
|
+
google.protobuf.Timestamp created_at = 12;
|
|
100
|
+
google.protobuf.Timestamp updated_at = 13;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
message WriteOffItem {
|
|
104
|
+
string id = 1;
|
|
105
|
+
string write_off_id = 2;
|
|
106
|
+
string product_id = 3;
|
|
107
|
+
string product_batch_id = 4;
|
|
108
|
+
int32 quantity = 5;
|
|
109
|
+
string unit_price = 6;
|
|
110
|
+
string total_amount = 7;
|
|
111
|
+
optional string note = 8;
|
|
112
|
+
optional inventory.v1.Product product = 9;
|
|
113
|
+
optional inventory.v1.ProductBatch product_batch = 10;
|
|
114
|
+
google.protobuf.Timestamp created_at = 11;
|
|
115
|
+
google.protobuf.Timestamp updated_at = 12;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
message WriteOff {
|
|
119
|
+
string id = 1;
|
|
120
|
+
string document_number = 2;
|
|
121
|
+
string branch_id = 3;
|
|
122
|
+
optional string created_by_id = 4;
|
|
123
|
+
WriteOffReason reason = 5;
|
|
124
|
+
optional string note = 6;
|
|
125
|
+
repeated WriteOffItem items = 7;
|
|
126
|
+
google.protobuf.Timestamp created_at = 8;
|
|
127
|
+
google.protobuf.Timestamp updated_at = 9;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
message CreateSaleItemInput {
|
|
131
|
+
string product_id = 1;
|
|
132
|
+
string product_batch_id = 2;
|
|
133
|
+
int32 quantity = 3;
|
|
134
|
+
string unit_price = 4;
|
|
135
|
+
optional string discount_amount = 5;
|
|
136
|
+
string total_amount = 6;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
message CreateSaleOrderRequest {
|
|
140
|
+
string receipt_number = 1;
|
|
141
|
+
optional SaleStatus status = 2;
|
|
142
|
+
string branch_id = 3;
|
|
143
|
+
optional string cashier_id = 4;
|
|
144
|
+
optional string customer_id = 5;
|
|
145
|
+
PaymentMethod payment_method = 6;
|
|
146
|
+
optional string subtotal = 7;
|
|
147
|
+
optional string discount_amount = 8;
|
|
148
|
+
optional string tax_amount = 9;
|
|
149
|
+
optional string total_amount = 10;
|
|
150
|
+
optional string paid_amount = 11;
|
|
151
|
+
optional string change_amount = 12;
|
|
152
|
+
optional string note = 13;
|
|
153
|
+
optional google.protobuf.Timestamp sold_at = 14;
|
|
154
|
+
repeated CreateSaleItemInput items = 15;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
message UpdateSaleOrderRequest {
|
|
158
|
+
string id = 1;
|
|
159
|
+
optional string receipt_number = 2;
|
|
160
|
+
optional SaleStatus status = 3;
|
|
161
|
+
optional string branch_id = 4;
|
|
162
|
+
optional string cashier_id = 5;
|
|
163
|
+
optional string customer_id = 6;
|
|
164
|
+
optional PaymentMethod payment_method = 7;
|
|
165
|
+
optional string subtotal = 8;
|
|
166
|
+
optional string discount_amount = 9;
|
|
167
|
+
optional string tax_amount = 10;
|
|
168
|
+
optional string total_amount = 11;
|
|
169
|
+
optional string paid_amount = 12;
|
|
170
|
+
optional string change_amount = 13;
|
|
171
|
+
optional string note = 14;
|
|
172
|
+
optional google.protobuf.Timestamp sold_at = 15;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
message ListSaleOrdersRequest {
|
|
176
|
+
common.v1.PaginationRequest pagination = 1;
|
|
177
|
+
optional string branch_id = 2;
|
|
178
|
+
optional string cashier_id = 3;
|
|
179
|
+
optional string customer_id = 4;
|
|
180
|
+
optional SaleStatus status = 5;
|
|
181
|
+
optional string receipt_number = 6;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
message ListSaleOrdersResponse {
|
|
185
|
+
repeated SaleOrder items = 1;
|
|
186
|
+
common.v1.PaginationMeta meta = 2;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
message CreateSaleReturnItemInput {
|
|
190
|
+
string product_id = 1;
|
|
191
|
+
string product_batch_id = 2;
|
|
192
|
+
int32 quantity = 3;
|
|
193
|
+
string unit_price = 4;
|
|
194
|
+
string total_amount = 5;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
message CreateSaleReturnRequest {
|
|
198
|
+
string return_number = 1;
|
|
199
|
+
string sale_order_id = 2;
|
|
200
|
+
string branch_id = 3;
|
|
201
|
+
optional string customer_id = 4;
|
|
202
|
+
optional string processed_by_id = 5;
|
|
203
|
+
optional string total_amount = 6;
|
|
204
|
+
optional string reason = 7;
|
|
205
|
+
optional google.protobuf.Timestamp returned_at = 8;
|
|
206
|
+
repeated CreateSaleReturnItemInput items = 9;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
message UpdateSaleReturnRequest {
|
|
210
|
+
string id = 1;
|
|
211
|
+
optional string customer_id = 2;
|
|
212
|
+
optional string processed_by_id = 3;
|
|
213
|
+
optional string total_amount = 4;
|
|
214
|
+
optional string reason = 5;
|
|
215
|
+
optional google.protobuf.Timestamp returned_at = 6;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
message ListSaleReturnsRequest {
|
|
219
|
+
common.v1.PaginationRequest pagination = 1;
|
|
220
|
+
optional string branch_id = 2;
|
|
221
|
+
optional string sale_order_id = 3;
|
|
222
|
+
optional string customer_id = 4;
|
|
223
|
+
optional string processed_by_id = 5;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
message ListSaleReturnsResponse {
|
|
227
|
+
repeated SaleReturn items = 1;
|
|
228
|
+
common.v1.PaginationMeta meta = 2;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
message CreateWriteOffItemInput {
|
|
232
|
+
string product_id = 1;
|
|
233
|
+
string product_batch_id = 2;
|
|
234
|
+
int32 quantity = 3;
|
|
235
|
+
string unit_price = 4;
|
|
236
|
+
string total_amount = 5;
|
|
237
|
+
optional string note = 6;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
message CreateWriteOffRequest {
|
|
241
|
+
string document_number = 1;
|
|
242
|
+
string branch_id = 2;
|
|
243
|
+
optional string created_by_id = 3;
|
|
244
|
+
WriteOffReason reason = 4;
|
|
245
|
+
optional string note = 5;
|
|
246
|
+
repeated CreateWriteOffItemInput items = 6;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
message UpdateWriteOffRequest {
|
|
250
|
+
string id = 1;
|
|
251
|
+
optional string document_number = 2;
|
|
252
|
+
optional string branch_id = 3;
|
|
253
|
+
optional string created_by_id = 4;
|
|
254
|
+
optional WriteOffReason reason = 5;
|
|
255
|
+
optional string note = 6;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
message ListWriteOffsRequest {
|
|
259
|
+
common.v1.PaginationRequest pagination = 1;
|
|
260
|
+
optional string branch_id = 2;
|
|
261
|
+
optional string created_by_id = 3;
|
|
262
|
+
optional WriteOffReason reason = 4;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
message ListWriteOffsResponse {
|
|
266
|
+
repeated WriteOff items = 1;
|
|
267
|
+
common.v1.PaginationMeta meta = 2;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
service SaleOrderService {
|
|
271
|
+
rpc CreateSaleOrder(CreateSaleOrderRequest) returns (SaleOrder);
|
|
272
|
+
rpc UpdateSaleOrder(UpdateSaleOrderRequest) returns (SaleOrder);
|
|
273
|
+
rpc GetSaleOrderById(common.v1.IdRequest) returns (SaleOrder);
|
|
274
|
+
rpc ListSaleOrders(ListSaleOrdersRequest) returns (ListSaleOrdersResponse);
|
|
275
|
+
rpc DeleteSaleOrder(common.v1.IdRequest) returns (common.v1.BoolResponse);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
service SaleReturnService {
|
|
279
|
+
rpc CreateSaleReturn(CreateSaleReturnRequest) returns (SaleReturn);
|
|
280
|
+
rpc UpdateSaleReturn(UpdateSaleReturnRequest) returns (SaleReturn);
|
|
281
|
+
rpc GetSaleReturnById(common.v1.IdRequest) returns (SaleReturn);
|
|
282
|
+
rpc ListSaleReturns(ListSaleReturnsRequest) returns (ListSaleReturnsResponse);
|
|
283
|
+
rpc DeleteSaleReturn(common.v1.IdRequest) returns (common.v1.BoolResponse);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
service WriteOffService {
|
|
287
|
+
rpc CreateWriteOff(CreateWriteOffRequest) returns (WriteOff);
|
|
288
|
+
rpc UpdateWriteOff(UpdateWriteOffRequest) returns (WriteOff);
|
|
289
|
+
rpc GetWriteOffById(common.v1.IdRequest) returns (WriteOff);
|
|
290
|
+
rpc ListWriteOffs(ListWriteOffsRequest) returns (ListWriteOffsResponse);
|
|
291
|
+
rpc DeleteWriteOff(common.v1.IdRequest) returns (common.v1.BoolResponse);
|
|
292
|
+
}
|