@alacard-project/shared 1.1.1 → 1.1.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/constants/microservices.constants.d.ts +4 -0
- package/dist/constants/microservices.constants.js +4 -0
- package/dist/constants/microservices.constants.js.map +1 -1
- package/dist/contracts/card.contract.d.ts +98 -0
- package/dist/contracts/card.contract.js +3 -0
- package/dist/contracts/card.contract.js.map +1 -0
- package/dist/contracts/index.d.ts +3 -1
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/transaction.contract.d.ts +63 -0
- package/dist/contracts/transaction.contract.js +3 -0
- package/dist/contracts/transaction.contract.js.map +1 -0
- package/dist/dto/auth.dto.d.ts +3 -1
- package/dist/dto/auth.dto.js +11 -0
- package/dist/dto/auth.dto.js.map +1 -1
- package/dist/dto/index.d.ts +1 -0
- package/dist/dto/index.js +1 -0
- package/dist/dto/index.js.map +1 -1
- package/dist/dto/invoice.dto.d.ts +12 -0
- package/dist/dto/invoice.dto.js +62 -0
- package/dist/dto/invoice.dto.js.map +1 -0
- package/dist/enums/auth.enum.d.ts +2 -3
- package/dist/enums/auth.enum.js +2 -3
- package/dist/enums/auth.enum.js.map +1 -1
- package/dist/filters/global-exception.filter.d.ts +12 -0
- package/dist/filters/global-exception.filter.js +152 -0
- package/dist/filters/global-exception.filter.js.map +1 -0
- package/dist/filters/index.d.ts +1 -1
- package/dist/filters/index.js +1 -1
- package/dist/filters/index.js.map +1 -1
- package/dist/index.d.ts +14 -4
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/middleware/index.d.ts +2 -0
- package/dist/{interceptors → middleware}/index.js +2 -2
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/prisma-logging.middleware.d.ts +3 -0
- package/dist/middleware/prisma-logging.middleware.js +52 -0
- package/dist/middleware/prisma-logging.middleware.js.map +1 -0
- package/dist/middleware/tracing.middleware.d.ts +8 -0
- package/dist/middleware/tracing.middleware.js +33 -0
- package/dist/middleware/tracing.middleware.js.map +1 -0
- package/dist/resilience/circuit-breaker.service.d.ts +2 -3
- package/dist/resilience/circuit-breaker.service.js +10 -16
- package/dist/resilience/circuit-breaker.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/logger.interface.d.ts +6 -0
- package/dist/types/logger.interface.js +3 -0
- package/dist/types/logger.interface.js.map +1 -0
- package/dist/utils/app-logger.d.ts +11 -0
- package/dist/utils/app-logger.js +65 -0
- package/dist/utils/app-logger.js.map +1 -0
- package/dist/utils/app.utils.d.ts +4 -0
- package/dist/utils/app.utils.js +8 -1
- package/dist/utils/app.utils.js.map +1 -1
- package/dist/{filters/http-exception.filter.js → utils/filters.js} +3 -12
- package/dist/utils/filters.js.map +1 -0
- package/dist/utils/grpc-tracing-server.interceptor.d.ts +8 -0
- package/dist/utils/grpc-tracing-server.interceptor.js +48 -0
- package/dist/utils/grpc-tracing-server.interceptor.js.map +1 -0
- package/dist/utils/grpc-tracing.interceptor.d.ts +8 -0
- package/dist/utils/grpc-tracing.interceptor.js +35 -0
- package/dist/utils/grpc-tracing.interceptor.js.map +1 -0
- package/dist/utils/http-tracing.interceptor.d.ts +8 -0
- package/dist/utils/http-tracing.interceptor.js +35 -0
- package/dist/utils/http-tracing.interceptor.js.map +1 -0
- package/dist/{interceptors/transform.interceptor.d.ts → utils/interceptors.d.ts} +0 -1
- package/dist/{interceptors/transform.interceptor.js → utils/interceptors.js} +3 -3
- package/dist/utils/interceptors.js.map +1 -0
- package/dist/utils/proto-path.js +1 -1
- package/dist/utils/proto-path.js.map +1 -1
- package/dist/utils/tracing.module.d.ts +2 -0
- package/dist/{observability/metrics/metrics.module.js → utils/tracing.module.js} +10 -16
- package/dist/utils/tracing.module.js.map +1 -0
- package/dist/utils/tracing.service.d.ts +10 -0
- package/dist/utils/tracing.service.js +43 -0
- package/dist/utils/tracing.service.js.map +1 -0
- package/dist/utils/tracing.utils.js +7 -0
- package/dist/utils/tracing.utils.js.map +1 -0
- package/package.json +48 -46
- package/dist/config/base-config.service.d.ts +0 -25
- package/dist/config/base-config.service.js +0 -87
- package/dist/config/base-config.service.js.map +0 -1
- package/dist/constants/logging.constants.d.ts +0 -24
- package/dist/constants/logging.constants.js +0 -28
- package/dist/constants/logging.constants.js.map +0 -1
- package/dist/constants/monitoring.constants.d.ts +0 -51
- package/dist/constants/monitoring.constants.js +0 -55
- package/dist/constants/monitoring.constants.js.map +0 -1
- package/dist/constants/tokens.constants.d.ts +0 -6
- package/dist/constants/tokens.constants.js +0 -10
- package/dist/constants/tokens.constants.js.map +0 -1
- package/dist/filters/http-exception.filter.js.map +0 -1
- package/dist/interceptors/http-logging.interceptor.d.ts +0 -10
- package/dist/interceptors/http-logging.interceptor.js +0 -74
- package/dist/interceptors/http-logging.interceptor.js.map +0 -1
- package/dist/interceptors/index.d.ts +0 -2
- package/dist/interceptors/index.js.map +0 -1
- package/dist/interceptors/logging.interceptor.d.ts +0 -6
- package/dist/interceptors/logging.interceptor.js +0 -41
- package/dist/interceptors/logging.interceptor.js.map +0 -1
- package/dist/interceptors/transform.interceptor.js.map +0 -1
- package/dist/observability/index.d.ts +0 -2
- package/dist/observability/index.js +0 -19
- package/dist/observability/index.js.map +0 -1
- package/dist/observability/metrics/metrics.module.d.ts +0 -2
- package/dist/observability/metrics/metrics.module.js.map +0 -1
- package/dist/observability/tracing.js +0 -28
- package/dist/observability/tracing.js.map +0 -1
- package/dist/utils/logging-client.d.ts +0 -9
- package/dist/utils/logging-client.js +0 -58
- package/dist/utils/logging-client.js.map +0 -1
- package/dist/utils/prometheus.utils.d.ts +0 -9
- package/dist/utils/prometheus.utils.js +0 -66
- package/dist/utils/prometheus.utils.js.map +0 -1
- package/proto/auth.proto +0 -123
- package/proto/card.proto +0 -43
- package/proto/client.proto +0 -45
- package/proto/config.proto +0 -39
- package/proto/dbf.proto +0 -183
- package/proto/logging.proto +0 -143
- package/proto/partner.proto +0 -18
- package/proto/terminal.proto +0 -18
- package/proto/transaction.proto +0 -45
- package/proto/user.proto +0 -122
- package/src/constants/auth-config.constants.ts +0 -16
- package/src/constants/auth.constants.ts +0 -50
- package/src/constants/common.constants.ts +0 -16
- package/src/constants/env.constants.ts +0 -49
- package/src/constants/error-messages.ts +0 -10
- package/src/constants/grpc.constants.ts +0 -43
- package/src/constants/http.constants.ts +0 -11
- package/src/constants/index.ts +0 -11
- package/src/constants/logging-messages.constants.ts +0 -60
- package/src/constants/microservices.constants.ts +0 -62
- package/src/constants/queue.constants.ts +0 -8
- package/src/constants/routes.constants.ts +0 -21
- package/src/contracts/auth.contract.ts +0 -146
- package/src/contracts/config.contract.ts +0 -14
- package/src/contracts/index.ts +0 -14
- package/src/contracts/logging.contract.ts +0 -115
- package/src/contracts/token.contract.ts +0 -47
- package/src/decorators/index.ts +0 -3
- package/src/decorators/permissions.decorator.ts +0 -5
- package/src/decorators/roles.decorator.ts +0 -5
- package/src/decorators/scopes.decorator.ts +0 -4
- package/src/dto/account.dto.ts +0 -28
- package/src/dto/auth.dto.ts +0 -233
- package/src/dto/card.dto.ts +0 -64
- package/src/dto/client.dto.ts +0 -137
- package/src/dto/index.ts +0 -8
- package/src/dto/logging.dto.ts +0 -101
- package/src/dto/partner.dto.ts +0 -18
- package/src/dto/transaction.dto.ts +0 -52
- package/src/dto/user.dto.ts +0 -28
- package/src/enums/auth.enum.ts +0 -13
- package/src/enums/env.enum.ts +0 -7
- package/src/enums/error.enum.ts +0 -28
- package/src/enums/events.enum.ts +0 -22
- package/src/enums/health.enum.ts +0 -7
- package/src/enums/iam.enum.ts +0 -28
- package/src/enums/index.ts +0 -10
- package/src/enums/logging.enum.ts +0 -7
- package/src/enums/notification.enum.ts +0 -5
- package/src/enums/permission.enum.ts +0 -31
- package/src/enums/user.enum.ts +0 -27
- package/src/errors/app.error.ts +0 -33
- package/src/errors/error-map.ts +0 -105
- package/src/filters/http-exception.filter.ts +0 -49
- package/src/filters/index.ts +0 -2
- package/src/index.ts +0 -17
- package/src/interceptors/index.ts +0 -3
- package/src/interceptors/logging.interceptor.ts +0 -37
- package/src/interceptors/transform.interceptor.ts +0 -21
- package/src/observability/index.ts +0 -3
- package/src/observability/metrics/metrics.module.ts +0 -16
- package/src/observability/tracing.ts +0 -33
- package/src/resilience/circuit-breaker.service.ts +0 -46
- package/src/resilience/resilience.module.ts +0 -9
- package/src/types/auth.types.ts +0 -38
- package/src/types/common.types.ts +0 -18
- package/src/types/config.types.ts +0 -32
- package/src/types/iam.types.ts +0 -78
- package/src/types/index.ts +0 -6
- package/src/types/monitoring.types.ts +0 -77
- package/src/types/user.types.ts +0 -11
- package/src/utils/app.utils.ts +0 -52
- package/src/utils/health.utils.ts +0 -24
- package/src/utils/proto-path.ts +0 -21
- package/src/utils/user.utils.ts +0 -3
- package/tsconfig.json +0 -28
- /package/dist/{filters/http-exception.filter.d.ts → utils/filters.d.ts} +0 -0
- /package/dist/{observability/tracing.d.ts → utils/tracing.utils.d.ts} +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface GetConfigRequest {
|
|
2
|
-
serviceName: string;
|
|
3
|
-
environment: string;
|
|
4
|
-
version: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface ConfigResponse {
|
|
8
|
-
values: Record<string, string>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface ListConfigsResponse {
|
|
12
|
-
service: string;
|
|
13
|
-
values: Record<string, string>;
|
|
14
|
-
}
|
package/src/contracts/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './config.contract';
|
|
2
|
-
export * from './logging.contract';
|
|
3
|
-
export * from './auth.contract';
|
|
4
|
-
// export * from './token.contract';
|
|
5
|
-
export type {
|
|
6
|
-
GenerateTokensRequest,
|
|
7
|
-
TokensResponse,
|
|
8
|
-
ITokenService,
|
|
9
|
-
ValidateTokenRequest,
|
|
10
|
-
ValidateTokenResponse,
|
|
11
|
-
RefreshTokensRequest,
|
|
12
|
-
RevokeTokenRequest,
|
|
13
|
-
RevokeTokenResponse
|
|
14
|
-
} from './token.contract';
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
export interface LogEventGrpcRequest {
|
|
2
|
-
serviceId: string;
|
|
3
|
-
serviceName: string;
|
|
4
|
-
level: string;
|
|
5
|
-
message: string;
|
|
6
|
-
metadata: string;
|
|
7
|
-
userId?: string;
|
|
8
|
-
requestId?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface LogEventGrpcResponse {
|
|
12
|
-
success: boolean;
|
|
13
|
-
logId: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface LogUserActionGrpcRequest {
|
|
17
|
-
userId: string;
|
|
18
|
-
userName: string;
|
|
19
|
-
action: string;
|
|
20
|
-
resource: string;
|
|
21
|
-
details?: string;
|
|
22
|
-
ipAddress?: string;
|
|
23
|
-
userAgent?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface LogUserActionGrpcResponse {
|
|
27
|
-
success: boolean;
|
|
28
|
-
actionId: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface UpdateServiceStatusGrpcRequest {
|
|
32
|
-
serviceName: string;
|
|
33
|
-
status: string;
|
|
34
|
-
version?: string;
|
|
35
|
-
uptime?: number;
|
|
36
|
-
metadata?: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface UpdateServiceStatusGrpcResponse {
|
|
40
|
-
success: boolean;
|
|
41
|
-
statusId: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface GetServiceLogsGrpcRequest {
|
|
45
|
-
serviceName?: string;
|
|
46
|
-
level?: string;
|
|
47
|
-
userId?: string;
|
|
48
|
-
requestId?: string;
|
|
49
|
-
startDate?: string;
|
|
50
|
-
endDate?: string;
|
|
51
|
-
limit?: number;
|
|
52
|
-
offset?: number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface ServiceLogEntry {
|
|
56
|
-
id: string;
|
|
57
|
-
serviceId: string;
|
|
58
|
-
serviceName: string;
|
|
59
|
-
level: string;
|
|
60
|
-
message: string;
|
|
61
|
-
metadata: string;
|
|
62
|
-
timestamp: string;
|
|
63
|
-
userId?: string;
|
|
64
|
-
requestId?: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface GetServiceLogsGrpcResponse {
|
|
68
|
-
logs: ServiceLogEntry[];
|
|
69
|
-
total: number;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface GetServiceStatusGrpcRequest {
|
|
73
|
-
serviceName?: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface ServiceStatusEntry {
|
|
77
|
-
id: string;
|
|
78
|
-
serviceName: string;
|
|
79
|
-
status: string;
|
|
80
|
-
lastHeartbeat: string;
|
|
81
|
-
version?: string;
|
|
82
|
-
uptime?: number;
|
|
83
|
-
metadata?: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface GetServiceStatusGrpcResponse {
|
|
87
|
-
statuses: ServiceStatusEntry[];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export interface GetUserActionsGrpcRequest {
|
|
91
|
-
userId?: string;
|
|
92
|
-
action?: string;
|
|
93
|
-
resource?: string;
|
|
94
|
-
startDate?: string;
|
|
95
|
-
endDate?: string;
|
|
96
|
-
limit?: number;
|
|
97
|
-
offset?: number;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface UserActionEntry {
|
|
101
|
-
id: string;
|
|
102
|
-
userId: string;
|
|
103
|
-
userName: string;
|
|
104
|
-
action: string;
|
|
105
|
-
resource: string;
|
|
106
|
-
details: string;
|
|
107
|
-
timestamp: string;
|
|
108
|
-
ipAddress?: string;
|
|
109
|
-
userAgent?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface GetUserActionsGrpcResponse {
|
|
113
|
-
actions: UserActionEntry[];
|
|
114
|
-
total: number;
|
|
115
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
|
|
3
|
-
export interface GenerateTokensRequest {
|
|
4
|
-
userId: string;
|
|
5
|
-
email: string;
|
|
6
|
-
role: string;
|
|
7
|
-
scopes?: string[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface TokensResponse {
|
|
11
|
-
accessToken: string;
|
|
12
|
-
refreshToken: string;
|
|
13
|
-
expiresIn: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface ValidateTokenRequest {
|
|
17
|
-
token: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ValidateTokenResponse {
|
|
21
|
-
isValid: boolean;
|
|
22
|
-
userId: string;
|
|
23
|
-
role: string;
|
|
24
|
-
scopes: string[];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface RefreshTokensRequest {
|
|
28
|
-
refreshToken: string;
|
|
29
|
-
userAgent?: string;
|
|
30
|
-
ipAddress?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface RevokeTokenRequest {
|
|
34
|
-
userId: string;
|
|
35
|
-
refreshToken: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface RevokeTokenResponse {
|
|
39
|
-
success: boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface ITokenService {
|
|
43
|
-
generateTokens(request: GenerateTokensRequest): Observable<TokensResponse>;
|
|
44
|
-
validateToken(request: ValidateTokenRequest): Observable<ValidateTokenResponse>;
|
|
45
|
-
refreshTokens(request: RefreshTokensRequest): Observable<TokensResponse>;
|
|
46
|
-
revokeToken(request: RevokeTokenRequest): Observable<RevokeTokenResponse>;
|
|
47
|
-
}
|
package/src/decorators/index.ts
DELETED
package/src/dto/account.dto.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IsString, IsOptional } from 'class-validator';
|
|
2
|
-
|
|
3
|
-
export class CreateAccountDto {
|
|
4
|
-
@IsString()
|
|
5
|
-
accountNumber!: string;
|
|
6
|
-
|
|
7
|
-
@IsOptional()
|
|
8
|
-
@IsString()
|
|
9
|
-
clientNumber?: string;
|
|
10
|
-
|
|
11
|
-
@IsOptional()
|
|
12
|
-
@IsString()
|
|
13
|
-
currency?: string;
|
|
14
|
-
|
|
15
|
-
@IsOptional()
|
|
16
|
-
@IsString() // Or @IsNumber() depending on your schema. Assuming string for Decimal/Money
|
|
17
|
-
balance?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class UpdateAccountDto {
|
|
21
|
-
@IsOptional()
|
|
22
|
-
@IsString()
|
|
23
|
-
status?: string;
|
|
24
|
-
|
|
25
|
-
@IsOptional()
|
|
26
|
-
@IsString()
|
|
27
|
-
balance?: string;
|
|
28
|
-
}
|
package/src/dto/auth.dto.ts
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { IsEmail, IsString, MinLength, IsEnum, IsOptional } from 'class-validator';
|
|
2
|
-
import { UserRole } from '../enums/user.enum';
|
|
3
|
-
import { ServiceTokenType, IdentifierType } from '../enums';
|
|
4
|
-
|
|
5
|
-
export class RegisterDto {
|
|
6
|
-
@IsEmail()
|
|
7
|
-
email!: string;
|
|
8
|
-
|
|
9
|
-
@IsString()
|
|
10
|
-
@MinLength(8)
|
|
11
|
-
password!: string;
|
|
12
|
-
|
|
13
|
-
@IsEnum(UserRole)
|
|
14
|
-
@IsOptional()
|
|
15
|
-
role?: UserRole;
|
|
16
|
-
|
|
17
|
-
@IsString()
|
|
18
|
-
@IsOptional()
|
|
19
|
-
firstName?: string;
|
|
20
|
-
|
|
21
|
-
@IsString()
|
|
22
|
-
@IsOptional()
|
|
23
|
-
lastName?: string;
|
|
24
|
-
|
|
25
|
-
@IsString()
|
|
26
|
-
@IsOptional()
|
|
27
|
-
userId?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export class LoginDto {
|
|
31
|
-
@IsEmail()
|
|
32
|
-
email!: string;
|
|
33
|
-
|
|
34
|
-
@IsString()
|
|
35
|
-
password!: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Employee Login DTO
|
|
40
|
-
* Used for employee authentication via email
|
|
41
|
-
*/
|
|
42
|
-
export class EmployeeLoginDto {
|
|
43
|
-
@IsEmail()
|
|
44
|
-
email!: string;
|
|
45
|
-
|
|
46
|
-
@IsString()
|
|
47
|
-
@MinLength(8)
|
|
48
|
-
password!: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Public Login DTO
|
|
53
|
-
* Used for client and partner authentication via username
|
|
54
|
-
*/
|
|
55
|
-
export class PublicLoginDto {
|
|
56
|
-
@IsString()
|
|
57
|
-
username!: string;
|
|
58
|
-
|
|
59
|
-
@IsString()
|
|
60
|
-
@MinLength(8)
|
|
61
|
-
password!: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface UserResponse {
|
|
65
|
-
id: string;
|
|
66
|
-
email: string;
|
|
67
|
-
role: UserRole;
|
|
68
|
-
isActive: boolean;
|
|
69
|
-
status: string;
|
|
70
|
-
createdAt?: string;
|
|
71
|
-
updatedAt?: string;
|
|
72
|
-
|
|
73
|
-
// Profile Fields (Shared/Employee)
|
|
74
|
-
firstName?: string;
|
|
75
|
-
lastName?: string;
|
|
76
|
-
middleName?: string;
|
|
77
|
-
shortName?: string;
|
|
78
|
-
|
|
79
|
-
// Employee Specific
|
|
80
|
-
position?: string;
|
|
81
|
-
department?: string;
|
|
82
|
-
internalPhone?: string;
|
|
83
|
-
mobilePhone?: string;
|
|
84
|
-
facsimileSignature?: string;
|
|
85
|
-
|
|
86
|
-
// Client/Partner Specific
|
|
87
|
-
companyName?: string;
|
|
88
|
-
taxId?: string;
|
|
89
|
-
address?: string;
|
|
90
|
-
contactPhone?: string;
|
|
91
|
-
|
|
92
|
-
avatar?: string;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface UserProfileDto {
|
|
96
|
-
id: string;
|
|
97
|
-
email: string;
|
|
98
|
-
role: string;
|
|
99
|
-
isActive: boolean;
|
|
100
|
-
status: string;
|
|
101
|
-
createdAt: Date;
|
|
102
|
-
updatedAt: Date;
|
|
103
|
-
fullName: string;
|
|
104
|
-
position: string;
|
|
105
|
-
department: string;
|
|
106
|
-
emailVerified: boolean;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export class InviteRequestBody {
|
|
110
|
-
@IsEmail()
|
|
111
|
-
email!: string;
|
|
112
|
-
|
|
113
|
-
@IsEnum(UserRole)
|
|
114
|
-
role!: UserRole;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export class RegisterByInviteBody extends RegisterDto {
|
|
118
|
-
@IsString()
|
|
119
|
-
token!: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export class ResetPasswordRequestBody {
|
|
123
|
-
@IsEmail()
|
|
124
|
-
email!: string;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export class ResetPasswordConfirmBody {
|
|
128
|
-
@IsString()
|
|
129
|
-
token!: string;
|
|
130
|
-
|
|
131
|
-
@IsString()
|
|
132
|
-
@MinLength(8)
|
|
133
|
-
newPassword!: string;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Logout DTO
|
|
138
|
-
*/
|
|
139
|
-
export class LogoutDto {
|
|
140
|
-
@IsString()
|
|
141
|
-
@IsOptional()
|
|
142
|
-
refreshToken?: string;
|
|
143
|
-
|
|
144
|
-
@IsString()
|
|
145
|
-
@IsOptional()
|
|
146
|
-
sessionId?: string;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export class RefreshTokenDto {
|
|
150
|
-
@IsString()
|
|
151
|
-
refreshToken!: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Service Token DTOs
|
|
156
|
-
*/
|
|
157
|
-
export class CreateServiceTokenDto {
|
|
158
|
-
@IsString()
|
|
159
|
-
serviceName!: string;
|
|
160
|
-
|
|
161
|
-
@IsEnum(ServiceTokenType)
|
|
162
|
-
type!: ServiceTokenType;
|
|
163
|
-
|
|
164
|
-
@IsOptional()
|
|
165
|
-
@IsString()
|
|
166
|
-
description?: string;
|
|
167
|
-
|
|
168
|
-
@IsOptional()
|
|
169
|
-
@IsString()
|
|
170
|
-
name?: string;
|
|
171
|
-
|
|
172
|
-
@IsString()
|
|
173
|
-
identityId!: string;
|
|
174
|
-
|
|
175
|
-
@IsOptional()
|
|
176
|
-
@IsString()
|
|
177
|
-
expiresInDays?: number;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export class ValidateServiceTokenDto {
|
|
181
|
-
@IsString()
|
|
182
|
-
token!: string;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Credential DTOs
|
|
187
|
-
*/
|
|
188
|
-
export class CreateCredentialDto {
|
|
189
|
-
@IsEnum(IdentifierType)
|
|
190
|
-
identifierType!: IdentifierType;
|
|
191
|
-
|
|
192
|
-
@IsString()
|
|
193
|
-
identifierValue!: string;
|
|
194
|
-
|
|
195
|
-
@IsString()
|
|
196
|
-
password!: string;
|
|
197
|
-
|
|
198
|
-
@IsString()
|
|
199
|
-
identityId!: string;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Session DTOs
|
|
204
|
-
*/
|
|
205
|
-
export class CreateSessionDto {
|
|
206
|
-
@IsString()
|
|
207
|
-
identityId!: string;
|
|
208
|
-
|
|
209
|
-
@IsOptional()
|
|
210
|
-
@IsString()
|
|
211
|
-
ipAddress?: string;
|
|
212
|
-
|
|
213
|
-
@IsOptional()
|
|
214
|
-
@IsString()
|
|
215
|
-
userAgent?: string;
|
|
216
|
-
|
|
217
|
-
@IsOptional()
|
|
218
|
-
@IsString()
|
|
219
|
-
deviceInfo?: string;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* 2FA Verification DTO
|
|
224
|
-
*/
|
|
225
|
-
export class Verify2faDto {
|
|
226
|
-
@IsString()
|
|
227
|
-
challengeId!: string;
|
|
228
|
-
|
|
229
|
-
@IsString()
|
|
230
|
-
@MinLength(6)
|
|
231
|
-
code!: string;
|
|
232
|
-
}
|
|
233
|
-
|
package/src/dto/card.dto.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { IsString, IsOptional, IsNumber, IsDate } from 'class-validator';
|
|
2
|
-
import { Type } from 'class-transformer';
|
|
3
|
-
|
|
4
|
-
export class CreateCardDto {
|
|
5
|
-
@IsString()
|
|
6
|
-
cardNumber!: string;
|
|
7
|
-
|
|
8
|
-
@IsOptional()
|
|
9
|
-
@IsString()
|
|
10
|
-
clientId?: string;
|
|
11
|
-
|
|
12
|
-
@IsOptional()
|
|
13
|
-
@IsString()
|
|
14
|
-
accountId?: string;
|
|
15
|
-
|
|
16
|
-
@IsOptional()
|
|
17
|
-
@IsString()
|
|
18
|
-
cardType?: string;
|
|
19
|
-
|
|
20
|
-
@IsOptional()
|
|
21
|
-
@IsString()
|
|
22
|
-
cardStatus?: string;
|
|
23
|
-
|
|
24
|
-
@IsOptional()
|
|
25
|
-
@Type(() => Date)
|
|
26
|
-
@IsDate()
|
|
27
|
-
issuedAt?: Date;
|
|
28
|
-
|
|
29
|
-
@IsOptional()
|
|
30
|
-
@Type(() => Date)
|
|
31
|
-
@IsDate()
|
|
32
|
-
expiresAt?: Date;
|
|
33
|
-
|
|
34
|
-
@IsOptional()
|
|
35
|
-
@IsNumber()
|
|
36
|
-
balance?: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class UpdateCardDto {
|
|
40
|
-
@IsOptional()
|
|
41
|
-
@IsString()
|
|
42
|
-
clientId?: string;
|
|
43
|
-
|
|
44
|
-
@IsOptional()
|
|
45
|
-
@IsString()
|
|
46
|
-
accountId?: string;
|
|
47
|
-
|
|
48
|
-
@IsOptional()
|
|
49
|
-
@IsString()
|
|
50
|
-
cardType?: string;
|
|
51
|
-
|
|
52
|
-
@IsOptional()
|
|
53
|
-
@IsString()
|
|
54
|
-
cardStatus?: string;
|
|
55
|
-
|
|
56
|
-
@IsOptional()
|
|
57
|
-
@Type(() => Date)
|
|
58
|
-
@IsDate()
|
|
59
|
-
expiresAt?: Date;
|
|
60
|
-
|
|
61
|
-
@IsOptional()
|
|
62
|
-
@IsNumber()
|
|
63
|
-
balance?: number;
|
|
64
|
-
}
|
package/src/dto/client.dto.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { IsString, IsOptional, IsBoolean, IsArray, ValidateNested, IsNumber, IsEnum, IsObject } from 'class-validator';
|
|
2
|
-
import { Type } from 'class-transformer';
|
|
3
|
-
import { RegisterDto } from './auth.dto';
|
|
4
|
-
|
|
5
|
-
export class CreateClientContactDto {
|
|
6
|
-
@IsString()
|
|
7
|
-
contactType!: string;
|
|
8
|
-
|
|
9
|
-
@IsString()
|
|
10
|
-
value!: string;
|
|
11
|
-
|
|
12
|
-
@IsOptional()
|
|
13
|
-
@IsBoolean()
|
|
14
|
-
isPrimary?: boolean;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class CreateClientDetailDto {
|
|
18
|
-
@IsString()
|
|
19
|
-
detailType!: string;
|
|
20
|
-
|
|
21
|
-
@IsString()
|
|
22
|
-
value!: string;
|
|
23
|
-
|
|
24
|
-
@IsOptional()
|
|
25
|
-
@IsBoolean()
|
|
26
|
-
isActive?: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export class CreateClientDto {
|
|
30
|
-
@IsString()
|
|
31
|
-
clientNumber!: string;
|
|
32
|
-
|
|
33
|
-
@IsOptional()
|
|
34
|
-
@IsString()
|
|
35
|
-
clientNumberFormatted?: string;
|
|
36
|
-
|
|
37
|
-
@IsString()
|
|
38
|
-
clientType!: string;
|
|
39
|
-
|
|
40
|
-
@IsOptional()
|
|
41
|
-
@IsString()
|
|
42
|
-
shortName?: string;
|
|
43
|
-
|
|
44
|
-
@IsString()
|
|
45
|
-
fullName!: string;
|
|
46
|
-
|
|
47
|
-
@IsOptional()
|
|
48
|
-
@IsBoolean()
|
|
49
|
-
isActive?: boolean;
|
|
50
|
-
|
|
51
|
-
@IsOptional()
|
|
52
|
-
@IsArray()
|
|
53
|
-
@ValidateNested({ each: true })
|
|
54
|
-
@Type(() => CreateClientContactDto)
|
|
55
|
-
contacts?: CreateClientContactDto[];
|
|
56
|
-
|
|
57
|
-
@IsOptional()
|
|
58
|
-
@IsArray()
|
|
59
|
-
@ValidateNested({ each: true })
|
|
60
|
-
@Type(() => CreateClientDetailDto)
|
|
61
|
-
details?: CreateClientDetailDto[];
|
|
62
|
-
|
|
63
|
-
@IsOptional()
|
|
64
|
-
@ValidateNested()
|
|
65
|
-
@Type(() => RegisterDto)
|
|
66
|
-
adminUser?: RegisterDto;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export class UpdateClientDto {
|
|
70
|
-
@IsOptional()
|
|
71
|
-
@IsString()
|
|
72
|
-
clientNumber?: string;
|
|
73
|
-
|
|
74
|
-
@IsOptional()
|
|
75
|
-
@IsString()
|
|
76
|
-
clientNumberFormatted?: string;
|
|
77
|
-
|
|
78
|
-
@IsOptional()
|
|
79
|
-
@IsString()
|
|
80
|
-
clientType?: string;
|
|
81
|
-
|
|
82
|
-
@IsOptional()
|
|
83
|
-
@IsString()
|
|
84
|
-
shortName?: string;
|
|
85
|
-
|
|
86
|
-
@IsOptional()
|
|
87
|
-
@IsString()
|
|
88
|
-
fullName?: string;
|
|
89
|
-
|
|
90
|
-
@IsOptional()
|
|
91
|
-
@IsBoolean()
|
|
92
|
-
isActive?: boolean;
|
|
93
|
-
|
|
94
|
-
@IsOptional()
|
|
95
|
-
@IsArray()
|
|
96
|
-
@ValidateNested({ each: true })
|
|
97
|
-
@Type(() => CreateClientContactDto)
|
|
98
|
-
contacts?: CreateClientContactDto[];
|
|
99
|
-
|
|
100
|
-
@IsOptional()
|
|
101
|
-
@IsArray()
|
|
102
|
-
@ValidateNested({ each: true })
|
|
103
|
-
@Type(() => CreateClientDetailDto)
|
|
104
|
-
details?: CreateClientDetailDto[];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export class FindClientsQueryDto {
|
|
108
|
-
@IsOptional()
|
|
109
|
-
@IsString()
|
|
110
|
-
search?: string;
|
|
111
|
-
|
|
112
|
-
@IsOptional()
|
|
113
|
-
@IsString()
|
|
114
|
-
searchType?: string;
|
|
115
|
-
|
|
116
|
-
@IsOptional()
|
|
117
|
-
@IsString()
|
|
118
|
-
status?: string;
|
|
119
|
-
|
|
120
|
-
@IsOptional()
|
|
121
|
-
@Type(() => Number)
|
|
122
|
-
@IsNumber()
|
|
123
|
-
skip?: number;
|
|
124
|
-
|
|
125
|
-
@IsOptional()
|
|
126
|
-
@Type(() => Number)
|
|
127
|
-
@IsNumber()
|
|
128
|
-
take?: number;
|
|
129
|
-
|
|
130
|
-
@IsOptional()
|
|
131
|
-
@IsString()
|
|
132
|
-
sortBy?: string;
|
|
133
|
-
|
|
134
|
-
@IsOptional()
|
|
135
|
-
@IsString()
|
|
136
|
-
sortOrder?: 'asc' | 'desc';
|
|
137
|
-
}
|
package/src/dto/index.ts
DELETED