feat(core): add models for institution
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
namespace FiscalOS.Core.Accounts;
|
||||
|
||||
public sealed class Institution : Entity
|
||||
{
|
||||
public Guid UserId { get; init; }
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public InstitutionMetadata Metadata { get; init; } = null!;
|
||||
|
||||
private Institution()
|
||||
{
|
||||
}
|
||||
|
||||
public static Institution From(string name, InstitutionMetadata metadata)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(name);
|
||||
ArgumentNullException.ThrowIfNull(metadata);
|
||||
|
||||
return new Institution()
|
||||
{
|
||||
Name = name,
|
||||
Metadata = metadata
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace FiscalOS.Core.Accounts;
|
||||
|
||||
public abstract class InstitutionMetadata : Entity
|
||||
{
|
||||
private readonly string _type;
|
||||
|
||||
public string Type => _type;
|
||||
|
||||
public Guid InstitutionId { get; init; }
|
||||
|
||||
protected InstitutionMetadata(string type)
|
||||
{
|
||||
_type = type;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user