- Move login and refresh endpoints under a unified /auth route group
- Relocate institution connection logic from /accounts to /institutions
- Implement GET /institutions/{id}/available to fetch real-time Plaid
accounts
- Introduce HttpRequestBuilder utility to streamline integration testing
- Enhance PlaidService with GetAccountsAsync to support account fetching
- Clean up global usings and project structure for better domain
isolation
29 lines
939 B
C#
29 lines
939 B
C#
namespace FiscalOS.API.Accounts.Add;
|
|
|
|
public record Request : IValidatableObject
|
|
{
|
|
public string PlaidInstitutionId { get; init; } = string.Empty;
|
|
public string PlaidAccountId { get; init; } = string.Empty;
|
|
public string PlaidAccountName { get; init; } = string.Empty;
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(PlaidInstitutionId))
|
|
{
|
|
var fieldName = nameof(PlaidInstitutionId);
|
|
yield return new($"The {fieldName} field is required.", [fieldName]);
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(PlaidAccountId))
|
|
{
|
|
var fieldName = nameof(PlaidAccountId);
|
|
yield return new($"The {fieldName} field is required.", [fieldName]);
|
|
}
|
|
|
|
if (string.IsNullOrWhiteSpace(PlaidAccountName))
|
|
{
|
|
var fieldName = nameof(PlaidAccountName);
|
|
yield return new($"The {fieldName} field is required.", [fieldName]);
|
|
}
|
|
}
|
|
} |