using GB5Shared.DTO.Framework.Login;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CostingDAL.CustomCode.VnoGeneration
{
///
/// GB5 VNO (Voucher Number) Generation Service Interface.
/// Migrated from GB4 IVnoGenerationDLL.
///
/// Three operations:
/// GetNextVno — single VNO, auto-commits if no transaction passed.
/// GetNextVnoInTx — single VNO, always within an existing transaction (GB4: GetNextVnoWithSameSession).
/// GetMultiVno — N VNOs in one DB round-trip, always within a transaction.
///
public interface IVnoGenerationService
{
///
/// Generate the next VNO for the given BizTransactionType and document date.
/// Must be called inside an existing open transaction (same as GB4 GetNextVnoWithSameSession).
///
Task GetNextVnoAsync(
int bizTransactionTypeId,
DateTime vdate,
LoginDTO login,
System.Data.Common.DbTransaction tx,
CancellationToken ct = default);
///
/// Generate N sequential VNOs in one DB round-trip.
/// Returns formatted strings in ascending order.
/// Must be called inside an existing open transaction.
///
Task> GetMultiVnoAsync(
int count,
int bizTransactionTypeId,
DateTime vdate,
LoginDTO login,
System.Data.Common.DbTransaction tx,
CancellationToken ct = default);
}
}