using System.ComponentModel.DataAnnotations; using Asp.Versioning; using Baya.Application.Features.Verification.Commands.ConfirmDocumentUpload; using Baya.Application.Features.Verification.Commands.RequestDocumentUploadUrl; using Baya.Application.Features.Verification.Commands.RunBankAccountVerification; using Baya.Application.Features.Verification.Commands.RunIdentityKyc; using Baya.Application.Features.Verification.Commands.RunShahkarMatch; using Baya.Application.Features.Verification.Commands.SubmitVerification; using Baya.Application.Features.Verification.Queries.GetStatus; using Baya.Application.Models.Verification; using Baya.WebFramework.Attributes; using Baya.WebFramework.BaseController; using Mediator; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace Baya.Web.Api.Controllers.V1; [ApiVersion("1")] [ApiController] [Route("api/v{version:apiVersion}/[controller]")] [Authorize] [Display(Description = "The signed-in nurse's verification pipeline (checklist, uploads, automated runs)")] public sealed class NurseVerificationController(ISender sender) : BaseController { [HttpPost("[action]")] [ProducesOkApiResponseType] public async Task Submit(CancellationToken cancellationToken) => OperationResult(await sender.Send(new SubmitNurseVerificationCommand(), cancellationToken)); [HttpGet] [ProducesOkApiResponseType] public async Task Get(CancellationToken cancellationToken) => OperationResult(await sender.Send(new GetNurseVerificationStatusQuery(), cancellationToken)); [HttpPost("steps/{stepId}/[action]")] [ProducesOkApiResponseType] public async Task UploadUrl(long stepId, RequestDocumentUploadUrlCommand command, CancellationToken cancellationToken) => OperationResult(await sender.Send(command with { StepId = stepId }, cancellationToken)); [HttpPost("steps/{stepId}/documents")] [ProducesOkApiResponseType] public async Task ConfirmDocument(long stepId, ConfirmDocumentUploadCommand command, CancellationToken cancellationToken) => OperationResult(await sender.Send(command with { StepId = stepId }, cancellationToken)); [HttpPost("steps/identity_kyc/run")] [ProducesOkApiResponseType] public async Task RunIdentityKyc(RunIdentityKycCommand command, CancellationToken cancellationToken) => OperationResult(await sender.Send(command, cancellationToken)); [HttpPost("steps/shahkar_match/run")] [ProducesOkApiResponseType] public async Task RunShahkarMatch(CancellationToken cancellationToken) => OperationResult(await sender.Send(new RunShahkarMatchCommand(), cancellationToken)); [HttpPost("steps/bank_account_verification/run")] [ProducesOkApiResponseType] public async Task RunBankAccountVerification(CancellationToken cancellationToken) => OperationResult(await sender.Send(new RunBankAccountVerificationCommand(), cancellationToken)); }