mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Update DTO properties to support nullable types and add required validation attributes
This commit is contained in:
@@ -33,15 +33,15 @@ public class BasePhotoDto : BaseDto<Guid>
|
||||
[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<Guid>
|
||||
[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<Guid>
|
||||
[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<Guid>
|
||||
[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<Guid>
|
||||
[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")]
|
||||
|
||||
@@ -31,25 +31,25 @@ namespace Marechai.Data.Dtos;
|
||||
public class BaseScanDto : BaseDto<Guid>
|
||||
{
|
||||
[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<Guid>
|
||||
[JsonPropertyName("original_extension")]
|
||||
public string OriginalExtension { get; set; }
|
||||
[JsonPropertyName("user_id")]
|
||||
public string UserId { get; set; }
|
||||
public string? UserId { get; set; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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")]
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -33,27 +33,27 @@ public class CompanyDto : BaseDto<int>
|
||||
{
|
||||
[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<int>
|
||||
[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<int>
|
||||
[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"
|
||||
|
||||
@@ -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<int>
|
||||
{
|
||||
[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")]
|
||||
|
||||
@@ -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<int>
|
||||
{
|
||||
[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")]
|
||||
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -31,10 +31,10 @@ namespace Marechai.Data.Dtos;
|
||||
public class DocumentCompanyDto : BaseDto<int>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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}";
|
||||
|
||||
@@ -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<string>
|
||||
{
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
[Required]
|
||||
public required string Name { get; set; }
|
||||
[JsonPropertyName("enabled")]
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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")]
|
||||
|
||||
@@ -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<int>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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<int>
|
||||
[JsonPropertyName("family_id")]
|
||||
public int? FamilyId { get; set; }
|
||||
[JsonPropertyName("family_name")]
|
||||
public string FamilyName { get; set; }
|
||||
public List<GpuDto> Gpus { get; set; }
|
||||
public List<MemoryDto> Memory { get; set; }
|
||||
public List<ProcessorDto> Processors { get; set; }
|
||||
public List<SoundSynthDto> SoundSynthesizers { get; set; }
|
||||
public List<StorageDto> Storage { get; set; }
|
||||
public string? FamilyName { get; set; }
|
||||
public List<GpuDto>? Gpus { get; set; }
|
||||
public List<MemoryDto>? Memory { get; set; }
|
||||
public List<ProcessorDto>? Processors { get; set; }
|
||||
public List<SoundSynthDto>? SoundSynthesizers { get; set; }
|
||||
public List<StorageDto>? 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";
|
||||
|
||||
@@ -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<int>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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")]
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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<ulong>
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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}";
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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}";
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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}";
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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]
|
||||
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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<int>
|
||||
[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<int>
|
||||
[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<string> InstructionSetExtensions { get; set; }
|
||||
public List<string>? InstructionSetExtensions { get; set; }
|
||||
[JsonPropertyName("company_id")]
|
||||
public int? CompanyId { get; set; }
|
||||
[JsonPropertyName("instruction_set_id")]
|
||||
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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;
|
||||
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
[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;
|
||||
|
||||
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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<ulong>
|
||||
[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; }
|
||||
}
|
||||
@@ -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<ulong>
|
||||
{
|
||||
[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; }
|
||||
|
||||
@@ -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<long>
|
||||
{
|
||||
[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; }
|
||||
}
|
||||
@@ -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<int>
|
||||
{
|
||||
[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")]
|
||||
|
||||
@@ -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<long>
|
||||
{
|
||||
[JsonPropertyName("machine_id")]
|
||||
[Required]
|
||||
public int MachineId { get; set; }
|
||||
[JsonPropertyName("type")]
|
||||
public StorageType Type { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user