This commit is contained in:
Zeeshaun
2026-03-13 09:27:34 -05:00
parent 256f579489
commit a675c5f5b0
381 changed files with 20992 additions and 0 deletions
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LCU.API.Collections.CollectionsApiLib.Models;
namespace LCU.API.Internal.RepoApi.Repos.Models
{
public class RepoCompanySelection : IValidatableObject
{
public int? Id { get; set; }
[Required]
public int? CollateralId { get; set; }
public RepoType RepoType { get; set; }
public int? RepoCompanyId { get; set; }
public DateTime? RepoCompanyAssignmentDate { get; set; }
public DateTime? DateRepoed { get; set; }
public DateTime? DateTimeCreated { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var failedValidations = new List<ValidationResult>();
// This cannot be a required field on account of it resulting in a SQL error
if (RepoType == null)
{
failedValidations.Add(new ValidationResult("Repo Company Selection: The RepoType cannot be blank"));
}
if (RepoCompanyAssignmentDate > DateRepoed)
{
failedValidations.Add(new ValidationResult("Repo Company Selection: The date repoed cannot come before the date assigned."));
}
if (RepoCompanyId != null && RepoCompanyAssignmentDate == null)
{
failedValidations.Add(new ValidationResult("Repo Company Selection: The Repo Company Assignment date cannot be null when a Repo Company is set."));
}
return failedValidations;
}
}
}