-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPDBT-2915] crc controlling memeber (#1308)
# Description This PR includes the following proposed change(s): - add contract (manager) and cotnroller for crc controlling member(unauth post)
- Loading branch information
Showing
2 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
src/Spd.Manager.Licence/ControllingMemberCrcAppContract.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using MediatR; | ||
using Spd.Manager.Shared; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Spd.Manager.Licence; | ||
public abstract record ControllingMemberCrcApp | ||
{ | ||
public string? AccessCode { get; set; } | ||
public string? GivenName { get; set; } | ||
public string? MiddleName1 { get; set; } | ||
public string? MiddleName2 { get; set; } | ||
public string? Surname { get; set; } | ||
public bool? IsTermsOfUseAccepted { get; set; } | ||
public DateTime DateSigned { get; set; } | ||
public DateOnly DateOfBirth { get; set; } | ||
public GenderCode? GenderCode { get; set; } | ||
public string? PhoneNumber { get; set; } | ||
public string? EmailAddress { get; set; } | ||
public bool? HasPreviousNames { get; set; } | ||
public IEnumerable<Alias> Aliases { get; set; } = Array.Empty<Alias>(); | ||
public bool? HasBcDriverLicence { get; set; } | ||
public string? BcDriverLicenceNumber { get; set; } | ||
|
||
public bool? IsPoliceOrPeaceOfficer { get; set; } | ||
public PoliceOfficerRoleCode? PoliceOfficerRoleCode { get; set; } | ||
// public LicenceAppDocumentUpload? LetterOfConflictDoucuments { get; set; } | ||
|
||
public bool? IsCanadianCitizen { get; set; } | ||
//public LicenceAppDocumentUpload? CitizenshipProofDoucuments { get; set; } | ||
public DateOnly? CitizenshipProofExpiryDate { get; set; } | ||
//public LicenceAppDocumentUpload? FingerPrintDoucuments { get; set; } | ||
//public LicenceAppDocumentUpload? GovernmentIssuedIdDoucuments1 { get; set; } | ||
//public LicenceAppDocumentUpload? GovernmentIssuedIdDoucuments2 { get; set; } | ||
|
||
public bool? HasCriminalHistory { get; set; } | ||
public string? CriminalHistoryDetail { get; set; } | ||
|
||
public bool? HasBankruptcyHistory { get; set; } | ||
public string? BankruptcyHistoryDetail { get; set; } | ||
|
||
public bool? HasMentalCondition { get; set; } | ||
//public LicenceAppDocumentUpload? MentalHealthConditionDoucuments { get; set; } | ||
|
||
public Address? ResidentialAddress { get; set; } | ||
} | ||
|
||
public record ControllingMemberCrcAppCommandResponse | ||
{ | ||
public Guid ControllingMemberAppId { get; set; } | ||
}; | ||
|
||
|
||
public record ControllingMemberCrcAppSubmitRequest : ControllingMemberCrcApp | ||
{ | ||
}; | ||
|
||
public record ControllingMemberCrcAppSubmitRequestCommand(ControllingMemberCrcAppSubmitRequest CrcControllingMemberUpsertRequest) : IRequest<ControllingMemberCrcAppCommandResponse>; |
36 changes: 36 additions & 0 deletions
36
src/Spd.Presentation.Licensing/Controllers/ControllingMemberCrcAppController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using MediatR; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Spd.Manager.Licence; | ||
using Spd.Utilities.Shared; | ||
using Spd.Utilities.Shared.Exceptions; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Net; | ||
|
||
namespace Spd.Presentation.Licensing.Controllers; | ||
|
||
[ApiController] | ||
public class ControllingMemberCrcAppController : SpdControllerBase | ||
{ | ||
private readonly IMediator _mediator; | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="mediator"></param> | ||
public ControllingMemberCrcAppController (IMediator mediator) | ||
{ | ||
_mediator = mediator; | ||
} | ||
|
||
/// <summary> | ||
/// Save New Licence Crc Controlling Member | ||
/// </summary> | ||
/// <param name="ControllingMemberCrcSubmitRequest"></param> | ||
/// <returns></returns> | ||
[Route("api/controlling-member-crc-applications/anonymous/submit")] | ||
[HttpPost] | ||
public async Task<ControllingMemberCrcAppCommandResponse> SubmitControllingMemberCrcApplication([FromBody][Required] ControllingMemberCrcAppSubmitRequest ControllingMemberCrcSubmitRequest, CancellationToken ct) | ||
{ | ||
return await _mediator.Send(new ControllingMemberCrcAppSubmitRequestCommand(ControllingMemberCrcSubmitRequest), ct); | ||
} | ||
} |