|
|
@ -6,140 +6,140 @@ namespace RemitInboundAPI.Business.Helper.ValidationHelper |
|
|
|
{ |
|
|
|
public class SendTransactionValidationHelper |
|
|
|
{ |
|
|
|
public async Task<CommonResponse> SendTransactionValidationRequest(SendRemittanceModel model) |
|
|
|
public async Task<ApiResponse> SendTransactionValidationRequest(SendRemittanceModel model) |
|
|
|
{ |
|
|
|
CommonResponse _response; |
|
|
|
ApiResponse _response; |
|
|
|
if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCountryCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCountryCode can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCountryCode can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCurrencyCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutCountryCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutCountryCode can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutCountryCode can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutTypeCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutTypeCode can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutTypeCode can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutCurrencyCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutCurrencyCode can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutCurrencyCode can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.CollectionAmount)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "CollectionAmount can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "CollectionAmount can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCurrencyCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.TransferAmount)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "TransferAmount can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "TransferAmount can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutAmount)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutAmount can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutAmount can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.ServiceCharge)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ServiceCharge can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ServiceCharge can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.ExchangeRate)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ExchangeRate can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ExchangeRate can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.SendingCurrencyCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SendingCurrencyCode can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.RemittancePurpose)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "RemittancePurpose can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "RemittancePurpose can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.SourceOfFund)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SourceOfFund can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SourceOfFund can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.Relationship)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "Relationship can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "Relationship can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.Occupation)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "Occupation can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "Occupation can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.CalcBy)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "CalcBy can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "CalcBy can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderFirstName)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderFirstName can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderFirstName can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderDOB)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderDOB can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderDOB can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderLastName)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderLastName can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderLastName can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdType)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdType can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdType can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdNo)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdNo can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdNo can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdIssuedDate)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdIssuedDate can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdIssuedDate can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderIdValidDate)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderIdValidDate can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderIdValidDate can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderMobile)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderMobile can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderMobile can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderAddress)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderAddress can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderAddress can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitSenderDetails.SenderGender)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "SenderGender can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "SenderGender can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverFirstName)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverFirstName can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverFirstName can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverLastName)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverLastName can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverLastName can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverMobile)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverMobile can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverMobile can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverCity)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverCity can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverCity can not be empty."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverAddress)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverAddress can not be empty."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverAddress can not be empty."); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS); |
|
|
|
_response = new ApiResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS); |
|
|
|
} |
|
|
|
|
|
|
|
//conditional
|
|
|
@ -149,19 +149,19 @@ namespace RemitInboundAPI.Business.Helper.ValidationHelper |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutBankCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutBankCode can not be empty for payment type Bank Deposit."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutBankCode can not be empty for payment type Bank Deposit."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemittanceDetails.PayoutBankBranchCode)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "PayoutBankBranchCode can not be empty for payment type Bank Deposit."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "PayoutBankBranchCode can not be empty for payment type Bank Deposit."); |
|
|
|
} |
|
|
|
else if (string.IsNullOrEmpty(model.RemitReceiverDetails.ReceiverAccountNo)) |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.FAILED, "ReceiverAccountNo can not be empty for payment type Bank Deposit."); |
|
|
|
_response = new ApiResponse(ResponseHelper.FAILED, "ReceiverAccountNo can not be empty for payment type Bank Deposit."); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_response = new CommonResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS); |
|
|
|
_response = new ApiResponse(ResponseHelper.SUCCESS, ResponseMessageHelper.SUCCESS); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|