Added organisation entity
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
namespace PostFundManagement.Domain.Configuration;
|
||||||
|
|
||||||
|
public sealed class Organisation : IEntityTypeConfiguration<Entities.Organisation>
|
||||||
|
{
|
||||||
|
public void Configure(EntityTypeBuilder<Entities.Organisation> builder)
|
||||||
|
{
|
||||||
|
builder.ToTable(nameof(Entities.Organisation).Pluralize());
|
||||||
|
|
||||||
|
builder.HasKey(pk => pk.Id);
|
||||||
|
builder.Property(f => f.CreatedBy).IsRequired();
|
||||||
|
builder.Property(f => f.CreatedAt).IsRequired().HasDefaultValueSql("now()");
|
||||||
|
builder.Property(f => f.RegistrationNo).IsRequired().HasMaxLength(256);
|
||||||
|
builder.Property(f => f.Name).IsRequired().HasMaxLength(256);
|
||||||
|
builder.Property(f => f.Email).IsRequired().HasMaxLength(256);
|
||||||
|
builder.Property(f => f.Type).IsRequired().HasDefaultValue(OrganisationType.PrivateLimitedCompany);
|
||||||
|
builder.Property(f => f.Status).IsRequired().HasDefaultValue(ActivityStatus.Active);
|
||||||
|
|
||||||
|
builder.HasOne(f => f.Creator)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey(fk => fk.CreatedBy)
|
||||||
|
.IsRequired()
|
||||||
|
.OnDelete(DeleteBehavior.NoAction);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace PostFundManagement.Domain.Entities;
|
||||||
|
|
||||||
|
[EntityTypeConfiguration<Configuration.Organisation, Organisation>]
|
||||||
|
public class Organisation : Models.Organisation
|
||||||
|
{
|
||||||
|
public virtual User? Creator { get; set; }
|
||||||
|
}
|
||||||
@@ -1,5 +1,49 @@
|
|||||||
namespace PostFundManagement.Domain;
|
namespace PostFundManagement.Domain;
|
||||||
|
|
||||||
|
public enum OrganisationType : int
|
||||||
|
{
|
||||||
|
// Non-Profit & Civil Society
|
||||||
|
NonGovernmentalOrganisation = 1, // NGO / NPO
|
||||||
|
CivilSocietyOrganisation = 2, // CSO / Community-based group
|
||||||
|
Trust = 3, // Charitable Trust / Foundation
|
||||||
|
FaithBasedOrganisation = 4, // FBO
|
||||||
|
|
||||||
|
// Commercial & Private Sector
|
||||||
|
PrivateLimitedCompany = 5, // Pty Ltd / Ltd
|
||||||
|
PublicLimitedCompany = 6, // PLC
|
||||||
|
SoleProprietorship = 7, // Individual / Sole Trader
|
||||||
|
Partnership = 8, // General / Limited Partnership
|
||||||
|
SocialEnterprise = 9, // Revenue-generating impact entity
|
||||||
|
|
||||||
|
// Public Sector & Government
|
||||||
|
NationalGovernmentMinistry = 10, // Department / Ministry
|
||||||
|
ProvincialGovernmentEntity = 11, // State / Provincial authority
|
||||||
|
LocalGovernmentMunicipality = 12,// District / City Council
|
||||||
|
StateOwnedEnterprise = 13, // Parastatal / SOE
|
||||||
|
PublicAgency = 14, // Statutory body / Regulator
|
||||||
|
|
||||||
|
// Academia & Research
|
||||||
|
PublicUniversity = 15,
|
||||||
|
PrivateUniversity = 16,
|
||||||
|
ResearchInstitute = 17, // Science / Policy think tank
|
||||||
|
TechnicalVocationalCollege = 18, // TVET / Vocational school
|
||||||
|
|
||||||
|
// Cooperative & Financial
|
||||||
|
Cooperative = 19, // Producer / Worker co-op
|
||||||
|
MicrofinanceInstitution = 20, // MFI / Financial Intermediary
|
||||||
|
CommercialBank = 21,
|
||||||
|
DevelopmentFinanceInstitution = 22, // DFI / Multilateral Bank
|
||||||
|
|
||||||
|
// International & Multilateral
|
||||||
|
UnitedNationsAgency = 23, // UN / UNDP / UNICEF
|
||||||
|
IntergovernmentalOrganisation = 24, // IGO (e.g., AU, SADC, EU)
|
||||||
|
InternationalNGO = 25, // INGO
|
||||||
|
|
||||||
|
// Consortium & Special Vehicles
|
||||||
|
Consortium = 26, // Unincorporated joint venture
|
||||||
|
SpecialPurposeVehicle = 27 // SPV / Joint Venture Entity
|
||||||
|
}
|
||||||
|
|
||||||
public enum Priority : int
|
public enum Priority : int
|
||||||
{
|
{
|
||||||
Low = 1,
|
Low = 1,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public class Organisation
|
|||||||
|
|
||||||
public string? Email { get; set; }
|
public string? Email { get; set; }
|
||||||
|
|
||||||
public int Type { get; set; }
|
public OrganisationType Type { get; set; }
|
||||||
|
|
||||||
public ActivityStatus Status { get; set; }
|
public ActivityStatus Status { get; set; }
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@ namespace PostFundManagement.Infrastructure.Database;
|
|||||||
|
|
||||||
public sealed class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : DbContext(options)
|
public sealed class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : DbContext(options)
|
||||||
{
|
{
|
||||||
|
public DbSet<Organisation> Organisations => Set<Organisation>();
|
||||||
|
|
||||||
public DbSet<Rule> Rules => Set<Rule>();
|
public DbSet<Rule> Rules => Set<Rule>();
|
||||||
|
|
||||||
public DbSet<Programme> Programmes => Set<Programme>();
|
public DbSet<Programme> Programmes => Set<Programme>();
|
||||||
|
|||||||
Reference in New Issue
Block a user