diff --git a/Marechai.Data/Dtos/BasePhotoDto.cs b/Marechai.Data/Dtos/BasePhotoDto.cs index ff0d7274..5b6b3220 100644 --- a/Marechai.Data/Dtos/BasePhotoDto.cs +++ b/Marechai.Data/Dtos/BasePhotoDto.cs @@ -33,15 +33,15 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("aperture")] public double? Aperture { get; set; } [JsonPropertyName("author")] - public string Author { get; set; } + public string? Author { get; set; } [JsonPropertyName("camera_manufacturer")] - public string CameraManufacturer { get; set; } + public string? CameraManufacturer { get; set; } [JsonPropertyName("camera_model")] - public string CameraModel { get; set; } + public string? CameraModel { get; set; } [JsonPropertyName("colorspace")] public ColorSpace? ColorSpace { get; set; } [JsonPropertyName("comments")] - public string Comments { get; set; } + public string? Comments { get; set; } [JsonPropertyName("contrast")] public Contrast? Contrast { get; set; } [JsonPropertyName("creation_date")] @@ -49,7 +49,7 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("digital_zoom")] public double? DigitalZoomRatio { get; set; } [JsonPropertyName("exif_version")] - public string ExifVersion { get; set; } + public string? ExifVersion { get; set; } [JsonPropertyName("exposure")] public double? ExposureTime { get; set; } [JsonPropertyName("exposure_method")] @@ -69,7 +69,7 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("iso")] public ushort? IsoRating { get; set; } [JsonPropertyName("lens")] - public string Lens { get; set; } + public string? Lens { get; set; } [JsonPropertyName("light_source")] public LightSource? LightSource { get; set; } [JsonPropertyName("metering_mode")] @@ -87,7 +87,7 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("sharpness")] public Sharpness? Sharpness { get; set; } [JsonPropertyName("software")] - public string SoftwareUsed { get; set; } + public string? SoftwareUsed { get; set; } [JsonPropertyName("subject_distance_range")] public SubjectDistanceRange? SubjectDistanceRange { get; set; } [JsonPropertyName("upload_date")] @@ -97,9 +97,9 @@ public class BasePhotoDto : BaseDto [JsonPropertyName("white_balance")] public WhiteBalance? WhiteBalance { get; set; } [JsonPropertyName("user_id")] - public string UserId { get; set; } + public string? UserId { get; set; } [JsonPropertyName("license_name")] - public string LicenseName { get; set; } + public string? LicenseName { get; set; } [JsonPropertyName("license_id")] public int LicenseId { get; set; } [JsonPropertyName("original_extension")] diff --git a/Marechai.Data/Dtos/BaseScanDto.cs b/Marechai.Data/Dtos/BaseScanDto.cs index 8ecc59e2..b44a0f1d 100644 --- a/Marechai.Data/Dtos/BaseScanDto.cs +++ b/Marechai.Data/Dtos/BaseScanDto.cs @@ -31,25 +31,25 @@ namespace Marechai.Data.Dtos; public class BaseScanDto : BaseDto { [JsonPropertyName("author")] - public string Author { get; set; } + public string? Author { get; set; } [JsonPropertyName("colorspace")] public ColorSpace? ColorSpace { get; set; } [JsonPropertyName("comments")] - public string Comments { get; set; } + public string? Comments { get; set; } [JsonPropertyName("creation_date")] public DateTime? CreationDate { get; set; } [JsonPropertyName("exif_version")] - public string ExifVersion { get; set; } + public string? ExifVersion { get; set; } [JsonPropertyName("horizontal_resolution")] public double? HorizontalResolution { get; set; } [JsonPropertyName("resolution_unit")] public ResolutionUnit? ResolutionUnit { get; set; } [JsonPropertyName("scanner_manufacturer")] - public string ScannerManufacturer { get; set; } + public string? ScannerManufacturer { get; set; } [JsonPropertyName("scanner_model")] - public string ScannerModel { get; set; } + public string? ScannerModel { get; set; } [JsonPropertyName("software")] - public string SoftwareUsed { get; set; } + public string? SoftwareUsed { get; set; } [JsonPropertyName("upload_date")] public DateTime UploadDate { get; set; } [JsonPropertyName("vertical_resolution")] @@ -57,5 +57,5 @@ public class BaseScanDto : BaseDto [JsonPropertyName("original_extension")] public string OriginalExtension { get; set; } [JsonPropertyName("user_id")] - public string UserId { get; set; } + public string? UserId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BookByMachineDto.cs b/Marechai.Data/Dtos/BookByMachineDto.cs index 0b991186..f9904bba 100644 --- a/Marechai.Data/Dtos/BookByMachineDto.cs +++ b/Marechai.Data/Dtos/BookByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class BookByMachineDto : BaseDto { [JsonPropertyName("book_id")] + [Required] public long BookId { get; set; } [JsonPropertyName("book")] - public string Book { get; set; } + public string? Book { get; set; } [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("machine")] - public string Machine { get; set; } + public string? Machine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BookByMachineFamilyDto.cs b/Marechai.Data/Dtos/BookByMachineFamilyDto.cs index 62ec9709..0be4be1d 100644 --- a/Marechai.Data/Dtos/BookByMachineFamilyDto.cs +++ b/Marechai.Data/Dtos/BookByMachineFamilyDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class BookByMachineFamilyDto : BaseDto { [JsonPropertyName("book_id")] + [Required] public long BookId { get; set; } [JsonPropertyName("book")] - public string Book { get; set; } + public string? Book { get; set; } [JsonPropertyName("machine_family_id")] + [Required] public int MachineFamilyId { get; set; } [JsonPropertyName("machine_family")] - public string MachineFamily { get; set; } + public string? MachineFamily { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/BookDto.cs b/Marechai.Data/Dtos/BookDto.cs index 8b45eadb..8802598d 100644 --- a/Marechai.Data/Dtos/BookDto.cs +++ b/Marechai.Data/Dtos/BookDto.cs @@ -5,7 +5,7 @@ namespace Marechai.Data.Dtos; public class BookDto : DocumentBaseDto { [JsonPropertyName("isbn")] - public string Isbn { get; set; } + public string? Isbn { get; set; } [JsonPropertyName("pages")] public short? Pages { get; set; } [JsonPropertyName("edition")] diff --git a/Marechai.Data/Dtos/BookScanDto.cs b/Marechai.Data/Dtos/BookScanDto.cs index 6a384df9..a0822df5 100644 --- a/Marechai.Data/Dtos/BookScanDto.cs +++ b/Marechai.Data/Dtos/BookScanDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,7 +31,8 @@ namespace Marechai.Data.Dtos; public class BookScanDto : DocumentScanBaseDto { [JsonPropertyName("book_id")] + [Required] public long BookId { get; set; } [JsonPropertyName("book")] - public string Book { get; set; } + public string? Book { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyByBookDto.cs b/Marechai.Data/Dtos/CompanyByBookDto.cs index 21f2f087..b2bcdc1f 100644 --- a/Marechai.Data/Dtos/CompanyByBookDto.cs +++ b/Marechai.Data/Dtos/CompanyByBookDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,16 @@ namespace Marechai.Data.Dtos; public class CompanyByBookDto : BaseDto { [JsonPropertyName("company_id")] + [Required] public int CompanyId { get; set; } [JsonPropertyName("book_id")] + [Required] public long BookId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyByDocumentDto.cs b/Marechai.Data/Dtos/CompanyByDocumentDto.cs index 48e279e4..90e6234e 100644 --- a/Marechai.Data/Dtos/CompanyByDocumentDto.cs +++ b/Marechai.Data/Dtos/CompanyByDocumentDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,16 @@ namespace Marechai.Data.Dtos; public class CompanyByDocumentDto : BaseDto { [JsonPropertyName("company_id")] + [Required] public int CompanyId { get; set; } [JsonPropertyName("document_id")] + [Required] public long DocumentId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyByMagazineDto.cs b/Marechai.Data/Dtos/CompanyByMagazineDto.cs index 03c7d1d8..108d596a 100644 --- a/Marechai.Data/Dtos/CompanyByMagazineDto.cs +++ b/Marechai.Data/Dtos/CompanyByMagazineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,16 @@ namespace Marechai.Data.Dtos; public class CompanyByMagazineDto : BaseDto { [JsonPropertyName("company_id")] + [Required] public int CompanyId { get; set; } [JsonPropertyName("magazine_id")] + [Required] public long MagazineId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs b/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs index dde7c7bc..29d9ccbf 100644 --- a/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs +++ b/Marechai.Data/Dtos/CompanyBySoftwareFamilyDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,16 @@ namespace Marechai.Data.Dtos; public class CompanyBySoftwareFamilyDto : BaseDto { [JsonPropertyName("company_id")] + [Required] public int CompanyId { get; set; } [JsonPropertyName("software_family_id")] + [Required] public ulong SoftwareFamilyId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs b/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs index a02bd723..dc4a4299 100644 --- a/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs +++ b/Marechai.Data/Dtos/CompanyBySoftwareVariantDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,16 @@ namespace Marechai.Data.Dtos; public class CompanyBySoftwareVariantDto : BaseDto { [JsonPropertyName("company_id")] + [Required] public int CompanyId { get; set; } [JsonPropertyName("software_variant_id")] + [Required] public ulong SoftwareVariantId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs b/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs index 26b40c57..89e71c4d 100644 --- a/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs +++ b/Marechai.Data/Dtos/CompanyBySoftwareVersionDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,16 @@ namespace Marechai.Data.Dtos; public class CompanyBySoftwareVersionDto : BaseDto { [JsonPropertyName("company_id")] + [Required] public int CompanyId { get; set; } [JsonPropertyName("software_version_id")] + [Required] public ulong SoftwareVersionId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyDescriptionDto.cs b/Marechai.Data/Dtos/CompanyDescriptionDto.cs index 45ac17a2..29305c75 100644 --- a/Marechai.Data/Dtos/CompanyDescriptionDto.cs +++ b/Marechai.Data/Dtos/CompanyDescriptionDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,9 +31,11 @@ namespace Marechai.Data.Dtos; public class CompanyDescriptionDto : BaseDto { [JsonPropertyName("markdown")] - public string Markdown { get; set; } + [Required] + public required string Markdown { get; set; } [JsonPropertyName("html")] - public string Html { get; set; } + public string? Html { get; set; } [JsonPropertyName("company_id")] + [Required] public int CompanyId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/CompanyDto.cs b/Marechai.Data/Dtos/CompanyDto.cs index 4e83ecf0..92a253f1 100644 --- a/Marechai.Data/Dtos/CompanyDto.cs +++ b/Marechai.Data/Dtos/CompanyDto.cs @@ -33,27 +33,27 @@ public class CompanyDto : BaseDto { [JsonPropertyName("name")] [Required] - public string Name { get; set; } + public required string Name { get; set; } [JsonPropertyName("founded")] public DateTime? Founded { get; set; } [JsonPropertyName("website")] - public string Website { get; set; } + public string? Website { get; set; } [JsonPropertyName("twitter")] - public string Twitter { get; set; } + public string? Twitter { get; set; } [JsonPropertyName("facebook")] - public string Facebook { get; set; } + public string? Facebook { get; set; } [JsonPropertyName("sold")] public DateTime? Sold { get; set; } [JsonPropertyName("sold_to_id")] public int? SoldToId { get; set; } [JsonPropertyName("address")] - public string Address { get; set; } + public string? Address { get; set; } [JsonPropertyName("city")] - public string City { get; set; } + public string? City { get; set; } [JsonPropertyName("province")] - public string Province { get; set; } + public string? Province { get; set; } [JsonPropertyName("postal_code")] - public string PostalCode { get; set; } + public string? PostalCode { get; set; } [JsonPropertyName("country_id")] public short? CountryId { get; set; } [JsonPropertyName("status")] @@ -61,9 +61,9 @@ public class CompanyDto : BaseDto [JsonPropertyName("last_logo")] public Guid? LastLogo { get; set; } [JsonPropertyName("sold_to")] - public string SoldTo { get; set; } + public string? SoldTo { get; set; } [JsonPropertyName("country")] - public string Country { get; set; } + public string? Country { get; set; } [JsonPropertyName("founded_day_is_unknown")] public bool FoundedDayIsUnknown { get; set; } [JsonPropertyName("founded_month_is_unknown")] @@ -73,7 +73,7 @@ public class CompanyDto : BaseDto [JsonPropertyName("sold_month_is_unknown")] public bool SoldMonthIsUnknown { get; set; } [JsonPropertyName("legal_name")] - public string LegalName { get; set; } + public string? LegalName { get; set; } [JsonIgnore] public string SoldView => Status != CompanyStatus.Active && Status != CompanyStatus.Unknown ? Sold?.ToShortDateString() ?? "Unknown" diff --git a/Marechai.Data/Dtos/CurrencyInflationDto.cs b/Marechai.Data/Dtos/CurrencyInflationDto.cs index ded02575..3a1bb187 100644 --- a/Marechai.Data/Dtos/CurrencyInflationDto.cs +++ b/Marechai.Data/Dtos/CurrencyInflationDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,9 +31,10 @@ namespace Marechai.Data.Dtos; public class CurrencyInflationDto : BaseDto { [JsonPropertyName("code")] - public string CurrencyCode { get; set; } + [Required] + public required string CurrencyCode { get; set; } [JsonPropertyName("name")] - public string CurrencyName { get; set; } + public string? CurrencyName { get; set; } [JsonPropertyName("year")] public uint Year { get; set; } [JsonPropertyName("inflation")] diff --git a/Marechai.Data/Dtos/CurrencyPeggingDto.cs b/Marechai.Data/Dtos/CurrencyPeggingDto.cs index e116c50c..91fd1c5d 100644 --- a/Marechai.Data/Dtos/CurrencyPeggingDto.cs +++ b/Marechai.Data/Dtos/CurrencyPeggingDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,15 @@ namespace Marechai.Data.Dtos; public class CurrencyPeggingDto : BaseDto { [JsonPropertyName("source_code")] - public string SourceCode { get; set; } + [Required] + public required string SourceCode { get; set; } [JsonPropertyName("destination_code")] - public string DestinationCode { get; set; } + [Required] + public required string DestinationCode { get; set; } [JsonPropertyName("source_name")] - public string SourceName { get; set; } + public string? SourceName { get; set; } [JsonPropertyName("destination_name")] - public string DestinationName { get; set; } + public string? DestinationName { get; set; } [JsonPropertyName("ratio")] public float Ratio { get; set; } [JsonPropertyName("start")] diff --git a/Marechai.Data/Dtos/DocumentBaseDto.cs b/Marechai.Data/Dtos/DocumentBaseDto.cs index 99d7aaa1..eb1f7c55 100644 --- a/Marechai.Data/Dtos/DocumentBaseDto.cs +++ b/Marechai.Data/Dtos/DocumentBaseDto.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -5,15 +6,16 @@ namespace Marechai.Data.Dtos; public abstract class DocumentBaseDto : BaseDto { [JsonPropertyName("title")] - public string Title { get; set; } + [Required] + public required string Title { get; set; } [JsonPropertyName("native_title")] - public string NativeTitle { get; set; } + public string? NativeTitle { get; set; } [JsonPropertyName("published")] public DateTime? Published { get; set; } [JsonPropertyName("country_id")] public short? CountryId { get; set; } [JsonPropertyName("country")] - public string Country { get; set; } + public string? Country { get; set; } [JsonPropertyName("synopsis")] - public string Synopsis { get; set; } + public string? Synopsis { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentByMachineDto.cs b/Marechai.Data/Dtos/DocumentByMachineDto.cs index 0ed4b9d0..bbaa2879 100644 --- a/Marechai.Data/Dtos/DocumentByMachineDto.cs +++ b/Marechai.Data/Dtos/DocumentByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class DocumentByMachineDto : BaseDto { [JsonPropertyName("document_id")] + [Required] public long DocumentId { get; set; } [JsonPropertyName("document")] - public string Document { get; set; } + public string? Document { get; set; } [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("machine")] - public string Machine { get; set; } + public string? Machine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs b/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs index a6884eef..6db4dda8 100644 --- a/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs +++ b/Marechai.Data/Dtos/DocumentByMachineFamilyDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class DocumentByMachineFamilyDto : BaseDto { [JsonPropertyName("document_id")] + [Required] public long DocumentId { get; set; } [JsonPropertyName("document")] - public string Document { get; set; } + public string? Document { get; set; } [JsonPropertyName("machine_family_id")] + [Required] public int MachineFamilyId { get; set; } [JsonPropertyName("machine_family")] - public string MachineFamily { get; set; } + public string? MachineFamily { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentCompanyDto.cs b/Marechai.Data/Dtos/DocumentCompanyDto.cs index 9c3eea03..f0aa5bb6 100644 --- a/Marechai.Data/Dtos/DocumentCompanyDto.cs +++ b/Marechai.Data/Dtos/DocumentCompanyDto.cs @@ -31,10 +31,10 @@ namespace Marechai.Data.Dtos; public class DocumentCompanyDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } [DisplayName("Linked company")] [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("company_id")] public int? CompanyId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentPersonDto.cs b/Marechai.Data/Dtos/DocumentPersonDto.cs index bc949b61..79165d6a 100644 --- a/Marechai.Data/Dtos/DocumentPersonDto.cs +++ b/Marechai.Data/Dtos/DocumentPersonDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,17 +31,18 @@ namespace Marechai.Data.Dtos; public class DocumentPersonDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("person")] - public string Person { get; set; } + public string? Person { get; set; } [JsonPropertyName("person_id")] public int? PersonId { get; set; } [JsonPropertyName("alias")] - public string Alias { get; set; } + public string? Alias { get; set; } [JsonPropertyName("surname")] - public string Surname { get; set; } + public string? Surname { get; set; } [JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; diff --git a/Marechai.Data/Dtos/DocumentRoleDto.cs b/Marechai.Data/Dtos/DocumentRoleDto.cs index a61ed16d..c66bfc22 100644 --- a/Marechai.Data/Dtos/DocumentRoleDto.cs +++ b/Marechai.Data/Dtos/DocumentRoleDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,7 +31,8 @@ namespace Marechai.Data.Dtos; public class DocumentRoleDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("enabled")] public bool Enabled { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DocumentScanDto.cs b/Marechai.Data/Dtos/DocumentScanDto.cs index 3872353f..faeabefe 100644 --- a/Marechai.Data/Dtos/DocumentScanDto.cs +++ b/Marechai.Data/Dtos/DocumentScanDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,7 +31,8 @@ namespace Marechai.Data.Dtos; public class DocumentScanDto : DocumentScanBaseDto { [JsonPropertyName("document_id")] + [Required] public long DocumentId { get; set; } [JsonPropertyName("document")] - public string Document { get; set; } + public string? Document { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/DumpDto.cs b/Marechai.Data/Dtos/DumpDto.cs index 73c130fe..8f785c2c 100644 --- a/Marechai.Data/Dtos/DumpDto.cs +++ b/Marechai.Data/Dtos/DumpDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,19 +31,20 @@ namespace Marechai.Data.Dtos; public class DumpDto : BaseDto { [JsonPropertyName("dumper")] - public string Dumper { get; set; } + [Required] + public required string Dumper { get; set; } [JsonPropertyName("user_id")] - public string UserId { get; set; } + public string? UserId { get; set; } [JsonPropertyName("dumping_group")] - public string DumpingGroup { get; set; } + public string? DumpingGroup { get; set; } [JsonPropertyName("dump_date")] public DateTime? DumpDate { get; set; } [JsonPropertyName("username")] - public string UserName { get; set; } + public string? UserName { get; set; } [JsonPropertyName("media_id")] public ulong MediaId { get; set; } [JsonPropertyName("media_title")] - public string MediaTitle { get; set; } + public string? MediaTitle { get; set; } [JsonPropertyName("media_dump_id")] public ulong MediaDumpId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/GpuByMachineDto.cs b/Marechai.Data/Dtos/GpuByMachineDto.cs index e6332525..1ef51b70 100644 --- a/Marechai.Data/Dtos/GpuByMachineDto.cs +++ b/Marechai.Data/Dtos/GpuByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class GpuByMachineDto : BaseDto { [JsonPropertyName("gpu_id")] + [Required] public int GpuId { get; set; } [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("company")] - public string CompanyName { get; set; } + public string? CompanyName { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/GpuDto.cs b/Marechai.Data/Dtos/GpuDto.cs index a278febc..e5a76e2e 100644 --- a/Marechai.Data/Dtos/GpuDto.cs +++ b/Marechai.Data/Dtos/GpuDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,19 +31,20 @@ namespace Marechai.Data.Dtos; public class GpuDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("company_id")] public int? CompanyId { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("model_code")] - public string ModelCode { get; set; } + public string? ModelCode { get; set; } [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } [JsonPropertyName("package")] - public string Package { get; set; } + public string? Package { get; set; } [JsonPropertyName("process")] - public string Process { get; set; } + public string? Process { get; set; } [JsonPropertyName("process_nm")] public float? ProcessNm { get; set; } [JsonPropertyName("die_size")] diff --git a/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs b/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs index 7c0d4032..ca9d13fe 100644 --- a/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs +++ b/Marechai.Data/Dtos/InstructionSetExtensionByProcessorDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class InstructionSetExtensionByProcessorDto : BaseDto { [JsonPropertyName("extensions")] - public string Extension { get; set; } + public string? Extension { get; set; } [JsonPropertyName("processor")] - public string Processor { get; set; } + public string? Processor { get; set; } [JsonPropertyName("processor_id")] + [Required] public int ProcessorId { get; set; } [JsonPropertyName("extension_id")] + [Required] public int ExtensionId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MachineDto.cs b/Marechai.Data/Dtos/MachineDto.cs index 09b0be37..5a4e2962 100644 --- a/Marechai.Data/Dtos/MachineDto.cs +++ b/Marechai.Data/Dtos/MachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using Marechai.Database; @@ -31,9 +32,10 @@ namespace Marechai.Data.Dtos; public class MachineDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("model")] - public string Model { get; set; } + public string? Model { get; set; } [JsonPropertyName("company_id")] public int CompanyId { get; set; } [JsonPropertyName("company_logo")] @@ -43,18 +45,18 @@ public class MachineDto : BaseDto [JsonPropertyName("family_id")] public int? FamilyId { get; set; } [JsonPropertyName("family_name")] - public string FamilyName { get; set; } - public List Gpus { get; set; } - public List Memory { get; set; } - public List Processors { get; set; } - public List SoundSynthesizers { get; set; } - public List Storage { get; set; } + public string? FamilyName { get; set; } + public List? Gpus { get; set; } + public List? Memory { get; set; } + public List? Processors { get; set; } + public List? SoundSynthesizers { get; set; } + public List? Storage { get; set; } [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("type")] public MachineType Type { get; set; } [JsonPropertyName("family")] - public string Family { get; set; } + public string? Family { get; set; } [JsonIgnore] public string IntroducedView => Introduced?.Year == 1000 ? "Prototype" : Introduced?.ToShortDateString() ?? "Unknown"; diff --git a/Marechai.Data/Dtos/MachineFamilyDto.cs b/Marechai.Data/Dtos/MachineFamilyDto.cs index f479016c..0b12c8a5 100644 --- a/Marechai.Data/Dtos/MachineFamilyDto.cs +++ b/Marechai.Data/Dtos/MachineFamilyDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,9 +31,10 @@ namespace Marechai.Data.Dtos; public class MachineFamilyDto : BaseDto { [JsonPropertyName("company")] - public string Company { get; set; } + public string? Company { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("company_id")] public int CompanyId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MachinePhotoDto.cs b/Marechai.Data/Dtos/MachinePhotoDto.cs index a4fc51c5..fa470688 100644 --- a/Marechai.Data/Dtos/MachinePhotoDto.cs +++ b/Marechai.Data/Dtos/MachinePhotoDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,12 @@ namespace Marechai.Data.Dtos; public class MachinePhotoDto : BasePhotoDto { [JsonPropertyName("source")] - public string Source { get; set; } + public string? Source { get; set; } [JsonPropertyName("machine_name")] - public string MachineName { get; set; } + public string? MachineName { get; set; } [JsonPropertyName("machine_company_name")] - public string MachineCompanyName { get; set; } + public string? MachineCompanyName { get; set; } [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineByMachineDto.cs b/Marechai.Data/Dtos/MagazineByMachineDto.cs index a61c6fb6..938fdb8e 100644 --- a/Marechai.Data/Dtos/MagazineByMachineDto.cs +++ b/Marechai.Data/Dtos/MagazineByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class MagazineByMachineDto : BaseDto { [JsonPropertyName("magazine_id")] + [Required] public long MagazineId { get; set; } [JsonPropertyName("magazine")] - public string Magazine { get; set; } + public string? Magazine { get; set; } [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("machine")] - public string Machine { get; set; } + public string? Machine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs b/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs index b2886a94..bd325d76 100644 --- a/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs +++ b/Marechai.Data/Dtos/MagazineByMachineFamilyDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class MagazineByMachineFamilyDto : BaseDto { [JsonPropertyName("magazine_id")] + [Required] public long MagazineId { get; set; } [JsonPropertyName("magazine")] - public string Magazine { get; set; } + public string? Magazine { get; set; } [JsonPropertyName("machine_family_id")] + [Required] public int MachineFamilyId { get; set; } [JsonPropertyName("machine_family")] - public string MachineFamily { get; set; } + public string? MachineFamily { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineDto.cs b/Marechai.Data/Dtos/MagazineDto.cs index 914a1dd0..9d0a5563 100644 --- a/Marechai.Data/Dtos/MagazineDto.cs +++ b/Marechai.Data/Dtos/MagazineDto.cs @@ -30,7 +30,7 @@ namespace Marechai.Data.Dtos; public class MagazineDto : DocumentBaseDto { [JsonPropertyName("issn")] - public string Issn { get; set; } + public string? Issn { get; set; } [JsonPropertyName("first_publication")] public DateTime? FirstPublication { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MagazineIssueDto.cs b/Marechai.Data/Dtos/MagazineIssueDto.cs index baed690b..86cded68 100644 --- a/Marechai.Data/Dtos/MagazineIssueDto.cs +++ b/Marechai.Data/Dtos/MagazineIssueDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,17 +31,18 @@ namespace Marechai.Data.Dtos; public class MagazineIssueDto : BaseDto { [JsonPropertyName("magazine_id")] + [Required] public long MagazineId { get; set; } [JsonPropertyName("magazine_title")] - public string MagazineTitle { get; set; } + public string? MagazineTitle { get; set; } [JsonPropertyName("caption")] - public string Caption { get; set; } + public string? Caption { get; set; } [JsonPropertyName("native_caption")] - public string NativeCaption { get; set; } + public string? NativeCaption { get; set; } [JsonPropertyName("published")] public DateTime? Published { get; set; } [JsonPropertyName("product_code")] - public string ProductCode { get; set; } + public string? ProductCode { get; set; } [JsonPropertyName("pages")] public short? Pages { get; set; } [JsonPropertyName("issue_number")] diff --git a/Marechai.Data/Dtos/MagazineScanDto.cs b/Marechai.Data/Dtos/MagazineScanDto.cs index 408852ce..e8a6ddd6 100644 --- a/Marechai.Data/Dtos/MagazineScanDto.cs +++ b/Marechai.Data/Dtos/MagazineScanDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,7 +31,8 @@ namespace Marechai.Data.Dtos; public class MagazineScanDto : DocumentScanBaseDto { [JsonPropertyName("magazine_id")] + [Required] public long MagazineId { get; set; } [JsonPropertyName("magazine")] - public string Magazine { get; set; } + public string? Magazine { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/MediaDto.cs b/Marechai.Data/Dtos/MediaDto.cs index 84c500b1..742a57ae 100644 --- a/Marechai.Data/Dtos/MediaDto.cs +++ b/Marechai.Data/Dtos/MediaDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using Aaru.CommonTypes; using Marechai.Database; @@ -33,7 +34,8 @@ namespace Marechai.Data.Dtos; public class MediaDto : BaseDto { [JsonPropertyName("title")] - public string Title { get; set; } + [Required] + public required string Title { get; set; } [JsonPropertyName("sequence")] public ushort? Sequence { get; set; } [JsonPropertyName("last_sequence")] @@ -55,31 +57,31 @@ public class MediaDto : BaseDto [JsonPropertyName("size")] public ulong Size { get; set; } [JsonPropertyName("copy_protection")] - public string CopyProtection { get; set; } + public string? CopyProtection { get; set; } [JsonPropertyName("part_number")] - public string PartNumber { get; set; } + public string? PartNumber { get; set; } [JsonPropertyName("serial_number")] - public string SerialNumber { get; set; } + public string? SerialNumber { get; set; } [JsonPropertyName("barcode")] - public string Barcode { get; set; } + public string? Barcode { get; set; } [JsonPropertyName("catalogue_number")] - public string CatalogueNumber { get; set; } + public string? CatalogueNumber { get; set; } [JsonPropertyName("manufacturer")] - public string Manufacturer { get; set; } + public string? Manufacturer { get; set; } [JsonPropertyName("model")] - public string Model { get; set; } + public string? Model { get; set; } [JsonPropertyName("revision")] - public string Revision { get; set; } + public string? Revision { get; set; } [JsonPropertyName("firmware")] - public string Firmware { get; set; } + public string? Firmware { get; set; } [JsonPropertyName("physical_block_size")] public int? PhysicalBlockSize { get; set; } [JsonPropertyName("logical_block_size")] public int? LogicalBlockSize { get; set; } [JsonPropertyName("block_sizes")] - public VariableBlockSize[] BlockSizes { get; set; } + public VariableBlockSize[]? BlockSizes { get; set; } [JsonPropertyName("storage_interface")] public StorageInterface? StorageInterface { get; set; } [JsonPropertyName("table_of_contents")] - public OpticalDiscTrack[] TableOfContents { get; set; } + public OpticalDiscTrack[]? TableOfContents { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonByBookDto.cs b/Marechai.Data/Dtos/PersonByBookDto.cs index 7bb5b114..934ef52d 100644 --- a/Marechai.Data/Dtos/PersonByBookDto.cs +++ b/Marechai.Data/Dtos/PersonByBookDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,21 +31,24 @@ namespace Marechai.Data.Dtos; public class PersonByBookDto : BaseDto { [JsonPropertyName("person_id")] + [Required] public int PersonId { get; set; } [JsonPropertyName("book_id")] + [Required] public long BookId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } [JsonPropertyName("alias")] - public string Alias { get; set; } + public string? Alias { get; set; } [JsonPropertyName("surname")] - public string Surname { get; set; } + public string? Surname { get; set; } [JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonByDocumentDto.cs b/Marechai.Data/Dtos/PersonByDocumentDto.cs index 21708272..fae04efa 100644 --- a/Marechai.Data/Dtos/PersonByDocumentDto.cs +++ b/Marechai.Data/Dtos/PersonByDocumentDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,21 +31,24 @@ namespace Marechai.Data.Dtos; public class PersonByDocumentDto : BaseDto { [JsonPropertyName("person_id")] + [Required] public int PersonId { get; set; } [JsonPropertyName("document_id")] + [Required] public long DocumentId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } [JsonPropertyName("alias")] - public string Alias { get; set; } + public string? Alias { get; set; } [JsonPropertyName("surname")] - public string Surname { get; set; } + public string? Surname { get; set; } [JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonByMagazineDto.cs b/Marechai.Data/Dtos/PersonByMagazineDto.cs index 4c5c2668..f4a9567a 100644 --- a/Marechai.Data/Dtos/PersonByMagazineDto.cs +++ b/Marechai.Data/Dtos/PersonByMagazineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,21 +31,24 @@ namespace Marechai.Data.Dtos; public class PersonByMagazineDto : BaseDto { [JsonPropertyName("person_id")] + [Required] public int PersonId { get; set; } [JsonPropertyName("magazine_id")] + [Required] public long MagazineId { get; set; } [JsonPropertyName("role_id")] - public string RoleId { get; set; } + [Required] + public required string RoleId { get; set; } [JsonPropertyName("role")] - public string Role { get; set; } + public string? Role { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } [JsonPropertyName("alias")] - public string Alias { get; set; } + public string? Alias { get; set; } [JsonPropertyName("surname")] - public string Surname { get; set; } + public string? Surname { get; set; } [JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [JsonIgnore] public string FullName => DisplayName ?? Alias ?? $"{Name} {Surname}"; } \ No newline at end of file diff --git a/Marechai.Data/Dtos/PersonDto.cs b/Marechai.Data/Dtos/PersonDto.cs index b76d2047..93374ec0 100644 --- a/Marechai.Data/Dtos/PersonDto.cs +++ b/Marechai.Data/Dtos/PersonDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,27 +31,28 @@ namespace Marechai.Data.Dtos; public class PersonDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("surname")] - public string Surname { get; set; } + public string? Surname { get; set; } [JsonPropertyName("country")] - public string CountryOfBirth { get; set; } + public string? CountryOfBirth { get; set; } [JsonPropertyName("birthdate")] public DateTime BirthDate { get; set; } [JsonPropertyName("death_date")] public DateTime? DeathDate { get; set; } [JsonPropertyName("webpage")] - public string Webpage { get; set; } + public string? Webpage { get; set; } [JsonPropertyName("twitter")] - public string Twitter { get; set; } + public string? Twitter { get; set; } [JsonPropertyName("facebook")] - public string Facebook { get; set; } + public string? Facebook { get; set; } [JsonPropertyName("photo")] - public Guid Photo { get; set; } + public Guid? Photo { get; set; } [JsonPropertyName("alias")] - public string Alias { get; set; } + public string? Alias { get; set; } [JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string? DisplayName { get; set; } [JsonPropertyName("country_id")] public short? CountryOfBirthId { get; set; } [JsonIgnore] diff --git a/Marechai.Data/Dtos/ProcessorByMachineDto.cs b/Marechai.Data/Dtos/ProcessorByMachineDto.cs index 73cda466..2e8be1a6 100644 --- a/Marechai.Data/Dtos/ProcessorByMachineDto.cs +++ b/Marechai.Data/Dtos/ProcessorByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,15 @@ namespace Marechai.Data.Dtos; public class ProcessorByMachineDto : BaseDto { [JsonPropertyName("processor_id")] + [Required] public int ProcessorId { get; set; } [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("company")] - public string CompanyName { get; set; } + public string? CompanyName { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } [JsonPropertyName("speed")] public float? Speed { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ProcessorDto.cs b/Marechai.Data/Dtos/ProcessorDto.cs index b2b03f39..378dbdf7 100644 --- a/Marechai.Data/Dtos/ProcessorDto.cs +++ b/Marechai.Data/Dtos/ProcessorDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,17 +31,18 @@ namespace Marechai.Data.Dtos; public class ProcessorDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("company")] - public string CompanyName { get; set; } + public string? CompanyName { get; set; } [JsonPropertyName("model_code")] - public string ModelCode { get; set; } + public string? ModelCode { get; set; } [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } [JsonPropertyName("speed")] public double? Speed { get; set; } [JsonPropertyName("package")] - public string Package { get; set; } + public string? Package { get; set; } [JsonPropertyName("gprs")] public int? Gprs { get; set; } [JsonPropertyName("gpr_size")] @@ -54,7 +56,7 @@ public class ProcessorDto : BaseDto [JsonPropertyName("threads_per_core")] public int? ThreadsPerCore { get; set; } [JsonPropertyName("process")] - public string Process { get; set; } + public string? Process { get; set; } [JsonPropertyName("process_nm")] public float? ProcessNm { get; set; } [JsonPropertyName("die_size")] @@ -78,9 +80,9 @@ public class ProcessorDto : BaseDto [JsonPropertyName("l3")] public float? L3 { get; set; } [JsonPropertyName("instruction_set")] - public string InstructionSet { get; set; } + public string? InstructionSet { get; set; } [JsonPropertyName("instruction_set_extensions")] - public List InstructionSetExtensions { get; set; } + public List? InstructionSetExtensions { get; set; } [JsonPropertyName("company_id")] public int? CompanyId { get; set; } [JsonPropertyName("instruction_set_id")] diff --git a/Marechai.Data/Dtos/ResolutionByGpuDto.cs b/Marechai.Data/Dtos/ResolutionByGpuDto.cs index 4cb63dcb..24a6bbdf 100644 --- a/Marechai.Data/Dtos/ResolutionByGpuDto.cs +++ b/Marechai.Data/Dtos/ResolutionByGpuDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,9 +31,11 @@ namespace Marechai.Data.Dtos; public class ResolutionByGpuDto : BaseDto { [JsonPropertyName("resolution_id")] + [Required] public int ResolutionId { get; set; } [JsonPropertyName("gpu_id")] + [Required] public int GpuId { get; set; } [JsonPropertyName("resolution")] - public ResolutionDto Resolution { get; set; } + public ResolutionDto? Resolution { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ResolutionByScreenDto.cs b/Marechai.Data/Dtos/ResolutionByScreenDto.cs index 9917fe3a..f3f38658 100644 --- a/Marechai.Data/Dtos/ResolutionByScreenDto.cs +++ b/Marechai.Data/Dtos/ResolutionByScreenDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,9 +31,11 @@ namespace Marechai.Data.Dtos; public class ResolutionByScreenDto : BaseDto { [JsonPropertyName("resolution_id")] + [Required] public int ResolutionId { get; set; } [JsonPropertyName("screen_id")] + [Required] public int ScreenId { get; set; } [JsonPropertyName("resolution")] - public ResolutionDto Resolution { get; set; } + public ResolutionDto? Resolution { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ResolutionDto.cs b/Marechai.Data/Dtos/ResolutionDto.cs index e73fffa2..b8204b7e 100644 --- a/Marechai.Data/Dtos/ResolutionDto.cs +++ b/Marechai.Data/Dtos/ResolutionDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,16 +31,20 @@ namespace Marechai.Data.Dtos; public class ResolutionDto : BaseDto { [JsonPropertyName("width")] + [Required] public int Width { get; set; } [JsonPropertyName("height")] + [Required] public int Height { get; set; } [JsonPropertyName("colors")] public long? Colors { get; set; } [JsonPropertyName("palette")] public long? Palette { get; set; } [JsonPropertyName("chars")] + [Required] public bool Chars { get; set; } [JsonPropertyName("grayscale")] + [Required] public bool Grayscale { get; set; } [JsonIgnore] public long? PaletteView => Palette ?? Colors; diff --git a/Marechai.Data/Dtos/ScreenByMachineDto.cs b/Marechai.Data/Dtos/ScreenByMachineDto.cs index 785e2605..3c0d4fb6 100644 --- a/Marechai.Data/Dtos/ScreenByMachineDto.cs +++ b/Marechai.Data/Dtos/ScreenByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,9 +31,11 @@ namespace Marechai.Data.Dtos; public class ScreenByMachineDto : BaseDto { [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("screen")] - public ScreenDto Screen { get; set; } + public ScreenDto? Screen { get; set; } [JsonPropertyName("screen_id")] + [Required] public int ScreenId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/ScreenDto.cs b/Marechai.Data/Dtos/ScreenDto.cs index c40a7791..adf11a6d 100644 --- a/Marechai.Data/Dtos/ScreenDto.cs +++ b/Marechai.Data/Dtos/ScreenDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -34,15 +35,17 @@ public class ScreenDto : BaseDto [JsonPropertyName("height")] public double? Height { get; set; } [JsonPropertyName("diagonal")] + [Required] public double Diagonal { get; set; } [JsonPropertyName("native_resolution_id")] + [Required] public int NativeResolutionId { get; set; } [JsonPropertyName("native_resolution")] - public ResolutionDto NativeResolution { get; set; } + public ResolutionDto? NativeResolution { get; set; } [JsonPropertyName("effective_colors")] public long? EffectiveColors { get; set; } [JsonPropertyName("type")] - public string Type { get; set; } + public string? Type { get; set; } [JsonIgnore] public long? Colors => EffectiveColors ?? NativeResolution.Colors; diff --git a/Marechai.Data/Dtos/SoftwareFamilyDto.cs b/Marechai.Data/Dtos/SoftwareFamilyDto.cs index c96753ed..f225c303 100644 --- a/Marechai.Data/Dtos/SoftwareFamilyDto.cs +++ b/Marechai.Data/Dtos/SoftwareFamilyDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,12 @@ namespace Marechai.Data.Dtos; public class SoftwareFamilyDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } [JsonPropertyName("parent")] - public string Parent { get; set; } + public string? Parent { get; set; } [JsonPropertyName("parent_id")] public ulong? ParentId { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/SoftwareVariantDto.cs b/Marechai.Data/Dtos/SoftwareVariantDto.cs index d0ef5109..1953a494 100644 --- a/Marechai.Data/Dtos/SoftwareVariantDto.cs +++ b/Marechai.Data/Dtos/SoftwareVariantDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using Marechai.Database; @@ -31,19 +32,21 @@ namespace Marechai.Data.Dtos; public class SoftwareVariantDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("version")] - public string Version { get; set; } + public string? Version { get; set; } [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } [JsonPropertyName("parent_id")] public ulong? ParentId { get; set; } [JsonPropertyName("parent")] - public string Parent { get; set; } + public string? Parent { get; set; } [JsonPropertyName("version_id")] + [Required] public ulong SoftwareVersionId { get; set; } [JsonPropertyName("version")] - public string SoftwareVersion { get; set; } + public string? SoftwareVersion { get; set; } [JsonPropertyName("minimum_memory")] public ulong? MinimumMemory { get; set; } [JsonPropertyName("recommended_memory")] @@ -51,15 +54,15 @@ public class SoftwareVariantDto : BaseDto [JsonPropertyName("required_storage")] public ulong? RequiredStorage { get; set; } [JsonPropertyName("part_number")] - public string PartNumber { get; set; } + public string? PartNumber { get; set; } [JsonPropertyName("serial_number")] - public string SerialNumber { get; set; } + public string? SerialNumber { get; set; } [JsonPropertyName("product_code")] - public string ProductCode { get; set; } + public string? ProductCode { get; set; } [JsonPropertyName("catalogue_number")] - public string CatalogueNumber { get; set; } + public string? CatalogueNumber { get; set; } [JsonPropertyName("distribution_mode")] public DistributionMode DistributionMode { get; set; } [JsonPropertyName("family")] - public string Family { get; set; } + public string? Family { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/SoftwareVersionDto.cs b/Marechai.Data/Dtos/SoftwareVersionDto.cs index 872e71b2..f0a8ef6d 100644 --- a/Marechai.Data/Dtos/SoftwareVersionDto.cs +++ b/Marechai.Data/Dtos/SoftwareVersionDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,20 +31,22 @@ namespace Marechai.Data.Dtos; public class SoftwareVersionDto : BaseDto { [JsonPropertyName("family")] - public string Family { get; set; } + public string? Family { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("codename")] - public string Codename { get; set; } + public string? Codename { get; set; } [JsonPropertyName("version")] - public string Version { get; set; } + public string? Version { get; set; } [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } [JsonPropertyName("previous")] - public string Previous { get; set; } + public string? Previous { get; set; } [JsonPropertyName("license")] - public string License { get; set; } + public string? License { get; set; } [JsonPropertyName("family_id")] + [Required] public ulong FamilyId { get; set; } [JsonPropertyName("license_id")] public int? LicenseId { get; set; } diff --git a/Marechai.Data/Dtos/SoundSynthByMachineDto.cs b/Marechai.Data/Dtos/SoundSynthByMachineDto.cs index 0826e1bb..523a77a9 100644 --- a/Marechai.Data/Dtos/SoundSynthByMachineDto.cs +++ b/Marechai.Data/Dtos/SoundSynthByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,11 +31,13 @@ namespace Marechai.Data.Dtos; public class SoundSynthByMachineDto : BaseDto { [JsonPropertyName("sound_synth_id")] + [Required] public int SoundSynthId { get; set; } [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("company")] - public string CompanyName { get; set; } + public string? CompanyName { get; set; } [JsonPropertyName("name")] - public string Name { get; set; } + public string? Name { get; set; } } \ No newline at end of file diff --git a/Marechai.Data/Dtos/SoundSynthDto.cs b/Marechai.Data/Dtos/SoundSynthDto.cs index 38de1adf..9b2fc74b 100644 --- a/Marechai.Data/Dtos/SoundSynthDto.cs +++ b/Marechai.Data/Dtos/SoundSynthDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; namespace Marechai.Data.Dtos; @@ -30,13 +31,14 @@ namespace Marechai.Data.Dtos; public class SoundSynthDto : BaseDto { [JsonPropertyName("name")] - public string Name { get; set; } + [Required] + public required string Name { get; set; } [JsonPropertyName("company")] - public string CompanyName { get; set; } + public string? CompanyName { get; set; } [JsonPropertyName("company_id")] public int? CompanyId { get; set; } [JsonPropertyName("model_code")] - public string ModelCode { get; set; } + public string? ModelCode { get; set; } [JsonPropertyName("introduced")] public DateTime? Introduced { get; set; } [JsonPropertyName("voices")] diff --git a/Marechai.Data/Dtos/StorageByMachineDto.cs b/Marechai.Data/Dtos/StorageByMachineDto.cs index 3e8669b1..3fd23586 100644 --- a/Marechai.Data/Dtos/StorageByMachineDto.cs +++ b/Marechai.Data/Dtos/StorageByMachineDto.cs @@ -23,6 +23,7 @@ // Copyright © 2003-2021 Natalia Portillo *******************************************************************************/ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using Marechai.Database; @@ -31,6 +32,7 @@ namespace Marechai.Data.Dtos; public class StorageByMachineDto : BaseDto { [JsonPropertyName("machine_id")] + [Required] public int MachineId { get; set; } [JsonPropertyName("type")] public StorageType Type { get; set; }