using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using ExpressiveAnnotations.Attributes;
using ILM.Services.API.Models.Helpers.ValidationHelpers;
using Newtonsoft.Json.Converters;
namespace ILM.Services.API.Models.DataObjects
public class QuoteRequest
public static class ValidationError
public static readonly string CoverStartDate_Required = "Cover Start Date is required.";
public static readonly string CoverStartDate_DataType = "Invalid date format.";
public static readonly string CoverStartDate_Range = "The Cover Start Date is falls outside the unacceptable bounds.";
[Required(ErrorMessage = "Cover Start Date is required.")]
[DataType(DataType.Date, ErrorMessage = "Invalid date format.")]
[CoverStartDate(ErrorMessage = "The Cover Start Date is falls outside the unacceptable bounds.")]
public DateTime CoverStartDate { get; set; }
public static readonly string Currency_Required = "Currency is required.";
public static readonly string Currency_DataType = "Invalid date format.";
[JsonConverter(typeof(StringEnumConverter))]
[EnumDataType(typeof(Currency), ErrorMessage = "Invalid Currency.")]
[Required(ErrorMessage = "Currency is required.")]
public Currency Currency { get; set; }
*********************************************************************************
[EnumDataType(typeof(HealthPlan), ErrorMessage = "Invalid Health Plan Category")]
[Required(ErrorMessage = "A Health Plan Category is required.")]
public HealthPlan HealthPlanCategory { get; set; }
[EnumDataType(typeof(Product), ErrorMessage = "Invalid product")]
[Required(ErrorMessage = "A Product is required.")]
public Product Product { get; set; }
public Product ExcessView_Product { get; set; }
[RequiredIf("HealthPlanCategory == HealthPlan.IHPIndividual",
ErrorMessage = "Area of cover is required for IHP products")]
[EnumDataType(typeof(CoverageArea), ErrorMessage = "Invalid area of cover")]
public CoverageArea? AreaOfCover { get; set; }
[EnumDataType(typeof(UnderwritingStyle), ErrorMessage = "Invalid Underwriting Style")]
[Required(ErrorMessage = "An Underwriting Style is required.")]
public UnderwritingStyle UnderwritingStyleId { get; set; }
public bool IncludeTravel { get; set; }
public bool IncludeHospital { get; set; }
public bool IncludeDental { get; set; }
[RequiredIf("HealthPlanCategory == HealthPlan.IHPIndividual",
ErrorMessage = "Country of residence is required for IHP products")]
public int? CountryOfResidenceId { get; set; }
public string CountryOfResidence { get; set; }
[RequiredIf("HealthPlanCategory == HealthPlan.TIHPIndividual",
ErrorMessage = "Island is required for TIHP (Islands) products")]
[EnumDataType(typeof(Island))]
public Island? Island { get; set; }
[Required(ErrorMessage = "A Payment Frequency period is required.")]
[Range(1,3, ErrorMessage = "Invalid payment frequency period.")]
public int PaymentFrequencyId { get; set; }
[Required(ErrorMessage = "An Excess is required.")]
[Range(0, 5, ErrorMessage = "Invalid Excess.")]
public int Excess { get; set; }
[Range(0, 11, ErrorMessage = "Invalid number of months free.")]
public int MonthsFree { get; set; }
[Range(typeof(decimal), "0", "100", ErrorMessage = "Invalid Acquisition Channel Discount.")]
public decimal AcquisitionChannelDiscount { get; set; }
[Range(typeof(decimal), "0","100", ErrorMessage = "Invalid Cover Choice Discount.")]
public decimal CoverChoiceDiscount { get; set; }
[Range(typeof(decimal), "-1000", "1000", ErrorMessage = "Invalid Rating Adjustment Factor.")]
public decimal RatingAdjustmentFactor { get; set; }
[Range(typeof(decimal), "0", "100", ErrorMessage = "Invalid Manual Adjustment Percentage.")]
public decimal ManualAdjustmentPercentage { get; set; }
[Range(typeof(decimal), "-1000", "1000", ErrorMessage = "Invalid (Fixed) Manual Adjustment.")]
public decimal ManualAdjustmentFixed { get; set; }
public Prospect Prospect { get; set; }
public List<Dependant> Dependants { get; set; }
public override string ToString()
return this.ReportAllProperties();