import { z } from 'zod';

export const AzureConfigSchema = z.object({
  id: z.string(),
  tenantId: z.string(),
  clientId: z.string(),
  clientSecret: z.string(), // This will be encrypted
  keyVaultUrl: z.string().url(),
  isActive: z.boolean().default(true),
  updatedAt: z.string(),
  productId: z.string(),
});

export type AzureConfig = z.infer<typeof AzureConfigSchema>;

export const CreateAzureConfigSchema = AzureConfigSchema.partial({
  id: true,
  updatedAt: true,
  productId: true,
});

export type CreateAzureConfig = z.infer<typeof CreateAzureConfigSchema>;

export const UpdateAzureConfigSchema = CreateAzureConfigSchema.partial({
  tenantId: true,
  clientId: true,
}).strict();

export type UpdateAzureConfig = z.infer<typeof UpdateAzureConfigSchema>;
