using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; namespace Erp.Platform.Entities; public class Partner : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } public string Code { get; set; } public string Name { get; set; } public string PartyType { get; set; } public Guid? SectorId { get; set; } public Sector? Sector { get; set; } public long TaxNumber { get; set; } public string? TaxOffice { get; set; } public string Country { get; set; } public string City { get; set; } public string District { get; set; } public string Township { get; set; } public string Address1 { get; set; } public string Address2 { get; set; } public string PostalCode { get; set; } public string MobileNumber { get; set; } public string PhoneNumber { get; set; } public string FaxNumber { get; set; } public string Email { get; set; } public string Website { get; set; } public Guid? CurrencyId { get; set; } public Currency? Currency { get; set; } public Guid? PaymentTermId { get; set; } public PaymentTerm? PaymentTerm { get; set; } public decimal CreditLimit { get; set; } public DateTime? LastOrderDate { get; set; } public string Status { get; set; } public ICollection Banks { get; set; } public ICollection Certificates { get; set; } public ICollection Contacts { get; set; } //Customer ile ilgil bilgiler public Guid? CustomerTypeId { get; set; } public CustomerType? CustomerType { get; set; } public Guid? CustomerSegmentId { get; set; } public CustomerSegment? CustomerSegment { get; set; } public Guid? EmployeeId { get; set; } public Employee? Employee { get; set; } public string? TeamCode { get; set; } // Organization Unit Code public decimal TotalRevenue { get; set; } // Toplam Gelir public decimal AverageOrderValue { get; set; } // Ortalama Sipariş Değeri public decimal LifetimeValue { get; set; } // Müşteri Ömrü Değeri //Supplier ile ilgili bilgiler public Guid? SupplierTypeId { get; set; } public SupplyType? SupplierType { get; set; } public Guid? SupplyCardTypeId { get; set; } public SupplyCardType? SupplyCardType { get; set; } public string? CardNumber { get; set; } public DateTime? ValidFrom { get; set; } public DateTime? ValidTo { get; set; } public decimal CurrentBalance { get; set; } public decimal DiscountRate { get; set; } public string? PerformanceMetricsJson { get; set; } public PerformanceMetrics PerformanceMetrics { get { if (!string.IsNullOrEmpty(PerformanceMetricsJson)) return JsonSerializer.Deserialize(PerformanceMetricsJson); return new PerformanceMetrics(); } set { PerformanceMetricsJson = JsonSerializer.Serialize(value); } } } [NotMapped] public class PerformanceMetrics { public int DeliveryPerformance { get; set; } public int QualityRating { get; set; } public int PriceCompetitiveness { get; set; } public int Responsiveness { get; set; } public int ComplianceRating { get; set; } public int OverallScore { get; set; } public DateTime LastEvaluationDate { get; set; } }