Added PFM Console UI project
This commit is contained in:
@@ -0,0 +1,666 @@
|
||||
/**
|
||||
* Post Fund Management (PFM) Console - Domain & API Types
|
||||
* Based on OpenAPI 3.1.1 specification and PFM System Requirements Specification v2.0
|
||||
*/
|
||||
|
||||
// ==========================================
|
||||
// Enumerations
|
||||
// ==========================================
|
||||
|
||||
export enum EmailStatuses {
|
||||
GeneralError = 0,
|
||||
AuthenticationError = 1,
|
||||
ProtocolError = 2,
|
||||
Connected = 3,
|
||||
Disconnected = 4,
|
||||
TooManyConnections = 5,
|
||||
ConnectionAborted = 6,
|
||||
Success = 7,
|
||||
}
|
||||
|
||||
export enum NotificationStatus {
|
||||
Pending = 1,
|
||||
Queued = 2,
|
||||
Processing = 3,
|
||||
Sent = 4,
|
||||
Delivered = 5,
|
||||
Read = 6,
|
||||
Failed = 7,
|
||||
Cancelled = 8,
|
||||
Bounced = 9,
|
||||
}
|
||||
|
||||
export enum NotificationPlatform {
|
||||
Email = 1,
|
||||
SMS = 2,
|
||||
WhatsApp = 3,
|
||||
PushNotification = 4,
|
||||
InApp = 5,
|
||||
Teams = 6,
|
||||
Slack = 7,
|
||||
Webhook = 8,
|
||||
Other = 99,
|
||||
}
|
||||
|
||||
export enum EvidenceType {
|
||||
AttendanceRegister = 1,
|
||||
BankStatement = 2,
|
||||
CompletionCertificate = 3,
|
||||
FinancialInvoiceOrReceipt = 4,
|
||||
GeotaggedPhoto = 5,
|
||||
InspectionReport = 6,
|
||||
MeetingMinutes = 7,
|
||||
PayrollOrStipendRegister = 8,
|
||||
ProcurementDocument = 9,
|
||||
TechnicalSpecificationOrDesign = 10,
|
||||
VideoRecording = 11,
|
||||
Other = 99,
|
||||
// Compatibility aliases
|
||||
ProgressReport = 1,
|
||||
FinancialStatement = 2,
|
||||
Invoice = 4,
|
||||
DeliverableProof = 10,
|
||||
Certification = 3,
|
||||
AuditReport = 6,
|
||||
}
|
||||
|
||||
export enum ProjectType {
|
||||
CapacityBuildingAndTraining = 1,
|
||||
CapitalExpenditureAndInfrastructure = 2,
|
||||
CommercializationAndScaling = 3,
|
||||
FeasibilityAndTechnicalAssistance = 4,
|
||||
OperationalGrantAndSubsidy = 5,
|
||||
ProductDevelopmentAndPrototyping = 6,
|
||||
ResearchAndDevelopment = 7,
|
||||
SocialImpactAndCommunityDevelopment = 8,
|
||||
TechnologyTransferAndAdoption = 9,
|
||||
Innovation = 10,
|
||||
Other = 99,
|
||||
// Compatibility aliases
|
||||
Grant = 5,
|
||||
BlendedFinance = 3,
|
||||
TechnicalAssistance = 4,
|
||||
}
|
||||
|
||||
export enum IndustrySector {
|
||||
AgricultureAndAgroProcessing = 1,
|
||||
AutomotiveAndTransportEquipment = 2,
|
||||
ChemicalsAndPharmaceuticals = 3,
|
||||
ConstructionAndInfrastructure = 4,
|
||||
CreativeIndustriesAndMedia = 5,
|
||||
DefenseAndAerospace = 6,
|
||||
EducationAndSkillsDevelopment = 7,
|
||||
EnergyAndUtilities = 8,
|
||||
FinancialServices = 9,
|
||||
HealthcareAndLifeSciences = 10,
|
||||
InformationCommunicationTechnology = 11,
|
||||
ManufacturingAndIndustrial = 12,
|
||||
MiningAndMetals = 13,
|
||||
RealEstateAndHousing = 14,
|
||||
RetailAndConsumerGoods = 15,
|
||||
TourismAndHospitality = 16,
|
||||
WaterAndSanitation = 17,
|
||||
Other = 99,
|
||||
// Compatibility aliases
|
||||
AgriTech = 1,
|
||||
CleanEnergy = 8,
|
||||
HealthTech = 10,
|
||||
Education = 7,
|
||||
ICTDigital = 11,
|
||||
Manufacturing = 12,
|
||||
SocialDevelopment = 15,
|
||||
}
|
||||
|
||||
export enum OrganisationType {
|
||||
NonGovernmentalOrganisation = 1,
|
||||
CivilSocietyOrganisation = 2,
|
||||
Trust = 3,
|
||||
FaithBasedOrganisation = 4,
|
||||
PrivateLimitedCompany = 5,
|
||||
PublicLimitedCompany = 6,
|
||||
SoleProprietorship = 7,
|
||||
Partnership = 8,
|
||||
SocialEnterprise = 9,
|
||||
NationalGovernmentMinistry = 10,
|
||||
ProvincialGovernmentEntity = 11,
|
||||
LocalGovernmentMunicipality = 12,
|
||||
StateOwnedEnterprise = 13,
|
||||
PublicAgency = 14,
|
||||
PublicUniversity = 15,
|
||||
PrivateUniversity = 16,
|
||||
ResearchInstitute = 17,
|
||||
TechnicalVocationalCollege = 18,
|
||||
Cooperative = 19,
|
||||
MicrofinanceInstitution = 20,
|
||||
CommercialBank = 21,
|
||||
DevelopmentFinanceInstitution = 22,
|
||||
UnitedNationsAgency = 23,
|
||||
IntergovernmentalOrganisation = 24,
|
||||
InternationalNGO = 25,
|
||||
Consortium = 26,
|
||||
SpecialPurposeVehicle = 27,
|
||||
// Compatibility aliases
|
||||
GovernmentDepartment = 10,
|
||||
CorporateCSI = 3,
|
||||
Enterprise = 5,
|
||||
}
|
||||
|
||||
export enum Priority {
|
||||
Low = 1,
|
||||
Medium = 2,
|
||||
High = 3,
|
||||
Critical = 4,
|
||||
}
|
||||
|
||||
export enum UnitOfMeasure {
|
||||
Count = 1,
|
||||
Percentage = 2,
|
||||
Currency = 3,
|
||||
Area = 4,
|
||||
Weight = 5,
|
||||
Volume = 6,
|
||||
DurationDays = 7,
|
||||
DurationMonths = 8,
|
||||
Ratio = 9,
|
||||
// Compatibility alias
|
||||
CurrencyZAR = 3,
|
||||
}
|
||||
|
||||
export enum ContractStatus {
|
||||
Draft = 1,
|
||||
PendingApproval = 2,
|
||||
Active = 3,
|
||||
Expired = 4,
|
||||
Terminated = 5,
|
||||
Amended = 6,
|
||||
// Compatibility aliases
|
||||
UnderReview = 2,
|
||||
Executed = 3,
|
||||
}
|
||||
|
||||
export enum RiskLikelihood {
|
||||
Rare = 1,
|
||||
Unlikely = 2,
|
||||
Possible = 3,
|
||||
Likely = 4,
|
||||
AlmostCertain = 5,
|
||||
// Compatibility aliases
|
||||
VeryLow = 1,
|
||||
Low = 2,
|
||||
Medium = 3,
|
||||
High = 4,
|
||||
VeryHigh = 5,
|
||||
}
|
||||
|
||||
export enum RiskImpact {
|
||||
Minor = 1,
|
||||
Moderate = 2,
|
||||
Major = 3,
|
||||
Critical = 4,
|
||||
Severe = 5,
|
||||
// Compatibility aliases
|
||||
Insignificant = 1,
|
||||
}
|
||||
|
||||
export enum ApprovalStatus {
|
||||
Pending = 1,
|
||||
Review = 2,
|
||||
Approved = 3,
|
||||
Rejected = 4,
|
||||
Removed = 5,
|
||||
// Compatibility aliases
|
||||
Draft = 1,
|
||||
PendingReview = 2,
|
||||
}
|
||||
|
||||
export enum ActivityStatus {
|
||||
Active = 1,
|
||||
Inactive = 2,
|
||||
Disabled = 3,
|
||||
// Compatibility alias
|
||||
Suspended = 3,
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// Entities
|
||||
// ==========================================
|
||||
|
||||
export interface ProblemDetails {
|
||||
type?: string | null;
|
||||
title?: string | null;
|
||||
status?: number | null;
|
||||
detail?: string | null;
|
||||
instance?: string | null;
|
||||
errors?: Record<string, string[]>;
|
||||
}
|
||||
|
||||
export interface Dashboard {
|
||||
portfolioValue: number;
|
||||
activeAwards: number;
|
||||
disbursed: number;
|
||||
onTrackPercentage: number;
|
||||
atRiskCount: number;
|
||||
beneficiariesReached: number;
|
||||
}
|
||||
|
||||
export enum UserRole {
|
||||
SuperAdmin = 1,
|
||||
Executive = 2,
|
||||
ProgrammeManager = 3,
|
||||
FinanceOfficer = 4,
|
||||
RecipientViewer = 5,
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string | null;
|
||||
status: ActivityStatus;
|
||||
lastLoginAt: string | null;
|
||||
role?: string | UserRole;
|
||||
name?: string;
|
||||
organisationId?: number | string;
|
||||
organisationName?: string;
|
||||
}
|
||||
|
||||
export type SystemUser = User;
|
||||
|
||||
export interface InviteUserRequest {
|
||||
email: string;
|
||||
role: UserRole;
|
||||
organisationId: number | string;
|
||||
}
|
||||
|
||||
export interface AuditLog {
|
||||
id: string;
|
||||
action: string;
|
||||
entityType: string;
|
||||
entityId: string | number;
|
||||
userEmail: string;
|
||||
details?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface UserFilterRequest {
|
||||
status?: ActivityStatus | null;
|
||||
email?: string | null;
|
||||
sortBy?: string | null;
|
||||
sortDescending?: boolean;
|
||||
}
|
||||
|
||||
export interface Organisation {
|
||||
id: number | string;
|
||||
name: string | null;
|
||||
registrationNo: string | null;
|
||||
email: string | null;
|
||||
type: OrganisationType;
|
||||
status: ActivityStatus;
|
||||
createdAt: string;
|
||||
createdBy: string;
|
||||
}
|
||||
|
||||
export interface CreateOrganisationRequest {
|
||||
name: string;
|
||||
registrationNo: string;
|
||||
email: string;
|
||||
type: OrganisationType;
|
||||
}
|
||||
|
||||
export interface UpdateOrganisationRequest {
|
||||
organisationId: number | string;
|
||||
name: string;
|
||||
registrationNo: string;
|
||||
email: string;
|
||||
type: OrganisationType;
|
||||
status?: ActivityStatus;
|
||||
}
|
||||
|
||||
export interface Portfolio {
|
||||
id: number | string;
|
||||
organisationId: number | string;
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
ownedBy: string;
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface CreatePortfolioRequest {
|
||||
name: string;
|
||||
description: string;
|
||||
organisationId: number | string;
|
||||
ownerId: string;
|
||||
}
|
||||
|
||||
export interface UpdatePortfolioRequest {
|
||||
portfolioId: number | string;
|
||||
name: string;
|
||||
description: string;
|
||||
organisationId?: number | string;
|
||||
ownerId: string;
|
||||
}
|
||||
|
||||
export interface Programme {
|
||||
id: number | string;
|
||||
portfolioId: number | string;
|
||||
name: string | null;
|
||||
status: ApprovalStatus;
|
||||
ownedBy: string;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
}
|
||||
|
||||
export interface CreateProgrammeRequest {
|
||||
portfolioId: number | string;
|
||||
name: string;
|
||||
ownerId: string;
|
||||
}
|
||||
|
||||
export interface UpdateProgrammeRequest {
|
||||
programmeId: number | string;
|
||||
name: string;
|
||||
ownerId: string;
|
||||
status: ApprovalStatus;
|
||||
portfolioId?: number | string;
|
||||
}
|
||||
|
||||
export interface Instrument {
|
||||
id: number | string;
|
||||
programmeId: number | string;
|
||||
code: string | null;
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
status: ActivityStatus;
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
id: number | string;
|
||||
programmeId: number | string;
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
sector: IndustrySector;
|
||||
projectType: ProjectType;
|
||||
status: ApprovalStatus;
|
||||
startedAt?: string | null;
|
||||
endedAt?: string | null;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
programmeName?: string;
|
||||
}
|
||||
|
||||
export interface CreateProjectRequest {
|
||||
programmeId: number | string;
|
||||
name: string;
|
||||
description: string;
|
||||
sector: IndustrySector;
|
||||
projectType: ProjectType;
|
||||
}
|
||||
|
||||
export interface UpdateProjectRequest {
|
||||
projectId: number | string;
|
||||
name: string;
|
||||
description: string;
|
||||
startedAt?: string | null;
|
||||
endedAt?: string | null;
|
||||
sector: IndustrySector;
|
||||
projectType: ProjectType;
|
||||
}
|
||||
|
||||
export interface UpdateProjectStatusRequest {
|
||||
projectId: number | string;
|
||||
status: ApprovalStatus;
|
||||
}
|
||||
|
||||
export interface Activity {
|
||||
id: number | string;
|
||||
projectId: number | string | null;
|
||||
milestoneId: number | string | null;
|
||||
category: string | null;
|
||||
status: ApprovalStatus;
|
||||
amount: number;
|
||||
title: string | null;
|
||||
description: string | null;
|
||||
performedAt?: string | null;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
approvedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
}
|
||||
|
||||
export interface CreateActivityRequest {
|
||||
projectId: number | string;
|
||||
milestoneId?: number | string | null;
|
||||
category: string;
|
||||
amount: number;
|
||||
title: string;
|
||||
description: string;
|
||||
performedAt?: string | null;
|
||||
}
|
||||
|
||||
export interface Milestone {
|
||||
id: number | string;
|
||||
projectId: number | string;
|
||||
name: string | null;
|
||||
dueAt: string;
|
||||
status: ApprovalStatus;
|
||||
priority: Priority;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
}
|
||||
|
||||
export interface CreateMilestoneRequest {
|
||||
projectId: number | string;
|
||||
name: string;
|
||||
dueAt: string;
|
||||
priority: Priority;
|
||||
}
|
||||
|
||||
export interface UpdateMilestoneRequest {
|
||||
milestoneId: number | string;
|
||||
name: string;
|
||||
dueAt: string;
|
||||
priority: Priority;
|
||||
status: ApprovalStatus;
|
||||
}
|
||||
|
||||
export interface Award {
|
||||
id: number | string;
|
||||
organisationId: number | string;
|
||||
programmeId: number | string;
|
||||
projectId?: number | string | null;
|
||||
amount: number;
|
||||
status: ApprovalStatus;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
approvedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
referenceNo?: string;
|
||||
organisationName?: string;
|
||||
programmeName?: string;
|
||||
}
|
||||
|
||||
export interface CreateAwardRequest {
|
||||
organisationId: number | string;
|
||||
programmeId: number | string;
|
||||
amount: number;
|
||||
referenceNo?: string;
|
||||
fundingPeriod?: string;
|
||||
}
|
||||
|
||||
export interface Contract {
|
||||
id: number | string;
|
||||
awardId: number | string;
|
||||
totalValue: number;
|
||||
effectiveAt?: string | null;
|
||||
expiresAt?: string | null;
|
||||
status: ContractStatus;
|
||||
externalSignatureId?: string | null;
|
||||
signedDocumentUrl?: string | null;
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface CreateContractRequest {
|
||||
awardId: number | string;
|
||||
totalValue: number;
|
||||
effectiveAt: string;
|
||||
expiresAt: string;
|
||||
}
|
||||
|
||||
export interface ExecuteContractRequest {
|
||||
contractId: number | string;
|
||||
externalSignatureId: string;
|
||||
signedDocumentUrl: string;
|
||||
}
|
||||
|
||||
export interface Budget {
|
||||
id: number | string;
|
||||
projectId: number | string;
|
||||
name: string | null;
|
||||
amount: number;
|
||||
createdBy: string;
|
||||
approvedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
}
|
||||
|
||||
export interface CreateBudgetRequest {
|
||||
projectId: number | string;
|
||||
name: string;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
export interface Disbursement {
|
||||
id: number | string;
|
||||
projectId: number | string;
|
||||
milestoneId?: number | string | null;
|
||||
amount: number;
|
||||
status: ApprovalStatus;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
paymentReference?: string | null;
|
||||
conditionsChecked?: boolean;
|
||||
}
|
||||
|
||||
export interface CreateDisbursementRequest {
|
||||
projectId: number | string;
|
||||
milestoneId?: number | string | null;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
export interface UpdateDisbursementRequest {
|
||||
disbursementId: number | string;
|
||||
milestoneId?: number | string | null;
|
||||
amount: number;
|
||||
}
|
||||
|
||||
export interface Indicator {
|
||||
id: number | string;
|
||||
projectId: number | string;
|
||||
name: string | null;
|
||||
unitOfMeasure?: UnitOfMeasure | null;
|
||||
baselineAmount: number;
|
||||
targetAmount: number;
|
||||
actualAmount: number;
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface CreateIndicatorRequest {
|
||||
projectId: number | string;
|
||||
name: string;
|
||||
unitOfMeasure: UnitOfMeasure;
|
||||
baselineAmount: number;
|
||||
targetAmount: number;
|
||||
}
|
||||
|
||||
export interface Risk {
|
||||
id: number | string;
|
||||
projectId: number | string;
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
likelihood: RiskLikelihood;
|
||||
impact: RiskImpact;
|
||||
createdBy: string;
|
||||
createdAt: string;
|
||||
owner?: string;
|
||||
mitigationAction?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface CreateRiskRequest {
|
||||
projectId: number | string;
|
||||
name: string;
|
||||
description: string;
|
||||
likelihood: RiskLikelihood;
|
||||
impact: RiskImpact;
|
||||
}
|
||||
|
||||
export interface UpdateRiskRequest {
|
||||
riskId: number | string;
|
||||
name: string;
|
||||
description: string;
|
||||
likelihood: RiskLikelihood;
|
||||
impact: RiskImpact;
|
||||
}
|
||||
|
||||
export interface Evidence {
|
||||
id: number | string;
|
||||
projectId: number | string;
|
||||
milestoneId?: number | string | null;
|
||||
indicatorId?: number | string | null;
|
||||
activityId?: number | string | null;
|
||||
version: number;
|
||||
type: EvidenceType;
|
||||
documentUrl?: string | null;
|
||||
status: ApprovalStatus;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
fileName?: string;
|
||||
fileSize?: string;
|
||||
}
|
||||
|
||||
export interface UpdateEvidenceRequest {
|
||||
evidenceId: number | string;
|
||||
version: number;
|
||||
evidenceType: EvidenceType;
|
||||
status: ApprovalStatus;
|
||||
}
|
||||
|
||||
export interface Invite {
|
||||
id: number | string;
|
||||
organisationId: number | string;
|
||||
invitedOrganisationId: number | string;
|
||||
awardId: number | string;
|
||||
contractId: number | string;
|
||||
recipient: string;
|
||||
createdBy: string;
|
||||
updatedBy?: string | null;
|
||||
createdAt: string;
|
||||
updatedAt?: string | null;
|
||||
message?: string;
|
||||
platform?: NotificationPlatform;
|
||||
}
|
||||
|
||||
export interface InviteRequest {
|
||||
organisationId: number | string;
|
||||
invitedOrganisationId: number | string;
|
||||
awardId: number | string;
|
||||
contractId: number | string;
|
||||
recipient: string;
|
||||
message: string;
|
||||
platform: NotificationPlatform;
|
||||
}
|
||||
Reference in New Issue
Block a user