This commit is contained in:
Zeeshaun
2026-04-20 14:47:24 -05:00
parent 89057eceea
commit 8b3ea92501
485 changed files with 71042 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.Shared.Collections.RepoApiLib.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;
}
}
}