using CashLineERP.Contracts.Sales;

namespace CashLineERP.Application.Sales;

public interface ISalesOrderService
{
    IReadOnlyCollection<SalesOrderResponse> GetSalesOrders();

    SalesOrderResponse? GetSalesOrder(long salesOrderId);

    SalesOrderResponse CreateSalesOrder(CreateSalesOrderRequest request);

    SalesOrderResponse SubmitSalesOrder(long salesOrderId, long actorUserId);

    SalesOrderResponse ReleaseCreditHold(long salesOrderId, ReleaseSalesOrderCreditHoldRequest request);

    IReadOnlyCollection<SalesDiscountOverrideResponse> GetDiscountOverrides(long salesOrderId);

    SalesDiscountOverrideResponse CreateDiscountOverride(long salesOrderId, long actorUserId, CreateSalesDiscountOverrideRequest request);

    SalesDiscountOverrideResponse ApproveDiscountOverride(long salesOrderId, long actorUserId, ReviewSalesDiscountOverrideRequest request, long salesDiscountOverrideId);

    SalesDiscountOverrideResponse RejectDiscountOverride(long salesOrderId, long actorUserId, ReviewSalesDiscountOverrideRequest request, long salesDiscountOverrideId);

    CustomerCreditControlResponse GetCustomerCreditControl(long customerId, string? currencyCode = null, DateOnly? asOfDate = null);
}
