import Joi from 'joi';
import { CustomsContentTypesSchema } from './customs-content-types-schema';
import { CustomsNonDeliverySchema } from './customs-non-delivery-schema';
import { CustomsItemSchema } from './customs-item-schema';
import { CurrencySchema } from '../currency-schema';
import { TermsOfTradeCodeSchema } from '../inconterms/terms-of-trade-code-schema';
import { ImporterOfRecordSchema } from '../importer-records/importer-of-record-schema';
import { CustomsChargesSchema } from './customs-charges-schema';

export const CustomsSchema = Joi.object({
  contents: CustomsContentTypesSchema.optional(),
  non_delivery: CustomsNonDeliverySchema.optional(),
  customs_items: Joi.array().items(CustomsItemSchema).optional(),
  buyer_shipping_amount_paid: CurrencySchema.optional(),
  duties_paid: CurrencySchema.optional(),
  declaration: Joi.string().optional(),
  termsOfTradeCode: TermsOfTradeCodeSchema.optional(),
  importer_of_record: ImporterOfRecordSchema.optional(),
  invoice_additional_details: CustomsChargesSchema.optional(),
  contents_explanation: Joi.string().optional(),
});
