@misterhomer1992/miit-bot-payment 1.0.7 → 1.0.8
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/README.md +1 -359
- package/dist/modules/cancellableAPI/utils.d.ts +1 -2
- package/dist/modules/cancellableAPI/utils.d.ts.map +1 -1
- package/dist/modules/cancellableAPI/utils.js.map +1 -1
- package/dist/modules/invoice/repository.d.ts +0 -25
- package/dist/modules/invoice/repository.d.ts.map +1 -1
- package/dist/modules/invoice/repository.js +0 -25
- package/dist/modules/invoice/repository.js.map +1 -1
- package/dist/modules/invoice/service.d.ts +0 -21
- package/dist/modules/invoice/service.d.ts.map +1 -1
- package/dist/modules/invoice/service.js +0 -21
- package/dist/modules/invoice/service.js.map +1 -1
- package/dist/modules/invoice/types.d.ts +0 -8
- package/dist/modules/invoice/types.d.ts.map +1 -1
- package/dist/modules/payments/api.d.ts +3 -4
- package/dist/modules/payments/api.d.ts.map +1 -1
- package/dist/modules/payments/api.js +3 -3
- package/dist/modules/payments/api.js.map +1 -1
- package/dist/modules/payments/repository.d.ts +1 -59
- package/dist/modules/payments/repository.d.ts.map +1 -1
- package/dist/modules/payments/repository.js +2 -59
- package/dist/modules/payments/repository.js.map +1 -1
- package/dist/modules/payments/service.d.ts +2 -66
- package/dist/modules/payments/service.d.ts.map +1 -1
- package/dist/modules/payments/service.js +5 -68
- package/dist/modules/payments/service.js.map +1 -1
- package/dist/modules/payments/types.d.ts +4 -11
- package/dist/modules/payments/types.d.ts.map +1 -1
- package/dist/modules/payments/utils.d.ts +3 -4
- package/dist/modules/payments/utils.d.ts.map +1 -1
- package/dist/modules/payments/utils.js +6 -6
- package/dist/modules/payments/utils.js.map +1 -1
- package/dist/modules/subscription/repository.d.ts +4 -83
- package/dist/modules/subscription/repository.d.ts.map +1 -1
- package/dist/modules/subscription/repository.js +15 -109
- package/dist/modules/subscription/repository.js.map +1 -1
- package/dist/modules/subscription/service.d.ts +5 -89
- package/dist/modules/subscription/service.d.ts.map +1 -1
- package/dist/modules/subscription/service.js +7 -83
- package/dist/modules/subscription/service.js.map +1 -1
- package/dist/modules/subscription/types.d.ts +12 -27
- package/dist/modules/subscription/types.d.ts.map +1 -1
- package/dist/modules/user/types.d.ts +7 -8
- package/dist/modules/user/types.d.ts.map +1 -1
- package/dist/modules/user/userRepository.d.ts +3 -46
- package/dist/modules/user/userRepository.d.ts.map +1 -1
- package/dist/modules/user/userRepository.js +6 -48
- package/dist/modules/user/userRepository.js.map +1 -1
- package/dist/modules/user/userService.d.ts +3 -37
- package/dist/modules/user/userService.d.ts.map +1 -1
- package/dist/modules/user/userService.js +3 -36
- package/dist/modules/user/userService.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,57 +1,23 @@
|
|
|
1
1
|
import { Logger } from '../logger/types';
|
|
2
2
|
import { UpdateDBUserFields } from './userRepository';
|
|
3
3
|
import { User, IUserRepository, IUserService } from './types';
|
|
4
|
-
import { AppNamespace } from '../app/types';
|
|
5
|
-
/**
|
|
6
|
-
* UserService class handles business logic related to users.
|
|
7
|
-
* Acts as an intermediary between controllers/handlers and the repository layer.
|
|
8
|
-
*/
|
|
9
4
|
export declare class UserService implements IUserService {
|
|
10
5
|
private readonly logger;
|
|
11
6
|
private readonly repository;
|
|
12
|
-
/**
|
|
13
|
-
* Creates an instance of UserService.
|
|
14
|
-
* @param params - Service dependencies
|
|
15
|
-
* @param params.logger - Application logger instance for logging operations
|
|
16
|
-
* @param params.repository - Optional user repository instance for dependency injection (defaults to new UserRepository())
|
|
17
|
-
*/
|
|
18
7
|
constructor({ logger, repository }: {
|
|
19
8
|
logger: Logger;
|
|
20
9
|
repository?: IUserRepository;
|
|
21
10
|
});
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves a user by their ID.
|
|
24
|
-
* @param params - Query parameters
|
|
25
|
-
* @param params.userId - The user's unique identifier
|
|
26
|
-
* @param params.appNamespace - The application namespace/platform
|
|
27
|
-
* @returns Promise resolving to User or null if not found
|
|
28
|
-
*/
|
|
29
11
|
getByUserId(params: {
|
|
30
12
|
userId: string;
|
|
31
|
-
|
|
13
|
+
platform: string;
|
|
32
14
|
}): Promise<User | null>;
|
|
33
|
-
/**
|
|
34
|
-
* Creates a new user record in the database.
|
|
35
|
-
* @param params - User creation parameters
|
|
36
|
-
* @param params.user - The user data to create
|
|
37
|
-
* @param params.appNamespace - The application namespace/platform
|
|
38
|
-
* @returns Promise resolving when user is created
|
|
39
|
-
* @throws Error if user creation fails
|
|
40
|
-
*/
|
|
41
15
|
create(params: {
|
|
42
16
|
user: User;
|
|
43
|
-
|
|
17
|
+
platform: string;
|
|
44
18
|
}): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Updates specific fields of a user identified by userId.
|
|
47
|
-
* @param params - Update parameters
|
|
48
|
-
* @param params.userId - The user's unique identifier
|
|
49
|
-
* @param params.appNamespace - The application namespace/platform
|
|
50
|
-
* @param params.fields - Array of field paths and values to update
|
|
51
|
-
* @throws Error if user not found or update fails
|
|
52
|
-
*/
|
|
53
19
|
updateFieldsByUserId(params: {
|
|
54
|
-
|
|
20
|
+
platform: string;
|
|
55
21
|
userId: string;
|
|
56
22
|
fields: UpdateDBUserFields;
|
|
57
23
|
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userService.d.ts","sourceRoot":"","sources":["../../../src/modules/user/userService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAkB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"userService.d.ts","sourceRoot":"","sources":["../../../src/modules/user/userService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAkB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE9D,qBAAa,WAAY,YAAW,YAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;gBAEjC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,eAAe,CAAA;KAAE;IAKvE,WAAW,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAgB/E,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB/D,oBAAoB,CAAC,MAAM,EAAE;QACtC,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,kBAAkB,CAAC;KAC9B,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBpB"}
|
|
@@ -2,28 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserService = void 0;
|
|
4
4
|
const userRepository_1 = require("./userRepository");
|
|
5
|
-
/**
|
|
6
|
-
* UserService class handles business logic related to users.
|
|
7
|
-
* Acts as an intermediary between controllers/handlers and the repository layer.
|
|
8
|
-
*/
|
|
9
5
|
class UserService {
|
|
10
|
-
/**
|
|
11
|
-
* Creates an instance of UserService.
|
|
12
|
-
* @param params - Service dependencies
|
|
13
|
-
* @param params.logger - Application logger instance for logging operations
|
|
14
|
-
* @param params.repository - Optional user repository instance for dependency injection (defaults to new UserRepository())
|
|
15
|
-
*/
|
|
16
6
|
constructor({ logger, repository }) {
|
|
17
7
|
this.logger = logger;
|
|
18
8
|
this.repository = repository || new userRepository_1.UserRepository();
|
|
19
9
|
}
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves a user by their ID.
|
|
22
|
-
* @param params - Query parameters
|
|
23
|
-
* @param params.userId - The user's unique identifier
|
|
24
|
-
* @param params.appNamespace - The application namespace/platform
|
|
25
|
-
* @returns Promise resolving to User or null if not found
|
|
26
|
-
*/
|
|
27
10
|
async getByUserId(params) {
|
|
28
11
|
try {
|
|
29
12
|
return await this.repository.getByUserId(params);
|
|
@@ -33,21 +16,13 @@ class UserService {
|
|
|
33
16
|
message: 'Error in user service getByUserId',
|
|
34
17
|
payload: {
|
|
35
18
|
userId: params.userId,
|
|
36
|
-
|
|
19
|
+
platform: params.platform,
|
|
37
20
|
error: JSON.stringify(error),
|
|
38
21
|
},
|
|
39
22
|
});
|
|
40
23
|
return null;
|
|
41
24
|
}
|
|
42
25
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Creates a new user record in the database.
|
|
45
|
-
* @param params - User creation parameters
|
|
46
|
-
* @param params.user - The user data to create
|
|
47
|
-
* @param params.appNamespace - The application namespace/platform
|
|
48
|
-
* @returns Promise resolving when user is created
|
|
49
|
-
* @throws Error if user creation fails
|
|
50
|
-
*/
|
|
51
26
|
async create(params) {
|
|
52
27
|
try {
|
|
53
28
|
await this.repository.create(params);
|
|
@@ -57,21 +32,13 @@ class UserService {
|
|
|
57
32
|
message: 'Error in user service create',
|
|
58
33
|
payload: {
|
|
59
34
|
userId: params.user.user.id,
|
|
60
|
-
|
|
35
|
+
platform: params.platform,
|
|
61
36
|
error: JSON.stringify(error),
|
|
62
37
|
},
|
|
63
38
|
});
|
|
64
39
|
throw error;
|
|
65
40
|
}
|
|
66
41
|
}
|
|
67
|
-
/**
|
|
68
|
-
* Updates specific fields of a user identified by userId.
|
|
69
|
-
* @param params - Update parameters
|
|
70
|
-
* @param params.userId - The user's unique identifier
|
|
71
|
-
* @param params.appNamespace - The application namespace/platform
|
|
72
|
-
* @param params.fields - Array of field paths and values to update
|
|
73
|
-
* @throws Error if user not found or update fails
|
|
74
|
-
*/
|
|
75
42
|
async updateFieldsByUserId(params) {
|
|
76
43
|
try {
|
|
77
44
|
await this.repository.updateFieldsByUserId(params);
|
|
@@ -81,7 +48,7 @@ class UserService {
|
|
|
81
48
|
message: 'Error in user service updateFieldsByUserId',
|
|
82
49
|
payload: {
|
|
83
50
|
userId: params.userId,
|
|
84
|
-
|
|
51
|
+
platform: params.platform,
|
|
85
52
|
fields: JSON.stringify(params.fields),
|
|
86
53
|
error: JSON.stringify(error),
|
|
87
54
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userService.js","sourceRoot":"","sources":["../../../src/modules/user/userService.ts"],"names":[],"mappings":";;;AACA,qDAAsE;
|
|
1
|
+
{"version":3,"file":"userService.js","sourceRoot":"","sources":["../../../src/modules/user/userService.ts"],"names":[],"mappings":";;;AACA,qDAAsE;AAGtE,MAAa,WAAW;IAIpB,YAAY,EAAE,MAAM,EAAE,UAAU,EAAoD;QAChF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,IAAI,IAAI,+BAAc,EAAE,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,MAA4C;QACjE,IAAI,CAAC;YACD,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;gBACd,OAAO,EAAE,mCAAmC;gBAC5C,OAAO,EAAE;oBACL,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;oBACzB,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;iBAC/B;aACJ,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CA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