using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using eprintServer.Enums; using System.Text.Json.Serialization; namespace eprintServer.Entities; public class OrderItem { [Key] public long Id { get; set; } [Column("order_id")] public long OrderId { get; set; } [Column("sellable_product_id")] public int? SellableProductId { get; set; } public SellableProduct? SellableProduct { get; set; } [Column("customizable_product_id")] public long? CustomizableProductId { get; set; } public CustomizableProduct? CustomizableProduct { get; set; } [Column("user_customization_id")] public Guid? UserCustomizationId { get; set; } public UserCustomization? UserCustomization { get; set; } [Column("offer_id")] public long? OfferId { get; set; } [Column("quantity")] public int Quantity { get; set; } [Column("unit_price")] public decimal UnitPrice { get; set; } [JsonIgnore] [ForeignKey(nameof(OrderId))] public Order Order { get; set; } [Column("invoice_id")] public long? InvoiceId { get; set; } [Column("package_awb")] public string? PackageAwb { get; set; } [JsonIgnore] [ForeignKey(nameof(InvoiceId))] public Invoice? Invoice { get; set; } }