Files

68 lines
2.0 KiB
C#

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
{
[Key]
[StringLength(12, MinimumLength = 12)]
public string Isin { get; set; } = string.Empty;
// --- Verknüpfung zum Basiswert (Underlying) ---
[StringLength(12, MinimumLength = 12)]
public string UnderlyingIsin { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
// --- 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 DateTime LastUpdatedAt { get; set; } = DateTime.UtcNow;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
// PostgreSQL Mapped Array für TR-Kategorien
public List<string> DerivativeProductCategories { get; set; } = new();
}