@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/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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prodoctors/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,22 +1,68 @@
1
-
2
1
  syntax = "proto3";
3
2
 
4
- package account.v1;
3
+ package account.v1;
5
4
 
6
- // Account service for managing user profiles
7
- service AccountService {
8
- // Get user profile information
9
- rpc GetProfile (GetAccountRequest) returns (GetAccountResponse);
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;
10
32
  }
11
33
 
12
- message GetAccountRequest {
34
+ message UpdateAccountRequest {
13
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;
14
46
  }
15
47
 
16
- message GetAccountResponse {
17
- string id = 1;
18
- string name = 2;
19
- string username = 3;
20
- string role = 4;
21
- string branch_id = 5;
22
- }
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
+ }
package/proto/auth.proto CHANGED
@@ -34,8 +34,10 @@ message RegisterRequest {
34
34
  string name = 1;
35
35
  string username = 2;
36
36
  string password = 3;
37
- optional string role = 4;
38
- optional string branch_id = 5;
37
+ optional string phone = 4;
38
+ optional string email = 5;
39
+ optional string role = 6;
40
+ optional string branch_id = 7;
39
41
  }
40
42
 
41
43
  message RegisterResponse {
@@ -69,4 +71,4 @@ message RefreshRequest {
69
71
  message RefreshResponse {
70
72
  string access_token = 1;
71
73
  string refresh_token = 2;
72
- }
74
+ }
@@ -2,63 +2,63 @@ syntax = "proto3";
2
2
 
3
3
  package branch.v1;
4
4
 
5
- // Branch service for managing branches
6
- service BranchService {
7
- // Create a new branch
8
- rpc CreateBranch (CreateBranchRequest) returns (CreateBranchResponse);
9
-
10
- // Get branch details by ID
11
- rpc GetBranch (GetBranchRequest) returns (GetBranchResponse);
12
-
13
- // Update branch details
14
- rpc UpdateBranch (UpdateBranchRequest) returns (UpdateBranchResponse);
5
+ import "google/protobuf/timestamp.proto";
6
+ import "common.proto";
15
7
 
16
- // Delete a branch by ID
17
- rpc DeleteBranch (DeleteBranchRequest) returns (DeleteBranchResponse);
8
+ message Branch {
9
+ string id = 1;
10
+ string name = 2;
11
+ optional string code = 3;
12
+ optional string address = 4;
13
+ optional string phone = 5;
14
+ bool is_active = 6;
15
+ optional string work_time = 7;
16
+ optional string lat = 8;
17
+ optional string lng = 9;
18
+ optional string parent_branch_id = 10;
19
+ google.protobuf.Timestamp created_at = 11;
20
+ google.protobuf.Timestamp updated_at = 12;
18
21
  }
19
22
 
20
23
  message CreateBranchRequest {
21
- string name = 1;
22
- string phone = 2;
24
+ string name = 1;
25
+ optional string code = 2;
23
26
  optional string address = 3;
24
- optional string lat = 4;
25
- optional string lng = 5;
26
- }
27
-
28
- message CreateBranchResponse {
29
- string id = 1;
30
- }
31
-
32
- message GetBranchRequest {
33
- string id = 1;
34
- }
35
-
36
- message GetBranchResponse {
37
- string id = 1;
38
- string name = 2;
39
- string phone = 3;
40
- optional string address = 4;
41
- optional string lat = 5;
42
- optional string lng = 6;
27
+ optional string phone = 4;
28
+ optional bool is_active = 5;
29
+ optional string work_time = 6;
30
+ optional string lat = 7;
31
+ optional string lng = 8;
32
+ optional string parent_branch_id = 9;
43
33
  }
44
34
 
45
35
  message UpdateBranchRequest {
46
- string id = 1;
47
- string name = 2;
48
- string phone = 3;
36
+ string id = 1;
37
+ optional string name = 2;
38
+ optional string code = 3;
49
39
  optional string address = 4;
50
- optional string lat = 5;
51
- optional string lng = 6;
40
+ optional string phone = 5;
41
+ optional bool is_active = 6;
42
+ optional string work_time = 7;
43
+ optional string lat = 8;
44
+ optional string lng = 9;
45
+ optional string parent_branch_id = 10;
52
46
  }
53
47
 
54
- message UpdateBranchResponse {
55
- bool ok = 1;
48
+ message ListBranchesRequest {
49
+ optional bool is_active = 1;
50
+ optional string parent_branch_id = 2;
51
+ optional string search = 3;
56
52
  }
57
53
 
58
- message DeleteBranchRequest {
59
- string id = 1;
54
+ message ListBranchesResponse {
55
+ repeated Branch items = 1;
60
56
  }
61
57
 
62
- message DeleteBranchResponse {
63
- bool ok = 1;
58
+ service BranchService {
59
+ rpc CreateBranch(CreateBranchRequest) returns (Branch);
60
+ rpc UpdateBranch(UpdateBranchRequest) returns (Branch);
61
+ rpc GetBranch(common.v1.IdRequest) returns (Branch);
62
+ rpc ListBranches(ListBranchesRequest) returns (ListBranchesResponse);
63
+ rpc DeleteBranch(common.v1.IdRequest) returns (common.v1.BoolResponse);
64
64
  }