@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/proto/auth.proto CHANGED
@@ -1,82 +1,74 @@
1
- syntax = "proto3";
2
-
3
- package auth.v1;
4
-
5
- // Authentication service for sending and verifying OTPs
6
- service AuthService {
7
- // Authoriration user
8
- rpc Login (LoginRequest) returns (LoginResponse);
9
-
10
- // Registration user
11
- rpc Register (RegisterRequest) returns (RegisterResponse);
12
-
13
- // Send OTP to the user
14
- rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
15
-
16
- // Verify the OTP sent to the user
17
- rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
18
-
19
- // Refersh token
20
- rpc Refresh (RefreshRequest) returns (RefreshResponse);
21
- }
22
-
23
- message LoginRequest {
24
- string username = 1;
25
- string password = 2;
26
- }
27
-
28
- message LoginResponse {
29
- string access_token = 1;
30
- string refresh_token = 2;
31
- }
32
-
33
- message RegisterRequest {
34
- string name = 1;
35
- string username = 2;
36
- string password = 3;
37
- optional Role role = 4;
38
- optional string branch_id = 5;
39
- }
40
-
41
- message RegisterResponse {
42
- bool ok = 1;
43
- }
44
-
45
- message SendOtpRequest {
46
- string identifier = 1;
47
- string type = 2;
48
- }
49
-
50
- message SendOtpResponse {
51
- bool ok = 1;
52
- }
53
-
54
- message VerifyOtpRequest {
55
- string identifier = 1;
56
- string type = 2;
57
- string code = 3;
58
- }
59
-
60
- message VerifyOtpResponse {
61
- string access_token = 1;
62
- string refresh_token = 2;
63
- }
64
-
65
- message RefreshRequest {
66
- string refresh_token = 1;
67
- }
68
-
69
- message RefreshResponse {
70
- string access_token = 1;
71
- string refresh_token = 2;
72
- }
73
-
74
- enum Role {
75
- USER = 0;
76
- SUPER_ADMIN = 1;
77
- MANAGER = 2;
78
- PHARMACIST = 3;
79
- CASHIER = 4;
80
- INVENTORY_MANAGER = 5;
81
- AUDITOR = 6;
82
- }
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ // Authentication service for sending and verifying OTPs
6
+ service AuthService {
7
+ // Authoriration user
8
+ rpc Login (LoginRequest) returns (LoginResponse);
9
+
10
+ // Registration user
11
+ rpc Register (RegisterRequest) returns (RegisterResponse);
12
+
13
+ // Send OTP to the user
14
+ rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
15
+
16
+ // Verify the OTP sent to the user
17
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
18
+
19
+ // Refersh token
20
+ rpc Refresh (RefreshRequest) returns (RefreshResponse);
21
+ }
22
+
23
+ message LoginRequest {
24
+ string username = 1;
25
+ string password = 2;
26
+ }
27
+
28
+ message LoginResponse {
29
+ string access_token = 1;
30
+ string refresh_token = 2;
31
+ }
32
+
33
+ message RegisterRequest {
34
+ string name = 1;
35
+ string username = 2;
36
+ string password = 3;
37
+ optional string phone = 4;
38
+ optional string email = 5;
39
+ optional string role = 6;
40
+ optional string branch_id = 7;
41
+ }
42
+
43
+ message RegisterResponse {
44
+ bool ok = 1;
45
+ }
46
+
47
+ message SendOtpRequest {
48
+ string identifier = 1;
49
+ string type = 2;
50
+ }
51
+
52
+ message SendOtpResponse {
53
+ bool ok = 1;
54
+ }
55
+
56
+ message VerifyOtpRequest {
57
+ string identifier = 1;
58
+ string type = 2;
59
+ string code = 3;
60
+ }
61
+
62
+ message VerifyOtpResponse {
63
+ string access_token = 1;
64
+ string refresh_token = 2;
65
+ }
66
+
67
+ message RefreshRequest {
68
+ string refresh_token = 1;
69
+ }
70
+
71
+ message RefreshResponse {
72
+ string access_token = 1;
73
+ string refresh_token = 2;
74
+ }
@@ -1,64 +1,64 @@
1
- syntax = "proto3";
2
-
3
- package branch.v1;
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);
15
-
16
- // Delete a branch by ID
17
- rpc DeleteBranch (DeleteBranchRequest) returns (DeleteBranchResponse);
18
- }
19
-
20
- message CreateBranchRequest {
21
- string name = 1;
22
- string phone = 2;
23
- string address = 3;
24
- string lat = 4;
25
- 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
- string address = 4;
41
- string lat = 5;
42
- string lng = 6;
43
- }
44
-
45
- message UpdateBranchRequest {
46
- string id = 1;
47
- string name = 2;
48
- string phone = 3;
49
- string address = 4;
50
- string lat = 5;
51
- string lng = 6;
52
- }
53
-
54
- message UpdateBranchResponse {
55
- bool ok = 1;
56
- }
57
-
58
- message DeleteBranchRequest {
59
- string id = 1;
60
- }
61
-
62
- message DeleteBranchResponse {
63
- bool ok = 1;
64
- }
1
+ syntax = "proto3";
2
+
3
+ package branch.v1;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+ import "common.proto";
7
+
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;
21
+ }
22
+
23
+ message CreateBranchRequest {
24
+ string name = 1;
25
+ optional string code = 2;
26
+ optional string address = 3;
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;
33
+ }
34
+
35
+ message UpdateBranchRequest {
36
+ string id = 1;
37
+ optional string name = 2;
38
+ optional string code = 3;
39
+ optional string address = 4;
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;
46
+ }
47
+
48
+ message ListBranchesRequest {
49
+ optional bool is_active = 1;
50
+ optional string parent_branch_id = 2;
51
+ optional string search = 3;
52
+ }
53
+
54
+ message ListBranchesResponse {
55
+ repeated Branch items = 1;
56
+ }
57
+
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
+ }
@@ -0,0 +1,124 @@
1
+ syntax = "proto3";
2
+
3
+ package catalog.v1;
4
+
5
+ import "common.proto";
6
+ import "google/protobuf/timestamp.proto";
7
+
8
+ message Brand {
9
+ string id = 1;
10
+ string name = 2;
11
+ google.protobuf.Timestamp created_at = 3;
12
+ google.protobuf.Timestamp updated_at = 4;
13
+ }
14
+
15
+ message Category {
16
+ string id = 1;
17
+ string name = 2;
18
+ google.protobuf.Timestamp created_at = 3;
19
+ google.protobuf.Timestamp updated_at = 4;
20
+ }
21
+
22
+ message InternationalName {
23
+ string id = 1;
24
+ string name = 2;
25
+ google.protobuf.Timestamp created_at = 3;
26
+ google.protobuf.Timestamp updated_at = 4;
27
+ }
28
+
29
+ message Manufacturer {
30
+ string id = 1;
31
+ string name = 2;
32
+ optional string country = 3;
33
+ optional string note = 4;
34
+ google.protobuf.Timestamp created_at = 5;
35
+ google.protobuf.Timestamp updated_at = 6;
36
+ }
37
+
38
+ message CreateBrandRequest {
39
+ string name = 1;
40
+ }
41
+
42
+ message UpdateBrandRequest {
43
+ string id = 1;
44
+ string name = 2;
45
+ }
46
+
47
+ message ListBrandsResponse {
48
+ repeated Brand items = 1;
49
+ }
50
+
51
+ message CreateCategoryRequest {
52
+ string name = 1;
53
+ }
54
+
55
+ message UpdateCategoryRequest {
56
+ string id = 1;
57
+ string name = 2;
58
+ }
59
+
60
+ message ListCategoriesResponse {
61
+ repeated Category items = 1;
62
+ }
63
+
64
+ message CreateInternationalNameRequest {
65
+ string name = 1;
66
+ }
67
+
68
+ message UpdateInternationalNameRequest {
69
+ string id = 1;
70
+ string name = 2;
71
+ }
72
+
73
+ message ListInternationalNamesResponse {
74
+ repeated InternationalName items = 1;
75
+ }
76
+
77
+ message CreateManufacturerRequest {
78
+ string name = 1;
79
+ optional string country = 2;
80
+ optional string note = 3;
81
+ }
82
+
83
+ message UpdateManufacturerRequest {
84
+ string id = 1;
85
+ optional string name = 2;
86
+ optional string country = 3;
87
+ optional string note = 4;
88
+ }
89
+
90
+ message ListManufacturersResponse {
91
+ repeated Manufacturer items = 1;
92
+ }
93
+
94
+ service BrandService {
95
+ rpc CreateBrand(CreateBrandRequest) returns (Brand);
96
+ rpc UpdateBrand(UpdateBrandRequest) returns (Brand);
97
+ rpc GetBrandById(common.v1.IdRequest) returns (Brand);
98
+ rpc ListBrands(common.v1.Empty) returns (ListBrandsResponse);
99
+ rpc DeleteBrand(common.v1.IdRequest) returns (common.v1.BoolResponse);
100
+ }
101
+
102
+ service CategoryService {
103
+ rpc CreateCategory(CreateCategoryRequest) returns (Category);
104
+ rpc UpdateCategory(UpdateCategoryRequest) returns (Category);
105
+ rpc GetCategoryById(common.v1.IdRequest) returns (Category);
106
+ rpc ListCategories(common.v1.Empty) returns (ListCategoriesResponse);
107
+ rpc DeleteCategory(common.v1.IdRequest) returns (common.v1.BoolResponse);
108
+ }
109
+
110
+ service InternationalNameService {
111
+ rpc CreateInternationalName(CreateInternationalNameRequest) returns (InternationalName);
112
+ rpc UpdateInternationalName(UpdateInternationalNameRequest) returns (InternationalName);
113
+ rpc GetInternationalNameById(common.v1.IdRequest) returns (InternationalName);
114
+ rpc ListInternationalNames(common.v1.Empty) returns (ListInternationalNamesResponse);
115
+ rpc DeleteInternationalName(common.v1.IdRequest) returns (common.v1.BoolResponse);
116
+ }
117
+
118
+ service ManufacturerService {
119
+ rpc CreateManufacturer(CreateManufacturerRequest) returns (Manufacturer);
120
+ rpc UpdateManufacturer(UpdateManufacturerRequest) returns (Manufacturer);
121
+ rpc GetManufacturerById(common.v1.IdRequest) returns (Manufacturer);
122
+ rpc ListManufacturers(common.v1.Empty) returns (ListManufacturersResponse);
123
+ rpc DeleteManufacturer(common.v1.IdRequest) returns (common.v1.BoolResponse);
124
+ }
@@ -0,0 +1,34 @@
1
+ syntax = "proto3";
2
+
3
+
4
+ package common.v1;
5
+
6
+ import "google/protobuf/timestamp.proto";
7
+
8
+ message Empty {}
9
+
10
+ message PaginationRequest {
11
+ int32 page = 1;
12
+ int32 limit = 2;
13
+ }
14
+
15
+ message PaginationMeta {
16
+ int32 page = 1;
17
+ int32 limit = 2;
18
+ int64 total = 3;
19
+ int32 total_pages = 4;
20
+ }
21
+
22
+ message IdRequest {
23
+ string id = 1;
24
+ }
25
+
26
+ message BoolResponse {
27
+ bool success = 1;
28
+ string message = 2;
29
+ }
30
+
31
+ message DateRange {
32
+ google.protobuf.Timestamp from = 1;
33
+ google.protobuf.Timestamp to = 2;
34
+ }