turash/bugulma/frontend/schemas/symbiosis.ts

27 lines
923 B
TypeScript

import { z } from 'zod';
import { organizationSchema } from '@/schemas/organization';
// Enriched schema used in the UI after processing the Gemini response to include the full organization object
export const symbiosisMatchSchema = z.object({
id: z.string(),
reason: z.string(),
org: organizationSchema,
});
// Schema for showing connections between two organizations on the map
export const symbioticPairSchema = z.object({
source: organizationSchema,
target: organizationSchema,
});
// Schema for a confirmed or potential symbiotic link
export const symbiosisLinkSchema = z.object({
id: z.string(),
providerOrgId: z.string(),
consumerOrgId: z.string(),
resource: z.string(),
description: z.string().max(500, { error: 'Описание слишком длинное (макс. 500 символов).' }),
status: z.enum(['potential', 'active', 'inactive']),
startDate: z.date().optional(),
});