using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace FinlyticAssets.Entities; public enum OptionType { Long, Short } public class DerivativeEntity : AssetEntity { // --- Verknüpfung zum Basiswert (Underlying) --- [StringLength(12, MinimumLength = 12)] public string? UnderlyingIsin { get; set; } // --- Derivat-Spezifikationen --- public OptionType OptionType { get; set; } // Long / Short [MaxLength(100)] public string ProductCategoryName { get; set; } = string.Empty; // Z.B. "Best Turbo" [MaxLength(100)] public string NextGenProductCategoryName { get; set; } = string.Empty; // Z.B. "Turbo" // --- Kennzahlen (Präzise decimals für Finanzwerte) --- [Column(TypeName = "numeric(18,6)")] public decimal Strike { get; set; } // Basispreis [Column(TypeName = "numeric(18,6)")] public decimal Barrier { get; set; } // Knock-Out-Schwelle [Column(TypeName = "numeric(10,4)")] public decimal Leverage { get; set; } // Hebel (z. B. 1.01) public decimal? Size { get; set; } public decimal? Factor { get; set; } public decimal? Delta { get; set; } [MaxLength(10)] public string Currency { get; set; } = "EUR"; public DateTime? Expiry { get; set; } // Verfallsdatum (null bei Open-End / Best Turbo) // --- Emittent (Issuer) Daten --- [MaxLength(150)] public string Issuer { get; set; } = string.Empty; // Z.B. "Société Générale" [MaxLength(150)] public string IssuerDisplayName { get; set; } = string.Empty; public string? IssuerImageId { get; set; } // PostgreSQL Mapped Array für TR-Kategorien public List DerivativeProductCategories { get; set; } = new(); }