Added models for presentation layer with data annotations
This commit is contained in:
		| @@ -1,16 +1,40 @@ | ||||
| using Domains.VisaApplicationDomain; | ||||
| using System.ComponentModel.DataAnnotations; | ||||
| using ApplicationLayer.Services.VisaApplications.Models; | ||||
| using Domains; | ||||
| using Domains.VisaApplicationDomain; | ||||
|  | ||||
| namespace ApplicationLayer.Services.VisaApplications.Requests; | ||||
|  | ||||
| /// Model of visa request from user | ||||
| public record VisaApplicationCreateRequest( | ||||
|     ReentryPermit? ReentryPermit, | ||||
|     string DestinationCountry, | ||||
|     VisaCategory VisaCategory, | ||||
|     bool IsForGroup, | ||||
|     RequestedNumberOfEntries RequestedNumberOfEntries, | ||||
|     int ValidDaysRequested, | ||||
|     PastVisa[] PastVisas, | ||||
|     PermissionToDestCountry? PermissionToDestCountry, | ||||
|     PastVisit[] PastVisits | ||||
| ); | ||||
| public class VisaApplicationCreateRequest | ||||
| { | ||||
|  | ||||
|     [Required] | ||||
|     public ReentryPermitModel? ReentryPermit { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     [MaxLength(ConfigurationConstraints.CountryNameLength)] | ||||
|     public string DestinationCountry { get; set; } = null!; | ||||
|  | ||||
|     [Required] | ||||
|     public VisaCategory VisaCategory { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     public bool IsForGroup { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     public RequestedNumberOfEntries RequestedNumberOfEntries { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     [Range(0, ConfigurationConstraints.MaxValidDays)] | ||||
|     public int ValidDaysRequested { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     public PastVisaModel[] PastVisas { get; set; } = null!; | ||||
|  | ||||
|     [Required] | ||||
|     public PermissionToDestCountryModel? PermissionToDestCountry { get; set; } | ||||
|  | ||||
|     [Required] | ||||
|     public PastVisitModel[] PastVisits { get; set; } = null!; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user