@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
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { SubjectType, IdentityStatus, UserRole, IdentifierType } from '../enums';
|
|
2
2
|
import { JsonValue } from './common.types';
|
|
3
3
|
export interface Identity {
|
|
4
|
+
id: string;
|
|
4
5
|
identityId: string;
|
|
5
6
|
subjectType: SubjectType;
|
|
6
7
|
role: UserRole;
|
|
7
8
|
status: IdentityStatus;
|
|
8
9
|
createdAt?: Date;
|
|
9
10
|
updatedAt?: Date;
|
|
11
|
+
createdBy?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ICreateIdentityDto {
|
|
14
|
+
subjectType: SubjectType;
|
|
15
|
+
createdBy?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IUpdateIdentityStatusDto {
|
|
18
|
+
status: IdentityStatus;
|
|
10
19
|
}
|
|
11
20
|
export interface IdentityAttributes {
|
|
12
21
|
department?: string;
|
|
@@ -34,6 +43,27 @@ export interface ScopeCheckRequest {
|
|
|
34
43
|
scope: string;
|
|
35
44
|
context?: Record<string, JsonValue>;
|
|
36
45
|
}
|
|
46
|
+
export interface Role {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
level: number;
|
|
51
|
+
isSystem: boolean;
|
|
52
|
+
createdAt: Date;
|
|
53
|
+
updatedAt: Date;
|
|
54
|
+
}
|
|
55
|
+
export interface IAssignRoleDto {
|
|
56
|
+
roleId: string;
|
|
57
|
+
grantedBy?: string;
|
|
58
|
+
expiresAt?: Date;
|
|
59
|
+
}
|
|
60
|
+
export interface IdentityRole {
|
|
61
|
+
identityId: string;
|
|
62
|
+
roleId: string;
|
|
63
|
+
grantedBy?: string;
|
|
64
|
+
grantedAt: Date;
|
|
65
|
+
expiresAt?: Date;
|
|
66
|
+
}
|
|
37
67
|
export interface Credential {
|
|
38
68
|
id: string;
|
|
39
69
|
identityId: string;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -20,4 +20,5 @@ __exportStar(require("./iam.types"), exports);
|
|
|
20
20
|
__exportStar(require("./user.types"), exports);
|
|
21
21
|
__exportStar(require("./common.types"), exports);
|
|
22
22
|
__exportStar(require("./monitoring.types"), exports);
|
|
23
|
+
__exportStar(require("./saga.types"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,iDAA+B;AAC/B,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B;AAC7B,iDAA+B;AAC/B,qDAAmC;AACnC,+CAA6B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SagaStatus } from '../enums/saga.enum';
|
|
2
|
+
export interface SagaState {
|
|
3
|
+
sagaId: string;
|
|
4
|
+
type: string;
|
|
5
|
+
status: SagaStatus;
|
|
6
|
+
currentStep: number;
|
|
7
|
+
totalSteps: number;
|
|
8
|
+
data: Record<string, any>;
|
|
9
|
+
error?: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
completedAt?: Date;
|
|
13
|
+
}
|
|
14
|
+
export interface SagaStep {
|
|
15
|
+
name: string;
|
|
16
|
+
execute: () => Promise<any>;
|
|
17
|
+
compensate: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export interface SagaResult {
|
|
20
|
+
sagaId: string;
|
|
21
|
+
status: SagaStatus;
|
|
22
|
+
data?: Record<string, any>;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saga.types.js","sourceRoot":"","sources":["../../src/types/saga.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { UserResponse } from '../dto/auth.dto';
|
|
3
3
|
import { GetUserByIdGrpcRequest, GetUserByEmailGrpcRequest } from '../contracts/auth.contract';
|
|
4
|
+
import { UserType, UserStatus } from '../enums/user.enum';
|
|
5
|
+
export interface User {
|
|
6
|
+
id: string;
|
|
7
|
+
identityId: string;
|
|
8
|
+
userType: UserType;
|
|
9
|
+
status: UserStatus;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
13
|
+
export interface EmployeeProfile {
|
|
14
|
+
userId: string;
|
|
15
|
+
fullName: string;
|
|
16
|
+
shortName?: string;
|
|
17
|
+
email: string;
|
|
18
|
+
workPhone?: string;
|
|
19
|
+
mobilePhone?: string;
|
|
20
|
+
position?: string;
|
|
21
|
+
department?: string;
|
|
22
|
+
fax?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PublicProfile {
|
|
25
|
+
userId: string;
|
|
26
|
+
firstName: string;
|
|
27
|
+
lastName: string;
|
|
28
|
+
username: string;
|
|
29
|
+
phone?: string;
|
|
30
|
+
email?: string;
|
|
31
|
+
}
|
|
4
32
|
export interface IUserService {
|
|
5
33
|
getUserById(data: GetUserByIdGrpcRequest): Observable<UserResponse>;
|
|
6
34
|
getUserByEmail(data: GetUserByEmailGrpcRequest): Observable<UserResponse>;
|
package/dist/utils/proto-path.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getProtoPath = getProtoPath;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
+
const fs_1 = require("fs");
|
|
5
6
|
function getProtoPath(serviceName) {
|
|
6
7
|
if (process.env.PROTO_PATH_OVERRIDE) {
|
|
7
8
|
return (0, path_1.join)(process.env.PROTO_PATH_OVERRIDE, `${serviceName}.proto`);
|
|
@@ -10,6 +11,19 @@ function getProtoPath(serviceName) {
|
|
|
10
11
|
if (process.platform === 'linux' || process.env.NODE_ENV === 'production' || process.env.KUBERNETES_SERVICE_HOST) {
|
|
11
12
|
return (0, path_1.join)(dockerProtoPath, `${serviceName}.proto`);
|
|
12
13
|
}
|
|
14
|
+
try {
|
|
15
|
+
const sharedPath = require.resolve('@alacard-project/shared/package.json');
|
|
16
|
+
const protoPath = (0, path_1.join)((0, path_1.dirname)(sharedPath), 'proto', `${serviceName}.proto`);
|
|
17
|
+
if ((0, fs_1.existsSync)(protoPath)) {
|
|
18
|
+
return protoPath;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
}
|
|
23
|
+
const monorepoProtoPath = (0, path_1.join)(process.cwd(), '..', '..', 'sdks', 'shared', 'proto', `${serviceName}.proto`);
|
|
24
|
+
if ((0, fs_1.existsSync)(monorepoProtoPath)) {
|
|
25
|
+
return monorepoProtoPath;
|
|
26
|
+
}
|
|
13
27
|
return (0, path_1.join)(process.cwd(), 'proto', `${serviceName}.proto`);
|
|
14
28
|
}
|
|
15
29
|
//# sourceMappingURL=proto-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proto-path.js","sourceRoot":"","sources":["../../src/utils/proto-path.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"proto-path.js","sourceRoot":"","sources":["../../src/utils/proto-path.ts"],"names":[],"mappings":";;AAGA,oCAmCC;AAtCD,+BAAqC;AACrC,2BAAgC;AAEhC,SAAgB,YAAY,CAAC,WAAmB;IAE5C,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAClC,OAAO,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,WAAW,QAAQ,CAAC,CAAC;IACzE,CAAC;IAKD,MAAM,eAAe,GAAG,wBAAwB,CAAC;IAGjD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC;QAC/G,OAAO,IAAA,WAAI,EAAC,eAAe,EAAE,GAAG,WAAW,QAAQ,CAAC,CAAC;IACzD,CAAC;IAGD,IAAI,CAAC;QACD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC;QAC3E,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,IAAA,cAAO,EAAC,UAAU,CAAC,EAAE,OAAO,EAAE,GAAG,WAAW,QAAQ,CAAC,CAAC;QAC7E,IAAI,IAAA,eAAU,EAAC,SAAS,CAAC,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;IAEb,CAAC;IAGD,MAAM,iBAAiB,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,WAAW,QAAQ,CAAC,CAAC;IAC7G,IAAI,IAAA,eAAU,EAAC,iBAAiB,CAAC,EAAE,CAAC;QAChC,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAGD,OAAO,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,WAAW,QAAQ,CAAC,CAAC;AAChE,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account;
|
|
4
|
+
|
|
5
|
+
service AccountService {
|
|
6
|
+
rpc Create (CreateAccountRequest) returns (Account) {}
|
|
7
|
+
rpc FindAll (FindAllRequest) returns (stream Account) {}
|
|
8
|
+
rpc FindOne (FindOneRequest) returns (Account) {}
|
|
9
|
+
rpc Update (UpdateAccountRequest) returns (Account) {}
|
|
10
|
+
rpc Remove (FindOneRequest) returns (Account) {}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message Account {
|
|
14
|
+
string id = 1;
|
|
15
|
+
string name = 2;
|
|
16
|
+
// Add other fields as needed
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message CreateAccountRequest {
|
|
20
|
+
string name = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message FindAllRequest {}
|
|
24
|
+
|
|
25
|
+
message FindOneRequest {
|
|
26
|
+
string id = 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message UpdateAccountRequest {
|
|
30
|
+
string id = 1;
|
|
31
|
+
string name = 2;
|
|
32
|
+
}
|
package/proto/auth.proto
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth;
|
|
4
|
+
|
|
5
|
+
service AuthService {
|
|
6
|
+
rpc CreateIdentity (CreateIdentityRequest) returns (TokenResponse);
|
|
7
|
+
rpc Login (LoginRequest) returns (TokenResponse);
|
|
8
|
+
rpc Verify2FA (Verify2faRequest) returns (TokenResponse);
|
|
9
|
+
rpc RequestPasswordReset (PasswordResetRequestRequest) returns (GenericResponse);
|
|
10
|
+
rpc ResetPassword (ResetPasswordRequest) returns (GenericResponse);
|
|
11
|
+
rpc ChangePassword (ChangePasswordRequest) returns (GenericResponse);
|
|
12
|
+
rpc Validate (ValidateRequest) returns (ValidateResponse);
|
|
13
|
+
rpc GetUserById (GetUserByIdRequest) returns (UserResponse);
|
|
14
|
+
rpc GetUserByEmail (GetUserByEmailRequest) returns (UserResponse);
|
|
15
|
+
rpc ValidateToken (ValidateTokenRequest) returns (ValidateTokenResponse);
|
|
16
|
+
rpc RefreshToken (RefreshTokenRequest) returns (TokenResponse);
|
|
17
|
+
rpc RevokeToken (RevokeTokenRequest) returns (RevokeTokenResponse);
|
|
18
|
+
rpc GenerateTokens (GenerateTokensRequest) returns (TokenResponse);
|
|
19
|
+
rpc CheckPermission (CheckPermissionRequest) returns (CheckPermissionResponse);
|
|
20
|
+
rpc GetUserPermissions (GetUserPermissionsRequest) returns (GetUserPermissionsResponse);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message GenerateTokensRequest {
|
|
24
|
+
string userId = 1;
|
|
25
|
+
string email = 2;
|
|
26
|
+
string role = 3;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message CreateIdentityRequest {
|
|
30
|
+
string email = 1;
|
|
31
|
+
string password = 2;
|
|
32
|
+
string name = 3;
|
|
33
|
+
string userId = 4;
|
|
34
|
+
string role = 5;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message LoginRequest {
|
|
38
|
+
string email = 1;
|
|
39
|
+
string password = 2;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message TokenResponse {
|
|
43
|
+
string accessToken = 1;
|
|
44
|
+
string refreshToken = 2;
|
|
45
|
+
int32 expiresIn = 3;
|
|
46
|
+
string userId = 4;
|
|
47
|
+
string role = 5;
|
|
48
|
+
string email = 6;
|
|
49
|
+
string status = 7;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message ValidateRequest {
|
|
53
|
+
string token = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message ValidateResponse {
|
|
57
|
+
bool valid = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message GetUserByIdRequest {
|
|
61
|
+
string userId = 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message GetUserByEmailRequest {
|
|
65
|
+
string email = 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message UserResponse {
|
|
69
|
+
string id = 1;
|
|
70
|
+
string email = 2;
|
|
71
|
+
string name = 3;
|
|
72
|
+
string role = 4;
|
|
73
|
+
bool isActive = 5;
|
|
74
|
+
bool emailVerified = 6;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message ValidateTokenRequest {
|
|
78
|
+
string token = 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message ValidateTokenResponse {
|
|
82
|
+
bool valid = 1;
|
|
83
|
+
string userId = 2;
|
|
84
|
+
string email = 3;
|
|
85
|
+
string role = 4;
|
|
86
|
+
string status = 5;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
message RefreshTokenRequest {
|
|
90
|
+
string refreshToken = 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message RevokeTokenRequest {
|
|
94
|
+
string refreshToken = 1;
|
|
95
|
+
string userId = 2;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message RevokeTokenResponse {
|
|
99
|
+
bool success = 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message CheckPermissionRequest {
|
|
103
|
+
string userId = 1;
|
|
104
|
+
string resource = 2;
|
|
105
|
+
string action = 3;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message CheckPermissionResponse {
|
|
109
|
+
bool hasPermission = 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
message GetUserPermissionsRequest {
|
|
113
|
+
string userId = 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message Permission {
|
|
117
|
+
string id = 1;
|
|
118
|
+
string name = 2;
|
|
119
|
+
string resource = 3;
|
|
120
|
+
string action = 4;
|
|
121
|
+
string description = 5;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
message GetUserPermissionsResponse {
|
|
125
|
+
repeated Permission permissions = 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
message Verify2faRequest {
|
|
130
|
+
string challengeId = 1;
|
|
131
|
+
string code = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message PasswordResetRequestRequest {
|
|
135
|
+
string email = 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
message ResetPasswordRequest {
|
|
139
|
+
string token = 1;
|
|
140
|
+
string newPassword = 2;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
message GenericResponse {
|
|
144
|
+
bool success = 1;
|
|
145
|
+
string message = 2;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
message ChangePasswordRequest {
|
|
149
|
+
string identityId = 1;
|
|
150
|
+
string oldPassword = 2;
|
|
151
|
+
string newPassword = 3;
|
|
152
|
+
}
|
package/proto/card.proto
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package card;
|
|
4
|
+
|
|
5
|
+
service CardService {
|
|
6
|
+
rpc Create (CreateCardDto) returns (Card) {}
|
|
7
|
+
rpc FindAll (FindCardsDto) returns (CardsResponse) {}
|
|
8
|
+
rpc GetOne (FindOneCardDto) returns (Card) {}
|
|
9
|
+
rpc GetStats (Empty) returns (CardStatsResponse) {}
|
|
10
|
+
rpc GetSyncHistory (GetSyncHistoryDto) returns (SyncHistoryResponse) {}
|
|
11
|
+
rpc FindByClient (FindByClientDto) returns (CardsResponse) {}
|
|
12
|
+
rpc Update (UpdateCardDto) returns (Card) {}
|
|
13
|
+
rpc UpdatePhysicalBalance (UpdatePhysicalBalanceDto) returns (Card) {}
|
|
14
|
+
rpc UpdateVirtualBalance (UpdateVirtualBalanceDto) returns (Card) {}
|
|
15
|
+
rpc UpdateBalanceMode (UpdateBalanceModeDto) returns (Card) {}
|
|
16
|
+
rpc Remove (FindOneCardDto) returns (DeleteResponse) {}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message Card {
|
|
20
|
+
string id = 1;
|
|
21
|
+
string cardNumber = 2;
|
|
22
|
+
string cardType = 3;
|
|
23
|
+
string cardStatus = 4;
|
|
24
|
+
string clientId = 5;
|
|
25
|
+
string accountId = 6;
|
|
26
|
+
double balance = 7;
|
|
27
|
+
double physicalBalance = 8;
|
|
28
|
+
double virtualBalance = 9;
|
|
29
|
+
string balanceMode = 10;
|
|
30
|
+
string phoneNumber = 11;
|
|
31
|
+
string lastSyncAt = 12;
|
|
32
|
+
string issuedAt = 13;
|
|
33
|
+
string expiresAt = 14;
|
|
34
|
+
string createdAt = 15;
|
|
35
|
+
string updatedAt = 16;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message CreateCardDto {
|
|
39
|
+
string cardNumber = 1;
|
|
40
|
+
string clientId = 2;
|
|
41
|
+
string accountId = 3;
|
|
42
|
+
string cardType = 4;
|
|
43
|
+
string cardStatus = 5;
|
|
44
|
+
double balance = 6;
|
|
45
|
+
string phoneNumber = 7;
|
|
46
|
+
string balanceMode = 8;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message UpdateCardDto {
|
|
50
|
+
string id = 1;
|
|
51
|
+
string clientId = 2;
|
|
52
|
+
string accountId = 3;
|
|
53
|
+
string cardType = 4;
|
|
54
|
+
string cardStatus = 5;
|
|
55
|
+
double balance = 6;
|
|
56
|
+
string phoneNumber = 7;
|
|
57
|
+
string balanceMode = 8;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message FindOneCardDto {
|
|
61
|
+
string id = 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message FindByClientDto {
|
|
65
|
+
string clientId = 1;
|
|
66
|
+
string clientNumber = 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message FindCardsDto {
|
|
70
|
+
int32 skip = 1;
|
|
71
|
+
int32 take = 2;
|
|
72
|
+
string clientId = 3;
|
|
73
|
+
string status = 4;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message CardsResponse {
|
|
77
|
+
repeated Card cards = 1;
|
|
78
|
+
int32 total = 2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message BalanceResponse {
|
|
82
|
+
string cardId = 1;
|
|
83
|
+
double balance = 2;
|
|
84
|
+
string currency = 3;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message GetSyncHistoryDto {
|
|
88
|
+
string id = 1;
|
|
89
|
+
int32 page = 2;
|
|
90
|
+
int32 limit = 3;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message SyncHistoryResponse {
|
|
94
|
+
string cardId = 1;
|
|
95
|
+
repeated SyncHistoryEntry history = 2;
|
|
96
|
+
int32 total = 3;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message SyncHistoryEntry {
|
|
100
|
+
string id = 1;
|
|
101
|
+
string type = 2;
|
|
102
|
+
string status = 3;
|
|
103
|
+
double amountAdded = 4;
|
|
104
|
+
double physBalanceBefore = 5;
|
|
105
|
+
double physBalanceAfter = 6;
|
|
106
|
+
string syncedAt = 7;
|
|
107
|
+
string terminalId = 8;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message UpdatePhysicalBalanceDto {
|
|
111
|
+
string id = 1;
|
|
112
|
+
double amountAdded = 2;
|
|
113
|
+
string terminalId = 3;
|
|
114
|
+
string allocationId = 4;
|
|
115
|
+
string rawData = 5;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
message UpdateVirtualBalanceDto {
|
|
119
|
+
string id = 1;
|
|
120
|
+
double amount = 2;
|
|
121
|
+
string reason = 3;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
message UpdateBalanceModeDto {
|
|
125
|
+
string id = 1;
|
|
126
|
+
string mode = 2; // OFFLINE, ONLINE, HYBRID
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message CardStatsResponse {
|
|
130
|
+
int32 total = 1;
|
|
131
|
+
int32 active = 2;
|
|
132
|
+
int32 inactive = 3;
|
|
133
|
+
int32 blocked = 4;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
message Empty {}
|
|
137
|
+
|
|
138
|
+
message DeleteResponse {
|
|
139
|
+
bool success = 1;
|
|
140
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package client;
|
|
4
|
+
|
|
5
|
+
service ClientService {
|
|
6
|
+
rpc Create (CreateClientDto) returns (Client) {}
|
|
7
|
+
rpc FindAll (FindClientsDto) returns (ClientsResponse) {}
|
|
8
|
+
rpc FindOne (FindOneClientDto) returns (Client) {}
|
|
9
|
+
rpc Update (UpdateClientDto) returns (Client) {}
|
|
10
|
+
rpc Remove (FindOneClientDto) returns (Client) {}
|
|
11
|
+
rpc GetStats (GetStatsRequest) returns (ClientStatsResponse) {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message GetStatsRequest {}
|
|
15
|
+
|
|
16
|
+
message ClientStatsResponse {
|
|
17
|
+
int32 totalClients = 1;
|
|
18
|
+
int32 activeClients = 2;
|
|
19
|
+
int32 newClientsLastMonth = 3;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message ClientContact {
|
|
23
|
+
string id = 1;
|
|
24
|
+
string contactType = 2;
|
|
25
|
+
string value = 3;
|
|
26
|
+
bool isPrimary = 4;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message ClientDetail {
|
|
30
|
+
string id = 1;
|
|
31
|
+
string detailType = 2;
|
|
32
|
+
string value = 3;
|
|
33
|
+
bool isActive = 4;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message Client {
|
|
37
|
+
string id = 1;
|
|
38
|
+
string clientNumber = 2;
|
|
39
|
+
string clientNumberFormatted = 3;
|
|
40
|
+
string clientType = 4;
|
|
41
|
+
string shortName = 5;
|
|
42
|
+
string fullName = 6;
|
|
43
|
+
bool isActive = 7;
|
|
44
|
+
string createdAt = 8;
|
|
45
|
+
string updatedAt = 9;
|
|
46
|
+
string closedAt = 10;
|
|
47
|
+
repeated ClientContact contacts = 11;
|
|
48
|
+
repeated ClientDetail details = 12;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message CreateClientContactDto {
|
|
52
|
+
string contactType = 1;
|
|
53
|
+
string value = 2;
|
|
54
|
+
bool isPrimary = 3;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message CreateClientDetailDto {
|
|
58
|
+
string detailType = 1;
|
|
59
|
+
string value = 2;
|
|
60
|
+
bool isActive = 3;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message CreateClientDto {
|
|
64
|
+
string clientNumber = 1;
|
|
65
|
+
string clientNumberFormatted = 2;
|
|
66
|
+
string clientType = 3;
|
|
67
|
+
string shortName = 4;
|
|
68
|
+
string fullName = 5;
|
|
69
|
+
bool isActive = 6;
|
|
70
|
+
repeated CreateClientContactDto contacts = 7;
|
|
71
|
+
repeated CreateClientDetailDto details = 8;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
message UpdateClientDto {
|
|
75
|
+
string id = 1;
|
|
76
|
+
string clientNumber = 2;
|
|
77
|
+
string clientNumberFormatted = 3;
|
|
78
|
+
string clientType = 4;
|
|
79
|
+
string shortName = 5;
|
|
80
|
+
string fullName = 6;
|
|
81
|
+
bool isActive = 7;
|
|
82
|
+
repeated CreateClientContactDto contacts = 8;
|
|
83
|
+
repeated CreateClientDetailDto details = 9;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message FindOneClientDto {
|
|
87
|
+
string id = 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message FindClientsDto {
|
|
91
|
+
string search = 1;
|
|
92
|
+
int32 skip = 2;
|
|
93
|
+
int32 take = 3;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message ClientsResponse {
|
|
97
|
+
repeated Client clients = 1;
|
|
98
|
+
int32 total = 2;
|
|
99
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package config;
|
|
4
|
+
|
|
5
|
+
service ConfigService {
|
|
6
|
+
rpc GetConfig (GetConfigRequest) returns (ConfigResponse);
|
|
7
|
+
rpc SetConfig (SetConfigRequest) returns (ConfigResponse);
|
|
8
|
+
rpc ListConfigs (ListConfigsRequest) returns (ListConfigsResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message GetConfigRequest {
|
|
12
|
+
string serviceName = 1;
|
|
13
|
+
string environment = 2;
|
|
14
|
+
string version = 3;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message ConfigResponse {
|
|
18
|
+
map<string, string> values = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message SetConfigRequest {
|
|
22
|
+
string serviceName = 1;
|
|
23
|
+
string environment = 2;
|
|
24
|
+
string key = 3;
|
|
25
|
+
string value = 4;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message ListConfigsRequest {
|
|
29
|
+
string environment = 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message ServiceConfig {
|
|
33
|
+
string serviceName = 1;
|
|
34
|
+
map<string, string> values = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message ListConfigsResponse {
|
|
38
|
+
repeated ServiceConfig configs = 1;
|
|
39
|
+
}
|