erp-platform/api/src/Erp.Platform.Domain/Entities/Tenant/SupplyChain/Partner.cs

108 lines
3.5 KiB
C#
Raw Normal View History

2025-11-11 19:49:52 +00:00
using System;
2025-10-31 22:16:46 +00:00
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json;
2025-10-31 22:16:46 +00:00
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
2025-11-11 19:49:52 +00:00
namespace Erp.Platform.Entities;
2025-10-31 22:16:46 +00:00
public class Partner : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public PartnerType PartyType { get; set; }
2025-10-31 22:16:46 +00:00
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 Street { 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; }
2025-10-31 22:16:46 +00:00
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; }
2025-10-31 22:16:46 +00:00
public PartnerStatus Status { get; set; }
public ICollection<PartnerBank> Banks { get; set; }
public ICollection<PartnerCertificate> Certificates { get; set; }
2025-10-31 22:16:46 +00:00
public ICollection<PartnerContact> 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? AssignedEmployeeId { get; set; }
public Employee? AssignedEmployee { get; set; }
public string? TeamCode { get; set; } // Organization Unit Code
public decimal TotalRevenue { get; set; } // Toplam Gelir
2025-11-11 19:49:52 +00:00
public decimal AverageOrderValue { get; set; } // Ortalama SipariÅŸ DeÄŸeri
public decimal LifetimeValue { get; set; } // Müşteri Ãmrü DeÄŸeri
2025-10-31 22:16:46 +00:00
//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<PerformanceMetrics>(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; }
2025-11-11 19:49:52 +00:00
}