@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/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -6,4 +6,9 @@ exports.PROTO_PATHS = {
|
|
|
6
6
|
AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
|
|
7
7
|
ACCOUNT: (0, path_1.join)(__dirname, "../../proto/account.proto"),
|
|
8
8
|
BRANCH: (0, path_1.join)(__dirname, "../../proto/branch.proto"),
|
|
9
|
+
CATALOG: (0, path_1.join)(__dirname, "../../proto/catalog.proto"),
|
|
10
|
+
INVENTORY: (0, path_1.join)(__dirname, "../../proto/inventory.proto"),
|
|
11
|
+
PARTNER: (0, path_1.join)(__dirname, "../../proto/partner.proto"),
|
|
12
|
+
PURCHASE: (0, path_1.join)(__dirname, "../../proto/purchase.proto"),
|
|
13
|
+
SALES: (0, path_1.join)(__dirname, "../../proto/sales.proto"),
|
|
9
14
|
};
|
package/gen/account.ts
CHANGED
|
@@ -1,61 +1,122 @@
|
|
|
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: account.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export interface
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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: account.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 = "account.v1";
|
|
14
|
+
|
|
15
|
+
export interface Account {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
username: string;
|
|
19
|
+
phone?: string | undefined;
|
|
20
|
+
email?: string | undefined;
|
|
21
|
+
isPhoneVerified: boolean;
|
|
22
|
+
isEmailVerified: boolean;
|
|
23
|
+
isActive: boolean;
|
|
24
|
+
role: string;
|
|
25
|
+
branchId?: string | undefined;
|
|
26
|
+
createdAt: Timestamp | undefined;
|
|
27
|
+
updatedAt: Timestamp | undefined;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CreateAccountRequest {
|
|
31
|
+
name: string;
|
|
32
|
+
username: string;
|
|
33
|
+
password: string;
|
|
34
|
+
phone?: string | undefined;
|
|
35
|
+
email?: string | undefined;
|
|
36
|
+
role?: string | undefined;
|
|
37
|
+
branchId?: string | undefined;
|
|
38
|
+
isActive?: boolean | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface UpdateAccountRequest {
|
|
42
|
+
id: string;
|
|
43
|
+
name?: string | undefined;
|
|
44
|
+
username?: string | undefined;
|
|
45
|
+
password?: string | undefined;
|
|
46
|
+
phone?: string | undefined;
|
|
47
|
+
email?: string | undefined;
|
|
48
|
+
role?: string | undefined;
|
|
49
|
+
branchId?: string | undefined;
|
|
50
|
+
isActive?: boolean | undefined;
|
|
51
|
+
isPhoneVerified?: boolean | undefined;
|
|
52
|
+
isEmailVerified?: boolean | undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface ListAccountsRequest {
|
|
56
|
+
pagination: PaginationRequest | undefined;
|
|
57
|
+
branchId?: string | undefined;
|
|
58
|
+
role?: string | undefined;
|
|
59
|
+
isActive?: boolean | undefined;
|
|
60
|
+
search?: string | undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ListAccountsResponse {
|
|
64
|
+
items: Account[];
|
|
65
|
+
meta: PaginationMeta | undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
69
|
+
|
|
70
|
+
export interface AccountServiceClient {
|
|
71
|
+
createAccount(request: CreateAccountRequest): Observable<Account>;
|
|
72
|
+
|
|
73
|
+
updateAccount(request: UpdateAccountRequest): Observable<Account>;
|
|
74
|
+
|
|
75
|
+
getAccount(request: IdRequest): Observable<Account>;
|
|
76
|
+
|
|
77
|
+
getProfile(request: IdRequest): Observable<Account>;
|
|
78
|
+
|
|
79
|
+
listAccounts(request: ListAccountsRequest): Observable<ListAccountsResponse>;
|
|
80
|
+
|
|
81
|
+
deleteAccount(request: IdRequest): Observable<BoolResponse>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AccountServiceController {
|
|
85
|
+
createAccount(request: CreateAccountRequest): Promise<Account> | Observable<Account> | Account;
|
|
86
|
+
|
|
87
|
+
updateAccount(request: UpdateAccountRequest): Promise<Account> | Observable<Account> | Account;
|
|
88
|
+
|
|
89
|
+
getAccount(request: IdRequest): Promise<Account> | Observable<Account> | Account;
|
|
90
|
+
|
|
91
|
+
getProfile(request: IdRequest): Promise<Account> | Observable<Account> | Account;
|
|
92
|
+
|
|
93
|
+
listAccounts(
|
|
94
|
+
request: ListAccountsRequest,
|
|
95
|
+
): Promise<ListAccountsResponse> | Observable<ListAccountsResponse> | ListAccountsResponse;
|
|
96
|
+
|
|
97
|
+
deleteAccount(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function AccountServiceControllerMethods() {
|
|
101
|
+
return function (constructor: Function) {
|
|
102
|
+
const grpcMethods: string[] = [
|
|
103
|
+
"createAccount",
|
|
104
|
+
"updateAccount",
|
|
105
|
+
"getAccount",
|
|
106
|
+
"getProfile",
|
|
107
|
+
"listAccounts",
|
|
108
|
+
"deleteAccount",
|
|
109
|
+
];
|
|
110
|
+
for (const method of grpcMethods) {
|
|
111
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
112
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
113
|
+
}
|
|
114
|
+
const grpcStreamMethods: string[] = [];
|
|
115
|
+
for (const method of grpcStreamMethods) {
|
|
116
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
117
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/auth.ts
CHANGED
|
@@ -1,140 +1,131 @@
|
|
|
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: auth.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
|
|
11
|
-
export const protobufPackage = "auth.v1";
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
username: string;
|
|
26
|
-
password: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface
|
|
43
|
-
ok: boolean;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export interface
|
|
47
|
-
identifier: string;
|
|
48
|
-
type: string;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface
|
|
62
|
-
accessToken: string;
|
|
63
|
-
refreshToken: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export interface
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const grpcStreamMethods: string[] = [];
|
|
133
|
-
for (const method of grpcStreamMethods) {
|
|
134
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
135
|
-
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export const AUTH_SERVICE_NAME = "AuthService";
|
|
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: auth.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "auth.v1";
|
|
12
|
+
|
|
13
|
+
export interface LoginRequest {
|
|
14
|
+
username: string;
|
|
15
|
+
password: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface LoginResponse {
|
|
19
|
+
accessToken: string;
|
|
20
|
+
refreshToken: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface RegisterRequest {
|
|
24
|
+
name: string;
|
|
25
|
+
username: string;
|
|
26
|
+
password: string;
|
|
27
|
+
phone?: string | undefined;
|
|
28
|
+
email?: string | undefined;
|
|
29
|
+
role?: string | undefined;
|
|
30
|
+
branchId?: string | undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface RegisterResponse {
|
|
34
|
+
ok: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface SendOtpRequest {
|
|
38
|
+
identifier: string;
|
|
39
|
+
type: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SendOtpResponse {
|
|
43
|
+
ok: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface VerifyOtpRequest {
|
|
47
|
+
identifier: string;
|
|
48
|
+
type: string;
|
|
49
|
+
code: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface VerifyOtpResponse {
|
|
53
|
+
accessToken: string;
|
|
54
|
+
refreshToken: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface RefreshRequest {
|
|
58
|
+
refreshToken: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface RefreshResponse {
|
|
62
|
+
accessToken: string;
|
|
63
|
+
refreshToken: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
67
|
+
|
|
68
|
+
/** Authentication service for sending and verifying OTPs */
|
|
69
|
+
|
|
70
|
+
export interface AuthServiceClient {
|
|
71
|
+
/** Authoriration user */
|
|
72
|
+
|
|
73
|
+
login(request: LoginRequest): Observable<LoginResponse>;
|
|
74
|
+
|
|
75
|
+
/** Registration user */
|
|
76
|
+
|
|
77
|
+
register(request: RegisterRequest): Observable<RegisterResponse>;
|
|
78
|
+
|
|
79
|
+
/** Send OTP to the user */
|
|
80
|
+
|
|
81
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
82
|
+
|
|
83
|
+
/** Verify the OTP sent to the user */
|
|
84
|
+
|
|
85
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
86
|
+
|
|
87
|
+
/** Refersh token */
|
|
88
|
+
|
|
89
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Authentication service for sending and verifying OTPs */
|
|
93
|
+
|
|
94
|
+
export interface AuthServiceController {
|
|
95
|
+
/** Authoriration user */
|
|
96
|
+
|
|
97
|
+
login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
|
|
98
|
+
|
|
99
|
+
/** Registration user */
|
|
100
|
+
|
|
101
|
+
register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
|
|
102
|
+
|
|
103
|
+
/** Send OTP to the user */
|
|
104
|
+
|
|
105
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
106
|
+
|
|
107
|
+
/** Verify the OTP sent to the user */
|
|
108
|
+
|
|
109
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
110
|
+
|
|
111
|
+
/** Refersh token */
|
|
112
|
+
|
|
113
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function AuthServiceControllerMethods() {
|
|
117
|
+
return function (constructor: Function) {
|
|
118
|
+
const grpcMethods: string[] = ["login", "register", "sendOtp", "verifyOtp", "refresh"];
|
|
119
|
+
for (const method of grpcMethods) {
|
|
120
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
121
|
+
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
122
|
+
}
|
|
123
|
+
const grpcStreamMethods: string[] = [];
|
|
124
|
+
for (const method of grpcStreamMethods) {
|
|
125
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
126
|
+
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const AUTH_SERVICE_NAME = "AuthService";
|
package/gen/branch.ts
CHANGED
|
@@ -7,106 +7,92 @@
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
+
import { BoolResponse, IdRequest } from "./common";
|
|
11
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
10
12
|
|
|
11
13
|
export const protobufPackage = "branch.v1";
|
|
12
14
|
|
|
13
|
-
export interface
|
|
14
|
-
name: string;
|
|
15
|
-
phone: string;
|
|
16
|
-
address: string;
|
|
17
|
-
lat: string;
|
|
18
|
-
lng: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface CreateBranchResponse {
|
|
22
|
-
id: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface GetBranchRequest {
|
|
15
|
+
export interface Branch {
|
|
26
16
|
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
code?: string | undefined;
|
|
19
|
+
address?: string | undefined;
|
|
20
|
+
phone?: string | undefined;
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
workTime?: string | undefined;
|
|
23
|
+
lat?: string | undefined;
|
|
24
|
+
lng?: string | undefined;
|
|
25
|
+
parentBranchId?: string | undefined;
|
|
26
|
+
createdAt: Timestamp | undefined;
|
|
27
|
+
updatedAt: Timestamp | undefined;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
export interface
|
|
30
|
-
id: string;
|
|
30
|
+
export interface CreateBranchRequest {
|
|
31
31
|
name: string;
|
|
32
|
-
|
|
33
|
-
address
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
code?: string | undefined;
|
|
33
|
+
address?: string | undefined;
|
|
34
|
+
phone?: string | undefined;
|
|
35
|
+
isActive?: boolean | undefined;
|
|
36
|
+
workTime?: string | undefined;
|
|
37
|
+
lat?: string | undefined;
|
|
38
|
+
lng?: string | undefined;
|
|
39
|
+
parentBranchId?: string | undefined;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
export interface UpdateBranchRequest {
|
|
39
43
|
id: string;
|
|
40
|
-
name
|
|
41
|
-
|
|
42
|
-
address
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
name?: string | undefined;
|
|
45
|
+
code?: string | undefined;
|
|
46
|
+
address?: string | undefined;
|
|
47
|
+
phone?: string | undefined;
|
|
48
|
+
isActive?: boolean | undefined;
|
|
49
|
+
workTime?: string | undefined;
|
|
50
|
+
lat?: string | undefined;
|
|
51
|
+
lng?: string | undefined;
|
|
52
|
+
parentBranchId?: string | undefined;
|
|
45
53
|
}
|
|
46
54
|
|
|
47
|
-
export interface
|
|
48
|
-
|
|
55
|
+
export interface ListBranchesRequest {
|
|
56
|
+
isActive?: boolean | undefined;
|
|
57
|
+
parentBranchId?: string | undefined;
|
|
58
|
+
search?: string | undefined;
|
|
49
59
|
}
|
|
50
60
|
|
|
51
|
-
export interface
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface DeleteBranchResponse {
|
|
56
|
-
ok: boolean;
|
|
61
|
+
export interface ListBranchesResponse {
|
|
62
|
+
items: Branch[];
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
export const BRANCH_V1_PACKAGE_NAME = "branch.v1";
|
|
60
66
|
|
|
61
|
-
/** Branch service for managing branches */
|
|
62
|
-
|
|
63
67
|
export interface BranchServiceClient {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
createBranch(request: CreateBranchRequest): Observable<CreateBranchResponse>;
|
|
67
|
-
|
|
68
|
-
/** Get branch details by ID */
|
|
68
|
+
createBranch(request: CreateBranchRequest): Observable<Branch>;
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
updateBranch(request: UpdateBranchRequest): Observable<Branch>;
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
getBranch(request: IdRequest): Observable<Branch>;
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
listBranches(request: ListBranchesRequest): Observable<ListBranchesResponse>;
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
deleteBranch(request: DeleteBranchRequest): Observable<DeleteBranchResponse>;
|
|
76
|
+
deleteBranch(request: IdRequest): Observable<BoolResponse>;
|
|
79
77
|
}
|
|
80
78
|
|
|
81
|
-
/** Branch service for managing branches */
|
|
82
|
-
|
|
83
79
|
export interface BranchServiceController {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
createBranch(
|
|
87
|
-
request: CreateBranchRequest,
|
|
88
|
-
): Promise<CreateBranchResponse> | Observable<CreateBranchResponse> | CreateBranchResponse;
|
|
89
|
-
|
|
90
|
-
/** Get branch details by ID */
|
|
91
|
-
|
|
92
|
-
getBranch(request: GetBranchRequest): Promise<GetBranchResponse> | Observable<GetBranchResponse> | GetBranchResponse;
|
|
80
|
+
createBranch(request: CreateBranchRequest): Promise<Branch> | Observable<Branch> | Branch;
|
|
93
81
|
|
|
94
|
-
|
|
82
|
+
updateBranch(request: UpdateBranchRequest): Promise<Branch> | Observable<Branch> | Branch;
|
|
95
83
|
|
|
96
|
-
|
|
97
|
-
request: UpdateBranchRequest,
|
|
98
|
-
): Promise<UpdateBranchResponse> | Observable<UpdateBranchResponse> | UpdateBranchResponse;
|
|
84
|
+
getBranch(request: IdRequest): Promise<Branch> | Observable<Branch> | Branch;
|
|
99
85
|
|
|
100
|
-
|
|
86
|
+
listBranches(
|
|
87
|
+
request: ListBranchesRequest,
|
|
88
|
+
): Promise<ListBranchesResponse> | Observable<ListBranchesResponse> | ListBranchesResponse;
|
|
101
89
|
|
|
102
|
-
deleteBranch(
|
|
103
|
-
request: DeleteBranchRequest,
|
|
104
|
-
): Promise<DeleteBranchResponse> | Observable<DeleteBranchResponse> | DeleteBranchResponse;
|
|
90
|
+
deleteBranch(request: IdRequest): Promise<BoolResponse> | Observable<BoolResponse> | BoolResponse;
|
|
105
91
|
}
|
|
106
92
|
|
|
107
93
|
export function BranchServiceControllerMethods() {
|
|
108
94
|
return function (constructor: Function) {
|
|
109
|
-
const grpcMethods: string[] = ["createBranch", "getBranch", "
|
|
95
|
+
const grpcMethods: string[] = ["createBranch", "updateBranch", "getBranch", "listBranches", "deleteBranch"];
|
|
110
96
|
for (const method of grpcMethods) {
|
|
111
97
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
112
98
|
GrpcMethod("BranchService", method)(constructor.prototype[method], method, descriptor);
|