Spaces:
Sleeping
Sleeping
| import { z } from 'zod'; | |
| // レギュレーションチェックAPIのレスポンス型 | |
| // 実際のレスポンス構造に基づいて定義する必要がある | |
| export const regulationCheckResponseSchema = z.object({ | |
| // レギュレーションチェック済みのFVデータ | |
| regulated_fv: z.record(z.unknown()).optional(), | |
| // レギュレーションチェック済みのCNデータ | |
| regulated_cn: z.record(z.unknown()).optional(), | |
| // レギュレーションチェック済みのIntentデータ | |
| regulated_intent: z.array(z.unknown()).optional(), | |
| // チェック結果のサマリー | |
| summary: z.object({ | |
| total_changes: z.number().optional(), | |
| fv_changes: z.number().optional(), | |
| cn_changes: z.number().optional(), | |
| intent_changes: z.number().optional(), | |
| }).optional(), | |
| // エラー情報 | |
| errors: z.array(z.object({ | |
| field: z.string(), | |
| message: z.string(), | |
| })).optional(), | |
| // 成功フラグ | |
| success: z.boolean().optional(), | |
| // メッセージ | |
| message: z.string().optional(), | |
| }); | |
| export type RegulationCheckResponse = z.infer<typeof regulationCheckResponseSchema>; | |
| // レギュレーションチェックAPIのリクエスト型 | |
| export const regulationCheckRequestSchema = z.object({ | |
| commonDict: z.record(z.unknown()), | |
| proposal_fv: z.record(z.unknown()), | |
| proposal_cn: z.record(z.unknown()), | |
| proposal_intent: z.array(z.unknown()), | |
| replace_excel: z.instanceof(File), | |
| }); | |
| export type RegulationCheckRequest = z.infer<typeof regulationCheckRequestSchema>; |