@prodoctors/contracts 1.0.2 → 1.0.4
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 +122 -61
- package/gen/auth.ts +131 -140
- package/gen/branch.ts +51 -65
- package/gen/catalog.ts +302 -0
- package/gen/common.ts +41 -0
- package/gen/google/protobuf/timestamp.ts +119 -0
- package/gen/inventory.ts +472 -0
- 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 +68 -24
- package/proto/auth.proto +74 -82
- package/proto/branch.proto +64 -64
- package/proto/catalog.proto +124 -0
- package/proto/common.proto +34 -0
- package/proto/inventory.proto +302 -0
- package/proto/partner.proto +103 -0
- package/proto/purchase.proto +105 -0
- package/proto/sales.proto +292 -0
package/gen/purchase.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.5
|
|
4
|
+
// protoc v7.34.0
|
|
5
|
+
// source: purchase.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { BoolResponse, IdRequest, PaginationMeta, PaginationRequest } from "./common";
|
|
11
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
12
|
+
import { Product } from "./inventory";
|
|
13
|
+
import { Supplier } from "./partner";
|
|
14
|
+
|
|
15
|
+
export const protobufPackage = "purchase.v1";
|
|
16
|
+
|
|
17
|
+
export enum PurchaseStatus {
|
|
18
|
+
PURCHASE_STATUS_UNSPECIFIED = 0,
|
|
19
|
+
PURCHASE_STATUS_DRAFT = 1,
|
|
20
|
+
PURCHASE_STATUS_RECEIVED = 2,
|
|
21
|
+
PURCHASE_STATUS_CANCELLED = 3,
|
|
22
|
+
UNRECOGNIZED = -1,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PurchaseItem {
|
|
26
|
+
id: string;
|
|
27
|
+
purchaseId: string;
|
|
28
|
+
productId: string;
|
|
29
|
+
batchNumber: string;
|
|
30
|
+
expiryDate: Timestamp | undefined;
|
|
31
|
+
manufactureDate?: Timestamp | undefined;
|
|
32
|
+
purchasePrice: string;
|
|
33
|
+
sellingPrice: string;
|
|
34
|
+
quantity: number;
|
|
35
|
+
totalAmount: string;
|
|
36
|
+
batchId?: string | undefined;
|
|
37
|
+
product?: Product | undefined;
|
|
38
|
+
createdAt: Timestamp | undefined;
|
|
39
|
+
updatedAt: Timestamp | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Purchase {
|
|
43
|
+
id: string;
|
|
44
|
+
invoiceNumber?: string | undefined;
|
|
45
|
+
status: PurchaseStatus;
|
|
46
|
+
branchId: string;
|
|
47
|
+
supplierId: string;
|
|
48
|
+
receivedById?: string | undefined;
|
|
49
|
+
purchaseDate: Timestamp | undefined;
|
|
50
|
+
totalAmount: string;
|
|
51
|
+
note?: string | undefined;
|
|
52
|
+
supplier?: Supplier | undefined;
|
|
53
|
+
items: PurchaseItem[];
|
|
54
|
+
createdAt: Timestamp | undefined;
|
|
55
|
+
updatedAt: Timestamp | undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface CreatePurchaseItemInput {
|
|
59
|
+
productId: string;
|
|
60
|
+
batchNumber: string;
|
|
61
|
+
expiryDate: Timestamp | undefined;
|
|
62
|
+
manufactureDate?: Timestamp | undefined;
|
|
63
|
+
purchasePrice: string;
|
|
64
|
+
sellingPrice: string;
|
|
65
|
+
quantity: number;
|
|
66
|
+
totalAmount: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CreatePurchaseRequest {
|
|
70
|
+
invoiceNumber?: string | undefined;
|
|
71
|
+
status?: PurchaseStatus | undefined;
|
|
72
|
+
branchId: string;
|
|
73
|
+
supplierId: string;
|
|
74
|
+
receivedById?: string | undefined;
|
|
75
|
+
purchaseDate?: Timestamp | undefined;
|
|
76
|
+
totalAmount?: string | undefined;
|
|
77
|
+
note?: string | undefined;
|
|
78
|
+
items: CreatePurchaseItemInput[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface UpdatePurchaseRequest {
|
|
82
|
+
id: string;
|
|
83
|
+
invoiceNumber?: string | undefined;
|
|
84
|
+
status?: PurchaseStatus | undefined;
|
|
85
|
+
branchId?: string | undefined;
|
|
86
|
+
supplierId?: string | undefined;
|
|
87
|
+
receivedById?: string | undefined;
|
|
88
|
+
purchaseDate?: Timestamp | undefined;
|
|
89
|
+
totalAmount?: string | undefined;
|
|
90
|
+
note?: string | undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface ListPurchasesRequest {
|
|
94
|
+
pagination: PaginationRequest | undefined;
|
|
95
|
+
branchId?: string | undefined;
|
|
96
|
+
supplierId?: string | undefined;
|
|
97
|
+
receivedById?: string | undefined;
|
|
98
|
+
status?: PurchaseStatus | undefined;
|
|
99
|
+
search?: string | undefined;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ListPurchasesResponse {
|
|
103
|
+
items: Purchase[];
|
|
104
|
+
meta: PaginationMeta | undefined;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const PURCHASE_V1_PACKAGE_NAME = "purchase.v1";
|
|
108
|
+
|
|
109
|
+
export interface PurchaseServiceClient {
|
|
110
|
+
createPurchase(request: CreatePurchaseRequest): Observable<Purchase>;
|
|
111
|
+
|
|
112
|
+
updatePurchase(request: UpdatePurchaseRequest): Observable<Purchase>;
|
|
113
|
+
|
|
114
|
+
getPurchaseById(request: IdRequest): Observable<Purchase>;
|
|
115
|
+
|
|
116
|
+
listPurchases(request: ListPurchasesRequest): Observable<ListPurchasesResponse>;
|
|
117
|
+
|
|
118
|
+
deletePurchase(request: IdRequest): Observable<BoolResponse>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface PurchaseServiceController {
|
|
122
|
+
createPurchase(request: CreatePurchaseRequest): Promise<Purchase> | Observable<Purchase> | Purchase;
|
|
123
|
+
|
|
124
|
+
updatePurchase(request: UpdatePurchaseRequest): Promise<Purchase> | Observable<Purchase> | Purchase;
|
|
125
|
+
|
|
126
|
+
getPurchaseById(request: IdRequest): Promise<Purchase> | Observable<Purchase> | Purchase;
|
|
127
|
+
|
|
128
|
+
listPurchases(
|
|
129
|
+
request: ListPurchasesRequest,
|
|
130
|
+
): Promise<ListPurchasesResponse> | Observable<ListPurchasesResponse> | ListPurchasesResponse;
|
|
131
|
+
|
|
132
|
+
deletePurchase(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function PurchaseServiceControllerMethods() {
|
|
136
|
+
return function (constructor: Function) {
|
|
137
|
+
const grpcMethods: string[] = [
|
|
138
|
+
"createPurchase",
|
|
139
|
+
"updatePurchase",
|
|
140
|
+
"getPurchaseById",
|
|
141
|
+
"listPurchases",
|
|
142
|
+
"deletePurchase",
|
|
143
|
+
];
|
|
144
|
+
for (const method of grpcMethods) {
|
|
145
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
146
|
+
GrpcMethod("PurchaseService", method)(constructor.prototype[method], method, descriptor);
|
|
147
|
+
}
|
|
148
|
+
const grpcStreamMethods: string[] = [];
|
|
149
|
+
for (const method of grpcStreamMethods) {
|
|
150
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
151
|
+
GrpcStreamMethod("PurchaseService", method)(constructor.prototype[method], method, descriptor);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export const PURCHASE_SERVICE_NAME = "PurchaseService";
|
package/gen/sales.ts
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.5
|
|
4
|
+
// protoc v7.34.0
|
|
5
|
+
// source: sales.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { BoolResponse, IdRequest, PaginationMeta, PaginationRequest } from "./common";
|
|
11
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
12
|
+
import { Product, ProductBatch } from "./inventory";
|
|
13
|
+
import { Customer } from "./partner";
|
|
14
|
+
|
|
15
|
+
export const protobufPackage = "sales.v1";
|
|
16
|
+
|
|
17
|
+
export enum SaleStatus {
|
|
18
|
+
SALE_STATUS_UNSPECIFIED = 0,
|
|
19
|
+
SALE_STATUS_DRAFT = 1,
|
|
20
|
+
SALE_STATUS_COMPLETED = 2,
|
|
21
|
+
SALE_STATUS_CANCELLED = 3,
|
|
22
|
+
SALE_STATUS_REFUNDED = 4,
|
|
23
|
+
UNRECOGNIZED = -1,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export enum PaymentMethod {
|
|
27
|
+
PAYMENT_METHOD_UNSPECIFIED = 0,
|
|
28
|
+
PAYMENT_METHOD_CASH = 1,
|
|
29
|
+
PAYMENT_METHOD_CARD = 2,
|
|
30
|
+
PAYMENT_METHOD_MIXED = 3,
|
|
31
|
+
PAYMENT_METHOD_BANK_TRANSFER = 4,
|
|
32
|
+
PAYMENT_METHOD_ONLINE = 5,
|
|
33
|
+
UNRECOGNIZED = -1,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export enum WriteOffReason {
|
|
37
|
+
WRITE_OFF_REASON_UNSPECIFIED = 0,
|
|
38
|
+
WRITE_OFF_REASON_EXPIRED = 1,
|
|
39
|
+
WRITE_OFF_REASON_DAMAGED = 2,
|
|
40
|
+
WRITE_OFF_REASON_LOST = 3,
|
|
41
|
+
WRITE_OFF_REASON_INTERNAL_USE = 4,
|
|
42
|
+
WRITE_OFF_REASON_OTHER = 5,
|
|
43
|
+
UNRECOGNIZED = -1,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface SaleItem {
|
|
47
|
+
id: string;
|
|
48
|
+
saleOrderId: string;
|
|
49
|
+
productId: string;
|
|
50
|
+
productBatchId: string;
|
|
51
|
+
quantity: number;
|
|
52
|
+
unitPrice: string;
|
|
53
|
+
discountAmount: string;
|
|
54
|
+
totalAmount: string;
|
|
55
|
+
product?: Product | undefined;
|
|
56
|
+
productBatch?: ProductBatch | undefined;
|
|
57
|
+
createdAt: Timestamp | undefined;
|
|
58
|
+
updatedAt: Timestamp | undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface SaleOrder {
|
|
62
|
+
id: string;
|
|
63
|
+
receiptNumber: string;
|
|
64
|
+
status: SaleStatus;
|
|
65
|
+
branchId: string;
|
|
66
|
+
cashierId?: string | undefined;
|
|
67
|
+
customerId?: string | undefined;
|
|
68
|
+
paymentMethod: PaymentMethod;
|
|
69
|
+
subtotal: string;
|
|
70
|
+
discountAmount: string;
|
|
71
|
+
taxAmount: string;
|
|
72
|
+
totalAmount: string;
|
|
73
|
+
paidAmount: string;
|
|
74
|
+
changeAmount: string;
|
|
75
|
+
note?: string | undefined;
|
|
76
|
+
customer?: Customer | undefined;
|
|
77
|
+
items: SaleItem[];
|
|
78
|
+
soldAt: Timestamp | undefined;
|
|
79
|
+
createdAt: Timestamp | undefined;
|
|
80
|
+
updatedAt: Timestamp | undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface SaleReturnItem {
|
|
84
|
+
id: string;
|
|
85
|
+
saleReturnId: string;
|
|
86
|
+
productId: string;
|
|
87
|
+
productBatchId: string;
|
|
88
|
+
quantity: number;
|
|
89
|
+
unitPrice: string;
|
|
90
|
+
totalAmount: string;
|
|
91
|
+
product?: Product | undefined;
|
|
92
|
+
productBatch?: ProductBatch | undefined;
|
|
93
|
+
createdAt: Timestamp | undefined;
|
|
94
|
+
updatedAt: Timestamp | undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface SaleReturn {
|
|
98
|
+
id: string;
|
|
99
|
+
returnNumber: string;
|
|
100
|
+
saleOrderId: string;
|
|
101
|
+
branchId: string;
|
|
102
|
+
customerId?: string | undefined;
|
|
103
|
+
processedById?: string | undefined;
|
|
104
|
+
totalAmount: string;
|
|
105
|
+
reason?: string | undefined;
|
|
106
|
+
items: SaleReturnItem[];
|
|
107
|
+
customer?: Customer | undefined;
|
|
108
|
+
returnedAt: Timestamp | undefined;
|
|
109
|
+
createdAt: Timestamp | undefined;
|
|
110
|
+
updatedAt: Timestamp | undefined;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface WriteOffItem {
|
|
114
|
+
id: string;
|
|
115
|
+
writeOffId: string;
|
|
116
|
+
productId: string;
|
|
117
|
+
productBatchId: string;
|
|
118
|
+
quantity: number;
|
|
119
|
+
unitPrice: string;
|
|
120
|
+
totalAmount: string;
|
|
121
|
+
note?: string | undefined;
|
|
122
|
+
product?: Product | undefined;
|
|
123
|
+
productBatch?: ProductBatch | undefined;
|
|
124
|
+
createdAt: Timestamp | undefined;
|
|
125
|
+
updatedAt: Timestamp | undefined;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface WriteOff {
|
|
129
|
+
id: string;
|
|
130
|
+
documentNumber: string;
|
|
131
|
+
branchId: string;
|
|
132
|
+
createdById?: string | undefined;
|
|
133
|
+
reason: WriteOffReason;
|
|
134
|
+
note?: string | undefined;
|
|
135
|
+
items: WriteOffItem[];
|
|
136
|
+
createdAt: Timestamp | undefined;
|
|
137
|
+
updatedAt: Timestamp | undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface CreateSaleItemInput {
|
|
141
|
+
productId: string;
|
|
142
|
+
productBatchId: string;
|
|
143
|
+
quantity: number;
|
|
144
|
+
unitPrice: string;
|
|
145
|
+
discountAmount?: string | undefined;
|
|
146
|
+
totalAmount: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface CreateSaleOrderRequest {
|
|
150
|
+
receiptNumber: string;
|
|
151
|
+
status?: SaleStatus | undefined;
|
|
152
|
+
branchId: string;
|
|
153
|
+
cashierId?: string | undefined;
|
|
154
|
+
customerId?: string | undefined;
|
|
155
|
+
paymentMethod: PaymentMethod;
|
|
156
|
+
subtotal?: string | undefined;
|
|
157
|
+
discountAmount?: string | undefined;
|
|
158
|
+
taxAmount?: string | undefined;
|
|
159
|
+
totalAmount?: string | undefined;
|
|
160
|
+
paidAmount?: string | undefined;
|
|
161
|
+
changeAmount?: string | undefined;
|
|
162
|
+
note?: string | undefined;
|
|
163
|
+
soldAt?: Timestamp | undefined;
|
|
164
|
+
items: CreateSaleItemInput[];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface UpdateSaleOrderRequest {
|
|
168
|
+
id: string;
|
|
169
|
+
receiptNumber?: string | undefined;
|
|
170
|
+
status?: SaleStatus | undefined;
|
|
171
|
+
branchId?: string | undefined;
|
|
172
|
+
cashierId?: string | undefined;
|
|
173
|
+
customerId?: string | undefined;
|
|
174
|
+
paymentMethod?: PaymentMethod | undefined;
|
|
175
|
+
subtotal?: string | undefined;
|
|
176
|
+
discountAmount?: string | undefined;
|
|
177
|
+
taxAmount?: string | undefined;
|
|
178
|
+
totalAmount?: string | undefined;
|
|
179
|
+
paidAmount?: string | undefined;
|
|
180
|
+
changeAmount?: string | undefined;
|
|
181
|
+
note?: string | undefined;
|
|
182
|
+
soldAt?: Timestamp | undefined;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface ListSaleOrdersRequest {
|
|
186
|
+
pagination: PaginationRequest | undefined;
|
|
187
|
+
branchId?: string | undefined;
|
|
188
|
+
cashierId?: string | undefined;
|
|
189
|
+
customerId?: string | undefined;
|
|
190
|
+
status?: SaleStatus | undefined;
|
|
191
|
+
receiptNumber?: string | undefined;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface ListSaleOrdersResponse {
|
|
195
|
+
items: SaleOrder[];
|
|
196
|
+
meta: PaginationMeta | undefined;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface CreateSaleReturnItemInput {
|
|
200
|
+
productId: string;
|
|
201
|
+
productBatchId: string;
|
|
202
|
+
quantity: number;
|
|
203
|
+
unitPrice: string;
|
|
204
|
+
totalAmount: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface CreateSaleReturnRequest {
|
|
208
|
+
returnNumber: string;
|
|
209
|
+
saleOrderId: string;
|
|
210
|
+
branchId: string;
|
|
211
|
+
customerId?: string | undefined;
|
|
212
|
+
processedById?: string | undefined;
|
|
213
|
+
totalAmount?: string | undefined;
|
|
214
|
+
reason?: string | undefined;
|
|
215
|
+
returnedAt?: Timestamp | undefined;
|
|
216
|
+
items: CreateSaleReturnItemInput[];
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface UpdateSaleReturnRequest {
|
|
220
|
+
id: string;
|
|
221
|
+
customerId?: string | undefined;
|
|
222
|
+
processedById?: string | undefined;
|
|
223
|
+
totalAmount?: string | undefined;
|
|
224
|
+
reason?: string | undefined;
|
|
225
|
+
returnedAt?: Timestamp | undefined;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface ListSaleReturnsRequest {
|
|
229
|
+
pagination: PaginationRequest | undefined;
|
|
230
|
+
branchId?: string | undefined;
|
|
231
|
+
saleOrderId?: string | undefined;
|
|
232
|
+
customerId?: string | undefined;
|
|
233
|
+
processedById?: string | undefined;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface ListSaleReturnsResponse {
|
|
237
|
+
items: SaleReturn[];
|
|
238
|
+
meta: PaginationMeta | undefined;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface CreateWriteOffItemInput {
|
|
242
|
+
productId: string;
|
|
243
|
+
productBatchId: string;
|
|
244
|
+
quantity: number;
|
|
245
|
+
unitPrice: string;
|
|
246
|
+
totalAmount: string;
|
|
247
|
+
note?: string | undefined;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface CreateWriteOffRequest {
|
|
251
|
+
documentNumber: string;
|
|
252
|
+
branchId: string;
|
|
253
|
+
createdById?: string | undefined;
|
|
254
|
+
reason: WriteOffReason;
|
|
255
|
+
note?: string | undefined;
|
|
256
|
+
items: CreateWriteOffItemInput[];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface UpdateWriteOffRequest {
|
|
260
|
+
id: string;
|
|
261
|
+
documentNumber?: string | undefined;
|
|
262
|
+
branchId?: string | undefined;
|
|
263
|
+
createdById?: string | undefined;
|
|
264
|
+
reason?: WriteOffReason | undefined;
|
|
265
|
+
note?: string | undefined;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface ListWriteOffsRequest {
|
|
269
|
+
pagination: PaginationRequest | undefined;
|
|
270
|
+
branchId?: string | undefined;
|
|
271
|
+
createdById?: string | undefined;
|
|
272
|
+
reason?: WriteOffReason | undefined;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface ListWriteOffsResponse {
|
|
276
|
+
items: WriteOff[];
|
|
277
|
+
meta: PaginationMeta | undefined;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export const SALES_V1_PACKAGE_NAME = "sales.v1";
|
|
281
|
+
|
|
282
|
+
export interface SaleOrderServiceClient {
|
|
283
|
+
createSaleOrder(request: CreateSaleOrderRequest): Observable<SaleOrder>;
|
|
284
|
+
|
|
285
|
+
updateSaleOrder(request: UpdateSaleOrderRequest): Observable<SaleOrder>;
|
|
286
|
+
|
|
287
|
+
getSaleOrderById(request: IdRequest): Observable<SaleOrder>;
|
|
288
|
+
|
|
289
|
+
listSaleOrders(request: ListSaleOrdersRequest): Observable<ListSaleOrdersResponse>;
|
|
290
|
+
|
|
291
|
+
deleteSaleOrder(request: IdRequest): Observable<BoolResponse>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface SaleOrderServiceController {
|
|
295
|
+
createSaleOrder(request: CreateSaleOrderRequest): Promise<SaleOrder> | Observable<SaleOrder> | SaleOrder;
|
|
296
|
+
|
|
297
|
+
updateSaleOrder(request: UpdateSaleOrderRequest): Promise<SaleOrder> | Observable<SaleOrder> | SaleOrder;
|
|
298
|
+
|
|
299
|
+
getSaleOrderById(request: IdRequest): Promise<SaleOrder> | Observable<SaleOrder> | SaleOrder;
|
|
300
|
+
|
|
301
|
+
listSaleOrders(
|
|
302
|
+
request: ListSaleOrdersRequest,
|
|
303
|
+
): Promise<ListSaleOrdersResponse> | Observable<ListSaleOrdersResponse> | ListSaleOrdersResponse;
|
|
304
|
+
|
|
305
|
+
deleteSaleOrder(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function SaleOrderServiceControllerMethods() {
|
|
309
|
+
return function (constructor: Function) {
|
|
310
|
+
const grpcMethods: string[] = [
|
|
311
|
+
"createSaleOrder",
|
|
312
|
+
"updateSaleOrder",
|
|
313
|
+
"getSaleOrderById",
|
|
314
|
+
"listSaleOrders",
|
|
315
|
+
"deleteSaleOrder",
|
|
316
|
+
];
|
|
317
|
+
for (const method of grpcMethods) {
|
|
318
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
319
|
+
GrpcMethod("SaleOrderService", method)(constructor.prototype[method], method, descriptor);
|
|
320
|
+
}
|
|
321
|
+
const grpcStreamMethods: string[] = [];
|
|
322
|
+
for (const method of grpcStreamMethods) {
|
|
323
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
324
|
+
GrpcStreamMethod("SaleOrderService", method)(constructor.prototype[method], method, descriptor);
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export const SALE_ORDER_SERVICE_NAME = "SaleOrderService";
|
|
330
|
+
|
|
331
|
+
export interface SaleReturnServiceClient {
|
|
332
|
+
createSaleReturn(request: CreateSaleReturnRequest): Observable<SaleReturn>;
|
|
333
|
+
|
|
334
|
+
updateSaleReturn(request: UpdateSaleReturnRequest): Observable<SaleReturn>;
|
|
335
|
+
|
|
336
|
+
getSaleReturnById(request: IdRequest): Observable<SaleReturn>;
|
|
337
|
+
|
|
338
|
+
listSaleReturns(request: ListSaleReturnsRequest): Observable<ListSaleReturnsResponse>;
|
|
339
|
+
|
|
340
|
+
deleteSaleReturn(request: IdRequest): Observable<BoolResponse>;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface SaleReturnServiceController {
|
|
344
|
+
createSaleReturn(request: CreateSaleReturnRequest): Promise<SaleReturn> | Observable<SaleReturn> | SaleReturn;
|
|
345
|
+
|
|
346
|
+
updateSaleReturn(request: UpdateSaleReturnRequest): Promise<SaleReturn> | Observable<SaleReturn> | SaleReturn;
|
|
347
|
+
|
|
348
|
+
getSaleReturnById(request: IdRequest): Promise<SaleReturn> | Observable<SaleReturn> | SaleReturn;
|
|
349
|
+
|
|
350
|
+
listSaleReturns(
|
|
351
|
+
request: ListSaleReturnsRequest,
|
|
352
|
+
): Promise<ListSaleReturnsResponse> | Observable<ListSaleReturnsResponse> | ListSaleReturnsResponse;
|
|
353
|
+
|
|
354
|
+
deleteSaleReturn(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function SaleReturnServiceControllerMethods() {
|
|
358
|
+
return function (constructor: Function) {
|
|
359
|
+
const grpcMethods: string[] = [
|
|
360
|
+
"createSaleReturn",
|
|
361
|
+
"updateSaleReturn",
|
|
362
|
+
"getSaleReturnById",
|
|
363
|
+
"listSaleReturns",
|
|
364
|
+
"deleteSaleReturn",
|
|
365
|
+
];
|
|
366
|
+
for (const method of grpcMethods) {
|
|
367
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
368
|
+
GrpcMethod("SaleReturnService", method)(constructor.prototype[method], method, descriptor);
|
|
369
|
+
}
|
|
370
|
+
const grpcStreamMethods: string[] = [];
|
|
371
|
+
for (const method of grpcStreamMethods) {
|
|
372
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
373
|
+
GrpcStreamMethod("SaleReturnService", method)(constructor.prototype[method], method, descriptor);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export const SALE_RETURN_SERVICE_NAME = "SaleReturnService";
|
|
379
|
+
|
|
380
|
+
export interface WriteOffServiceClient {
|
|
381
|
+
createWriteOff(request: CreateWriteOffRequest): Observable<WriteOff>;
|
|
382
|
+
|
|
383
|
+
updateWriteOff(request: UpdateWriteOffRequest): Observable<WriteOff>;
|
|
384
|
+
|
|
385
|
+
getWriteOffById(request: IdRequest): Observable<WriteOff>;
|
|
386
|
+
|
|
387
|
+
listWriteOffs(request: ListWriteOffsRequest): Observable<ListWriteOffsResponse>;
|
|
388
|
+
|
|
389
|
+
deleteWriteOff(request: IdRequest): Observable<BoolResponse>;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export interface WriteOffServiceController {
|
|
393
|
+
createWriteOff(request: CreateWriteOffRequest): Promise<WriteOff> | Observable<WriteOff> | WriteOff;
|
|
394
|
+
|
|
395
|
+
updateWriteOff(request: UpdateWriteOffRequest): Promise<WriteOff> | Observable<WriteOff> | WriteOff;
|
|
396
|
+
|
|
397
|
+
getWriteOffById(request: IdRequest): Promise<WriteOff> | Observable<WriteOff> | WriteOff;
|
|
398
|
+
|
|
399
|
+
listWriteOffs(
|
|
400
|
+
request: ListWriteOffsRequest,
|
|
401
|
+
): Promise<ListWriteOffsResponse> | Observable<ListWriteOffsResponse> | ListWriteOffsResponse;
|
|
402
|
+
|
|
403
|
+
deleteWriteOff(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export function WriteOffServiceControllerMethods() {
|
|
407
|
+
return function (constructor: Function) {
|
|
408
|
+
const grpcMethods: string[] = [
|
|
409
|
+
"createWriteOff",
|
|
410
|
+
"updateWriteOff",
|
|
411
|
+
"getWriteOffById",
|
|
412
|
+
"listWriteOffs",
|
|
413
|
+
"deleteWriteOff",
|
|
414
|
+
];
|
|
415
|
+
for (const method of grpcMethods) {
|
|
416
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
417
|
+
GrpcMethod("WriteOffService", method)(constructor.prototype[method], method, descriptor);
|
|
418
|
+
}
|
|
419
|
+
const grpcStreamMethods: string[] = [];
|
|
420
|
+
for (const method of grpcStreamMethods) {
|
|
421
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
422
|
+
GrpcStreamMethod("WriteOffService", method)(constructor.prototype[method], method, descriptor);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export const WRITE_OFF_SERVICE_NAME = "WriteOffService";
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -1,24 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "common.proto";
|
|
7
|
+
|
|
8
|
+
message Account {
|
|
9
|
+
string id = 1;
|
|
10
|
+
string name = 2;
|
|
11
|
+
string username = 3;
|
|
12
|
+
optional string phone = 4;
|
|
13
|
+
optional string email = 5;
|
|
14
|
+
bool is_phone_verified = 6;
|
|
15
|
+
bool is_email_verified = 7;
|
|
16
|
+
bool is_active = 8;
|
|
17
|
+
string role = 9;
|
|
18
|
+
optional string branch_id = 10;
|
|
19
|
+
google.protobuf.Timestamp created_at = 11;
|
|
20
|
+
google.protobuf.Timestamp updated_at = 12;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message CreateAccountRequest {
|
|
24
|
+
string name = 1;
|
|
25
|
+
string username = 2;
|
|
26
|
+
string password = 3;
|
|
27
|
+
optional string phone = 4;
|
|
28
|
+
optional string email = 5;
|
|
29
|
+
optional string role = 6;
|
|
30
|
+
optional string branch_id = 7;
|
|
31
|
+
optional bool is_active = 8;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message UpdateAccountRequest {
|
|
35
|
+
string id = 1;
|
|
36
|
+
optional string name = 2;
|
|
37
|
+
optional string username = 3;
|
|
38
|
+
optional string password = 4;
|
|
39
|
+
optional string phone = 5;
|
|
40
|
+
optional string email = 6;
|
|
41
|
+
optional string role = 7;
|
|
42
|
+
optional string branch_id = 8;
|
|
43
|
+
optional bool is_active = 9;
|
|
44
|
+
optional bool is_phone_verified = 10;
|
|
45
|
+
optional bool is_email_verified = 11;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message ListAccountsRequest {
|
|
49
|
+
common.v1.PaginationRequest pagination = 1;
|
|
50
|
+
optional string branch_id = 2;
|
|
51
|
+
optional string role = 3;
|
|
52
|
+
optional bool is_active = 4;
|
|
53
|
+
optional string search = 5;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message ListAccountsResponse {
|
|
57
|
+
repeated Account items = 1;
|
|
58
|
+
common.v1.PaginationMeta meta = 2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
service AccountService {
|
|
62
|
+
rpc CreateAccount(CreateAccountRequest) returns (Account);
|
|
63
|
+
rpc UpdateAccount(UpdateAccountRequest) returns (Account);
|
|
64
|
+
rpc GetAccount(common.v1.IdRequest) returns (Account);
|
|
65
|
+
rpc GetProfile(common.v1.IdRequest) returns (Account);
|
|
66
|
+
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse);
|
|
67
|
+
rpc DeleteAccount(common.v1.IdRequest) returns (common.v1.BoolResponse);
|
|
68
|
+
}
|