@prodoctors/contracts 1.13.0 → 1.15.0

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.
@@ -11,4 +11,5 @@ export declare const PROTO_PATHS: {
11
11
  readonly RESERVATION: string;
12
12
  readonly ANALYTICS: string;
13
13
  readonly PRESCRIPTION: string;
14
+ readonly PAYMENT: string;
14
15
  };
@@ -15,4 +15,5 @@ exports.PROTO_PATHS = {
15
15
  RESERVATION: (0, path_1.join)(__dirname, "../../proto/reservation.proto"),
16
16
  ANALYTICS: (0, path_1.join)(__dirname, "../../proto/analytics.proto"),
17
17
  PRESCRIPTION: (0, path_1.join)(__dirname, "../../proto/prescription.proto"),
18
+ PAYMENT: (0, path_1.join)(__dirname, "../../proto/payment.proto"),
18
19
  };
package/gen/branch.ts CHANGED
@@ -38,6 +38,7 @@ export interface Branch {
38
38
  updatedAt: Timestamp | undefined;
39
39
  regionId?: string | undefined;
40
40
  bankDetails?: BranchBankDetails | undefined;
41
+ coverImageUrl?: string | undefined;
41
42
  }
42
43
 
43
44
  export interface CreateBranchRequest {
@@ -52,6 +53,7 @@ export interface CreateBranchRequest {
52
53
  parentBranchId?: string | undefined;
53
54
  regionId?: string | undefined;
54
55
  bankDetails?: BranchBankDetails | undefined;
56
+ coverImageUrl?: string | undefined;
55
57
  }
56
58
 
57
59
  export interface UpdateBranchRequest {
@@ -67,6 +69,7 @@ export interface UpdateBranchRequest {
67
69
  parentBranchId?: string | undefined;
68
70
  regionId?: string | undefined;
69
71
  bankDetails?: BranchBankDetails | undefined;
72
+ coverImageUrl?: string | undefined;
70
73
  }
71
74
 
72
75
  export interface ListBranchesRequest {
package/gen/inventory.ts CHANGED
@@ -113,7 +113,13 @@ export interface Product {
113
113
  | number
114
114
  | undefined;
115
115
  /** Barcha dorixonalar bo'yicha jami mavjud miqdor (remaining - reserved). */
116
- availableQuantity?: number | undefined;
116
+ availableQuantity?:
117
+ | number
118
+ | undefined;
119
+ /** Fiskal chek (OFD) uchun soliq atributlari. */
120
+ taxUnitsCode?: number | undefined;
121
+ taxLgotaId?: number | undefined;
122
+ vatPercent?: string | undefined;
117
123
  }
118
124
 
119
125
  export interface ProductBarcode {
@@ -188,6 +194,9 @@ export interface CreateProductRequest {
188
194
  allowFractionalSale?: boolean | undefined;
189
195
  taxMxikCode?: string | undefined;
190
196
  taxPackageCode?: string | undefined;
197
+ taxUnitsCode?: number | undefined;
198
+ taxLgotaId?: number | undefined;
199
+ vatPercent?: string | undefined;
191
200
  }
192
201
 
193
202
  export interface UpdateProductRequest {
@@ -214,6 +223,9 @@ export interface UpdateProductRequest {
214
223
  allowFractionalSale?: boolean | undefined;
215
224
  taxMxikCode?: string | undefined;
216
225
  taxPackageCode?: string | undefined;
226
+ taxUnitsCode?: number | undefined;
227
+ taxLgotaId?: number | undefined;
228
+ vatPercent?: string | undefined;
217
229
  }
218
230
 
219
231
  export interface ListProductsRequest {
package/gen/payment.ts ADDED
@@ -0,0 +1,208 @@
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: payment.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { IdRequest } from "./common";
11
+ import { Timestamp } from "./google/protobuf/timestamp";
12
+
13
+ export const protobufPackage = "payment.v1";
14
+
15
+ /** Onlayn to'lov provayderi. */
16
+ export enum PaymentProvider {
17
+ PAYMENT_PROVIDER_UNSPECIFIED = 0,
18
+ PAYMENT_PROVIDER_VIA = 1,
19
+ UNRECOGNIZED = -1,
20
+ }
21
+
22
+ /** To'lov oqimi. */
23
+ export enum PaymentFlow {
24
+ PAYMENT_FLOW_UNSPECIFIED = 0,
25
+ /** PAYMENT_FLOW_INVOICE - Hisob-faktura: mijoz provayder tomonida to'laydi (karta bizdan o'tmaydi). */
26
+ PAYMENT_FLOW_INVOICE = 1,
27
+ /** PAYMENT_FLOW_HOLD - Karta tokeni bilan ushlab turish, olib ketishda yechish. */
28
+ PAYMENT_FLOW_HOLD = 2,
29
+ UNRECOGNIZED = -1,
30
+ }
31
+
32
+ /** To'lov holati. */
33
+ export enum PaymentStatus {
34
+ PAYMENT_STATUS_UNSPECIFIED = 0,
35
+ PAYMENT_STATUS_PENDING = 1,
36
+ PAYMENT_STATUS_HELD = 2,
37
+ PAYMENT_STATUS_PAID = 3,
38
+ PAYMENT_STATUS_CANCELLED = 4,
39
+ PAYMENT_STATUS_FAILED = 5,
40
+ PAYMENT_STATUS_REFUNDED = 6,
41
+ UNRECOGNIZED = -1,
42
+ }
43
+
44
+ export interface Payment {
45
+ id: string;
46
+ webOrderId: string;
47
+ provider: PaymentProvider;
48
+ flow: PaymentFlow;
49
+ status: PaymentStatus;
50
+ amount: string;
51
+ currency: string;
52
+ /** Bizning idempotentlik kalitimiz. */
53
+ externalId: string;
54
+ /** Provayder hisob-fakturasi (`inv_...`). */
55
+ invoiceId?:
56
+ | string
57
+ | undefined;
58
+ /** Provayder tranzaksiyasi (`trx_...`). */
59
+ transactionId?:
60
+ | string
61
+ | undefined;
62
+ /** Mijozni yo'naltirish uchun to'lov sahifasi (bo'lsa). */
63
+ paymentUrl?:
64
+ | string
65
+ | undefined;
66
+ /** Karta niqobi (oxirgi raqamlar). To'liq PAN saqlanmaydi. */
67
+ cardMask?: string | undefined;
68
+ paidAt?: Timestamp | undefined;
69
+ failureReason?: string | undefined;
70
+ createdAt: Timestamp | undefined;
71
+ updatedAt: Timestamp | undefined;
72
+ }
73
+
74
+ export interface StartPaymentRequest {
75
+ webOrderId: string;
76
+ /** Ko'rsatilmasa INVOICE ishlatiladi. */
77
+ flow: PaymentFlow;
78
+ /** HOLD oqimi uchun majburiy. */
79
+ cardToken?: string | undefined;
80
+ receiverPhone?: string | undefined;
81
+ receiverEmail?: string | undefined;
82
+ }
83
+
84
+ export interface GetPaymentByOrderRequest {
85
+ webOrderId: string;
86
+ }
87
+
88
+ /** Provayder callback'i yoki UI polling — holatni provayderdan tortadi. */
89
+ export interface SyncPaymentRequest {
90
+ /** Ikkalasidan biri: bizning to'lov id yoki provayder tranzaksiya/invoice id. */
91
+ paymentId?: string | undefined;
92
+ externalId?: string | undefined;
93
+ providerReference?: string | undefined;
94
+ }
95
+
96
+ /** HOLD → yechish (dori berilganda). */
97
+ export interface ConfirmPaymentRequest {
98
+ paymentId: string;
99
+ }
100
+
101
+ /** HOLD → qaytarish (bron bekor/muddati o'tganda). */
102
+ export interface CancelPaymentRequest {
103
+ paymentId: string;
104
+ reason?: string | undefined;
105
+ }
106
+
107
+ export interface RegisterCardRequest {
108
+ webOrderId: string;
109
+ /** Karta raqami — faqat provayderga uzatiladi, saqlanmaydi. */
110
+ pan: string;
111
+ expMonth: string;
112
+ expYear: string;
113
+ phone: string;
114
+ }
115
+
116
+ export interface RegisterCardResponse {
117
+ paymentId: string;
118
+ verifyId: string;
119
+ /** SMS yuborilgan raqam niqobi (mijozga ko'rsatish uchun). */
120
+ phoneMask: string;
121
+ }
122
+
123
+ export interface ConfirmCardRequest {
124
+ paymentId: string;
125
+ verifyCode: string;
126
+ }
127
+
128
+ export interface ResendCardCodeRequest {
129
+ paymentId: string;
130
+ }
131
+
132
+ export interface ResendCardCodeResponse {
133
+ verifyId: string;
134
+ phoneMask: string;
135
+ }
136
+
137
+ export const PAYMENT_V1_PACKAGE_NAME = "payment.v1";
138
+
139
+ export interface PaymentServiceClient {
140
+ startPayment(request: StartPaymentRequest): Observable<Payment>;
141
+
142
+ getPayment(request: IdRequest): Observable<Payment>;
143
+
144
+ getPaymentByOrder(request: GetPaymentByOrderRequest): Observable<Payment>;
145
+
146
+ syncPayment(request: SyncPaymentRequest): Observable<Payment>;
147
+
148
+ confirmPayment(request: ConfirmPaymentRequest): Observable<Payment>;
149
+
150
+ cancelPayment(request: CancelPaymentRequest): Observable<Payment>;
151
+
152
+ registerCard(request: RegisterCardRequest): Observable<RegisterCardResponse>;
153
+
154
+ confirmCard(request: ConfirmCardRequest): Observable<Payment>;
155
+
156
+ resendCardCode(request: ResendCardCodeRequest): Observable<ResendCardCodeResponse>;
157
+ }
158
+
159
+ export interface PaymentServiceController {
160
+ startPayment(request: StartPaymentRequest): Promise<Payment> | Observable<Payment> | Payment;
161
+
162
+ getPayment(request: IdRequest): Promise<Payment> | Observable<Payment> | Payment;
163
+
164
+ getPaymentByOrder(request: GetPaymentByOrderRequest): Promise<Payment> | Observable<Payment> | Payment;
165
+
166
+ syncPayment(request: SyncPaymentRequest): Promise<Payment> | Observable<Payment> | Payment;
167
+
168
+ confirmPayment(request: ConfirmPaymentRequest): Promise<Payment> | Observable<Payment> | Payment;
169
+
170
+ cancelPayment(request: CancelPaymentRequest): Promise<Payment> | Observable<Payment> | Payment;
171
+
172
+ registerCard(
173
+ request: RegisterCardRequest,
174
+ ): Promise<RegisterCardResponse> | Observable<RegisterCardResponse> | RegisterCardResponse;
175
+
176
+ confirmCard(request: ConfirmCardRequest): Promise<Payment> | Observable<Payment> | Payment;
177
+
178
+ resendCardCode(
179
+ request: ResendCardCodeRequest,
180
+ ): Promise<ResendCardCodeResponse> | Observable<ResendCardCodeResponse> | ResendCardCodeResponse;
181
+ }
182
+
183
+ export function PaymentServiceControllerMethods() {
184
+ return function (constructor: Function) {
185
+ const grpcMethods: string[] = [
186
+ "startPayment",
187
+ "getPayment",
188
+ "getPaymentByOrder",
189
+ "syncPayment",
190
+ "confirmPayment",
191
+ "cancelPayment",
192
+ "registerCard",
193
+ "confirmCard",
194
+ "resendCardCode",
195
+ ];
196
+ for (const method of grpcMethods) {
197
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
198
+ GrpcMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
199
+ }
200
+ const grpcStreamMethods: string[] = [];
201
+ for (const method of grpcStreamMethods) {
202
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
203
+ GrpcStreamMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
204
+ }
205
+ };
206
+ }
207
+
208
+ export const PAYMENT_SERVICE_NAME = "PaymentService";
@@ -28,7 +28,14 @@ export interface SearchPrescriptionRequest {
28
28
  | boolean
29
29
  | undefined;
30
30
  /** "prescription-{patient_id}-{safe_code}" — parse qilinadi */
31
- qr?: string | undefined;
31
+ qr?:
32
+ | string
33
+ | undefined;
34
+ /**
35
+ * Retseptni ochayotgan farmatsevt. DMED tokeni har bir shaxsga alohida
36
+ * bog'langani uchun (retsept berish DMED'da shaxsga yoziladi) majburiy.
37
+ */
38
+ accountId: string;
32
39
  }
33
40
 
34
41
  /** Bizning katalogdagi mos mahsulot (filialda mavjud stock bilan). */
@@ -85,6 +92,8 @@ export interface DispenseRequest {
85
92
  markingCode?: string | undefined;
86
93
  drugAmount: number;
87
94
  price: number;
95
+ /** Dorini beruvchi farmatsevt — DMED tokeni shu shaxsniki. */
96
+ accountId: string;
88
97
  }
89
98
 
90
99
  export interface CheckIssueResponse {
@@ -98,9 +107,50 @@ export interface IssueResponse {
98
107
  message: string;
99
108
  }
100
109
 
110
+ export interface DmedAccountRequest {
111
+ accountId: string;
112
+ }
113
+
114
+ export interface DmedAuthorizeUrlResponse {
115
+ /** Farmatsevt shu manzilga yo'naltiriladi (DMED login sahifasi). */
116
+ authorizeUrl: string;
117
+ /** CSRF himoyasi uchun; callback'da qaytib keladi. */
118
+ state: string;
119
+ }
120
+
121
+ export interface CompleteDmedConnectionRequest {
122
+ accountId: string;
123
+ code: string;
124
+ }
125
+
126
+ export interface DmedConnectionStatus {
127
+ connected: boolean;
128
+ dmedEmail?:
129
+ | string
130
+ | undefined;
131
+ /** Access token qachon tugashi (ISO 8601). */
132
+ expiresAt?: string | undefined;
133
+ }
134
+
101
135
  export const PRESCRIPTION_V1_PACKAGE_NAME = "prescription.v1";
102
136
 
103
137
  export interface PrescriptionServiceClient {
138
+ /** DMED hisobini ulash: login manzilini beradi. */
139
+
140
+ connectDmed(request: DmedAccountRequest): Observable<DmedAuthorizeUrlResponse>;
141
+
142
+ /** Callback'dan kelgan `code` ni tokenga almashtirib saqlaydi. */
143
+
144
+ completeDmedConnection(request: CompleteDmedConnectionRequest): Observable<DmedConnectionStatus>;
145
+
146
+ /** Ulanish holati (POS "ulangan/ulanmagan" ko'rsatishi uchun). */
147
+
148
+ getDmedStatus(request: DmedAccountRequest): Observable<DmedConnectionStatus>;
149
+
150
+ /** Ulanishni uzish. */
151
+
152
+ disconnectDmed(request: DmedAccountRequest): Observable<DmedConnectionStatus>;
153
+
104
154
  /** Retsept qidirish + bizdagi mos stockni topish. */
105
155
 
106
156
  searchPrescription(request: SearchPrescriptionRequest): Observable<SearchPrescriptionResponse>;
@@ -115,6 +165,30 @@ export interface PrescriptionServiceClient {
115
165
  }
116
166
 
117
167
  export interface PrescriptionServiceController {
168
+ /** DMED hisobini ulash: login manzilini beradi. */
169
+
170
+ connectDmed(
171
+ request: DmedAccountRequest,
172
+ ): Promise<DmedAuthorizeUrlResponse> | Observable<DmedAuthorizeUrlResponse> | DmedAuthorizeUrlResponse;
173
+
174
+ /** Callback'dan kelgan `code` ni tokenga almashtirib saqlaydi. */
175
+
176
+ completeDmedConnection(
177
+ request: CompleteDmedConnectionRequest,
178
+ ): Promise<DmedConnectionStatus> | Observable<DmedConnectionStatus> | DmedConnectionStatus;
179
+
180
+ /** Ulanish holati (POS "ulangan/ulanmagan" ko'rsatishi uchun). */
181
+
182
+ getDmedStatus(
183
+ request: DmedAccountRequest,
184
+ ): Promise<DmedConnectionStatus> | Observable<DmedConnectionStatus> | DmedConnectionStatus;
185
+
186
+ /** Ulanishni uzish. */
187
+
188
+ disconnectDmed(
189
+ request: DmedAccountRequest,
190
+ ): Promise<DmedConnectionStatus> | Observable<DmedConnectionStatus> | DmedConnectionStatus;
191
+
118
192
  /** Retsept qidirish + bizdagi mos stockni topish. */
119
193
 
120
194
  searchPrescription(
@@ -134,7 +208,15 @@ export interface PrescriptionServiceController {
134
208
 
135
209
  export function PrescriptionServiceControllerMethods() {
136
210
  return function (constructor: Function) {
137
- const grpcMethods: string[] = ["searchPrescription", "checkPrescriptionIssue", "issuePrescription"];
211
+ const grpcMethods: string[] = [
212
+ "connectDmed",
213
+ "completeDmedConnection",
214
+ "getDmedStatus",
215
+ "disconnectDmed",
216
+ "searchPrescription",
217
+ "checkPrescriptionIssue",
218
+ "issuePrescription",
219
+ ];
138
220
  for (const method of grpcMethods) {
139
221
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
140
222
  GrpcMethod("PrescriptionService", method)(constructor.prototype[method], method, descriptor);
@@ -125,7 +125,29 @@ export interface WebOrder {
125
125
  items: WebOrderItem[];
126
126
  /** Buyurtma bajariladigan dorixona (bitta order = bitta filial). */
127
127
  branchId?: string | undefined;
128
- pharmacyName?: string | undefined;
128
+ pharmacyName?:
129
+ | string
130
+ | undefined;
131
+ /** Onlayn to'lov. Bo'lmasa — dorixonada naqd/karta bilan to'lanadi. */
132
+ payment?: WebOrderPayment | undefined;
133
+ }
134
+
135
+ /**
136
+ * Buyurtmaning onlayn to'lovi (bo'lsa). To'liq tafsilot payment.v1 da —
137
+ * bu yerda ro'yxat/kartochkada ko'rsatish uchun zarur minimum.
138
+ */
139
+ export interface WebOrderPayment {
140
+ id: string;
141
+ /** PENDING | HELD | PAID | CANCELLED | FAILED | REFUNDED */
142
+ status: string;
143
+ amount: string;
144
+ cardMask?: string | undefined;
145
+ paidAt?:
146
+ | Timestamp
147
+ | undefined;
148
+ /** Fiskal chek yuborilganmi (yuborilmagan bo'lsa — sabab `receipt_error`). */
149
+ receiptSentAt?: Timestamp | undefined;
150
+ receiptError?: string | undefined;
129
151
  }
130
152
 
131
153
  export interface GetWebOrderByNumberRequest {
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
- {
2
- "name": "@prodoctors/contracts",
3
- "version": "1.13.0",
4
- "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc -p tsconfig.build.json",
9
- "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
10
- },
11
- "files": [
12
- "proto",
13
- "gen",
14
- "dist"
15
- ],
16
- "publishConfig": {
17
- "access": "public"
18
- },
19
- "dependencies": {
20
- "@nestjs/microservices": "^11.1.15",
21
- "rxjs": "^7.8.2",
22
- "ts-proto": "^2.11.4"
23
- },
24
- "devDependencies": {
25
- "@types/node": "^25.3.5",
26
- "typescript": "^5.9.3"
27
- }
28
- }
1
+ {
2
+ "name": "@prodoctors/contracts",
3
+ "version": "1.15.0",
4
+ "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc -p tsconfig.build.json",
9
+ "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
10
+ },
11
+ "files": [
12
+ "proto",
13
+ "gen",
14
+ "dist"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "dependencies": {
20
+ "@nestjs/microservices": "^11.1.15",
21
+ "rxjs": "^7.8.2",
22
+ "ts-proto": "^2.11.4"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^25.3.5",
26
+ "typescript": "^5.9.3"
27
+ }
28
+ }
@@ -1,81 +1,84 @@
1
- syntax = "proto3";
2
-
3
- package branch.v1;
4
-
5
- import "google/protobuf/timestamp.proto";
6
- import "common.proto";
7
-
8
- message BranchBankDetails {
9
- optional string legal_name = 1;
10
- optional string legal_address = 2;
11
- optional string account_number = 3;
12
- optional string bank_name = 4;
13
- optional string bank_branch = 5;
14
- optional string mfo = 6;
15
- optional string inn = 7;
16
- optional string okonx = 8;
17
- }
18
-
19
- message Branch {
20
- string id = 1;
21
- string name = 2;
22
- optional string code = 3;
23
- optional string address = 4;
24
- optional string phone = 5;
25
- bool is_active = 6;
26
- optional string work_time = 7;
27
- optional string lat = 8;
28
- optional string lng = 9;
29
- optional string parent_branch_id = 10;
30
- google.protobuf.Timestamp created_at = 11;
31
- google.protobuf.Timestamp updated_at = 12;
32
- optional string region_id = 13;
33
- optional BranchBankDetails bank_details = 14;
34
- }
35
-
36
- message CreateBranchRequest {
37
- string name = 1;
38
- optional string code = 2;
39
- optional string address = 3;
40
- optional string phone = 4;
41
- optional bool is_active = 5;
42
- optional string work_time = 6;
43
- optional string lat = 7;
44
- optional string lng = 8;
45
- optional string parent_branch_id = 9;
46
- optional string region_id = 10;
47
- optional BranchBankDetails bank_details = 11;
48
- }
49
-
50
- message UpdateBranchRequest {
51
- string id = 1;
52
- optional string name = 2;
53
- optional string code = 3;
54
- optional string address = 4;
55
- optional string phone = 5;
56
- optional bool is_active = 6;
57
- optional string work_time = 7;
58
- optional string lat = 8;
59
- optional string lng = 9;
60
- optional string parent_branch_id = 10;
61
- optional string region_id = 11;
62
- optional BranchBankDetails bank_details = 12;
63
- }
64
-
65
- message ListBranchesRequest {
66
- optional bool is_active = 1;
67
- optional string parent_branch_id = 2;
68
- optional string search = 3;
69
- }
70
-
71
- message ListBranchesResponse {
72
- repeated Branch items = 1;
73
- }
74
-
75
- service BranchService {
76
- rpc CreateBranch(CreateBranchRequest) returns (Branch);
77
- rpc UpdateBranch(UpdateBranchRequest) returns (Branch);
78
- rpc GetBranch(common.v1.IdRequest) returns (Branch);
79
- rpc ListBranches(ListBranchesRequest) returns (ListBranchesResponse);
80
- rpc DeleteBranch(common.v1.IdRequest) returns (common.v1.BoolResponse);
81
- }
1
+ syntax = "proto3";
2
+
3
+ package branch.v1;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+ import "common.proto";
7
+
8
+ message BranchBankDetails {
9
+ optional string legal_name = 1;
10
+ optional string legal_address = 2;
11
+ optional string account_number = 3;
12
+ optional string bank_name = 4;
13
+ optional string bank_branch = 5;
14
+ optional string mfo = 6;
15
+ optional string inn = 7;
16
+ optional string okonx = 8;
17
+ }
18
+
19
+ message Branch {
20
+ string id = 1;
21
+ string name = 2;
22
+ optional string code = 3;
23
+ optional string address = 4;
24
+ optional string phone = 5;
25
+ bool is_active = 6;
26
+ optional string work_time = 7;
27
+ optional string lat = 8;
28
+ optional string lng = 9;
29
+ optional string parent_branch_id = 10;
30
+ google.protobuf.Timestamp created_at = 11;
31
+ google.protobuf.Timestamp updated_at = 12;
32
+ optional string region_id = 13;
33
+ optional BranchBankDetails bank_details = 14;
34
+ optional string cover_image_url = 15;
35
+ }
36
+
37
+ message CreateBranchRequest {
38
+ string name = 1;
39
+ optional string code = 2;
40
+ optional string address = 3;
41
+ optional string phone = 4;
42
+ optional bool is_active = 5;
43
+ optional string work_time = 6;
44
+ optional string lat = 7;
45
+ optional string lng = 8;
46
+ optional string parent_branch_id = 9;
47
+ optional string region_id = 10;
48
+ optional BranchBankDetails bank_details = 11;
49
+ optional string cover_image_url = 12;
50
+ }
51
+
52
+ message UpdateBranchRequest {
53
+ string id = 1;
54
+ optional string name = 2;
55
+ optional string code = 3;
56
+ optional string address = 4;
57
+ optional string phone = 5;
58
+ optional bool is_active = 6;
59
+ optional string work_time = 7;
60
+ optional string lat = 8;
61
+ optional string lng = 9;
62
+ optional string parent_branch_id = 10;
63
+ optional string region_id = 11;
64
+ optional BranchBankDetails bank_details = 12;
65
+ optional string cover_image_url = 13;
66
+ }
67
+
68
+ message ListBranchesRequest {
69
+ optional bool is_active = 1;
70
+ optional string parent_branch_id = 2;
71
+ optional string search = 3;
72
+ }
73
+
74
+ message ListBranchesResponse {
75
+ repeated Branch items = 1;
76
+ }
77
+
78
+ service BranchService {
79
+ rpc CreateBranch(CreateBranchRequest) returns (Branch);
80
+ rpc UpdateBranch(UpdateBranchRequest) returns (Branch);
81
+ rpc GetBranch(common.v1.IdRequest) returns (Branch);
82
+ rpc ListBranches(ListBranchesRequest) returns (ListBranchesResponse);
83
+ rpc DeleteBranch(common.v1.IdRequest) returns (common.v1.BoolResponse);
84
+ }