using FrameworkDAL.DTO.Lock;
using GB5Shared.DTO.Framework.Criteria;
using GB5Shared.DTO.Framework.Login;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace FrameworkDAL.CustomCode.Lock
{
public interface ILockDAL
{
///
/// Retrieves a paginated, criteria-filtered picklist of Lock records (Id, Code, Name).
/// Mirrors GB4: excludes auto-validation locks (IsAutoValidation = 0) unless the
/// caller's criteria already filters explicitly on IsAutoValidation.
///
Task> GetSelectListLock(
int FirstNumber,
int MaxResult,
CriteriaDTO CriteriaDTO,
LoginDTO LoginDTO);
///
/// Returns the total count of Lock records matching the supplied criteria
/// (same default IsAutoValidation filter as GetSelectListLock).
///
Task GetSelectListLockCount(CriteriaDTO CriteriaDTO, LoginDTO LoginDTO);
///
/// GB4 parity: Lock.svc/Generic/Lock/Validate (GenericLockValidate → LockDAL.GenericLockValidationByProgram,
/// text/log branch only — GenericLockCriteriaDTO.IsExcelOutput == 0 requests the Excel export
/// branch, which is not ported yet and throws NotSupportedException).
/// Runs every MLOCKVALIDATION row's admin-authored Expression SQL (named params substituted
/// from criteria) against the tenant database and returns a single formatted text log of every
/// validation that returned rows (i.e. failed), or "" when every validation passed.
///
Task GenericLockValidationByProgram(
int LockId,
GenericLockCriteriaDTO GenericLockCriteriaDTO,
LoginDTO LoginDTO,
CancellationToken ct);
}
}