@floristcloud/api-lib 1.2.194 → 1.2.196
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/auth/get-security-code-status-by-admin.query.js +8 -0
- package/build/commands/auth/index.js +2 -0
- package/build/commands/auth/register-user.command.js +4 -15
- package/build/commands/auth/reset-password-by-admin.command.js +4 -9
- package/build/commands/auth/reset-password-by-security-code.command.js +8 -18
- package/build/commands/auth/reset-password-by-token.command.js +9 -20
- package/build/commands/auth/reset-password-by-user.command.js +4 -9
- package/build/commands/auth/reset-security-code-limits-by-admin.command.js +10 -0
- package/build/commands/company/createCompanyWithUser.command.js +4 -21
- package/build/commands/company/getCompanyList.query.js +4 -12
- package/build/commands/domain/get-domain-list.query.js +4 -12
- package/build/commands/session/validate-session-s2s.query.js +4 -19
- package/build/commands/session/validate-ws-ticket-s2s.query.js +2 -5
- package/build/commands/user/attachUserToCompany.command.js +1 -0
- package/build/commands/user/create-user-global.command.js +4 -22
- package/build/commands/user/createUserByClientId.command.js +4 -25
- package/build/commands/user/createUserForCompany.command.js +4 -23
- package/build/commands/user/get-me.query.js +2 -11
- package/build/commands/user/getUser.command.js +2 -8
- package/build/commands/user/update-password-by-user.command.js +4 -9
- package/build/commands/work-session/create-many-work-session.command.js +4 -11
- package/build/commands/work-session/export-overtime.query.js +4 -20
- package/build/constant/error.js +10 -0
- package/build/constant/validation-i18n-key.js +2 -0
- package/build/constant/validation-i18n-message.js +2 -0
- package/build/constant/work-session-report-limits.constant.js +7 -0
- package/build/enum/index.js +1 -0
- package/build/enum/security-code-blocked-reason.enum.js +2 -0
- package/build/enum/security-code-purpose.enum.js +8 -0
- package/build/schemas/auth/get-security-code-status-by-admin-response.schema.js +6 -0
- package/build/schemas/auth/index.js +36 -0
- package/build/schemas/auth/password-reset-data.schema.js +6 -0
- package/build/schemas/auth/password-reset-user.schema.js +5 -0
- package/build/schemas/auth/password.schema.js +9 -0
- package/build/schemas/auth/register-user-request.schema.js +11 -0
- package/build/schemas/auth/register-user-response.schema.js +6 -0
- package/build/schemas/auth/registration-success.schema.js +5 -0
- package/build/schemas/auth/reset-password-by-admin-request.schema.js +6 -0
- package/build/schemas/auth/reset-password-by-admin-response.schema.js +5 -0
- package/build/schemas/auth/reset-password-by-security-code-request.schema.js +11 -0
- package/build/schemas/auth/reset-password-by-security-code-response.schema.js +6 -0
- package/build/schemas/auth/reset-password-by-token-request.schema.js +8 -0
- package/build/schemas/auth/reset-password-by-token-response.schema.js +6 -0
- package/build/schemas/auth/reset-password-by-user-request.schema.js +6 -0
- package/build/schemas/auth/reset-password-by-user-response.schema.js +5 -0
- package/build/schemas/auth/reset-security-code-limits-by-admin-request.schema.js +5 -0
- package/build/schemas/auth/reset-security-code-limits-by-admin-response.schema.js +5 -0
- package/build/schemas/auth/restore-access-token.schema.js +5 -0
- package/build/schemas/auth/security-code-issuance-block.schema.js +9 -0
- package/build/schemas/auth/security-code-issuance-status.schema.js +16 -0
- package/build/schemas/client/register-client-webshop-request.schema.js +2 -1
- package/build/schemas/company/create-company-data.schema.js +5 -0
- package/build/schemas/company/create-company-user-data.schema.js +6 -0
- package/build/schemas/company/create-company-with-user-request.schema.js +7 -0
- package/build/schemas/company/create-company-with-user-response.schema.js +6 -0
- package/build/schemas/company/get-company-list-request.schema.js +8 -0
- package/build/schemas/company/get-company-list-response.schema.js +6 -0
- package/build/schemas/company/index.js +21 -0
- package/build/schemas/consignment/consignment.schema.js +9 -9
- package/build/schemas/domain/get-domain-list-request.schema.js +8 -0
- package/build/schemas/domain/get-domain-list-response.schema.js +6 -0
- package/build/schemas/employee-schedule/employee-schedule.schema.js +1 -1
- package/build/schemas/index.js +29 -8
- package/build/schemas/product/group/update-group-product-update-batch-request-data.schema.js +1 -1
- package/build/schemas/product/product-base.schema.js +1 -1
- package/build/schemas/product/update-product-request.schema.js +2 -2
- package/build/schemas/session/validate-session-s2s-request.schema.js +7 -0
- package/build/schemas/session/validate-session-s2s-response.schema.js +6 -0
- package/build/schemas/session/validate-ws-ticket-s2s-request.schema.js +7 -0
- package/build/schemas/session/validated-session-user.schema.js +15 -0
- package/build/schemas/user/allowed-user-role.schema.js +8 -0
- package/build/schemas/user/create-user-by-client-id-data.schema.js +15 -0
- package/build/schemas/user/create-user-by-client-id-request.schema.js +6 -0
- package/build/schemas/user/create-user-by-client-id-response.schema.js +11 -0
- package/build/schemas/user/create-user-for-company-request.schema.js +11 -0
- package/build/schemas/user/create-user-for-company-response.schema.js +11 -0
- package/build/schemas/user/create-user-global-request.schema.js +15 -0
- package/build/schemas/user/create-user-global-response.schema.js +6 -0
- package/build/schemas/user/create-user.schema.js +14 -0
- package/build/schemas/user/get-me-data.schema.js +7 -0
- package/build/schemas/user/get-me-response.schema.js +6 -0
- package/build/schemas/user/get-user-data.schema.js +6 -0
- package/build/schemas/user/get-user-response.schema.js +6 -0
- package/build/schemas/user/index.js +15 -0
- package/build/schemas/user/update-password-by-user-request.schema.js +9 -0
- package/build/schemas/user/update-password-by-user-response.schema.js +5 -0
- package/build/schemas/user/user.schema.js +2 -12
- package/build/schemas/work-session/create-many-work-session-request.schema.js +8 -0
- package/build/schemas/work-session/create-many-work-session-response.schema.js +9 -0
- package/build/schemas/work-session/create-work-session-for-employee.schema.js +8 -0
- package/build/schemas/work-session/create-work-session.schema.js +18 -0
- package/build/schemas/work-session/export-overtime-request.schema.js +23 -0
- package/build/schemas/work-session/export-overtime-response.schema.js +6 -0
- package/build/schemas/work-session/overtime-file.schema.js +5 -0
- package/build/schemas/work-session/update-work-session.schema.js +21 -0
- package/build/schemas/work-session/work-session-date.schema.js +13 -0
- package/build/schemas/work-session/work-session-extended-list.schema.js +9 -0
- package/build/schemas/work-session/work-session-extended.schema.js +8 -0
- package/build/schemas/work-session/work-session.schema.js +1 -26
- package/commands/auth/get-security-code-status-by-admin.query.ts +7 -0
- package/commands/auth/index.ts +2 -0
- package/commands/auth/register-user.command.ts +3 -15
- package/commands/auth/reset-password-by-admin.command.ts +3 -9
- package/commands/auth/reset-password-by-security-code.command.ts +5 -17
- package/commands/auth/reset-password-by-token.command.ts +6 -19
- package/commands/auth/reset-password-by-user.command.ts +3 -9
- package/commands/auth/reset-security-code-limits-by-admin.command.ts +11 -0
- package/commands/company/createCompanyWithUser.command.ts +3 -21
- package/commands/company/getCompanyList.query.ts +4 -14
- package/commands/domain/get-domain-list.query.ts +3 -13
- package/commands/session/validate-session-s2s.query.ts +3 -20
- package/commands/session/validate-ws-ticket-s2s.query.ts +2 -6
- package/commands/user/attachUserToCompany.command.ts +1 -0
- package/commands/user/create-user-global.command.ts +3 -22
- package/commands/user/createUserByClientId.command.ts +3 -25
- package/commands/user/createUserForCompany.command.ts +3 -26
- package/commands/user/get-me.query.ts +2 -11
- package/commands/user/getUser.command.ts +3 -9
- package/commands/user/update-password-by-user.command.ts +3 -10
- package/commands/work-session/create-many-work-session.command.ts +3 -12
- package/commands/work-session/export-overtime.query.ts +3 -21
- package/constant/error.ts +11 -0
- package/constant/validation-i18n-key.ts +2 -0
- package/constant/validation-i18n-message.ts +2 -0
- package/constant/work-session-report-limits.constant.ts +4 -0
- package/enum/index.ts +2 -0
- package/enum/security-code-blocked-reason.enum.ts +2 -0
- package/enum/security-code-purpose.enum.ts +4 -0
- package/package.json +1 -1
- package/schemas/auth/get-security-code-status-by-admin-response.schema.ts +4 -0
- package/schemas/auth/index.ts +20 -0
- package/schemas/auth/password-reset-data.schema.ts +4 -0
- package/schemas/auth/password-reset-user.schema.ts +3 -0
- package/schemas/auth/password.schema.ts +7 -0
- package/schemas/auth/register-user-request.schema.ts +9 -0
- package/schemas/auth/register-user-response.schema.ts +4 -0
- package/schemas/auth/registration-success.schema.ts +3 -0
- package/schemas/auth/reset-password-by-admin-request.schema.ts +4 -0
- package/schemas/auth/reset-password-by-admin-response.schema.ts +3 -0
- package/schemas/auth/reset-password-by-security-code-request.schema.ts +9 -0
- package/schemas/auth/reset-password-by-security-code-response.schema.ts +4 -0
- package/schemas/auth/reset-password-by-token-request.schema.ts +6 -0
- package/schemas/auth/reset-password-by-token-response.schema.ts +4 -0
- package/schemas/auth/reset-password-by-user-request.schema.ts +4 -0
- package/schemas/auth/reset-password-by-user-response.schema.ts +3 -0
- package/schemas/auth/reset-security-code-limits-by-admin-request.schema.ts +3 -0
- package/schemas/auth/reset-security-code-limits-by-admin-response.schema.ts +3 -0
- package/schemas/auth/restore-access-token.schema.ts +3 -0
- package/schemas/auth/security-code-issuance-block.schema.ts +7 -0
- package/schemas/auth/security-code-issuance-status.schema.ts +14 -0
- package/schemas/client/register-client-webshop-request.schema.ts +2 -1
- package/schemas/company/create-company-data.schema.ts +3 -0
- package/schemas/company/create-company-user-data.schema.ts +4 -0
- package/schemas/company/create-company-with-user-request.schema.ts +5 -0
- package/schemas/company/create-company-with-user-response.schema.ts +4 -0
- package/schemas/company/get-company-list-request.schema.ts +5 -0
- package/schemas/company/get-company-list-response.schema.ts +3 -0
- package/schemas/company/index.ts +5 -0
- package/schemas/consignment/consignment.schema.ts +9 -9
- package/schemas/domain/get-domain-list-request.schema.ts +5 -0
- package/schemas/domain/get-domain-list-response.schema.ts +3 -0
- package/schemas/employee-schedule/employee-schedule.schema.ts +1 -1
- package/schemas/index.ts +30 -8
- package/schemas/product/group/update-group-product-update-batch-request-data.schema.ts +1 -1
- package/schemas/product/product-base.schema.ts +1 -1
- package/schemas/product/update-product-request.schema.ts +2 -2
- package/schemas/session/validate-session-s2s-request.schema.ts +4 -0
- package/schemas/session/validate-session-s2s-response.schema.ts +3 -0
- package/schemas/session/validate-ws-ticket-s2s-request.schema.ts +4 -0
- package/schemas/session/validated-session-user.schema.ts +12 -0
- package/schemas/user/allowed-user-role.schema.ts +6 -0
- package/schemas/user/create-user-by-client-id-data.schema.ts +13 -0
- package/schemas/user/create-user-by-client-id-request.schema.ts +4 -0
- package/schemas/user/create-user-by-client-id-response.schema.ts +9 -0
- package/schemas/user/create-user-for-company-request.schema.ts +9 -0
- package/schemas/user/create-user-for-company-response.schema.ts +9 -0
- package/schemas/user/create-user-global-request.schema.ts +13 -0
- package/schemas/user/create-user-global-response.schema.ts +4 -0
- package/schemas/user/create-user.schema.ts +12 -0
- package/schemas/user/get-me-data.schema.ts +5 -0
- package/schemas/user/get-me-response.schema.ts +4 -0
- package/schemas/user/get-user-data.schema.ts +4 -0
- package/schemas/user/get-user-response.schema.ts +4 -0
- package/schemas/user/index.ts +15 -0
- package/schemas/user/update-password-by-user-request.schema.ts +7 -0
- package/schemas/user/update-password-by-user-response.schema.ts +3 -0
- package/schemas/user/user.schema.ts +1 -12
- package/schemas/work-session/create-many-work-session-request.schema.ts +5 -0
- package/schemas/work-session/create-many-work-session-response.schema.ts +6 -0
- package/schemas/work-session/create-work-session-for-employee.schema.ts +5 -0
- package/schemas/work-session/create-work-session.schema.ts +15 -0
- package/schemas/work-session/export-overtime-request.schema.ts +24 -0
- package/schemas/work-session/export-overtime-response.schema.ts +3 -0
- package/schemas/work-session/overtime-file.schema.ts +2 -0
- package/schemas/work-session/update-work-session.schema.ts +18 -0
- package/schemas/work-session/work-session-date.schema.ts +14 -0
- package/schemas/work-session/work-session-extended-list.schema.ts +6 -0
- package/schemas/work-session/work-session-extended.schema.ts +5 -0
- package/schemas/work-session/work-session.schema.ts +0 -30
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const CreateUserByClientIdRequestSchema = z.object({
|
|
6
|
-
user: z
|
|
7
|
-
.object({
|
|
8
|
-
password: z.string(),
|
|
9
|
-
name: z.string(),
|
|
10
|
-
email: z.email().toLowerCase().nullable().optional(),
|
|
11
|
-
phone: z.string().nullable().optional(),
|
|
12
|
-
roles: z.array(z.nativeEnum(UserRoleEnum)).optional().default([UserRoleEnum.BUYER]),
|
|
13
|
-
})
|
|
14
|
-
.refine(data => data.email || data.phone, {
|
|
15
|
-
message: 'validation.emailOrPhoneRequired',
|
|
16
|
-
}),
|
|
17
|
-
clientUuid: z.uuid(),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const CreateUserByClientIdResponseSchema = z.object({
|
|
21
|
-
message: z.string().optional(),
|
|
22
|
-
code: z.string().optional(),
|
|
23
|
-
i18nKey: z.string().optional(),
|
|
24
|
-
data: UserSchema,
|
|
25
|
-
});
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { CreateUserByClientIdRequestSchema } from '../../schemas/user/create-user-by-client-id-request.schema';
|
|
3
|
+
import { CreateUserByClientIdResponseSchema } from '../../schemas/user/create-user-by-client-id-response.schema';
|
|
26
4
|
|
|
27
5
|
export namespace CreateUserByClientIdCommand {
|
|
28
6
|
export const RequestSchema = CreateUserByClientIdRequestSchema;
|
|
@@ -1,29 +1,6 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const UserRoles = z.nativeEnum(UserRoleEnum);
|
|
6
|
-
const AllowedRoles = UserRoles.refine(role => role !== UserRoleEnum.BUYER, {
|
|
7
|
-
message: 'validation.allowedRoles',
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const CreateUserForCompanyRequestSchema = UserSchema.pick({
|
|
11
|
-
email: true,
|
|
12
|
-
phone: true,
|
|
13
|
-
name: true,
|
|
14
|
-
}).merge(
|
|
15
|
-
z.object({
|
|
16
|
-
roles: z.array(AllowedRoles),
|
|
17
|
-
password: z.string(),
|
|
18
|
-
}),
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
const CreateUserForCompanyResponseSchema = z.object({
|
|
22
|
-
message: z.string().optional(),
|
|
23
|
-
code: z.string().optional(),
|
|
24
|
-
i18nKey: z.string().optional(),
|
|
25
|
-
data: UserSchema,
|
|
26
|
-
});
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { CreateUserForCompanyRequestSchema } from '../../schemas/user/create-user-for-company-request.schema';
|
|
3
|
+
import { CreateUserForCompanyResponseSchema } from '../../schemas/user/create-user-for-company-response.schema';
|
|
27
4
|
|
|
28
5
|
export namespace CreateUserForCompanyCommand {
|
|
29
6
|
export const RequestSchema = CreateUserForCompanyRequestSchema;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import { EffectivePermissionsSchema } from '../../schemas/access-policy/access-policy.schema';
|
|
4
|
-
|
|
5
|
-
const GetMeResponseSchema = z.object({
|
|
6
|
-
message: z.string().optional(),
|
|
7
|
-
data: z.object({
|
|
8
|
-
user: UserSchema.omit({ passwordHash: true, restoreTokenHash: true }),
|
|
9
|
-
permissions: EffectivePermissionsSchema,
|
|
10
|
-
}),
|
|
11
|
-
});
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { GetMeResponseSchema } from '../../schemas/user/get-me-response.schema';
|
|
12
3
|
|
|
13
4
|
export namespace GetMeContractQuery {
|
|
14
5
|
export const ResponseSchema = GetMeResponseSchema;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const GetUserRequestSchema = z.object({
|
|
5
|
-
data: z.object({
|
|
6
|
-
user: UserSchema.omit({ passwordHash: true, restoreTokenHash: true }),
|
|
7
|
-
}),
|
|
8
|
-
});
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { GetUserResponseSchema } from '../../schemas/user/get-user-response.schema';
|
|
9
3
|
|
|
10
4
|
export namespace GetUserCommand {
|
|
11
|
-
export const ResponseSchema =
|
|
5
|
+
export const ResponseSchema = GetUserResponseSchema;
|
|
12
6
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
7
|
}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
password: z.string(),
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
const UpdatePasswordByUserResponseSchema = z.object({
|
|
8
|
-
message: z.string(),
|
|
9
|
-
});
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { UpdatePasswordByUserRequestSchema } from '../../schemas/user/update-password-by-user-request.schema';
|
|
3
|
+
import { UpdatePasswordByUserResponseSchema } from '../../schemas/user/update-password-by-user-response.schema';
|
|
10
4
|
|
|
11
5
|
export namespace UpdatePasswordByUserContractCommand {
|
|
12
6
|
export const RequestSchema = UpdatePasswordByUserRequestSchema;
|
|
13
7
|
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
-
|
|
15
8
|
export const ResponseSchema = UpdatePasswordByUserResponseSchema;
|
|
16
9
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
10
|
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const CreateManyWorkSessionRequestSchema = z.object({
|
|
5
|
-
data: z.array(CreateWorkSessionSchema),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const CreateManyWorkSessionResponseSchema = z.object({
|
|
9
|
-
message: z.string().optional(),
|
|
10
|
-
data: z.array(WorkSessionSchema),
|
|
11
|
-
});
|
|
12
|
-
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { CreateManyWorkSessionRequestSchema } from '../../schemas/work-session/create-many-work-session-request.schema';
|
|
3
|
+
import { CreateManyWorkSessionResponseSchema } from '../../schemas/work-session/create-many-work-session-response.schema';
|
|
13
4
|
export namespace CreateManyWorkSessionContractCommand {
|
|
14
5
|
export const RequestSchema = CreateManyWorkSessionRequestSchema;
|
|
15
6
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const ExportOvertimeRequestSchema = z
|
|
5
|
-
.object({
|
|
6
|
-
startDate: z.coerce.date(),
|
|
7
|
-
endDate: z.coerce.date(),
|
|
8
|
-
userUUIDs: z.array(z.string().uuid()).optional(),
|
|
9
|
-
})
|
|
10
|
-
.refine(value => dateRangeCheck(value.startDate, value.endDate), {
|
|
11
|
-
message: 'validation.dateRange',
|
|
12
|
-
path: ['endDate', 'startDate'],
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const ExportOvertimeResponseSchema = z.object({
|
|
16
|
-
data: z.object({
|
|
17
|
-
fileUrl: z.string(),
|
|
18
|
-
fileKey: z.string(),
|
|
19
|
-
}),
|
|
20
|
-
});
|
|
21
|
-
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { ExportOvertimeRequestSchema } from '../../schemas/work-session/export-overtime-request.schema';
|
|
3
|
+
import { ExportOvertimeResponseSchema } from '../../schemas/work-session/export-overtime-response.schema';
|
|
22
4
|
export namespace ExportOvertimeContractQuery {
|
|
23
5
|
export const RequestSchema = ExportOvertimeRequestSchema;
|
|
24
6
|
export type Request = z.infer<typeof RequestSchema>;
|
package/constant/error.ts
CHANGED
|
@@ -136,6 +136,9 @@ export const ERRORS = {
|
|
|
136
136
|
USER_EMAIL_REQUIRED_FOR_NOTIFICATION: { code: 'U018', message: 'User email is required for email notification', httpCode: 400 },
|
|
137
137
|
USER_PASSWORD_GENERATION_FAILED: { code: 'U019', message: 'Failed to generate and send password', httpCode: 500 },
|
|
138
138
|
|
|
139
|
+
CURRENT_PASSWORD_REQUIRED: { code: 'U020', message: 'Current password is required', httpCode: 400 },
|
|
140
|
+
INVALID_CURRENT_PASSWORD: { code: 'U021', message: 'Current password is incorrect', httpCode: 400 },
|
|
141
|
+
|
|
139
142
|
//AUTH
|
|
140
143
|
FAILED_TO_UPDATE: { code: 'A010', message: 'User update failed', httpCode: 500 },
|
|
141
144
|
RESTORE_TOKEN_ERROR: { code: 'A012', message: 'Invalid recovery token', httpCode: 500 },
|
|
@@ -544,6 +547,11 @@ export const ERRORS = {
|
|
|
544
547
|
CART_NOT_DELETED: { code: 'O013', message: 'Cart not deleted', httpCode: 500 },
|
|
545
548
|
ORDER_SEND_INVOICE_FAILED_NO_EMAIL: { code: 'O014', message: 'Order send invoice failed, client does not have email', httpCode: 500 },
|
|
546
549
|
ORDER_SEND_INVOICE_FAILED_NO_PHONE: { code: 'O017', message: 'Order send invoice failed, client does not have phone', httpCode: 500 },
|
|
550
|
+
ORDER_SEND_INVOICE_FAILED_NO_ACCOUNT: {
|
|
551
|
+
code: 'O067',
|
|
552
|
+
message: 'Order send invoice failed, client has no account for the selected channel',
|
|
553
|
+
httpCode: 400,
|
|
554
|
+
},
|
|
547
555
|
ORDER_SEND_INVOICE_FAILED_NO_CONTACTS: {
|
|
548
556
|
code: 'O025',
|
|
549
557
|
message: 'Order send invoice failed, client does not have contact methods',
|
|
@@ -1632,6 +1640,9 @@ export const ERRORS = {
|
|
|
1632
1640
|
SECURITY_CODE_FRAUD: { code: 'SC005', message: 'Security code attempts exceeded. Contact administrator', httpCode: 403 },
|
|
1633
1641
|
SECURITY_CODE_DAILY_LIMIT: { code: 'SC006', message: 'Daily security code limit reached. Contact administrator', httpCode: 429 },
|
|
1634
1642
|
SECURITY_CODE_FRAUD_BLOCK: { code: 'SC007', message: 'Security code temporarily blocked after fraud detection', httpCode: 429 },
|
|
1643
|
+
SECURITY_CODE_WINDOW_LIMIT: { code: 'SC008', message: 'Too many security codes requested. Try again later', httpCode: 429 },
|
|
1644
|
+
SECURITY_CODE_STATUS_FAILED: { code: 'SC009', message: 'Failed to get security code status', httpCode: 500 },
|
|
1645
|
+
SECURITY_CODE_LIMITS_RESET_FAILED: { code: 'SC010', message: 'Failed to reset security code limits', httpCode: 500 },
|
|
1635
1646
|
|
|
1636
1647
|
// MESSENGER PROFILE
|
|
1637
1648
|
MESSENGER_VERIFICATION_CODE_NOT_FOUND: { code: 'MP001', message: 'Verification code not found', httpCode: 404 },
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* stable contract; the English text lives only in the frontend dictionary.
|
|
8
8
|
*/
|
|
9
9
|
export const ValidationI18nKey = {
|
|
10
|
+
passwordMinLength: 'validation.passwordMinLength',
|
|
11
|
+
passwordMaxBytes: 'validation.passwordMaxBytes',
|
|
10
12
|
dateRange: 'validation.dateRange',
|
|
11
13
|
reportPeriodMax: 'validation.reportPeriodMax',
|
|
12
14
|
emailOrPhoneRequired: 'validation.emailOrPhoneRequired',
|
|
@@ -11,6 +11,8 @@ import { ValidationI18nKey, ValidationI18nKeyType } from './validation-i18n-key'
|
|
|
11
11
|
* Every token in ValidationI18nKey MUST have an entry here (enforced by the Record type).
|
|
12
12
|
*/
|
|
13
13
|
export const VALIDATION_I18N_MESSAGE: Record<ValidationI18nKeyType, string> = {
|
|
14
|
+
[ValidationI18nKey.passwordMinLength]: 'Password must contain at least 8 characters',
|
|
15
|
+
[ValidationI18nKey.passwordMaxBytes]: 'Password must not exceed 72 bytes in UTF-8',
|
|
14
16
|
[ValidationI18nKey.dateRange]: 'Start date must be before or equal to end date',
|
|
15
17
|
[ValidationI18nKey.reportPeriodMax]: 'The selected period exceeds the maximum allowed range',
|
|
16
18
|
[ValidationI18nKey.emailOrPhoneRequired]: 'Either email or phone is required',
|
package/enum/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './password.schema';
|
|
2
|
+
export * from './registration-success.schema';
|
|
3
|
+
export * from './register-user-request.schema';
|
|
4
|
+
export * from './register-user-response.schema';
|
|
5
|
+
export * from './reset-password-by-admin-request.schema';
|
|
6
|
+
export * from './reset-password-by-admin-response.schema';
|
|
7
|
+
export * from './reset-password-by-user-request.schema';
|
|
8
|
+
export * from './reset-password-by-user-response.schema';
|
|
9
|
+
export * from './reset-password-by-token-request.schema';
|
|
10
|
+
export * from './restore-access-token.schema';
|
|
11
|
+
export * from './reset-password-by-token-response.schema';
|
|
12
|
+
export * from './reset-password-by-security-code-request.schema';
|
|
13
|
+
export * from './password-reset-user.schema';
|
|
14
|
+
export * from './password-reset-data.schema';
|
|
15
|
+
export * from './reset-password-by-security-code-response.schema';
|
|
16
|
+
export * from './security-code-issuance-block.schema';
|
|
17
|
+
export * from './security-code-issuance-status.schema';
|
|
18
|
+
export * from './get-security-code-status-by-admin-response.schema';
|
|
19
|
+
export * from './reset-security-code-limits-by-admin-request.schema';
|
|
20
|
+
export * from './reset-security-code-limits-by-admin-response.schema';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ValidationI18nKey } from '../../constant/validation-i18n-key';
|
|
3
|
+
|
|
4
|
+
export const PasswordSchema = z
|
|
5
|
+
.string()
|
|
6
|
+
.min(8, { message: ValidationI18nKey.passwordMinLength })
|
|
7
|
+
.refine(password => new TextEncoder().encode(password).byteLength <= 72, { message: ValidationI18nKey.passwordMaxBytes });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PasswordSchema } from './password.schema';
|
|
3
|
+
|
|
4
|
+
export const ResetPasswordBySecurityCodeRequestSchema = z.object({
|
|
5
|
+
email: z.email().toLowerCase().optional(),
|
|
6
|
+
phone: z.string().optional(),
|
|
7
|
+
securityCode: z.string(),
|
|
8
|
+
password: PasswordSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PasswordSchema } from './password.schema';
|
|
3
|
+
|
|
4
|
+
export const ResetPasswordByTokenRequestSchema = z
|
|
5
|
+
.object({ email: z.email().toLowerCase().optional(), phone: z.string().optional(), restoreToken: z.string(), password: PasswordSchema })
|
|
6
|
+
.refine(data => data.email || data.phone, { message: 'validation.emailOrPhoneRequired', path: ['email', 'phone'] });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SecurityCodeIssuanceBlockSchema } from './security-code-issuance-block.schema';
|
|
3
|
+
|
|
4
|
+
export const SecurityCodeIssuanceStatusSchema = z.object({
|
|
5
|
+
isBlocked: z.boolean(),
|
|
6
|
+
/** Действующие блоки по приоритету; первый — тот, что сейчас мешает получить код. */
|
|
7
|
+
blocks: SecurityCodeIssuanceBlockSchema.array(),
|
|
8
|
+
dailyCount: z.number().int(),
|
|
9
|
+
dailyLimit: z.number().int(),
|
|
10
|
+
windowCount: z.number().int(),
|
|
11
|
+
windowLimit: z.number().int(),
|
|
12
|
+
windowMinutes: z.number().int(),
|
|
13
|
+
lastIssuedAt: z.date().nullable(),
|
|
14
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { PasswordSchema } from '../auth/password.schema';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { ClientTypeEnum } from '../../enum/client-type.enum';
|
|
3
4
|
|
|
4
5
|
export const RegisterClientWebshopRequestSchema = z.object({
|
|
5
6
|
name: z.string(),
|
|
6
|
-
password:
|
|
7
|
+
password: PasswordSchema,
|
|
7
8
|
contactName: z.string().nullable(),
|
|
8
9
|
phone: z.string(),
|
|
9
10
|
email: z.email().toLowerCase(),
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CreateCompanyDataSchema } from './create-company-data.schema';
|
|
3
|
+
import { CreateCompanyUserDataSchema } from './create-company-user-data.schema';
|
|
4
|
+
|
|
5
|
+
export const CreateCompanyWithUserRequestSchema = z.object({ company: CreateCompanyDataSchema, user: CreateCompanyUserDataSchema });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './create-company-data.schema';
|
|
2
|
+
export * from './create-company-user-data.schema';
|
|
3
|
+
export * from './create-company-with-user-request.schema';
|
|
4
|
+
export * from './create-company-with-user-response.schema';
|
|
5
|
+
export * from './get-company-list-response.schema';
|
|
@@ -21,25 +21,25 @@ export const ConsignmentSchema = z.object({
|
|
|
21
21
|
|
|
22
22
|
export const ConsignmentWithStatisticForListSchema = ConsignmentSchema.extend({
|
|
23
23
|
statistic: z.object({
|
|
24
|
-
totalCostPrice: MoneySchema,
|
|
24
|
+
totalCostPrice: MoneySchema.nullable(),
|
|
25
25
|
currentProductBalance: z.number(),
|
|
26
|
-
currentCostPrice: MoneySchema,
|
|
26
|
+
currentCostPrice: MoneySchema.nullable(),
|
|
27
27
|
totalProductQuantity: z.number(),
|
|
28
|
-
totalSellings: MoneySchema,
|
|
29
|
-
totalApprovedWriteOffSellings: MoneySchema,
|
|
28
|
+
totalSellings: MoneySchema.nullable(),
|
|
29
|
+
totalApprovedWriteOffSellings: MoneySchema.nullable(),
|
|
30
30
|
}),
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
export const ConsignmentWithStatisticSchema = ConsignmentSchema.extend({
|
|
34
34
|
statistic: z.object({
|
|
35
|
-
totalCostPrice: MoneySchema,
|
|
35
|
+
totalCostPrice: MoneySchema.nullable(),
|
|
36
36
|
currentProductBalance: z.number(),
|
|
37
|
-
currentCostPrice: MoneySchema,
|
|
37
|
+
currentCostPrice: MoneySchema.nullable(),
|
|
38
38
|
totalProductQuantity: z.number(),
|
|
39
|
-
totalSellings: MoneySchema,
|
|
39
|
+
totalSellings: MoneySchema.nullable(),
|
|
40
40
|
writeOffQuantity: z.number(),
|
|
41
|
-
writeOffCostPrice: MoneySchema,
|
|
42
|
-
writeOffCostPriceByOrderProduct: MoneySchema,
|
|
41
|
+
writeOffCostPrice: MoneySchema.nullable(),
|
|
42
|
+
writeOffCostPriceByOrderProduct: MoneySchema.nullable(),
|
|
43
43
|
}),
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -20,7 +20,7 @@ export const EmployeeScheduleListSchema = z.object({
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
export const EmployeeScheduleExtendedSchema = EmployeeScheduleSchema.extend({
|
|
23
|
-
user: UserSchema
|
|
23
|
+
user: UserSchema,
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
export const EmployeeScheduleExtendedListSchema = z.object({
|
package/schemas/index.ts
CHANGED
|
@@ -46,6 +46,7 @@ export * from './error-message.schema';
|
|
|
46
46
|
export * from './file';
|
|
47
47
|
export * from './i18n/localized-name.schema';
|
|
48
48
|
export * from './integration';
|
|
49
|
+
export * from './measure-unit';
|
|
49
50
|
export * from './message';
|
|
50
51
|
export * from './messenger-profile';
|
|
51
52
|
export * from './money-account';
|
|
@@ -70,9 +71,9 @@ export * from './package/package.schema';
|
|
|
70
71
|
export * from './package/validate-package.schema';
|
|
71
72
|
export * from './pagination-request.schema';
|
|
72
73
|
export * from './parser';
|
|
73
|
-
export * from './payment-invoice/payment-invoice.schema';
|
|
74
74
|
export * from './payment-invoice/create-payment-invoice-request.schema';
|
|
75
75
|
export * from './payment-invoice/create-payment-invoice-response.schema';
|
|
76
|
+
export * from './payment-invoice/payment-invoice.schema';
|
|
76
77
|
export * from './positive-decimal4.schema';
|
|
77
78
|
export * from './positive-money.schema';
|
|
78
79
|
export * from './pre-order';
|
|
@@ -106,13 +107,13 @@ export * from './report/user-activity-by-section.schema';
|
|
|
106
107
|
export * from './report/user-activity-summary-row.schema';
|
|
107
108
|
export * from './report/user-activity-timeline-row.schema';
|
|
108
109
|
export * from './service/service.schema';
|
|
109
|
-
export * from './settings/settings.schema';
|
|
110
|
-
export * from './settings/settings-private.schema';
|
|
111
|
-
export * from './settings/settings-private-response.schema';
|
|
112
110
|
export * from './settings/city-delivery-pricing-rule.schema';
|
|
113
111
|
export * from './settings/default-delivery-pricing-rule.schema';
|
|
114
|
-
export * from './settings/group-delivery-pricing-rule.schema';
|
|
115
112
|
export * from './settings/delivery-pricing-tiers.schema';
|
|
113
|
+
export * from './settings/group-delivery-pricing-rule.schema';
|
|
114
|
+
export * from './settings/settings-private-response.schema';
|
|
115
|
+
export * from './settings/settings-private.schema';
|
|
116
|
+
export * from './settings/settings.schema';
|
|
116
117
|
export * from './transaction';
|
|
117
118
|
export * from './transaction/transaction-list.schema';
|
|
118
119
|
export * from './transaction/transaction.schema';
|
|
@@ -129,7 +130,6 @@ export * from './write-off/write-off-archive-file.schema';
|
|
|
129
130
|
export * from './write-off/write-off-export.schema';
|
|
130
131
|
export * from './write-off/write-off-list.schema';
|
|
131
132
|
export * from './write-off/write-off.schema';
|
|
132
|
-
export * from './measure-unit';
|
|
133
133
|
|
|
134
134
|
export * from './integration/one-c/update-one-c-settings-request.schema';
|
|
135
135
|
export * from './integration/one-c/update-one-c-settings-response.schema';
|
|
@@ -146,9 +146,31 @@ export * from './integration/moysklad';
|
|
|
146
146
|
|
|
147
147
|
export * from './company-legal-profile';
|
|
148
148
|
|
|
149
|
+
export * from './company/create-company-request.schema';
|
|
150
|
+
export * from './company/create-company-response.schema';
|
|
149
151
|
export * from './order/create-order-request.schema';
|
|
150
152
|
export * from './order/create-order-response.schema';
|
|
151
153
|
export * from './order/update-order-request.schema';
|
|
152
154
|
export * from './order/update-order-response.schema';
|
|
153
|
-
|
|
154
|
-
export * from './
|
|
155
|
+
|
|
156
|
+
export * from './auth';
|
|
157
|
+
export * from './company';
|
|
158
|
+
export * from './company/get-company-list-request.schema';
|
|
159
|
+
export * from './domain/get-domain-list-request.schema';
|
|
160
|
+
export * from './domain/get-domain-list-response.schema';
|
|
161
|
+
export * from './session/session.schema';
|
|
162
|
+
export * from './session/validate-session-s2s-request.schema';
|
|
163
|
+
export * from './session/validate-session-s2s-response.schema';
|
|
164
|
+
export * from './session/validate-ws-ticket-s2s-request.schema';
|
|
165
|
+
export * from './session/validated-session-user.schema';
|
|
166
|
+
export * from './work-session/create-many-work-session-request.schema';
|
|
167
|
+
export * from './work-session/create-many-work-session-response.schema';
|
|
168
|
+
export * from './work-session/create-work-session-for-employee.schema';
|
|
169
|
+
export * from './work-session/create-work-session.schema';
|
|
170
|
+
export * from './work-session/export-overtime-request.schema';
|
|
171
|
+
export * from './work-session/export-overtime-response.schema';
|
|
172
|
+
export * from './work-session/overtime-file.schema';
|
|
173
|
+
export * from './work-session/update-work-session.schema';
|
|
174
|
+
export * from './work-session/work-session-date.schema';
|
|
175
|
+
export * from './work-session/work-session-extended-list.schema';
|
|
176
|
+
export * from './work-session/work-session-extended.schema';
|
|
@@ -6,7 +6,7 @@ export const UpdateGroupProductUpdateBatchRequestDataSchema = z.object({
|
|
|
6
6
|
name: z.string(),
|
|
7
7
|
categoryUUID: z.string(),
|
|
8
8
|
price: MoneySchema,
|
|
9
|
-
costPrice: MoneySchema,
|
|
9
|
+
costPrice: MoneySchema.nullable(),
|
|
10
10
|
color: z.string().nullable(),
|
|
11
11
|
size: z.string().nullable(),
|
|
12
12
|
multiplicity: z.coerce.number(),
|