feat(automations): ctx.tasks.sendMessage — сообщение в чат задачи от Системы; userId в triggerData status_changed

This commit is contained in:
2026-09-08 16:31:59 +03:00
parent 163351b345
commit 0b2319b11d
13 changed files with 171 additions and 32 deletions

View File

@@ -414,7 +414,9 @@ export function registerUserManagementRoutes(router: Router): void {
appRole: z.string().min(1, 'Выберите роль доступа'),
organizationalRoleIds: z.array(z.number()).optional(),
sendInvite: z.boolean().default(true),
statusId: z.union([z.number(), z.null()]).optional()
statusId: z.union([z.number(), z.null()]).optional(),
// Необязательный явный пароль; состав дополнительно проверяет hashPassword (400 с текстом правила)
password: z.string().min(8, 'Пароль должен содержать минимум 8 символов').optional()
})),
async (req: AuthenticatedRequest, res) => {
try {
@@ -427,7 +429,8 @@ export function registerUserManagementRoutes(router: Router): void {
appRole: req.body.appRole,
organizationalRoleIds: req.body.organizationalRoleIds,
sendInvite: req.body.sendInvite,
statusId: req.body.statusId ?? undefined
statusId: req.body.statusId ?? undefined,
password: req.body.password
});
if (result.success && result.user) {