namespace CashLineERP.Application.Sales;

public interface ISalesOrderRepository
{
    IReadOnlyCollection<SalesOrderDetailView> GetSalesOrders();

    SalesOrderDetailView? GetSalesOrder(long salesOrderId);

    SalesOrderDetailView Create(CreateSalesOrderCommand command);

    SalesOrderDetailView Submit(long salesOrderId, long actorUserId);

    SalesOrderDetailView ReleaseCreditHold(long salesOrderId, long actorUserId, string decisionCode, string notes);

    IReadOnlyCollection<SalesDiscountOverrideDetailView> GetDiscountOverrides(long salesOrderId);

    SalesDiscountOverrideDetailView CreateDiscountOverride(long salesOrderId, long actorUserId, CreateSalesDiscountOverrideCommand command);

    SalesDiscountOverrideDetailView ApproveDiscountOverride(long salesOrderId, long salesDiscountOverrideId, long actorUserId, ReviewSalesDiscountOverrideCommand command);

    SalesDiscountOverrideDetailView RejectDiscountOverride(long salesOrderId, long salesDiscountOverrideId, long actorUserId, ReviewSalesDiscountOverrideCommand command);

    CustomerCreditControlView GetCustomerCreditControl(long customerId, string currencyCode, DateOnly asOfDate);
}
