@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.
@@ -2,4 +2,9 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
4
  readonly BRANCH: string;
5
+ readonly CATALOG: string;
6
+ readonly INVENTORY: string;
7
+ readonly PARTNER: string;
8
+ readonly PURCHASE: string;
9
+ readonly SALES: string;
5
10
  };
@@ -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 { Role } from "./auth";
11
-
12
- export const protobufPackage = "account.v1";
13
-
14
- export interface GetAccountRequest {
15
- id: string;
16
- }
17
-
18
- export interface GetAccountResponse {
19
- id: string;
20
- name: string;
21
- username: string;
22
- role: Role;
23
- branchId: string;
24
- }
25
-
26
- export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
27
-
28
- /** Account service for managing user profiles */
29
-
30
- export interface AccountServiceClient {
31
- /** Get user profile information */
32
-
33
- getProfile(request: GetAccountRequest): Observable<GetAccountResponse>;
34
- }
35
-
36
- /** Account service for managing user profiles */
37
-
38
- export interface AccountServiceController {
39
- /** Get user profile information */
40
-
41
- getProfile(
42
- request: GetAccountRequest,
43
- ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
44
- }
45
-
46
- export function AccountServiceControllerMethods() {
47
- return function (constructor: Function) {
48
- const grpcMethods: string[] = ["getProfile"];
49
- for (const method of grpcMethods) {
50
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
51
- GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
52
- }
53
- const grpcStreamMethods: string[] = [];
54
- for (const method of grpcStreamMethods) {
55
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
56
- GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
57
- }
58
- };
59
- }
60
-
61
- export const ACCOUNT_SERVICE_NAME = "AccountService";
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 enum Role {
14
- USER = 0,
15
- SUPER_ADMIN = 1,
16
- MANAGER = 2,
17
- PHARMACIST = 3,
18
- CASHIER = 4,
19
- INVENTORY_MANAGER = 5,
20
- AUDITOR = 6,
21
- UNRECOGNIZED = -1,
22
- }
23
-
24
- export interface LoginRequest {
25
- username: string;
26
- password: string;
27
- }
28
-
29
- export interface LoginResponse {
30
- accessToken: string;
31
- refreshToken: string;
32
- }
33
-
34
- export interface RegisterRequest {
35
- name: string;
36
- username: string;
37
- password: string;
38
- role?: Role | undefined;
39
- branchId?: string | undefined;
40
- }
41
-
42
- export interface RegisterResponse {
43
- ok: boolean;
44
- }
45
-
46
- export interface SendOtpRequest {
47
- identifier: string;
48
- type: string;
49
- }
50
-
51
- export interface SendOtpResponse {
52
- ok: boolean;
53
- }
54
-
55
- export interface VerifyOtpRequest {
56
- identifier: string;
57
- type: string;
58
- code: string;
59
- }
60
-
61
- export interface VerifyOtpResponse {
62
- accessToken: string;
63
- refreshToken: string;
64
- }
65
-
66
- export interface RefreshRequest {
67
- refreshToken: string;
68
- }
69
-
70
- export interface RefreshResponse {
71
- accessToken: string;
72
- refreshToken: string;
73
- }
74
-
75
- export const AUTH_V1_PACKAGE_NAME = "auth.v1";
76
-
77
- /** Authentication service for sending and verifying OTPs */
78
-
79
- export interface AuthServiceClient {
80
- /** Authoriration user */
81
-
82
- login(request: LoginRequest): Observable<LoginResponse>;
83
-
84
- /** Registration user */
85
-
86
- register(request: RegisterRequest): Observable<RegisterResponse>;
87
-
88
- /** Send OTP to the user */
89
-
90
- sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
91
-
92
- /** Verify the OTP sent to the user */
93
-
94
- verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
95
-
96
- /** Refersh token */
97
-
98
- refresh(request: RefreshRequest): Observable<RefreshResponse>;
99
- }
100
-
101
- /** Authentication service for sending and verifying OTPs */
102
-
103
- export interface AuthServiceController {
104
- /** Authoriration user */
105
-
106
- login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
107
-
108
- /** Registration user */
109
-
110
- register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
111
-
112
- /** Send OTP to the user */
113
-
114
- sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
115
-
116
- /** Verify the OTP sent to the user */
117
-
118
- verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
119
-
120
- /** Refersh token */
121
-
122
- refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
123
- }
124
-
125
- export function AuthServiceControllerMethods() {
126
- return function (constructor: Function) {
127
- const grpcMethods: string[] = ["login", "register", "sendOtp", "verifyOtp", "refresh"];
128
- for (const method of grpcMethods) {
129
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
130
- GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
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 CreateBranchRequest {
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 GetBranchResponse {
30
- id: string;
30
+ export interface CreateBranchRequest {
31
31
  name: string;
32
- phone: string;
33
- address: string;
34
- lat: string;
35
- lng: string;
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: string;
41
- phone: string;
42
- address: string;
43
- lat: string;
44
- lng: string;
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 UpdateBranchResponse {
48
- ok: boolean;
55
+ export interface ListBranchesRequest {
56
+ isActive?: boolean | undefined;
57
+ parentBranchId?: string | undefined;
58
+ search?: string | undefined;
49
59
  }
50
60
 
51
- export interface DeleteBranchRequest {
52
- id: string;
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
- /** Create a new branch */
65
-
66
- createBranch(request: CreateBranchRequest): Observable<CreateBranchResponse>;
67
-
68
- /** Get branch details by ID */
68
+ createBranch(request: CreateBranchRequest): Observable<Branch>;
69
69
 
70
- getBranch(request: GetBranchRequest): Observable<GetBranchResponse>;
70
+ updateBranch(request: UpdateBranchRequest): Observable<Branch>;
71
71
 
72
- /** Update branch details */
72
+ getBranch(request: IdRequest): Observable<Branch>;
73
73
 
74
- updateBranch(request: UpdateBranchRequest): Observable<UpdateBranchResponse>;
74
+ listBranches(request: ListBranchesRequest): Observable<ListBranchesResponse>;
75
75
 
76
- /** Delete a branch by ID */
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
- /** Create a new branch */
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
- /** Update branch details */
82
+ updateBranch(request: UpdateBranchRequest): Promise<Branch> | Observable<Branch> | Branch;
95
83
 
96
- updateBranch(
97
- request: UpdateBranchRequest,
98
- ): Promise<UpdateBranchResponse> | Observable<UpdateBranchResponse> | UpdateBranchResponse;
84
+ getBranch(request: IdRequest): Promise<Branch> | Observable<Branch> | Branch;
99
85
 
100
- /** Delete a branch by ID */
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", "updateBranch", "deleteBranch"];
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);