@floristcloud/api-lib 1.2.194 → 1.2.195
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/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/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 +2 -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-purpose.enum.js +8 -0
- package/build/schemas/auth/index.js +31 -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/restore-access-token.schema.js +5 -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/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/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 +3 -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-purpose.enum.ts +4 -0
- package/package.json +1 -1
- package/schemas/auth/index.ts +15 -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/restore-access-token.schema.ts +3 -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,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 },
|
|
@@ -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,15 @@
|
|
|
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';
|
|
@@ -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'] });
|
|
@@ -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(),
|
|
@@ -9,7 +9,7 @@ export const UpdateProductRequestSchema = z.object({
|
|
|
9
9
|
balance: z.number(),
|
|
10
10
|
quantity: z.number(),
|
|
11
11
|
price: MoneySchema,
|
|
12
|
-
costPrice: MoneySchema,
|
|
12
|
+
costPrice: MoneySchema.nullish(),
|
|
13
13
|
multiplicity: z.number(),
|
|
14
14
|
isOpen: z.coerce.boolean(),
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ export const UpdateProductRequestSchema = z.object({
|
|
|
20
20
|
size: z.string().nullable(),
|
|
21
21
|
size2: z.string().nullable(),
|
|
22
22
|
size3: z.string().nullable(),
|
|
23
|
-
invoicePrice: MoneySchema.
|
|
23
|
+
invoicePrice: MoneySchema.nullish(),
|
|
24
24
|
invoiceNumber: z.string().nullable(),
|
|
25
25
|
imageUUID: z.string().nullable(),
|
|
26
26
|
country: z.string().nullable(),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UserRoleEnum, UserStatusEnum } from '../../enum';
|
|
3
|
+
export const ValidatedSessionUserSchema = z.object({
|
|
4
|
+
userUUID: z.string(),
|
|
5
|
+
companyUUID: z.string(),
|
|
6
|
+
email: z.string().nullable(),
|
|
7
|
+
phone: z.string().nullable(),
|
|
8
|
+
roles: z.array(z.nativeEnum(UserRoleEnum)),
|
|
9
|
+
status: z.nativeEnum(UserStatusEnum),
|
|
10
|
+
isGlobal: z.boolean(),
|
|
11
|
+
type: z.string().nullable(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PasswordSchema } from '../auth/password.schema';
|
|
3
|
+
import { UserRoleEnum } from '../../enum/userRole.enum';
|
|
4
|
+
|
|
5
|
+
export const CreateUserByClientIdDataSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
password: PasswordSchema,
|
|
8
|
+
name: z.string(),
|
|
9
|
+
email: z.email().toLowerCase().nullable().optional(),
|
|
10
|
+
phone: z.string().nullable().optional(),
|
|
11
|
+
roles: z.array(z.nativeEnum(UserRoleEnum)).optional().default([UserRoleEnum.BUYER]),
|
|
12
|
+
})
|
|
13
|
+
.refine(data => data.email || data.phone, { message: 'validation.emailOrPhoneRequired' });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UserSchema } from './user.schema';
|
|
3
|
+
import { PasswordSchema } from '../auth/password.schema';
|
|
4
|
+
import { AllowedUserRoleSchema } from './allowed-user-role.schema';
|
|
5
|
+
|
|
6
|
+
export const CreateUserForCompanyRequestSchema = UserSchema.pick({ email: true, phone: true, name: true }).extend({
|
|
7
|
+
roles: z.array(AllowedUserRoleSchema),
|
|
8
|
+
password: PasswordSchema,
|
|
9
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UserSchema } from './user.schema';
|
|
2
|
+
import { PasswordSchema } from '../auth/password.schema';
|
|
3
|
+
|
|
4
|
+
export const CreateUserGlobalRequestSchema = UserSchema.omit({
|
|
5
|
+
uuid: true,
|
|
6
|
+
createdAt: true,
|
|
7
|
+
updatedAt: true,
|
|
8
|
+
deletedAt: true,
|
|
9
|
+
companyUUID: true,
|
|
10
|
+
roles: true,
|
|
11
|
+
isGlobal: true,
|
|
12
|
+
status: true,
|
|
13
|
+
}).extend({ password: PasswordSchema });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PasswordSchema } from '../auth/password.schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { UserRoleEnum, UserStatusEnum } from '../../enum';
|
|
4
|
+
|
|
5
|
+
export const CreateUserSchema = z.object({
|
|
6
|
+
name: z.string(),
|
|
7
|
+
email: z.string(),
|
|
8
|
+
phone: z.string(),
|
|
9
|
+
password: PasswordSchema,
|
|
10
|
+
roles: z.array(z.nativeEnum(UserRoleEnum)).default([UserRoleEnum.BUYER]),
|
|
11
|
+
status: z.nativeEnum(UserStatusEnum).default(UserStatusEnum.INACTIVE),
|
|
12
|
+
});
|
package/schemas/user/index.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
export * from './user.schema';
|
|
2
2
|
export * from './user-contact-for-client.schema';
|
|
3
3
|
export * from './user-name.schema';
|
|
4
|
+
export * from './create-user.schema';
|
|
5
|
+
export * from './update-password-by-user-request.schema';
|
|
6
|
+
export * from './update-password-by-user-response.schema';
|
|
7
|
+
export * from './create-user-by-client-id-data.schema';
|
|
8
|
+
export * from './create-user-by-client-id-request.schema';
|
|
9
|
+
export * from './create-user-by-client-id-response.schema';
|
|
10
|
+
export * from './allowed-user-role.schema';
|
|
11
|
+
export * from './create-user-for-company-request.schema';
|
|
12
|
+
export * from './create-user-for-company-response.schema';
|
|
13
|
+
export * from './create-user-global-request.schema';
|
|
14
|
+
export * from './create-user-global-response.schema';
|
|
15
|
+
export * from './get-me-data.schema';
|
|
16
|
+
export * from './get-me-response.schema';
|
|
17
|
+
export * from './get-user-data.schema';
|
|
18
|
+
export * from './get-user-response.schema';
|