99 lines
2.8 KiB
C#
99 lines
2.8 KiB
C#
using Distribution.Models;
|
|
|
|
namespace Distribution.Features.Store;
|
|
|
|
public record CreateStoreRequest(
|
|
Guid RouteId,
|
|
string? OwnerName,
|
|
string StoreName,
|
|
string StoreAddress,
|
|
decimal Latitude,
|
|
decimal Longitude,
|
|
decimal OneTimeAmount,
|
|
decimal CreditAmount,
|
|
decimal CreditLimit = 0,
|
|
string? ContactNumber = null);
|
|
|
|
public record UpdateStoreRequest(
|
|
Guid RouteId,
|
|
string? OwnerName,
|
|
string StoreName,
|
|
string StoreAddress,
|
|
decimal Latitude,
|
|
decimal Longitude,
|
|
decimal OneTimeAmount,
|
|
decimal CreditAmount,
|
|
bool IsActive = true,
|
|
decimal? CreditLimit = null,
|
|
string? ContactNumber = null);
|
|
|
|
public record StoreResponse(
|
|
Guid Id,
|
|
Guid RouteId,
|
|
string? OwnerName,
|
|
string? ContactNumber,
|
|
string StoreName,
|
|
string StoreAddress,
|
|
decimal Latitude,
|
|
decimal Longitude,
|
|
decimal OneTimeAmount,
|
|
decimal CreditAmount,
|
|
decimal CreditLimit,
|
|
decimal OutstandingBalance,
|
|
string? Segment,
|
|
bool IsActive,
|
|
DateTime CreatedAt);
|
|
|
|
public record UpdateCreditLimitRequest(decimal NewLimit, Guid ApproverId);
|
|
|
|
public record UpdateOutstandingBalanceRequest(decimal NewBalance);
|
|
|
|
public record ClassifySegmentRequest(string Segment);
|
|
|
|
public record OutstandingBalanceResponse(Guid StoreId, decimal CreditLimit, decimal OutstandingBalance, decimal AvailableCredit);
|
|
|
|
public record StoreVisitHistoryItem(Guid VisitId, DateTime VisitDate, Guid RepUserId, string Outcome);
|
|
|
|
public record SchemeEligibilityResponse(bool Eligible, string? Reason);
|
|
|
|
public record PatchStoreStatusRequest(bool IsActive);
|
|
|
|
public record StoreDashboardResponse(Guid StoreId, string Period, int OrderCount, decimal TotalOrderValue, DateTime? LastOrderDate);
|
|
|
|
public record StoreAnalyticsSummary(
|
|
decimal TotalSales,
|
|
decimal TotalCollected,
|
|
decimal Outstanding,
|
|
decimal OverdueAmount,
|
|
int OverdueInvoiceCount,
|
|
int InvoiceCount,
|
|
decimal AverageOrderValue,
|
|
DateTime? LastSaleDate,
|
|
decimal CreditLimit,
|
|
decimal CreditUtilizationPercent);
|
|
|
|
public record StoreMonthlySales(string Month, decimal Invoiced, decimal Collected, decimal Outstanding);
|
|
|
|
public record StoreTopProduct(Guid ItemId, string Name, int Quantity, decimal Revenue, DateTime LastSoldAt);
|
|
|
|
public record StoreAgeingBucket(string Label, decimal Amount, int InvoiceCount);
|
|
|
|
public record StoreAnalyticsInvoice(
|
|
Guid InvoiceId,
|
|
DateTime InvoiceDate,
|
|
DateTime DueDate,
|
|
decimal TotalAmount,
|
|
decimal PaidAmount,
|
|
decimal Balance,
|
|
string PaymentStatus,
|
|
int DaysOverdue);
|
|
|
|
public record StoreAnalyticsResponse(
|
|
Guid StoreId,
|
|
int OverdueDays,
|
|
StoreAnalyticsSummary Summary,
|
|
List<StoreMonthlySales> MonthlySales,
|
|
List<StoreTopProduct> TopProducts,
|
|
List<StoreAgeingBucket> Ageing,
|
|
List<StoreAnalyticsInvoice> Invoices);
|