using AdminBLL.OrganizationUnit; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace AdminSL.EndPoints.OrganizationUnit { public class ValidateGSTIN : BaseEndpoint> { private readonly IOrganizationUnitBLL _OrganizationUnitBLL; public ValidateGSTIN(IOrganizationUnitBLL organizationUnitBLL) { _OrganizationUnitBLL = organizationUnitBLL; } public override void Configure() { Get("/OrganizationUnit/ValidateGSTIN"); AllowAnonymous(); } public record ValidateGSTINParameters( [property: FromHeader] string Login, [property: QueryParam] string GSTIN ); protected override async Task> ExecuteAsync(ValidateGSTINParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _OrganizationUnitBLL.ValidateGSTIN(req.GSTIN, LoginDTO!); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError(ex, CacheKeyLevel.NOT_REQUIRED, LoginDTO, ex.Message, 500); } } } }