Untitled

mail@pastecode.io avatar
unknown
plain_text
23 days ago
924 B
9
Indexable
Never
import Joi from 'joi';

// Define MandatoryCover schema
const mandatoryCoverSchema = Joi.object({
    coverCode: Joi.string().required(),
    coverIncluded: Joi.boolean().required(),
    coverageLimit: Joi.number().required()
});

// Define CoverageDetails schema
const coverageDetailsSchema = Joi.object({
    ownershipCode: Joi.number().required(),
    nationalityCode: Joi.number().required(),
    mandatoryCovers: Joi.array().items(mandatoryCoverSchema).min(1).required()
});

// Define HomeInsuranceFormBody schema
const homeInsuranceFormBodySchema = Joi.object({
    coverageDetails: coverageDetailsSchema.required(),
    listedItems: Joi.object(),  // Define `ListedItems` schema if necessary
    propertyDetails: Joi.object(),  // Define `PropertyDetails` schema if necessary
    stage: Joi.string().optional(),
    error: Joi.object().optional()  // Define `ErrorVO` schema if necessary
});
Leave a Comment