@prodoctors/contracts 1.0.3 → 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 +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 +27 -27
- 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 +226 -94
- package/proto/partner.proto +103 -0
- package/proto/purchase.proto +105 -0
- package/proto/sales.proto +292 -0
package/gen/inventory.ts
CHANGED
|
@@ -1,78 +1,164 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v2.11.5
|
|
4
|
-
// protoc
|
|
4
|
+
// protoc v7.34.0
|
|
5
5
|
// source: inventory.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
-
import {
|
|
10
|
+
import { Brand, Category, InternationalName, Manufacturer } from "./catalog";
|
|
11
|
+
import { BoolResponse, IdRequest, PaginationMeta, PaginationRequest } from "./common";
|
|
11
12
|
import { Timestamp } from "./google/protobuf/timestamp";
|
|
12
13
|
|
|
13
14
|
export const protobufPackage = "inventory.v1";
|
|
14
15
|
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
export enum ProductStatus {
|
|
17
|
+
PRODUCT_STATUS_UNSPECIFIED = 0,
|
|
18
|
+
PRODUCT_STATUS_ACTIVE = 1,
|
|
19
|
+
PRODUCT_STATUS_INACTIVE = 2,
|
|
20
|
+
UNRECOGNIZED = -1,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum UnitType {
|
|
24
|
+
UNIT_TYPE_UNSPECIFIED = 0,
|
|
25
|
+
UNIT_TYPE_PIECE = 1,
|
|
26
|
+
UNIT_TYPE_BOX = 2,
|
|
27
|
+
UNIT_TYPE_BOTTLE = 3,
|
|
28
|
+
UNIT_TYPE_PACK = 4,
|
|
29
|
+
UNIT_TYPE_BLISTER = 5,
|
|
30
|
+
UNIT_TYPE_TUBE = 6,
|
|
31
|
+
UNIT_TYPE_AMPULE = 7,
|
|
32
|
+
UNIT_TYPE_VIAL = 8,
|
|
33
|
+
UNRECOGNIZED = -1,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export enum ProductForm {
|
|
37
|
+
PRODUCT_FORM_UNSPECIFIED = 0,
|
|
38
|
+
PRODUCT_FORM_TABLET = 1,
|
|
39
|
+
PRODUCT_FORM_CAPSULE = 2,
|
|
40
|
+
PRODUCT_FORM_SYRUP = 3,
|
|
41
|
+
PRODUCT_FORM_INJECTION = 4,
|
|
42
|
+
PRODUCT_FORM_OINTMENT = 5,
|
|
43
|
+
PRODUCT_FORM_CREAM = 6,
|
|
44
|
+
PRODUCT_FORM_GEL = 7,
|
|
45
|
+
PRODUCT_FORM_DROPS = 8,
|
|
46
|
+
PRODUCT_FORM_SPRAY = 9,
|
|
47
|
+
PRODUCT_FORM_POWDER = 10,
|
|
48
|
+
PRODUCT_FORM_SOLUTION = 11,
|
|
49
|
+
PRODUCT_FORM_SUPPOSITORY = 12,
|
|
50
|
+
PRODUCT_FORM_OTHER = 13,
|
|
51
|
+
UNRECOGNIZED = -1,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export enum BatchStatus {
|
|
55
|
+
BATCH_STATUS_UNSPECIFIED = 0,
|
|
56
|
+
BATCH_STATUS_ACTIVE = 1,
|
|
57
|
+
BATCH_STATUS_EXPIRED = 2,
|
|
58
|
+
BATCH_STATUS_DEPLETED = 3,
|
|
59
|
+
BATCH_STATUS_BLOCKED = 4,
|
|
60
|
+
UNRECOGNIZED = -1,
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export enum StockMovementType {
|
|
64
|
+
STOCK_MOVEMENT_TYPE_UNSPECIFIED = 0,
|
|
65
|
+
STOCK_MOVEMENT_TYPE_IN = 1,
|
|
66
|
+
STOCK_MOVEMENT_TYPE_OUT = 2,
|
|
67
|
+
STOCK_MOVEMENT_TYPE_RETURN_IN = 3,
|
|
68
|
+
STOCK_MOVEMENT_TYPE_RETURN_OUT = 4,
|
|
69
|
+
STOCK_MOVEMENT_TYPE_WRITE_OFF = 5,
|
|
70
|
+
STOCK_MOVEMENT_TYPE_ADJUSTMENT = 6,
|
|
71
|
+
STOCK_MOVEMENT_TYPE_TRANSFER_OUT = 7,
|
|
72
|
+
STOCK_MOVEMENT_TYPE_TRANSFER_IN = 8,
|
|
73
|
+
UNRECOGNIZED = -1,
|
|
24
74
|
}
|
|
25
75
|
|
|
26
76
|
export interface Product {
|
|
27
77
|
id: string;
|
|
28
78
|
name: string;
|
|
29
79
|
sku: string;
|
|
30
|
-
barcode
|
|
80
|
+
barcode?: string | undefined;
|
|
81
|
+
dosage?: string | undefined;
|
|
82
|
+
description?: string | undefined;
|
|
83
|
+
form: ProductForm;
|
|
84
|
+
unit: UnitType;
|
|
85
|
+
requiresPrescription: boolean;
|
|
86
|
+
status: ProductStatus;
|
|
87
|
+
brandId?: string | undefined;
|
|
88
|
+
categoryId?: string | undefined;
|
|
89
|
+
internationalNameId?: string | undefined;
|
|
90
|
+
manufacturerId?: string | undefined;
|
|
31
91
|
price: string;
|
|
32
92
|
costPrice?: string | undefined;
|
|
93
|
+
brand?: Brand | undefined;
|
|
94
|
+
category?: Category | undefined;
|
|
95
|
+
internationalName?: InternationalName | undefined;
|
|
96
|
+
manufacturer?: Manufacturer | undefined;
|
|
33
97
|
createdAt: Timestamp | undefined;
|
|
34
98
|
updatedAt: Timestamp | undefined;
|
|
35
99
|
}
|
|
36
100
|
|
|
37
|
-
export interface
|
|
101
|
+
export interface ProductBarcode {
|
|
38
102
|
id: string;
|
|
39
|
-
branchId: string;
|
|
40
103
|
productId: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
branch: Branch | undefined;
|
|
46
|
-
product: Product | undefined;
|
|
104
|
+
barcode: string;
|
|
105
|
+
isPrimary: boolean;
|
|
106
|
+
packageType?: string | undefined;
|
|
107
|
+
note?: string | undefined;
|
|
47
108
|
createdAt: Timestamp | undefined;
|
|
48
109
|
updatedAt: Timestamp | undefined;
|
|
49
110
|
}
|
|
50
111
|
|
|
51
|
-
export interface
|
|
52
|
-
name: string;
|
|
53
|
-
address?: string | undefined;
|
|
54
|
-
phone?: string | undefined;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface UpdateBranchRequest {
|
|
112
|
+
export interface ProductBatch {
|
|
58
113
|
id: string;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
114
|
+
productId: string;
|
|
115
|
+
branchId: string;
|
|
116
|
+
batchNumber: string;
|
|
117
|
+
expiryDate: Timestamp | undefined;
|
|
118
|
+
manufactureDate?: Timestamp | undefined;
|
|
119
|
+
purchasePrice: string;
|
|
120
|
+
sellingPrice: string;
|
|
121
|
+
initialQuantity: number;
|
|
122
|
+
remainingQuantity: number;
|
|
123
|
+
status: BatchStatus;
|
|
124
|
+
purchaseItemId?: string | undefined;
|
|
125
|
+
product?: Product | undefined;
|
|
126
|
+
createdAt: Timestamp | undefined;
|
|
127
|
+
updatedAt: Timestamp | undefined;
|
|
62
128
|
}
|
|
63
129
|
|
|
64
|
-
export interface
|
|
65
|
-
|
|
130
|
+
export interface StockMovement {
|
|
131
|
+
id: string;
|
|
132
|
+
branchId: string;
|
|
133
|
+
productId: string;
|
|
134
|
+
productBatchId: string;
|
|
135
|
+
type: StockMovementType;
|
|
136
|
+
quantity: number;
|
|
137
|
+
balanceBefore: number;
|
|
138
|
+
balanceAfter: number;
|
|
139
|
+
referenceType?: string | undefined;
|
|
140
|
+
referenceId?: string | undefined;
|
|
141
|
+
performedById?: string | undefined;
|
|
142
|
+
note?: string | undefined;
|
|
143
|
+
createdAt: Timestamp | undefined;
|
|
66
144
|
}
|
|
67
145
|
|
|
68
146
|
export interface CreateProductRequest {
|
|
69
147
|
name: string;
|
|
70
148
|
sku: string;
|
|
71
|
-
barcode
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
149
|
+
barcode?: string | undefined;
|
|
150
|
+
dosage?: string | undefined;
|
|
151
|
+
description?: string | undefined;
|
|
152
|
+
form: ProductForm;
|
|
153
|
+
unit: UnitType;
|
|
154
|
+
requiresPrescription?: boolean | undefined;
|
|
155
|
+
status?: ProductStatus | undefined;
|
|
156
|
+
brandId?: string | undefined;
|
|
157
|
+
categoryId?: string | undefined;
|
|
158
|
+
internationalNameId?: string | undefined;
|
|
159
|
+
manufacturerId?: string | undefined;
|
|
160
|
+
price: string;
|
|
161
|
+
costPrice?: string | undefined;
|
|
76
162
|
}
|
|
77
163
|
|
|
78
164
|
export interface UpdateProductRequest {
|
|
@@ -80,17 +166,28 @@ export interface UpdateProductRequest {
|
|
|
80
166
|
name?: string | undefined;
|
|
81
167
|
sku?: string | undefined;
|
|
82
168
|
barcode?: string | undefined;
|
|
169
|
+
dosage?: string | undefined;
|
|
170
|
+
description?: string | undefined;
|
|
171
|
+
form?: ProductForm | undefined;
|
|
172
|
+
unit?: UnitType | undefined;
|
|
173
|
+
requiresPrescription?: boolean | undefined;
|
|
174
|
+
status?: ProductStatus | undefined;
|
|
175
|
+
brandId?: string | undefined;
|
|
176
|
+
categoryId?: string | undefined;
|
|
177
|
+
internationalNameId?: string | undefined;
|
|
178
|
+
manufacturerId?: string | undefined;
|
|
83
179
|
price?: string | undefined;
|
|
84
180
|
costPrice?: string | undefined;
|
|
85
181
|
}
|
|
86
182
|
|
|
87
|
-
export interface GetProductByIdRequest {
|
|
88
|
-
id: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
183
|
export interface ListProductsRequest {
|
|
92
184
|
pagination: PaginationRequest | undefined;
|
|
93
185
|
search?: string | undefined;
|
|
186
|
+
brandId?: string | undefined;
|
|
187
|
+
categoryId?: string | undefined;
|
|
188
|
+
internationalNameId?: string | undefined;
|
|
189
|
+
manufacturerId?: string | undefined;
|
|
190
|
+
status?: ProductStatus | undefined;
|
|
94
191
|
}
|
|
95
192
|
|
|
96
193
|
export interface ListProductsResponse {
|
|
@@ -98,104 +195,102 @@ export interface ListProductsResponse {
|
|
|
98
195
|
meta: PaginationMeta | undefined;
|
|
99
196
|
}
|
|
100
197
|
|
|
101
|
-
export interface
|
|
102
|
-
branchId: string;
|
|
198
|
+
export interface CreateProductBarcodeRequest {
|
|
103
199
|
productId: string;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
200
|
+
barcode: string;
|
|
201
|
+
isPrimary?: boolean | undefined;
|
|
202
|
+
packageType?: string | undefined;
|
|
203
|
+
note?: string | undefined;
|
|
108
204
|
}
|
|
109
205
|
|
|
110
|
-
export interface
|
|
206
|
+
export interface UpdateProductBarcodeRequest {
|
|
111
207
|
id: string;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
208
|
+
barcode?: string | undefined;
|
|
209
|
+
isPrimary?: boolean | undefined;
|
|
210
|
+
packageType?: string | undefined;
|
|
211
|
+
note?: string | undefined;
|
|
116
212
|
}
|
|
117
213
|
|
|
118
|
-
export interface
|
|
119
|
-
|
|
120
|
-
quantityChange: number;
|
|
121
|
-
reason: string;
|
|
214
|
+
export interface ListProductBarcodesResponse {
|
|
215
|
+
items: ProductBarcode[];
|
|
122
216
|
}
|
|
123
217
|
|
|
124
|
-
export interface
|
|
218
|
+
export interface CreateProductBatchRequest {
|
|
125
219
|
productId: string;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
220
|
+
branchId: string;
|
|
221
|
+
batchNumber: string;
|
|
222
|
+
expiryDate: Timestamp | undefined;
|
|
223
|
+
manufactureDate?: Timestamp | undefined;
|
|
224
|
+
purchasePrice: string;
|
|
225
|
+
sellingPrice: string;
|
|
226
|
+
initialQuantity: number;
|
|
227
|
+
remainingQuantity?: number | undefined;
|
|
228
|
+
status?: BatchStatus | undefined;
|
|
229
|
+
purchaseItemId?: string | undefined;
|
|
130
230
|
}
|
|
131
231
|
|
|
132
|
-
export interface
|
|
232
|
+
export interface UpdateProductBatchRequest {
|
|
133
233
|
id: string;
|
|
234
|
+
batchNumber?: string | undefined;
|
|
235
|
+
expiryDate?: Timestamp | undefined;
|
|
236
|
+
manufactureDate?: Timestamp | undefined;
|
|
237
|
+
purchasePrice?: string | undefined;
|
|
238
|
+
sellingPrice?: string | undefined;
|
|
239
|
+
initialQuantity?: number | undefined;
|
|
240
|
+
remainingQuantity?: number | undefined;
|
|
241
|
+
status?: BatchStatus | undefined;
|
|
134
242
|
}
|
|
135
243
|
|
|
136
|
-
export interface
|
|
244
|
+
export interface ListProductBatchesRequest {
|
|
137
245
|
pagination: PaginationRequest | undefined;
|
|
138
246
|
branchId?: string | undefined;
|
|
139
247
|
productId?: string | undefined;
|
|
140
|
-
|
|
248
|
+
batchNumber?: string | undefined;
|
|
249
|
+
status?: BatchStatus | undefined;
|
|
141
250
|
lowStockOnly?: boolean | undefined;
|
|
142
251
|
expiringSoonOnly?: boolean | undefined;
|
|
143
252
|
}
|
|
144
253
|
|
|
145
|
-
export interface
|
|
146
|
-
items:
|
|
254
|
+
export interface ListProductBatchesResponse {
|
|
255
|
+
items: ProductBatch[];
|
|
147
256
|
meta: PaginationMeta | undefined;
|
|
148
257
|
}
|
|
149
258
|
|
|
150
|
-
export
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
259
|
+
export interface CreateStockMovementRequest {
|
|
260
|
+
branchId: string;
|
|
261
|
+
productId: string;
|
|
262
|
+
productBatchId: string;
|
|
263
|
+
type: StockMovementType;
|
|
264
|
+
quantity: number;
|
|
265
|
+
balanceBefore: number;
|
|
266
|
+
balanceAfter: number;
|
|
267
|
+
referenceType?: string | undefined;
|
|
268
|
+
referenceId?: string | undefined;
|
|
269
|
+
performedById?: string | undefined;
|
|
270
|
+
note?: string | undefined;
|
|
162
271
|
}
|
|
163
272
|
|
|
164
|
-
export interface
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
listBranches(request: Empty): Promise<ListBranchesResponse> | Observable<ListBranchesResponse> | ListBranchesResponse;
|
|
172
|
-
|
|
173
|
-
deleteBranch(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
273
|
+
export interface ListStockMovementsRequest {
|
|
274
|
+
pagination: PaginationRequest | undefined;
|
|
275
|
+
branchId?: string | undefined;
|
|
276
|
+
productId?: string | undefined;
|
|
277
|
+
productBatchId?: string | undefined;
|
|
278
|
+
type?: StockMovementType | undefined;
|
|
174
279
|
}
|
|
175
280
|
|
|
176
|
-
export
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
for (const method of grpcMethods) {
|
|
180
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
181
|
-
GrpcMethod("BranchService", method)(constructor.prototype[method], method, descriptor);
|
|
182
|
-
}
|
|
183
|
-
const grpcStreamMethods: string[] = [];
|
|
184
|
-
for (const method of grpcStreamMethods) {
|
|
185
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
186
|
-
GrpcStreamMethod("BranchService", method)(constructor.prototype[method], method, descriptor);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
281
|
+
export interface ListStockMovementsResponse {
|
|
282
|
+
items: StockMovement[];
|
|
283
|
+
meta: PaginationMeta | undefined;
|
|
189
284
|
}
|
|
190
285
|
|
|
191
|
-
export const
|
|
286
|
+
export const INVENTORY_V1_PACKAGE_NAME = "inventory.v1";
|
|
192
287
|
|
|
193
288
|
export interface ProductServiceClient {
|
|
194
289
|
createProduct(request: CreateProductRequest): Observable<Product>;
|
|
195
290
|
|
|
196
291
|
updateProduct(request: UpdateProductRequest): Observable<Product>;
|
|
197
292
|
|
|
198
|
-
getProductById(request:
|
|
293
|
+
getProductById(request: IdRequest): Observable<Product>;
|
|
199
294
|
|
|
200
295
|
listProducts(request: ListProductsRequest): Observable<ListProductsResponse>;
|
|
201
296
|
|
|
@@ -207,7 +302,7 @@ export interface ProductServiceController {
|
|
|
207
302
|
|
|
208
303
|
updateProduct(request: UpdateProductRequest): Promise<Product> | Observable<Product> | Product;
|
|
209
304
|
|
|
210
|
-
getProductById(request:
|
|
305
|
+
getProductById(request: IdRequest): Promise<Product> | Observable<Product> | Product;
|
|
211
306
|
|
|
212
307
|
listProducts(
|
|
213
308
|
request: ListProductsRequest,
|
|
@@ -233,65 +328,145 @@ export function ProductServiceControllerMethods() {
|
|
|
233
328
|
|
|
234
329
|
export const PRODUCT_SERVICE_NAME = "ProductService";
|
|
235
330
|
|
|
236
|
-
export interface
|
|
237
|
-
|
|
331
|
+
export interface ProductBarcodeServiceClient {
|
|
332
|
+
createProductBarcode(request: CreateProductBarcodeRequest): Observable<ProductBarcode>;
|
|
333
|
+
|
|
334
|
+
updateProductBarcode(request: UpdateProductBarcodeRequest): Observable<ProductBarcode>;
|
|
238
335
|
|
|
239
|
-
|
|
336
|
+
getProductBarcodeById(request: IdRequest): Observable<ProductBarcode>;
|
|
240
337
|
|
|
241
|
-
|
|
338
|
+
listProductBarcodes(request: IdRequest): Observable<ListProductBarcodesResponse>;
|
|
242
339
|
|
|
243
|
-
|
|
340
|
+
deleteProductBarcode(request: IdRequest): Observable<BoolResponse>;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface ProductBarcodeServiceController {
|
|
344
|
+
createProductBarcode(
|
|
345
|
+
request: CreateProductBarcodeRequest,
|
|
346
|
+
): Promise<ProductBarcode> | Observable<ProductBarcode> | ProductBarcode;
|
|
244
347
|
|
|
245
|
-
|
|
348
|
+
updateProductBarcode(
|
|
349
|
+
request: UpdateProductBarcodeRequest,
|
|
350
|
+
): Promise<ProductBarcode> | Observable<ProductBarcode> | ProductBarcode;
|
|
246
351
|
|
|
247
|
-
|
|
352
|
+
getProductBarcodeById(request: IdRequest): Promise<ProductBarcode> | Observable<ProductBarcode> | ProductBarcode;
|
|
248
353
|
|
|
249
|
-
|
|
354
|
+
listProductBarcodes(
|
|
355
|
+
request: IdRequest,
|
|
356
|
+
): Promise<ListProductBarcodesResponse> | Observable<ListProductBarcodesResponse> | ListProductBarcodesResponse;
|
|
357
|
+
|
|
358
|
+
deleteProductBarcode(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export function ProductBarcodeServiceControllerMethods() {
|
|
362
|
+
return function (constructor: Function) {
|
|
363
|
+
const grpcMethods: string[] = [
|
|
364
|
+
"createProductBarcode",
|
|
365
|
+
"updateProductBarcode",
|
|
366
|
+
"getProductBarcodeById",
|
|
367
|
+
"listProductBarcodes",
|
|
368
|
+
"deleteProductBarcode",
|
|
369
|
+
];
|
|
370
|
+
for (const method of grpcMethods) {
|
|
371
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
372
|
+
GrpcMethod("ProductBarcodeService", method)(constructor.prototype[method], method, descriptor);
|
|
373
|
+
}
|
|
374
|
+
const grpcStreamMethods: string[] = [];
|
|
375
|
+
for (const method of grpcStreamMethods) {
|
|
376
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
377
|
+
GrpcStreamMethod("ProductBarcodeService", method)(constructor.prototype[method], method, descriptor);
|
|
378
|
+
}
|
|
379
|
+
};
|
|
250
380
|
}
|
|
251
381
|
|
|
252
|
-
export
|
|
253
|
-
|
|
382
|
+
export const PRODUCT_BARCODE_SERVICE_NAME = "ProductBarcodeService";
|
|
383
|
+
|
|
384
|
+
export interface ProductBatchServiceClient {
|
|
385
|
+
createProductBatch(request: CreateProductBatchRequest): Observable<ProductBatch>;
|
|
254
386
|
|
|
255
|
-
|
|
387
|
+
updateProductBatch(request: UpdateProductBatchRequest): Observable<ProductBatch>;
|
|
256
388
|
|
|
257
|
-
|
|
258
|
-
request: AdjustInventoryQuantityRequest,
|
|
259
|
-
): Promise<InventoryItem> | Observable<InventoryItem> | InventoryItem;
|
|
389
|
+
getProductBatchById(request: IdRequest): Observable<ProductBatch>;
|
|
260
390
|
|
|
261
|
-
|
|
391
|
+
listProductBatches(request: ListProductBatchesRequest): Observable<ListProductBatchesResponse>;
|
|
392
|
+
|
|
393
|
+
deleteProductBatch(request: IdRequest): Observable<BoolResponse>;
|
|
394
|
+
}
|
|
262
395
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
396
|
+
export interface ProductBatchServiceController {
|
|
397
|
+
createProductBatch(
|
|
398
|
+
request: CreateProductBatchRequest,
|
|
399
|
+
): Promise<ProductBatch> | Observable<ProductBatch> | ProductBatch;
|
|
266
400
|
|
|
267
|
-
|
|
268
|
-
request:
|
|
269
|
-
): Promise<
|
|
401
|
+
updateProductBatch(
|
|
402
|
+
request: UpdateProductBatchRequest,
|
|
403
|
+
): Promise<ProductBatch> | Observable<ProductBatch> | ProductBatch;
|
|
270
404
|
|
|
271
|
-
|
|
405
|
+
getProductBatchById(request: IdRequest): Promise<ProductBatch> | Observable<ProductBatch> | ProductBatch;
|
|
406
|
+
|
|
407
|
+
listProductBatches(
|
|
408
|
+
request: ListProductBatchesRequest,
|
|
409
|
+
): Promise<ListProductBatchesResponse> | Observable<ListProductBatchesResponse> | ListProductBatchesResponse;
|
|
410
|
+
|
|
411
|
+
deleteProductBatch(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
272
412
|
}
|
|
273
413
|
|
|
274
|
-
export function
|
|
414
|
+
export function ProductBatchServiceControllerMethods() {
|
|
275
415
|
return function (constructor: Function) {
|
|
276
416
|
const grpcMethods: string[] = [
|
|
277
|
-
"
|
|
278
|
-
"
|
|
279
|
-
"
|
|
280
|
-
"
|
|
281
|
-
"
|
|
282
|
-
"listInventory",
|
|
283
|
-
"deleteInventory",
|
|
417
|
+
"createProductBatch",
|
|
418
|
+
"updateProductBatch",
|
|
419
|
+
"getProductBatchById",
|
|
420
|
+
"listProductBatches",
|
|
421
|
+
"deleteProductBatch",
|
|
284
422
|
];
|
|
285
423
|
for (const method of grpcMethods) {
|
|
286
424
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
287
|
-
GrpcMethod("
|
|
425
|
+
GrpcMethod("ProductBatchService", method)(constructor.prototype[method], method, descriptor);
|
|
426
|
+
}
|
|
427
|
+
const grpcStreamMethods: string[] = [];
|
|
428
|
+
for (const method of grpcStreamMethods) {
|
|
429
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
430
|
+
GrpcStreamMethod("ProductBatchService", method)(constructor.prototype[method], method, descriptor);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export const PRODUCT_BATCH_SERVICE_NAME = "ProductBatchService";
|
|
436
|
+
|
|
437
|
+
export interface StockMovementServiceClient {
|
|
438
|
+
createStockMovement(request: CreateStockMovementRequest): Observable<StockMovement>;
|
|
439
|
+
|
|
440
|
+
getStockMovementById(request: IdRequest): Observable<StockMovement>;
|
|
441
|
+
|
|
442
|
+
listStockMovements(request: ListStockMovementsRequest): Observable<ListStockMovementsResponse>;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export interface StockMovementServiceController {
|
|
446
|
+
createStockMovement(
|
|
447
|
+
request: CreateStockMovementRequest,
|
|
448
|
+
): Promise<StockMovement> | Observable<StockMovement> | StockMovement;
|
|
449
|
+
|
|
450
|
+
getStockMovementById(request: IdRequest): Promise<StockMovement> | Observable<StockMovement> | StockMovement;
|
|
451
|
+
|
|
452
|
+
listStockMovements(
|
|
453
|
+
request: ListStockMovementsRequest,
|
|
454
|
+
): Promise<ListStockMovementsResponse> | Observable<ListStockMovementsResponse> | ListStockMovementsResponse;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export function StockMovementServiceControllerMethods() {
|
|
458
|
+
return function (constructor: Function) {
|
|
459
|
+
const grpcMethods: string[] = ["createStockMovement", "getStockMovementById", "listStockMovements"];
|
|
460
|
+
for (const method of grpcMethods) {
|
|
461
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
462
|
+
GrpcMethod("StockMovementService", method)(constructor.prototype[method], method, descriptor);
|
|
288
463
|
}
|
|
289
464
|
const grpcStreamMethods: string[] = [];
|
|
290
465
|
for (const method of grpcStreamMethods) {
|
|
291
466
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
292
|
-
GrpcStreamMethod("
|
|
467
|
+
GrpcStreamMethod("StockMovementService", method)(constructor.prototype[method], method, descriptor);
|
|
293
468
|
}
|
|
294
469
|
};
|
|
295
470
|
}
|
|
296
471
|
|
|
297
|
-
export const
|
|
472
|
+
export const STOCK_MOVEMENT_SERVICE_NAME = "StockMovementService";
|