@floristcloud/api-lib 1.2.15 → 1.2.16
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/build/commands/account-deletion-request/approve-account-deletion-request.command.js +15 -0
- package/build/commands/account-deletion-request/cancel-account-deletion-request.command.js +15 -0
- package/build/commands/account-deletion-request/confirm-public-account-deletion.command.js +23 -0
- package/build/commands/account-deletion-request/create-account-deletion-request.command.js +17 -0
- package/build/commands/account-deletion-request/execute-public-account-deletion.command.js +23 -0
- package/build/commands/account-deletion-request/get-account-deletion-request-list.query.js +23 -0
- package/build/commands/account-deletion-request/get-my-account-deletion-request.query.js +15 -0
- package/build/commands/account-deletion-request/index.js +25 -0
- package/build/commands/account-deletion-request/initiate-public-account-deletion.command.js +18 -0
- package/build/commands/account-deletion-request/reject-account-deletion-request.command.js +17 -0
- package/build/commands/index.js +1 -0
- package/build/constant/error.js +24 -0
- package/build/enum/account-deletion-request-source.enum.js +8 -0
- package/build/enum/account-deletion-request-status.enum.js +10 -0
- package/build/enum/index.js +2 -0
- package/build/enum/notification-type.enum.js +3 -0
- package/build/schemas/account-deletion-request/account-deletion-request.schema.js +18 -0
- package/build/schemas/index.js +1 -0
- package/commands/account-deletion-request/approve-account-deletion-request.command.ts +17 -0
- package/commands/account-deletion-request/cancel-account-deletion-request.command.ts +17 -0
- package/commands/account-deletion-request/confirm-public-account-deletion.command.ts +27 -0
- package/commands/account-deletion-request/create-account-deletion-request.command.ts +19 -0
- package/commands/account-deletion-request/execute-public-account-deletion.command.ts +27 -0
- package/commands/account-deletion-request/get-account-deletion-request-list.query.ts +25 -0
- package/commands/account-deletion-request/get-my-account-deletion-request.query.ts +17 -0
- package/commands/account-deletion-request/index.ts +9 -0
- package/commands/account-deletion-request/initiate-public-account-deletion.command.ts +20 -0
- package/commands/account-deletion-request/reject-account-deletion-request.command.ts +19 -0
- package/commands/index.ts +1 -0
- package/constant/error.ts +25 -0
- package/enum/account-deletion-request-source.enum.ts +4 -0
- package/enum/account-deletion-request-status.enum.ts +6 -0
- package/enum/index.ts +2 -0
- package/enum/notification-type.enum.ts +3 -0
- package/package.json +1 -1
- package/schemas/account-deletion-request/account-deletion-request.schema.ts +16 -0
- package/schemas/index.ts +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApproveAccountDeletionRequestContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const account_deletion_request_schema_1 = require("../../schemas/account-deletion-request/account-deletion-request.schema");
|
|
6
|
+
const ApproveAccountDeletionRequestRequestSchema = zod_1.z.object({});
|
|
7
|
+
const ApproveAccountDeletionRequestResponseSchema = zod_1.z.object({
|
|
8
|
+
message: zod_1.z.string().optional(),
|
|
9
|
+
data: account_deletion_request_schema_1.AccountDeletionRequestSchema,
|
|
10
|
+
});
|
|
11
|
+
var ApproveAccountDeletionRequestContractCommand;
|
|
12
|
+
(function (ApproveAccountDeletionRequestContractCommand) {
|
|
13
|
+
ApproveAccountDeletionRequestContractCommand.RequestSchema = ApproveAccountDeletionRequestRequestSchema;
|
|
14
|
+
ApproveAccountDeletionRequestContractCommand.ResponseSchema = ApproveAccountDeletionRequestResponseSchema;
|
|
15
|
+
})(ApproveAccountDeletionRequestContractCommand || (exports.ApproveAccountDeletionRequestContractCommand = ApproveAccountDeletionRequestContractCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelAccountDeletionRequestContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const account_deletion_request_schema_1 = require("../../schemas/account-deletion-request/account-deletion-request.schema");
|
|
6
|
+
const CancelAccountDeletionRequestRequestSchema = zod_1.z.object({});
|
|
7
|
+
const CancelAccountDeletionRequestResponseSchema = zod_1.z.object({
|
|
8
|
+
message: zod_1.z.string().optional(),
|
|
9
|
+
data: account_deletion_request_schema_1.AccountDeletionRequestSchema,
|
|
10
|
+
});
|
|
11
|
+
var CancelAccountDeletionRequestContractCommand;
|
|
12
|
+
(function (CancelAccountDeletionRequestContractCommand) {
|
|
13
|
+
CancelAccountDeletionRequestContractCommand.RequestSchema = CancelAccountDeletionRequestRequestSchema;
|
|
14
|
+
CancelAccountDeletionRequestContractCommand.ResponseSchema = CancelAccountDeletionRequestResponseSchema;
|
|
15
|
+
})(CancelAccountDeletionRequestContractCommand || (exports.CancelAccountDeletionRequestContractCommand = CancelAccountDeletionRequestContractCommand = {}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfirmPublicAccountDeletionContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ConfirmPublicAccountDeletionRequestSchema = zod_1.z.object({
|
|
6
|
+
contact: zod_1.z.string().min(1).max(320),
|
|
7
|
+
code: zod_1.z.string().min(1).max(10),
|
|
8
|
+
});
|
|
9
|
+
const ConfirmPublicAccountDeletionResponseSchema = zod_1.z.object({
|
|
10
|
+
message: zod_1.z.string().optional(),
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
verificationToken: zod_1.z.string(),
|
|
13
|
+
accounts: zod_1.z.array(zod_1.z.object({
|
|
14
|
+
tenantUUID: zod_1.z.uuid(),
|
|
15
|
+
companyName: zod_1.z.string(),
|
|
16
|
+
})),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
var ConfirmPublicAccountDeletionContractCommand;
|
|
20
|
+
(function (ConfirmPublicAccountDeletionContractCommand) {
|
|
21
|
+
ConfirmPublicAccountDeletionContractCommand.RequestSchema = ConfirmPublicAccountDeletionRequestSchema;
|
|
22
|
+
ConfirmPublicAccountDeletionContractCommand.ResponseSchema = ConfirmPublicAccountDeletionResponseSchema;
|
|
23
|
+
})(ConfirmPublicAccountDeletionContractCommand || (exports.ConfirmPublicAccountDeletionContractCommand = ConfirmPublicAccountDeletionContractCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateAccountDeletionRequestContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const account_deletion_request_schema_1 = require("../../schemas/account-deletion-request/account-deletion-request.schema");
|
|
6
|
+
const CreateAccountDeletionRequestRequestSchema = zod_1.z.object({
|
|
7
|
+
reason: zod_1.z.string().max(1000).optional(),
|
|
8
|
+
});
|
|
9
|
+
const CreateAccountDeletionRequestResponseSchema = zod_1.z.object({
|
|
10
|
+
message: zod_1.z.string().optional(),
|
|
11
|
+
data: account_deletion_request_schema_1.AccountDeletionRequestSchema,
|
|
12
|
+
});
|
|
13
|
+
var CreateAccountDeletionRequestContractCommand;
|
|
14
|
+
(function (CreateAccountDeletionRequestContractCommand) {
|
|
15
|
+
CreateAccountDeletionRequestContractCommand.RequestSchema = CreateAccountDeletionRequestRequestSchema;
|
|
16
|
+
CreateAccountDeletionRequestContractCommand.ResponseSchema = CreateAccountDeletionRequestResponseSchema;
|
|
17
|
+
})(CreateAccountDeletionRequestContractCommand || (exports.CreateAccountDeletionRequestContractCommand = CreateAccountDeletionRequestContractCommand = {}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutePublicAccountDeletionContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ExecutePublicAccountDeletionRequestSchema = zod_1.z.object({
|
|
6
|
+
verificationToken: zod_1.z.string(),
|
|
7
|
+
tenantUUIDs: zod_1.z.array(zod_1.z.uuid()).min(1),
|
|
8
|
+
reason: zod_1.z.string().max(1000).optional(),
|
|
9
|
+
});
|
|
10
|
+
const ExecutePublicAccountDeletionResponseSchema = zod_1.z.object({
|
|
11
|
+
message: zod_1.z.string().optional(),
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
createdRequests: zod_1.z.array(zod_1.z.object({
|
|
14
|
+
tenantUUID: zod_1.z.uuid(),
|
|
15
|
+
requestUUID: zod_1.z.uuid(),
|
|
16
|
+
})),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
var ExecutePublicAccountDeletionContractCommand;
|
|
20
|
+
(function (ExecutePublicAccountDeletionContractCommand) {
|
|
21
|
+
ExecutePublicAccountDeletionContractCommand.RequestSchema = ExecutePublicAccountDeletionRequestSchema;
|
|
22
|
+
ExecutePublicAccountDeletionContractCommand.ResponseSchema = ExecutePublicAccountDeletionResponseSchema;
|
|
23
|
+
})(ExecutePublicAccountDeletionContractCommand || (exports.ExecutePublicAccountDeletionContractCommand = ExecutePublicAccountDeletionContractCommand = {}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAccountDeletionRequestListContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const account_deletion_request_schema_1 = require("../../schemas/account-deletion-request/account-deletion-request.schema");
|
|
6
|
+
const enum_1 = require("../../enum");
|
|
7
|
+
const GetAccountDeletionRequestListRequestSchema = zod_1.z.object({
|
|
8
|
+
page: zod_1.z.coerce.number().optional().default(1),
|
|
9
|
+
count: zod_1.z.coerce.number().optional().default(10),
|
|
10
|
+
status: zod_1.z.nativeEnum(enum_1.AccountDeletionRequestStatusEnum).optional(),
|
|
11
|
+
});
|
|
12
|
+
const GetAccountDeletionRequestListResponseSchema = zod_1.z.object({
|
|
13
|
+
message: zod_1.z.string().optional(),
|
|
14
|
+
data: zod_1.z.object({
|
|
15
|
+
accountDeletionRequestList: account_deletion_request_schema_1.AccountDeletionRequestSchema.array(),
|
|
16
|
+
total: zod_1.z.number(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
var GetAccountDeletionRequestListContractQuery;
|
|
20
|
+
(function (GetAccountDeletionRequestListContractQuery) {
|
|
21
|
+
GetAccountDeletionRequestListContractQuery.RequestSchema = GetAccountDeletionRequestListRequestSchema;
|
|
22
|
+
GetAccountDeletionRequestListContractQuery.ResponseSchema = GetAccountDeletionRequestListResponseSchema;
|
|
23
|
+
})(GetAccountDeletionRequestListContractQuery || (exports.GetAccountDeletionRequestListContractQuery = GetAccountDeletionRequestListContractQuery = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetMyAccountDeletionRequestContractQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const account_deletion_request_schema_1 = require("../../schemas/account-deletion-request/account-deletion-request.schema");
|
|
6
|
+
const GetMyAccountDeletionRequestRequestSchema = zod_1.z.object({});
|
|
7
|
+
const GetMyAccountDeletionRequestResponseSchema = zod_1.z.object({
|
|
8
|
+
message: zod_1.z.string().optional(),
|
|
9
|
+
data: account_deletion_request_schema_1.AccountDeletionRequestSchema.nullable(),
|
|
10
|
+
});
|
|
11
|
+
var GetMyAccountDeletionRequestContractQuery;
|
|
12
|
+
(function (GetMyAccountDeletionRequestContractQuery) {
|
|
13
|
+
GetMyAccountDeletionRequestContractQuery.RequestSchema = GetMyAccountDeletionRequestRequestSchema;
|
|
14
|
+
GetMyAccountDeletionRequestContractQuery.ResponseSchema = GetMyAccountDeletionRequestResponseSchema;
|
|
15
|
+
})(GetMyAccountDeletionRequestContractQuery || (exports.GetMyAccountDeletionRequestContractQuery = GetMyAccountDeletionRequestContractQuery = {}));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-account-deletion-request.command"), exports);
|
|
18
|
+
__exportStar(require("./cancel-account-deletion-request.command"), exports);
|
|
19
|
+
__exportStar(require("./approve-account-deletion-request.command"), exports);
|
|
20
|
+
__exportStar(require("./reject-account-deletion-request.command"), exports);
|
|
21
|
+
__exportStar(require("./get-account-deletion-request-list.query"), exports);
|
|
22
|
+
__exportStar(require("./get-my-account-deletion-request.query"), exports);
|
|
23
|
+
__exportStar(require("./initiate-public-account-deletion.command"), exports);
|
|
24
|
+
__exportStar(require("./confirm-public-account-deletion.command"), exports);
|
|
25
|
+
__exportStar(require("./execute-public-account-deletion.command"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InitiatePublicAccountDeletionContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const InitiatePublicAccountDeletionRequestSchema = zod_1.z.object({
|
|
6
|
+
contact: zod_1.z.string().min(1).max(320),
|
|
7
|
+
});
|
|
8
|
+
const InitiatePublicAccountDeletionResponseSchema = zod_1.z.object({
|
|
9
|
+
message: zod_1.z.string(),
|
|
10
|
+
data: zod_1.z.object({
|
|
11
|
+
success: zod_1.z.boolean(),
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
var InitiatePublicAccountDeletionContractCommand;
|
|
15
|
+
(function (InitiatePublicAccountDeletionContractCommand) {
|
|
16
|
+
InitiatePublicAccountDeletionContractCommand.RequestSchema = InitiatePublicAccountDeletionRequestSchema;
|
|
17
|
+
InitiatePublicAccountDeletionContractCommand.ResponseSchema = InitiatePublicAccountDeletionResponseSchema;
|
|
18
|
+
})(InitiatePublicAccountDeletionContractCommand || (exports.InitiatePublicAccountDeletionContractCommand = InitiatePublicAccountDeletionContractCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RejectAccountDeletionRequestContractCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const account_deletion_request_schema_1 = require("../../schemas/account-deletion-request/account-deletion-request.schema");
|
|
6
|
+
const RejectAccountDeletionRequestRequestSchema = zod_1.z.object({
|
|
7
|
+
comment: zod_1.z.string().min(1).max(1000),
|
|
8
|
+
});
|
|
9
|
+
const RejectAccountDeletionRequestResponseSchema = zod_1.z.object({
|
|
10
|
+
message: zod_1.z.string().optional(),
|
|
11
|
+
data: account_deletion_request_schema_1.AccountDeletionRequestSchema,
|
|
12
|
+
});
|
|
13
|
+
var RejectAccountDeletionRequestContractCommand;
|
|
14
|
+
(function (RejectAccountDeletionRequestContractCommand) {
|
|
15
|
+
RejectAccountDeletionRequestContractCommand.RequestSchema = RejectAccountDeletionRequestRequestSchema;
|
|
16
|
+
RejectAccountDeletionRequestContractCommand.ResponseSchema = RejectAccountDeletionRequestResponseSchema;
|
|
17
|
+
})(RejectAccountDeletionRequestContractCommand || (exports.RejectAccountDeletionRequestContractCommand = RejectAccountDeletionRequestContractCommand = {}));
|
package/build/commands/index.js
CHANGED
|
@@ -63,6 +63,7 @@ __exportStar(require("./product-configuration/delete-product-configuration.comma
|
|
|
63
63
|
__exportStar(require("./product-configuration/find-product-configuration-by-attributes.query"), exports);
|
|
64
64
|
__exportStar(require("./bank-payment"), exports);
|
|
65
65
|
__exportStar(require("./integration"), exports);
|
|
66
|
+
__exportStar(require("./account-deletion-request"), exports);
|
|
66
67
|
// Session contracts exported individually to avoid webpack TDZ issues with Next.js SSG
|
|
67
68
|
var session_logout_command_1 = require("./session/session-logout.command");
|
|
68
69
|
Object.defineProperty(exports, "SessionLogoutContractCommand", { enumerable: true, get: function () { return session_logout_command_1.SessionLogoutContractCommand; } });
|
package/build/constant/error.js
CHANGED
|
@@ -949,4 +949,28 @@ exports.ERRORS = {
|
|
|
949
949
|
// PUSH NOTIFICATION
|
|
950
950
|
PUSH_NOTIFICATION_SEND_FAILED: { code: 'PN001', message: 'Failed to send push notification', httpCode: 500 },
|
|
951
951
|
PUSH_NOTIFICATION_NO_DEVICES: { code: 'PN002', message: 'No active devices found for user', httpCode: 404 },
|
|
952
|
+
// ACCOUNT DELETION REQUEST
|
|
953
|
+
ACCOUNT_DELETION_REQUEST_NOT_CREATED: { code: 'ADR001', message: 'Failed to create account deletion request', httpCode: 500 },
|
|
954
|
+
ACCOUNT_DELETION_REQUEST_NOT_FOUND: { code: 'ADR002', message: 'Account deletion request not found', httpCode: 404 },
|
|
955
|
+
ACCOUNT_DELETION_REQUEST_ALREADY_EXISTS: {
|
|
956
|
+
code: 'ADR003',
|
|
957
|
+
message: 'A pending account deletion request already exists for this user',
|
|
958
|
+
httpCode: 409,
|
|
959
|
+
},
|
|
960
|
+
ACCOUNT_DELETION_REQUEST_NOT_PENDING: { code: 'ADR004', message: 'Account deletion request is not in pending status', httpCode: 400 },
|
|
961
|
+
ACCOUNT_DELETION_REQUEST_NOT_UPDATED: { code: 'ADR005', message: 'Failed to update account deletion request', httpCode: 500 },
|
|
962
|
+
ACCOUNT_DELETION_REQUEST_FETCH_FAILED: { code: 'ADR006', message: 'Failed to fetch account deletion request', httpCode: 500 },
|
|
963
|
+
ACCOUNT_DELETION_REQUEST_FORBIDDEN: {
|
|
964
|
+
code: 'ADR007',
|
|
965
|
+
message: 'Account deletion request does not belong to current user',
|
|
966
|
+
httpCode: 403,
|
|
967
|
+
},
|
|
968
|
+
EMPLOYEE_DELETION_NOT_ALLOWED: {
|
|
969
|
+
code: 'ADR008',
|
|
970
|
+
message: 'Self-service account deletion is available only for buyer accounts. Please contact support to delete an employee account',
|
|
971
|
+
httpCode: 403,
|
|
972
|
+
},
|
|
973
|
+
PUBLIC_ACCOUNT_DELETION_INVALID_CODE: { code: 'ADR009', message: 'Invalid or expired verification code', httpCode: 400 },
|
|
974
|
+
PUBLIC_ACCOUNT_DELETION_INVALID_TOKEN: { code: 'ADR010', message: 'Invalid or expired verification token', httpCode: 400 },
|
|
975
|
+
PUBLIC_ACCOUNT_DELETION_NO_TENANTS_SELECTED: { code: 'ADR011', message: 'No valid tenants selected for deletion', httpCode: 400 },
|
|
952
976
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountDeletionRequestSourceEnum = void 0;
|
|
4
|
+
var AccountDeletionRequestSourceEnum;
|
|
5
|
+
(function (AccountDeletionRequestSourceEnum) {
|
|
6
|
+
AccountDeletionRequestSourceEnum["MOBILE_APP"] = "MOBILE_APP";
|
|
7
|
+
AccountDeletionRequestSourceEnum["PUBLIC_FORM"] = "PUBLIC_FORM";
|
|
8
|
+
})(AccountDeletionRequestSourceEnum || (exports.AccountDeletionRequestSourceEnum = AccountDeletionRequestSourceEnum = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountDeletionRequestStatusEnum = void 0;
|
|
4
|
+
var AccountDeletionRequestStatusEnum;
|
|
5
|
+
(function (AccountDeletionRequestStatusEnum) {
|
|
6
|
+
AccountDeletionRequestStatusEnum["PENDING"] = "PENDING";
|
|
7
|
+
AccountDeletionRequestStatusEnum["APPROVED"] = "APPROVED";
|
|
8
|
+
AccountDeletionRequestStatusEnum["REJECTED"] = "REJECTED";
|
|
9
|
+
AccountDeletionRequestStatusEnum["CANCELLED"] = "CANCELLED";
|
|
10
|
+
})(AccountDeletionRequestStatusEnum || (exports.AccountDeletionRequestStatusEnum = AccountDeletionRequestStatusEnum = {}));
|
package/build/enum/index.js
CHANGED
|
@@ -84,3 +84,5 @@ __exportStar(require("./match-confidence.enum"), exports);
|
|
|
84
84
|
__exportStar(require("./session-platform.enum"), exports);
|
|
85
85
|
__exportStar(require("./device-platform.enum"), exports);
|
|
86
86
|
__exportStar(require("./security-code-blocked-reason.enum"), exports);
|
|
87
|
+
__exportStar(require("./account-deletion-request-status.enum"), exports);
|
|
88
|
+
__exportStar(require("./account-deletion-request-source.enum"), exports);
|
|
@@ -10,4 +10,7 @@ var NotificationTypeEnum;
|
|
|
10
10
|
NotificationTypeEnum["WRITE_OFF_REJECTED"] = "WRITE_OFF_REJECTED";
|
|
11
11
|
NotificationTypeEnum["CLIENT_MESSAGE_TO_EMPLOYEE"] = "CLIENT_MESSAGE_TO_EMPLOYEE";
|
|
12
12
|
NotificationTypeEnum["PASSWORD_CHANGED"] = "PASSWORD_CHANGED";
|
|
13
|
+
NotificationTypeEnum["ACCOUNT_DELETION_REQUEST_CREATED"] = "ACCOUNT_DELETION_REQUEST_CREATED";
|
|
14
|
+
NotificationTypeEnum["ACCOUNT_DELETION_REQUEST_APPROVED"] = "ACCOUNT_DELETION_REQUEST_APPROVED";
|
|
15
|
+
NotificationTypeEnum["ACCOUNT_DELETION_REQUEST_REJECTED"] = "ACCOUNT_DELETION_REQUEST_REJECTED";
|
|
13
16
|
})(NotificationTypeEnum || (exports.NotificationTypeEnum = NotificationTypeEnum = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountDeletionRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enum_1 = require("../../enum");
|
|
6
|
+
exports.AccountDeletionRequestSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.uuid(),
|
|
8
|
+
userUUID: zod_1.z.uuid(),
|
|
9
|
+
companyUUID: zod_1.z.uuid(),
|
|
10
|
+
status: zod_1.z.nativeEnum(enum_1.AccountDeletionRequestStatusEnum),
|
|
11
|
+
source: zod_1.z.nativeEnum(enum_1.AccountDeletionRequestSourceEnum),
|
|
12
|
+
reason: zod_1.z.string().nullable(),
|
|
13
|
+
processedByUUID: zod_1.z.uuid().nullable(),
|
|
14
|
+
processedAt: zod_1.z.date().nullable(),
|
|
15
|
+
processedComment: zod_1.z.string().nullable(),
|
|
16
|
+
createdAt: zod_1.z.date(),
|
|
17
|
+
updatedAt: zod_1.z.date(),
|
|
18
|
+
});
|
package/build/schemas/index.js
CHANGED
|
@@ -76,3 +76,4 @@ __exportStar(require("./client-payment-identifier/client-payment-identifier.sche
|
|
|
76
76
|
__exportStar(require("./bank-payment/get-bank-payment-match-suggestions.schema"), exports);
|
|
77
77
|
__exportStar(require("./messenger-profile"), exports);
|
|
78
78
|
__exportStar(require("./error-message.schema"), exports);
|
|
79
|
+
__exportStar(require("./account-deletion-request/account-deletion-request.schema"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AccountDeletionRequestSchema } from '../../schemas/account-deletion-request/account-deletion-request.schema';
|
|
3
|
+
|
|
4
|
+
const ApproveAccountDeletionRequestRequestSchema = z.object({});
|
|
5
|
+
|
|
6
|
+
const ApproveAccountDeletionRequestResponseSchema = z.object({
|
|
7
|
+
message: z.string().optional(),
|
|
8
|
+
data: AccountDeletionRequestSchema,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export namespace ApproveAccountDeletionRequestContractCommand {
|
|
12
|
+
export const RequestSchema = ApproveAccountDeletionRequestRequestSchema;
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = ApproveAccountDeletionRequestResponseSchema;
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AccountDeletionRequestSchema } from '../../schemas/account-deletion-request/account-deletion-request.schema';
|
|
3
|
+
|
|
4
|
+
const CancelAccountDeletionRequestRequestSchema = z.object({});
|
|
5
|
+
|
|
6
|
+
const CancelAccountDeletionRequestResponseSchema = z.object({
|
|
7
|
+
message: z.string().optional(),
|
|
8
|
+
data: AccountDeletionRequestSchema,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export namespace CancelAccountDeletionRequestContractCommand {
|
|
12
|
+
export const RequestSchema = CancelAccountDeletionRequestRequestSchema;
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = CancelAccountDeletionRequestResponseSchema;
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const ConfirmPublicAccountDeletionRequestSchema = z.object({
|
|
4
|
+
contact: z.string().min(1).max(320),
|
|
5
|
+
code: z.string().min(1).max(10),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const ConfirmPublicAccountDeletionResponseSchema = z.object({
|
|
9
|
+
message: z.string().optional(),
|
|
10
|
+
data: z.object({
|
|
11
|
+
verificationToken: z.string(),
|
|
12
|
+
accounts: z.array(
|
|
13
|
+
z.object({
|
|
14
|
+
tenantUUID: z.uuid(),
|
|
15
|
+
companyName: z.string(),
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export namespace ConfirmPublicAccountDeletionContractCommand {
|
|
22
|
+
export const RequestSchema = ConfirmPublicAccountDeletionRequestSchema;
|
|
23
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
24
|
+
|
|
25
|
+
export const ResponseSchema = ConfirmPublicAccountDeletionResponseSchema;
|
|
26
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AccountDeletionRequestSchema } from '../../schemas/account-deletion-request/account-deletion-request.schema';
|
|
3
|
+
|
|
4
|
+
const CreateAccountDeletionRequestRequestSchema = z.object({
|
|
5
|
+
reason: z.string().max(1000).optional(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const CreateAccountDeletionRequestResponseSchema = z.object({
|
|
9
|
+
message: z.string().optional(),
|
|
10
|
+
data: AccountDeletionRequestSchema,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export namespace CreateAccountDeletionRequestContractCommand {
|
|
14
|
+
export const RequestSchema = CreateAccountDeletionRequestRequestSchema;
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = CreateAccountDeletionRequestResponseSchema;
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const ExecutePublicAccountDeletionRequestSchema = z.object({
|
|
4
|
+
verificationToken: z.string(),
|
|
5
|
+
tenantUUIDs: z.array(z.uuid()).min(1),
|
|
6
|
+
reason: z.string().max(1000).optional(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const ExecutePublicAccountDeletionResponseSchema = z.object({
|
|
10
|
+
message: z.string().optional(),
|
|
11
|
+
data: z.object({
|
|
12
|
+
createdRequests: z.array(
|
|
13
|
+
z.object({
|
|
14
|
+
tenantUUID: z.uuid(),
|
|
15
|
+
requestUUID: z.uuid(),
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export namespace ExecutePublicAccountDeletionContractCommand {
|
|
22
|
+
export const RequestSchema = ExecutePublicAccountDeletionRequestSchema;
|
|
23
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
24
|
+
|
|
25
|
+
export const ResponseSchema = ExecutePublicAccountDeletionResponseSchema;
|
|
26
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AccountDeletionRequestSchema } from '../../schemas/account-deletion-request/account-deletion-request.schema';
|
|
3
|
+
import { AccountDeletionRequestStatusEnum } from '../../enum';
|
|
4
|
+
|
|
5
|
+
const GetAccountDeletionRequestListRequestSchema = z.object({
|
|
6
|
+
page: z.coerce.number().optional().default(1),
|
|
7
|
+
count: z.coerce.number().optional().default(10),
|
|
8
|
+
status: z.nativeEnum(AccountDeletionRequestStatusEnum).optional(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const GetAccountDeletionRequestListResponseSchema = z.object({
|
|
12
|
+
message: z.string().optional(),
|
|
13
|
+
data: z.object({
|
|
14
|
+
accountDeletionRequestList: AccountDeletionRequestSchema.array(),
|
|
15
|
+
total: z.number(),
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export namespace GetAccountDeletionRequestListContractQuery {
|
|
20
|
+
export const RequestSchema = GetAccountDeletionRequestListRequestSchema;
|
|
21
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = GetAccountDeletionRequestListResponseSchema;
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AccountDeletionRequestSchema } from '../../schemas/account-deletion-request/account-deletion-request.schema';
|
|
3
|
+
|
|
4
|
+
const GetMyAccountDeletionRequestRequestSchema = z.object({});
|
|
5
|
+
|
|
6
|
+
const GetMyAccountDeletionRequestResponseSchema = z.object({
|
|
7
|
+
message: z.string().optional(),
|
|
8
|
+
data: AccountDeletionRequestSchema.nullable(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export namespace GetMyAccountDeletionRequestContractQuery {
|
|
12
|
+
export const RequestSchema = GetMyAccountDeletionRequestRequestSchema;
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = GetMyAccountDeletionRequestResponseSchema;
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './create-account-deletion-request.command';
|
|
2
|
+
export * from './cancel-account-deletion-request.command';
|
|
3
|
+
export * from './approve-account-deletion-request.command';
|
|
4
|
+
export * from './reject-account-deletion-request.command';
|
|
5
|
+
export * from './get-account-deletion-request-list.query';
|
|
6
|
+
export * from './get-my-account-deletion-request.query';
|
|
7
|
+
export * from './initiate-public-account-deletion.command';
|
|
8
|
+
export * from './confirm-public-account-deletion.command';
|
|
9
|
+
export * from './execute-public-account-deletion.command';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const InitiatePublicAccountDeletionRequestSchema = z.object({
|
|
4
|
+
contact: z.string().min(1).max(320),
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const InitiatePublicAccountDeletionResponseSchema = z.object({
|
|
8
|
+
message: z.string(),
|
|
9
|
+
data: z.object({
|
|
10
|
+
success: z.boolean(),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export namespace InitiatePublicAccountDeletionContractCommand {
|
|
15
|
+
export const RequestSchema = InitiatePublicAccountDeletionRequestSchema;
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const ResponseSchema = InitiatePublicAccountDeletionResponseSchema;
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AccountDeletionRequestSchema } from '../../schemas/account-deletion-request/account-deletion-request.schema';
|
|
3
|
+
|
|
4
|
+
const RejectAccountDeletionRequestRequestSchema = z.object({
|
|
5
|
+
comment: z.string().min(1).max(1000),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const RejectAccountDeletionRequestResponseSchema = z.object({
|
|
9
|
+
message: z.string().optional(),
|
|
10
|
+
data: AccountDeletionRequestSchema,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export namespace RejectAccountDeletionRequestContractCommand {
|
|
14
|
+
export const RequestSchema = RejectAccountDeletionRequestRequestSchema;
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = RejectAccountDeletionRequestResponseSchema;
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
package/commands/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ export * from './product-configuration/delete-product-configuration.command';
|
|
|
46
46
|
export * from './product-configuration/find-product-configuration-by-attributes.query';
|
|
47
47
|
export * from './bank-payment';
|
|
48
48
|
export * from './integration';
|
|
49
|
+
export * from './account-deletion-request';
|
|
49
50
|
// Session contracts exported individually to avoid webpack TDZ issues with Next.js SSG
|
|
50
51
|
export { SessionLogoutContractCommand } from './session/session-logout.command';
|
|
51
52
|
export { SessionRevokeAllContractCommand } from './session/session-revoke-all.command';
|
package/constant/error.ts
CHANGED
|
@@ -1007,4 +1007,29 @@ export const ERRORS = {
|
|
|
1007
1007
|
// PUSH NOTIFICATION
|
|
1008
1008
|
PUSH_NOTIFICATION_SEND_FAILED: { code: 'PN001', message: 'Failed to send push notification', httpCode: 500 },
|
|
1009
1009
|
PUSH_NOTIFICATION_NO_DEVICES: { code: 'PN002', message: 'No active devices found for user', httpCode: 404 },
|
|
1010
|
+
|
|
1011
|
+
// ACCOUNT DELETION REQUEST
|
|
1012
|
+
ACCOUNT_DELETION_REQUEST_NOT_CREATED: { code: 'ADR001', message: 'Failed to create account deletion request', httpCode: 500 },
|
|
1013
|
+
ACCOUNT_DELETION_REQUEST_NOT_FOUND: { code: 'ADR002', message: 'Account deletion request not found', httpCode: 404 },
|
|
1014
|
+
ACCOUNT_DELETION_REQUEST_ALREADY_EXISTS: {
|
|
1015
|
+
code: 'ADR003',
|
|
1016
|
+
message: 'A pending account deletion request already exists for this user',
|
|
1017
|
+
httpCode: 409,
|
|
1018
|
+
},
|
|
1019
|
+
ACCOUNT_DELETION_REQUEST_NOT_PENDING: { code: 'ADR004', message: 'Account deletion request is not in pending status', httpCode: 400 },
|
|
1020
|
+
ACCOUNT_DELETION_REQUEST_NOT_UPDATED: { code: 'ADR005', message: 'Failed to update account deletion request', httpCode: 500 },
|
|
1021
|
+
ACCOUNT_DELETION_REQUEST_FETCH_FAILED: { code: 'ADR006', message: 'Failed to fetch account deletion request', httpCode: 500 },
|
|
1022
|
+
ACCOUNT_DELETION_REQUEST_FORBIDDEN: {
|
|
1023
|
+
code: 'ADR007',
|
|
1024
|
+
message: 'Account deletion request does not belong to current user',
|
|
1025
|
+
httpCode: 403,
|
|
1026
|
+
},
|
|
1027
|
+
EMPLOYEE_DELETION_NOT_ALLOWED: {
|
|
1028
|
+
code: 'ADR008',
|
|
1029
|
+
message: 'Self-service account deletion is available only for buyer accounts. Please contact support to delete an employee account',
|
|
1030
|
+
httpCode: 403,
|
|
1031
|
+
},
|
|
1032
|
+
PUBLIC_ACCOUNT_DELETION_INVALID_CODE: { code: 'ADR009', message: 'Invalid or expired verification code', httpCode: 400 },
|
|
1033
|
+
PUBLIC_ACCOUNT_DELETION_INVALID_TOKEN: { code: 'ADR010', message: 'Invalid or expired verification token', httpCode: 400 },
|
|
1034
|
+
PUBLIC_ACCOUNT_DELETION_NO_TENANTS_SELECTED: { code: 'ADR011', message: 'No valid tenants selected for deletion', httpCode: 400 },
|
|
1010
1035
|
} as const;
|
package/enum/index.ts
CHANGED
|
@@ -68,3 +68,5 @@ export * from './match-confidence.enum';
|
|
|
68
68
|
export * from './session-platform.enum';
|
|
69
69
|
export * from './device-platform.enum';
|
|
70
70
|
export * from './security-code-blocked-reason.enum';
|
|
71
|
+
export * from './account-deletion-request-status.enum';
|
|
72
|
+
export * from './account-deletion-request-source.enum';
|
|
@@ -6,4 +6,7 @@ export enum NotificationTypeEnum {
|
|
|
6
6
|
WRITE_OFF_REJECTED = 'WRITE_OFF_REJECTED',
|
|
7
7
|
CLIENT_MESSAGE_TO_EMPLOYEE = 'CLIENT_MESSAGE_TO_EMPLOYEE',
|
|
8
8
|
PASSWORD_CHANGED = 'PASSWORD_CHANGED',
|
|
9
|
+
ACCOUNT_DELETION_REQUEST_CREATED = 'ACCOUNT_DELETION_REQUEST_CREATED',
|
|
10
|
+
ACCOUNT_DELETION_REQUEST_APPROVED = 'ACCOUNT_DELETION_REQUEST_APPROVED',
|
|
11
|
+
ACCOUNT_DELETION_REQUEST_REJECTED = 'ACCOUNT_DELETION_REQUEST_REJECTED',
|
|
9
12
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AccountDeletionRequestStatusEnum, AccountDeletionRequestSourceEnum } from '../../enum';
|
|
3
|
+
|
|
4
|
+
export const AccountDeletionRequestSchema = z.object({
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
userUUID: z.uuid(),
|
|
7
|
+
companyUUID: z.uuid(),
|
|
8
|
+
status: z.nativeEnum(AccountDeletionRequestStatusEnum),
|
|
9
|
+
source: z.nativeEnum(AccountDeletionRequestSourceEnum),
|
|
10
|
+
reason: z.string().nullable(),
|
|
11
|
+
processedByUUID: z.uuid().nullable(),
|
|
12
|
+
processedAt: z.date().nullable(),
|
|
13
|
+
processedComment: z.string().nullable(),
|
|
14
|
+
createdAt: z.date(),
|
|
15
|
+
updatedAt: z.date(),
|
|
16
|
+
});
|
package/schemas/index.ts
CHANGED
|
@@ -60,3 +60,4 @@ export * from './client-payment-identifier/client-payment-identifier.schema';
|
|
|
60
60
|
export * from './bank-payment/get-bank-payment-match-suggestions.schema';
|
|
61
61
|
export * from './messenger-profile';
|
|
62
62
|
export * from './error-message.schema';
|
|
63
|
+
export * from './account-deletion-request/account-deletion-request.schema';
|