Skip to content

Commit

Permalink
[SPDBT-2915] crc controlling memeber (#1308)
Browse files Browse the repository at this point in the history
# Description

This PR includes the following proposed change(s):

- add contract (manager) and cotnroller for crc controlling
member(unauth post)
  • Loading branch information
esdd1995 authored Aug 18, 2024
1 parent e6e677f commit aed2440
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/Spd.Manager.Licence/ControllingMemberCrcAppContract.cs
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>;
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);
}
}

0 comments on commit aed2440

Please sign in to comment.