@alacard-project/shared 1.1.8 → 1.1.9
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/dto/user.dto.d.ts +36 -13
- package/dist/dto/user.dto.js +104 -17
- package/dist/dto/user.dto.js.map +1 -1
- package/dist/enums/iam.enum.d.ts +2 -0
- package/dist/enums/iam.enum.js +2 -0
- package/dist/enums/iam.enum.js.map +1 -1
- package/dist/enums/index.d.ts +2 -0
- package/dist/enums/index.js +2 -0
- package/dist/enums/index.js.map +1 -1
- package/dist/enums/job.enum.d.ts +13 -0
- package/dist/enums/job.enum.js +19 -0
- package/dist/enums/job.enum.js.map +1 -0
- package/dist/enums/saga.enum.d.ts +8 -0
- package/dist/enums/saga.enum.js +13 -0
- package/dist/enums/saga.enum.js.map +1 -0
- package/dist/enums/user.enum.d.ts +7 -1
- package/dist/enums/user.enum.js +8 -1
- package/dist/enums/user.enum.js.map +1 -1
- package/dist/resilience/circuit-breaker.service.js +3 -2
- package/dist/resilience/circuit-breaker.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/iam.types.d.ts +30 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/saga.types.d.ts +24 -0
- package/dist/types/saga.types.js +3 -0
- package/dist/types/saga.types.js.map +1 -0
- package/dist/types/user.types.d.ts +28 -0
- package/dist/utils/proto-path.js +14 -0
- package/dist/utils/proto-path.js.map +1 -1
- package/package.json +2 -1
- package/proto/account.proto +32 -0
- package/proto/attachment.proto +12 -0
- package/proto/auth.proto +152 -0
- package/proto/card.proto +140 -0
- package/proto/client.proto +99 -0
- package/proto/config.proto +39 -0
- package/proto/dbf.proto +183 -0
- package/proto/iam.proto +70 -0
- package/proto/logging.proto +153 -0
- package/proto/notification.proto +44 -0
- package/proto/partner.proto +68 -0
- package/proto/terminal.proto +34 -0
- package/proto/transaction.proto +95 -0
- package/proto/user.proto +137 -0
- package/proto/wallet.proto +138 -0
package/proto/user.proto
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package user;
|
|
4
|
+
|
|
5
|
+
service UserService {
|
|
6
|
+
rpc GetUserById(GetUserByIdRequest) returns (UserResponse);
|
|
7
|
+
rpc GetUserByEmail(GetUserByEmailRequest) returns (UserResponse);
|
|
8
|
+
rpc GetUserPermissions(GetUserPermissionsRequest) returns (PermissionsResponse);
|
|
9
|
+
rpc CreateUser(CreateUserRequest) returns (UserResponse);
|
|
10
|
+
rpc UpdateUser(UpdateUserRequest) returns (UserResponse);
|
|
11
|
+
rpc UpdateProfile(UpdateProfileRequest) returns (UserResponse);
|
|
12
|
+
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse);
|
|
13
|
+
rpc FindByIdentityId(FindByIdentityIdRequest) returns (UserResponse);
|
|
14
|
+
rpc FindByIdentityIds(FindByIdentityIdsRequest) returns (UserListResponse);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message GetUserByIdRequest {
|
|
18
|
+
string userId = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message GetUserByEmailRequest {
|
|
22
|
+
string email = 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message GetUserPermissionsRequest {
|
|
26
|
+
string userId = 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message CreateUserRequest {
|
|
30
|
+
string email = 1;
|
|
31
|
+
string password = 2;
|
|
32
|
+
string role = 3;
|
|
33
|
+
|
|
34
|
+
// Employee Fields
|
|
35
|
+
optional string firstName = 4;
|
|
36
|
+
optional string lastName = 5;
|
|
37
|
+
optional string middleName = 6;
|
|
38
|
+
optional string position = 7;
|
|
39
|
+
optional string department = 8;
|
|
40
|
+
|
|
41
|
+
// Client Fields
|
|
42
|
+
optional string companyName = 9;
|
|
43
|
+
optional string taxId = 10;
|
|
44
|
+
optional string contactPhone = 11;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message UpdateUserRequest {
|
|
48
|
+
string userId = 1;
|
|
49
|
+
optional string email = 2;
|
|
50
|
+
optional string role = 3;
|
|
51
|
+
optional bool isActive = 4;
|
|
52
|
+
optional string password = 5;
|
|
53
|
+
|
|
54
|
+
// Employee Fields
|
|
55
|
+
optional string firstName = 6;
|
|
56
|
+
optional string lastName = 7;
|
|
57
|
+
optional string middleName = 8;
|
|
58
|
+
optional string position = 9;
|
|
59
|
+
optional string department = 10;
|
|
60
|
+
|
|
61
|
+
// Client Fields
|
|
62
|
+
optional string companyName = 11;
|
|
63
|
+
optional string taxId = 12;
|
|
64
|
+
optional string contactPhone = 13;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message UpdateProfileRequest {
|
|
68
|
+
string userId = 1;
|
|
69
|
+
optional string firstName = 2;
|
|
70
|
+
optional string lastName = 3;
|
|
71
|
+
optional string phone = 4;
|
|
72
|
+
optional string avatar = 5;
|
|
73
|
+
optional string companyName = 6;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message DeleteUserRequest {
|
|
77
|
+
string userId = 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
message FindByIdentityIdRequest {
|
|
81
|
+
string identityId = 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
message FindByIdentityIdsRequest {
|
|
85
|
+
repeated string identityIds = 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
message UserResponse {
|
|
89
|
+
string id = 1;
|
|
90
|
+
string email = 2;
|
|
91
|
+
string role = 3;
|
|
92
|
+
bool isActive = 4;
|
|
93
|
+
string createdAt = 5;
|
|
94
|
+
string updatedAt = 6;
|
|
95
|
+
|
|
96
|
+
// Profile Fields (Shared/Employee)
|
|
97
|
+
optional string firstName = 7;
|
|
98
|
+
optional string lastName = 8;
|
|
99
|
+
optional string middleName = 9;
|
|
100
|
+
optional string shortName = 10;
|
|
101
|
+
|
|
102
|
+
// Employee Specific
|
|
103
|
+
optional string position = 11;
|
|
104
|
+
optional string department = 12;
|
|
105
|
+
optional string internalPhone = 13;
|
|
106
|
+
optional string mobilePhone = 14;
|
|
107
|
+
optional string facsimileSignature = 15;
|
|
108
|
+
|
|
109
|
+
// Client Specific
|
|
110
|
+
optional string companyName = 16;
|
|
111
|
+
optional string taxId = 17;
|
|
112
|
+
optional string address = 18;
|
|
113
|
+
optional string contactPhone = 19;
|
|
114
|
+
|
|
115
|
+
optional string avatar = 20;
|
|
116
|
+
string identityId = 21;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message DeleteUserResponse {
|
|
120
|
+
bool success = 1;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message UserListResponse {
|
|
124
|
+
repeated UserResponse items = 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
message Permission {
|
|
128
|
+
string id = 1;
|
|
129
|
+
string resource = 2;
|
|
130
|
+
string action = 3;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
message PermissionsResponse {
|
|
134
|
+
string userId = 1;
|
|
135
|
+
repeated Permission permissions = 2;
|
|
136
|
+
repeated string scopes = 3;
|
|
137
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package wallet;
|
|
4
|
+
|
|
5
|
+
service WalletService {
|
|
6
|
+
rpc GetWallet (GetWalletRequest) returns (WalletResponse);
|
|
7
|
+
rpc CreditWallet (CreditWalletRequest) returns (CreditWalletResponse);
|
|
8
|
+
rpc CreateAllocationOrder (CreateAllocationOrderRequest) returns (AllocationOrderResponse);
|
|
9
|
+
rpc GetPendingAllocations (Empty) returns (PendingAllocationsResponse);
|
|
10
|
+
rpc UpdateAllocationStatus (UpdateAllocationStatusRequest) returns (AllocationOrderResponse);
|
|
11
|
+
rpc GetTransactions (GetTransactionsRequest) returns (TransactionsResponse);
|
|
12
|
+
rpc GetAllocations (GetAllocationsRequest) returns (AllocationsResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message Empty {}
|
|
16
|
+
|
|
17
|
+
enum WalletOwnerType {
|
|
18
|
+
PARTNER = 0;
|
|
19
|
+
CLIENT = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum AllocationStatus {
|
|
23
|
+
PENDING = 0;
|
|
24
|
+
SENT = 1;
|
|
25
|
+
SYNCED = 2;
|
|
26
|
+
FAILED = 3;
|
|
27
|
+
CANCELLED = 4;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
enum WalletTxType {
|
|
31
|
+
CREDIT = 0;
|
|
32
|
+
DEBIT = 1;
|
|
33
|
+
FREEZE = 2;
|
|
34
|
+
UNFREEZE = 3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message GetWalletRequest {
|
|
38
|
+
WalletOwnerType owner_type = 1;
|
|
39
|
+
string owner_id = 2;
|
|
40
|
+
string currency = 3;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message WalletResponse {
|
|
44
|
+
string id = 1;
|
|
45
|
+
WalletOwnerType owner_type = 2;
|
|
46
|
+
string owner_id = 3;
|
|
47
|
+
string currency = 4;
|
|
48
|
+
string free_balance = 5;
|
|
49
|
+
string frozen_balance = 6;
|
|
50
|
+
string created_at = 7;
|
|
51
|
+
string updated_at = 8;
|
|
52
|
+
repeated AllocationOrderResponse recent_allocations = 9;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message CreditWalletRequest {
|
|
56
|
+
string wallet_id = 1;
|
|
57
|
+
string amount = 2;
|
|
58
|
+
string purpose = 3;
|
|
59
|
+
string payment_ref = 4;
|
|
60
|
+
string reason = 5;
|
|
61
|
+
string reference_id = 6;
|
|
62
|
+
string created_by = 7;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message CreditWalletResponse {
|
|
66
|
+
WalletResponse wallet = 1;
|
|
67
|
+
WalletTransactionResponse transaction = 2;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message CreateAllocationOrderRequest {
|
|
71
|
+
string wallet_id = 1;
|
|
72
|
+
string card_id = 2;
|
|
73
|
+
string card_number = 3;
|
|
74
|
+
string amount = 4;
|
|
75
|
+
string note = 5;
|
|
76
|
+
string created_by = 6;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message AllocationOrderResponse {
|
|
80
|
+
string id = 1;
|
|
81
|
+
string wallet_id = 2;
|
|
82
|
+
string card_id = 3;
|
|
83
|
+
string card_number = 4;
|
|
84
|
+
string amount = 5;
|
|
85
|
+
AllocationStatus status = 6;
|
|
86
|
+
string note = 7;
|
|
87
|
+
string requested_at = 8;
|
|
88
|
+
string sent_at = 9;
|
|
89
|
+
string synced_at = 10;
|
|
90
|
+
string fail_reason = 11;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message PendingAllocationsResponse {
|
|
94
|
+
repeated AllocationOrderResponse allocations = 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
message UpdateAllocationStatusRequest {
|
|
98
|
+
string order_id = 1;
|
|
99
|
+
AllocationStatus status = 2;
|
|
100
|
+
string fail_reason = 3;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
message GetTransactionsRequest {
|
|
104
|
+
string wallet_id = 1;
|
|
105
|
+
int32 page = 2;
|
|
106
|
+
int32 limit = 3;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message WalletTransactionResponse {
|
|
110
|
+
string id = 1;
|
|
111
|
+
string wallet_id = 2;
|
|
112
|
+
WalletTxType type = 3;
|
|
113
|
+
string purpose = 4;
|
|
114
|
+
string amount = 5;
|
|
115
|
+
string balance_after = 6;
|
|
116
|
+
string reason = 7;
|
|
117
|
+
string reference_id = 8;
|
|
118
|
+
string payment_ref = 9;
|
|
119
|
+
string allocation_id = 10;
|
|
120
|
+
string created_at = 11;
|
|
121
|
+
string created_by = 12;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
message TransactionsResponse {
|
|
125
|
+
repeated WalletTransactionResponse data = 1;
|
|
126
|
+
int32 total = 2;
|
|
127
|
+
int32 page = 3;
|
|
128
|
+
int32 limit = 4;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
message GetAllocationsRequest {
|
|
132
|
+
string wallet_id = 1;
|
|
133
|
+
optional AllocationStatus status = 2;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
message AllocationsResponse {
|
|
137
|
+
repeated AllocationOrderResponse data = 1;
|
|
138
|
+
}
|