@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/partner.ts
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
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: partner.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
|
+
|
|
13
|
+
export const protobufPackage = "partner.v1";
|
|
14
|
+
|
|
15
|
+
export interface Supplier {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
phone?: string | undefined;
|
|
19
|
+
email?: string | undefined;
|
|
20
|
+
address?: string | undefined;
|
|
21
|
+
taxNumber?: string | undefined;
|
|
22
|
+
isActive: boolean;
|
|
23
|
+
note?: string | undefined;
|
|
24
|
+
createdAt: Timestamp | undefined;
|
|
25
|
+
updatedAt: Timestamp | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Customer {
|
|
29
|
+
id: string;
|
|
30
|
+
fullName?: string | undefined;
|
|
31
|
+
phone?: string | undefined;
|
|
32
|
+
code?: string | undefined;
|
|
33
|
+
branchId?: string | undefined;
|
|
34
|
+
createdAt: Timestamp | undefined;
|
|
35
|
+
updatedAt: Timestamp | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CreateSupplierRequest {
|
|
39
|
+
name: string;
|
|
40
|
+
phone?: string | undefined;
|
|
41
|
+
email?: string | undefined;
|
|
42
|
+
address?: string | undefined;
|
|
43
|
+
taxNumber?: string | undefined;
|
|
44
|
+
isActive?: boolean | undefined;
|
|
45
|
+
note?: string | undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface UpdateSupplierRequest {
|
|
49
|
+
id: string;
|
|
50
|
+
name?: string | undefined;
|
|
51
|
+
phone?: string | undefined;
|
|
52
|
+
email?: string | undefined;
|
|
53
|
+
address?: string | undefined;
|
|
54
|
+
taxNumber?: string | undefined;
|
|
55
|
+
isActive?: boolean | undefined;
|
|
56
|
+
note?: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ListSuppliersRequest {
|
|
60
|
+
pagination: PaginationRequest | undefined;
|
|
61
|
+
isActive?: boolean | undefined;
|
|
62
|
+
search?: string | undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ListSuppliersResponse {
|
|
66
|
+
items: Supplier[];
|
|
67
|
+
meta: PaginationMeta | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface CreateCustomerRequest {
|
|
71
|
+
fullName?: string | undefined;
|
|
72
|
+
phone?: string | undefined;
|
|
73
|
+
code?: string | undefined;
|
|
74
|
+
branchId?: string | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface UpdateCustomerRequest {
|
|
78
|
+
id: string;
|
|
79
|
+
fullName?: string | undefined;
|
|
80
|
+
phone?: string | undefined;
|
|
81
|
+
code?: string | undefined;
|
|
82
|
+
branchId?: string | undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface ListCustomersRequest {
|
|
86
|
+
pagination: PaginationRequest | undefined;
|
|
87
|
+
branchId?: string | undefined;
|
|
88
|
+
search?: string | undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ListCustomersResponse {
|
|
92
|
+
items: Customer[];
|
|
93
|
+
meta: PaginationMeta | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const PARTNER_V1_PACKAGE_NAME = "partner.v1";
|
|
97
|
+
|
|
98
|
+
export interface SupplierServiceClient {
|
|
99
|
+
createSupplier(request: CreateSupplierRequest): Observable<Supplier>;
|
|
100
|
+
|
|
101
|
+
updateSupplier(request: UpdateSupplierRequest): Observable<Supplier>;
|
|
102
|
+
|
|
103
|
+
getSupplierById(request: IdRequest): Observable<Supplier>;
|
|
104
|
+
|
|
105
|
+
listSuppliers(request: ListSuppliersRequest): Observable<ListSuppliersResponse>;
|
|
106
|
+
|
|
107
|
+
deleteSupplier(request: IdRequest): Observable<BoolResponse>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface SupplierServiceController {
|
|
111
|
+
createSupplier(request: CreateSupplierRequest): Promise<Supplier> | Observable<Supplier> | Supplier;
|
|
112
|
+
|
|
113
|
+
updateSupplier(request: UpdateSupplierRequest): Promise<Supplier> | Observable<Supplier> | Supplier;
|
|
114
|
+
|
|
115
|
+
getSupplierById(request: IdRequest): Promise<Supplier> | Observable<Supplier> | Supplier;
|
|
116
|
+
|
|
117
|
+
listSuppliers(
|
|
118
|
+
request: ListSuppliersRequest,
|
|
119
|
+
): Promise<ListSuppliersResponse> | Observable<ListSuppliersResponse> | ListSuppliersResponse;
|
|
120
|
+
|
|
121
|
+
deleteSupplier(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function SupplierServiceControllerMethods() {
|
|
125
|
+
return function (constructor: Function) {
|
|
126
|
+
const grpcMethods: string[] = [
|
|
127
|
+
"createSupplier",
|
|
128
|
+
"updateSupplier",
|
|
129
|
+
"getSupplierById",
|
|
130
|
+
"listSuppliers",
|
|
131
|
+
"deleteSupplier",
|
|
132
|
+
];
|
|
133
|
+
for (const method of grpcMethods) {
|
|
134
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
135
|
+
GrpcMethod("SupplierService", method)(constructor.prototype[method], method, descriptor);
|
|
136
|
+
}
|
|
137
|
+
const grpcStreamMethods: string[] = [];
|
|
138
|
+
for (const method of grpcStreamMethods) {
|
|
139
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
140
|
+
GrpcStreamMethod("SupplierService", method)(constructor.prototype[method], method, descriptor);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const SUPPLIER_SERVICE_NAME = "SupplierService";
|
|
146
|
+
|
|
147
|
+
export interface CustomerServiceClient {
|
|
148
|
+
createCustomer(request: CreateCustomerRequest): Observable<Customer>;
|
|
149
|
+
|
|
150
|
+
updateCustomer(request: UpdateCustomerRequest): Observable<Customer>;
|
|
151
|
+
|
|
152
|
+
getCustomerById(request: IdRequest): Observable<Customer>;
|
|
153
|
+
|
|
154
|
+
listCustomers(request: ListCustomersRequest): Observable<ListCustomersResponse>;
|
|
155
|
+
|
|
156
|
+
deleteCustomer(request: IdRequest): Observable<BoolResponse>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface CustomerServiceController {
|
|
160
|
+
createCustomer(request: CreateCustomerRequest): Promise<Customer> | Observable<Customer> | Customer;
|
|
161
|
+
|
|
162
|
+
updateCustomer(request: UpdateCustomerRequest): Promise<Customer> | Observable<Customer> | Customer;
|
|
163
|
+
|
|
164
|
+
getCustomerById(request: IdRequest): Promise<Customer> | Observable<Customer> | Customer;
|
|
165
|
+
|
|
166
|
+
listCustomers(
|
|
167
|
+
request: ListCustomersRequest,
|
|
168
|
+
): Promise<ListCustomersResponse> | Observable<ListCustomersResponse> | ListCustomersResponse;
|
|
169
|
+
|
|
170
|
+
deleteCustomer(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function CustomerServiceControllerMethods() {
|
|
174
|
+
return function (constructor: Function) {
|
|
175
|
+
const grpcMethods: string[] = [
|
|
176
|
+
"createCustomer",
|
|
177
|
+
"updateCustomer",
|
|
178
|
+
"getCustomerById",
|
|
179
|
+
"listCustomers",
|
|
180
|
+
"deleteCustomer",
|
|
181
|
+
];
|
|
182
|
+
for (const method of grpcMethods) {
|
|
183
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
184
|
+
GrpcMethod("CustomerService", method)(constructor.prototype[method], method, descriptor);
|
|
185
|
+
}
|
|
186
|
+
const grpcStreamMethods: string[] = [];
|
|
187
|
+
for (const method of grpcStreamMethods) {
|
|
188
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
189
|
+
GrpcStreamMethod("CustomerService", method)(constructor.prototype[method], method, descriptor);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export const CUSTOMER_SERVICE_NAME = "CustomerService";
|
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";
|