// src/shared/contracts/system.ts
// Shared contracts for system feature (modules and role color schemes)

import { z } from 'zod';

export const hexColorSchema = z.string().regex(/^#[0-9A-Fa-f]{6}$/, 'Цвет должен быть в формате HEX (#RRGGBB)');

export const roleColorValueSchema = z.object({
  privateNormal: hexColorSchema,
  privateHigh: hexColorSchema,
  publicNormal: hexColorSchema,
  publicHigh: hexColorSchema,
});

export const roleColorSchema = z.object({
  id: z.string().uuid(),
  role: z.string(),
  ...roleColorValueSchema.shape,
  createdAt: z.string().or(z.date()),
  updatedAt: z.string().or(z.date()),
});

export const roleColorsResponseSchema = z.array(roleColorSchema);

export type RoleColorValue = z.infer<typeof roleColorValueSchema>;
export type RoleColor = z.infer<typeof roleColorSchema>;

