import { z } from 'zod';

/**
 * EN: Assign Role DTO
 * VI: DTO gán role
 */
export const AssignRoleDto = z.object({
  userId: z.string().min(1),
  roleId: z.string().min(1),
  expiresAt: z.string().datetime().optional(),
});

export type AssignRoleDto = z.infer<typeof AssignRoleDto>;

/**
 * EN: Grant Permission DTO
 * VI: DTO cấp quyền
 */
export const GrantPermissionDto = z.object({
  userId: z.string().min(1),
  permissionId: z.string().min(1),
  expiresAt: z.string().datetime().optional(),
});

export type GrantPermissionDto = z.infer<typeof GrantPermissionDto>;

/**
 * EN: Check Permission DTO
 * VI: DTO kiểm tra quyền
 */
export const CheckPermissionDto = z.object({
  resource: z.string().min(1),
  action: z.string().min(1),
  scope: z.string().optional(),
});

export type CheckPermissionDto = z.infer<typeof CheckPermissionDto>;
