-
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.
- Loading branch information
Manish Kumar
committed
Nov 6, 2024
1 parent
5997869
commit 03c25e4
Showing
86 changed files
with
4,319 additions
and
322 deletions.
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
Duc.Splitt/Duc.Splitt.Common/Dtos/Requests/PACIMobileIdRequest.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,19 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel; | ||
|
||
namespace Duc.Splitt.Common.Dtos.Requests | ||
{ | ||
public class PACIMobileIdRequest | ||
{ | ||
public class MobileAuthPNRequestDto | ||
{ | ||
[Description("User Identifier to be sent to MID (For MID, this should be Civil ID) ")] | ||
[Required] | ||
public string CivilId { get; set; } = null!; | ||
|
||
[Required] | ||
public Guid CustomerRegistrationRequestId { get; set; } | ||
} | ||
|
||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
Duc.Splitt/Duc.Splitt.Common/Dtos/Responses/PACIMobileIdResponse.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,14 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel; | ||
|
||
namespace Duc.Splitt.Common.Dtos.Responses | ||
{ | ||
public class PACIMobileIdResponse | ||
{ | ||
|
||
public class MobileAuthPNResponseDto | ||
{ | ||
public string? DSPRefNo { get; set; } | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Duc.Splitt/Duc.Splitt.Common/Enums/CustomerRegistrationStatuses.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,13 @@ | ||
namespace Duc.Splitt.Common.Enums | ||
{ | ||
public enum CustomerRegistrationStatuses | ||
{ | ||
|
||
OtpPending = 1, | ||
OtpVerifed = 2, | ||
PACIPending = 3, | ||
PACIVerifed = 4, | ||
PaciVerifiedComplete = 5 | ||
} | ||
|
||
} |
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,10 @@ | ||
namespace Duc.Splitt.Common.Enums | ||
{ | ||
public enum CustomerStatuses | ||
{ | ||
|
||
Registration = 1, | ||
Login = 2 | ||
} | ||
|
||
} |
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,17 @@ | ||
namespace Duc.Splitt.Common.Enums | ||
{ | ||
public enum MidRequestStatuses | ||
{ | ||
|
||
Initiate = 1, | ||
InitiateSucess = 2, | ||
CallBackReceived = 3, | ||
CallBackProcessSucess = 4, | ||
CallBackProcessFail = 5, | ||
Reject = 6, | ||
CallBackReceivedDataIssue = 7, | ||
MIDIssue = 8, | ||
Exception = 9 | ||
} | ||
|
||
} |
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,8 @@ | ||
namespace Duc.Splitt.Common.Enums | ||
{ | ||
public enum MidRequestTypes | ||
{ | ||
AuthenticationPN = 1 | ||
} | ||
|
||
} |
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,10 @@ | ||
namespace Duc.Splitt.Common.Enums | ||
{ | ||
public enum OtpPurposes | ||
{ | ||
|
||
Registration = 1, | ||
Login = 2 | ||
} | ||
|
||
} |
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
2 changes: 1 addition & 1 deletion
2
...uc.Splitt.Common/Enums/Language - Copy.cs → Duc.Splitt/Duc.Splitt.Common/Enums/Roles.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace Duc.Splitt.Common.Enums | ||
{ | ||
public enum UserTypes | ||
public enum Roles | ||
{ | ||
|
||
Anonymous = 1, | ||
|
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
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
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
12 changes: 0 additions & 12 deletions
12
Duc.Splitt/Duc.Splitt.Core/Contracts/Services/IAuthConsumerService.cs
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
Duc.Splitt/Duc.Splitt.Core/Contracts/Services/IAuthCustomerService.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,15 @@ | ||
using Duc.Splitt.Common.Dtos.Responses; | ||
using System.Threading.Tasks; | ||
using static Duc.Splitt.Common.Dtos.Requests.AuthConsumerUserRequestDto; | ||
|
||
namespace Duc.Splitt.Core.Contracts.Services | ||
{ | ||
public interface IAuthCustomerService | ||
{ | ||
|
||
Task<ResponseDto<bool?>> RequestOTP(RequestHeader requestHeader, RegisterDto request); | ||
Task<ResponseDto<VerifyOtpResponse?>> VerifyOTP(RequestHeader requestHeader, VerifyOtpDto request); | ||
Task<ResponseDto<CustomerRegistrationResponseDto?>> CustomerRegistrationRequest(RequestHeader requestHeader, CustomerRegistrationRequestDto request); | ||
Task<ResponseDto<CheckMIdRequestStatusDto?>> CheckMidStatus(RequestHeader requestHeader, CheckMIdRequestStatusDto request); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
Duc.Splitt/Duc.Splitt.Core/Contracts/Services/IMIDServiceAuthenticationService.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,14 @@ | ||
using Duc.Splitt.Common.Dtos.Responses; | ||
using Duc.Splitt.MIDIntegrationService; | ||
using static Duc.Splitt.Common.Dtos.Requests.PACIMobileIdRequest; | ||
using static Duc.Splitt.Common.Dtos.Responses.PACIMobileIdResponse; | ||
|
||
namespace Duc.Splitt.Core.Contracts.Services | ||
{ | ||
public interface IMIDServiceAuthenticationService | ||
{ | ||
|
||
Task<ResponseDto<MobileAuthPNResponseDto?>> InitiateAuthRequestPN(RequestHeader requestHeader, MobileAuthPNRequestDto requestDto); | ||
Task<ResponseDto<bool?>> CallBackPN(CallbackResponse PACIcallback); | ||
} | ||
} |
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
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
57 changes: 57 additions & 0 deletions
57
Duc.Splitt/Duc.Splitt.CustomerApi/Controllers/PACIController.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,57 @@ | ||
using Duc.Splitt.Common.Dtos.Responses; | ||
using Duc.Splitt.Common.Enums; | ||
using Duc.Splitt.Core.Contracts.Services; | ||
using Duc.Splitt.CustomerApi.Helper; | ||
using Duc.Splitt.Logger; | ||
using Microsoft.AspNetCore.Mvc; | ||
using static Duc.Splitt.Common.Dtos.Requests.PACIMobileIdRequest; | ||
using static Duc.Splitt.Common.Dtos.Responses.PACIMobileIdResponse; | ||
|
||
namespace Duc.Splitt.CustomerApi.Controllers | ||
{ | ||
|
||
public class PACIController : BaseAnonymous | ||
{ | ||
private readonly IMIDServiceAuthenticationService _mIDServiceAuthentication; | ||
private readonly ILoggerService _logger; | ||
private IUtilsService _utilsService; | ||
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); | ||
public PACIController(IMIDServiceAuthenticationService mIDServiceAuthentication, ILoggerService logger, IUtilsService utilsService) | ||
{ | ||
_mIDServiceAuthentication = mIDServiceAuthentication; | ||
_logger = logger; | ||
_utilsService = utilsService; | ||
} | ||
|
||
|
||
[HttpPost()] | ||
public async Task<ResponseDto<MobileAuthPNResponseDto?>> InitiateAuthRequestPN(MobileAuthPNRequestDto requestDto) | ||
{ | ||
ResponseDto<MobileAuthPNResponseDto?> response = new ResponseDto<MobileAuthPNResponseDto?> | ||
{ | ||
Code = ResponseStatusCode.NoDataFound | ||
}; | ||
try | ||
{ | ||
var validateRequest = await _utilsService.ValidateRequest(this.Request, null); | ||
if (validateRequest == null) | ||
{ | ||
response.Code = ResponseStatusCode.InvalidToken; | ||
return response; | ||
} | ||
var obj = await _mIDServiceAuthentication.InitiateAuthRequestPN(validateRequest, requestDto); | ||
return obj; | ||
} | ||
catch (Exception ex) | ||
{ | ||
_logger.LogError(ex); | ||
response.Code = ResponseStatusCode.ServerError; | ||
response.Errors = _logger.ConvertExceptionToStringList(ex); | ||
return response; | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
|
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
Oops, something went wrong.