using CashLineERP.Application.Finance;
using CashLineERP.Contracts.Finance;

namespace CashLineERP.Api.Tests;

internal static class AccountsReceivableWorkflowTestHelper
{
    public static AccountsReceivableInvoiceResponse SubmitApproveAndPostInvoice(
        IAccountsReceivableInvoiceService invoiceService,
        long invoiceId,
        long submitterUserId = 3,
        long approverUserId = 4,
        long posterUserId = 4)
    {
        invoiceService.SubmitInvoice(invoiceId, submitterUserId);
        invoiceService.ApproveInvoice(invoiceId, approverUserId);
        return invoiceService.PostInvoice(invoiceId, posterUserId);
    }

    public static AccountsReceivableReceiptResponse SubmitApproveAndPostReceipt(
        IAccountsReceivableReceiptService receiptService,
        long receiptId,
        long submitterUserId = 3,
        long approverUserId = 4,
        long posterUserId = 4)
    {
        receiptService.SubmitReceipt(receiptId, submitterUserId);
        receiptService.ApproveReceipt(receiptId, approverUserId);
        return receiptService.PostReceipt(receiptId, posterUserId);
    }
}
