first commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Landmark.OLA.Models.Loan
|
||||
{
|
||||
[BsonIgnoreExtraElements]
|
||||
public class DealershipAuthRequest
|
||||
{
|
||||
[Required]
|
||||
public string DealershipCode { get; set; }
|
||||
|
||||
public string DealershipName { get; set; }
|
||||
|
||||
[Required]
|
||||
public string DealershipPassword { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ApplicantLastName { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ApplicationId { get; set; }
|
||||
|
||||
public DealershipAuthRequest(string dealershipCode, string dealershipName, string dealershipPassword, string applicantLastName, string applicationId)
|
||||
{
|
||||
this.DealershipCode = dealershipCode;
|
||||
this.DealershipName = dealershipName;
|
||||
this.DealershipPassword = dealershipPassword;
|
||||
this.ApplicantLastName = applicantLastName;
|
||||
this.ApplicationId = applicationId;
|
||||
}
|
||||
|
||||
public static bool ValidateAuthRequest(DealershipAuthRequest dealershipRequest, DealershipAuthRequest actionResponse)
|
||||
{
|
||||
return dealershipRequest?.Equals(actionResponse) ?? false;
|
||||
}
|
||||
|
||||
public override bool Equals(Object authRequest)
|
||||
{
|
||||
if (authRequest is not DealershipAuthRequest request)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return string.Equals(DealershipCode, request.DealershipCode, StringComparison.Ordinal) &&
|
||||
string.Equals(DealershipPassword, request.DealershipPassword, StringComparison.Ordinal) &&
|
||||
string.Equals(ApplicantLastName, request.ApplicantLastName, StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(ApplicationId, request.ApplicationId, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(
|
||||
DealershipCode?.ToUpperInvariant(),
|
||||
DealershipPassword,
|
||||
ApplicantLastName?.ToUpperInvariant(),
|
||||
ApplicationId?.ToUpperInvariant()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user