using AdminBLL.BIZTransaction; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace AdminSL.EndPoints.BIZTransaction { public class DeleteBIZTransaction : BaseEndpoint> { public readonly IBIZTransactionBLL _BIZTransactionBLL; public DeleteBIZTransaction(IBIZTransactionBLL IBIZTransactionBLL) { _BIZTransactionBLL = IBIZTransactionBLL; } public override void Configure() { Delete("/BIZTransaction/DeleteBIZTransaction"); AllowAnonymous(); } public record DeleteBIZTransactionParameters( [property: FromHeader] string Login, [property: QueryParam] int BIZTransactionId ); protected override async Task> ExecuteAsync(DeleteBIZTransactionParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _BIZTransactionBLL.DeleteBIZTransaction(req.BIZTransactionId, 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); } } } }