Add customer communication system

This commit is contained in:
sysadmin
2025-08-27 18:02:39 +01:00
parent 1f7c0af497
commit eae5be3e7c
136 changed files with 14552 additions and 97 deletions

View File

@@ -0,0 +1,90 @@
using System.ComponentModel.DataAnnotations;
namespace LittleShop.DTOs;
public class CustomerDto
{
public Guid Id { get; set; }
public long TelegramUserId { get; set; }
public string TelegramUsername { get; set; } = string.Empty;
public string TelegramDisplayName { get; set; } = string.Empty;
public string TelegramFirstName { get; set; } = string.Empty;
public string TelegramLastName { get; set; } = string.Empty;
public string? Email { get; set; }
public string? PhoneNumber { get; set; }
public bool AllowMarketing { get; set; }
public bool AllowOrderUpdates { get; set; }
public string Language { get; set; } = "en";
public string Timezone { get; set; } = "UTC";
public int TotalOrders { get; set; }
public decimal TotalSpent { get; set; }
public decimal AverageOrderValue { get; set; }
public DateTime FirstOrderDate { get; set; }
public DateTime LastOrderDate { get; set; }
public string? CustomerNotes { get; set; }
public bool IsBlocked { get; set; }
public string? BlockReason { get; set; }
public int RiskScore { get; set; }
public int SuccessfulOrders { get; set; }
public int CancelledOrders { get; set; }
public int DisputedOrders { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public DateTime LastActiveAt { get; set; }
public DateTime? DataRetentionDate { get; set; }
public bool IsActive { get; set; }
// Calculated Properties
public string DisplayName { get; set; } = string.Empty;
public string CustomerType { get; set; } = string.Empty;
}
public class CustomerSummaryDto
{
public Guid Id { get; set; }
public string DisplayName { get; set; } = string.Empty;
public string TelegramUsername { get; set; } = string.Empty;
public int TotalOrders { get; set; }
public decimal TotalSpent { get; set; }
public string CustomerType { get; set; } = string.Empty;
public int RiskScore { get; set; }
public DateTime LastActiveAt { get; set; }
public bool IsBlocked { get; set; }
}
public class CreateCustomerDto
{
[Required]
public long TelegramUserId { get; set; }
public string TelegramUsername { get; set; } = string.Empty;
[Required]
public string TelegramDisplayName { get; set; } = string.Empty;
public string TelegramFirstName { get; set; } = string.Empty;
public string TelegramLastName { get; set; } = string.Empty;
public string? Email { get; set; }
public string? PhoneNumber { get; set; }
public bool AllowMarketing { get; set; } = false;
public bool AllowOrderUpdates { get; set; } = true;
public string Language { get; set; } = "en";
public string Timezone { get; set; } = "UTC";
}
public class UpdateCustomerDto
{
public string TelegramUsername { get; set; } = string.Empty;
public string TelegramDisplayName { get; set; } = string.Empty;
public string TelegramFirstName { get; set; } = string.Empty;
public string TelegramLastName { get; set; } = string.Empty;
public string? Email { get; set; }
public string? PhoneNumber { get; set; }
public bool AllowMarketing { get; set; }
public bool AllowOrderUpdates { get; set; }
public string Language { get; set; } = "en";
public string Timezone { get; set; } = "UTC";
public string? CustomerNotes { get; set; }
public bool IsBlocked { get; set; }
public string? BlockReason { get; set; }
}