Fixed API calls on governance page

Enforced multitenancy
This commit is contained in:
2026-09-26 10:28:43 +02:00
parent b2688867f3
commit f3a8f78144
16 changed files with 3552 additions and 503 deletions
+290 -2
View File
@@ -320,6 +320,7 @@ export interface UpdateOrganisationRequest {
export interface Portfolio {
id: number | string;
tenantId?: number | string;
organisationId: number | string;
name: string | null;
description: string | null;
@@ -346,6 +347,7 @@ export interface UpdatePortfolioRequest {
export interface Programme {
id: number | string;
portfolioId: number | string;
tenantId?: number | string;
name: string | null;
status: ApprovalStatus;
ownedBy: string;
@@ -372,17 +374,42 @@ export interface UpdateProgrammeRequest {
export interface Instrument {
id: number | string;
programmeId: number | string;
tenantId?: number | string;
code: string | null;
name: string | null;
description: string | null;
status: ActivityStatus;
createdBy: string;
createdAt: string;
createdBy?: string;
createdAt?: string;
updatedBy?: string | null;
updatedAt?: string | null;
}
export type Instruction = Instrument;
export interface CreateInstructionRequest {
programmeId: number | string;
code?: string;
name: string;
description: string;
status?: ActivityStatus;
userId?: string;
}
export interface UpdateInstructionRequest {
instructionId: number | string;
programmeId?: number | string;
code?: string;
name: string;
description: string;
status: ActivityStatus;
userId?: string;
}
export interface Project {
id: number | string;
programmeId: number | string;
tenantId?: number | string;
name: string | null;
description: string | null;
sector: IndustrySector;
@@ -422,6 +449,7 @@ export interface UpdateProjectStatusRequest {
export interface Activity {
id: number | string;
tenantId?: number | string;
projectId: number | string | null;
milestoneId: number | string | null;
category: string | null;
@@ -461,6 +489,7 @@ export interface UpdateActivityRequest {
export interface Milestone {
id: number | string;
tenantId?: number | string;
projectId: number | string;
name: string | null;
dueAt: string;
@@ -490,6 +519,7 @@ export interface UpdateMilestoneRequest {
export interface Award {
id: number | string;
organisationId: number | string;
tenantId?: number | string;
programmeId: number | string;
projectId?: number | string | null;
amount: number;
@@ -514,6 +544,7 @@ export interface CreateAwardRequest {
export interface Contract {
id: number | string;
tenantId?: number | string;
awardId: number | string;
totalValue: number;
effectiveAt?: string | null;
@@ -545,6 +576,7 @@ export interface ExecuteContractRequest {
export interface Budget {
id: number | string;
tenantId?: number | string;
projectId: number | string;
name: string | null;
amount: number;
@@ -562,6 +594,7 @@ export interface CreateBudgetRequest {
export interface Disbursement {
id: number | string;
tenantId?: number | string;
projectId: number | string;
milestoneId?: number | string | null;
amount: number;
@@ -588,6 +621,7 @@ export interface UpdateDisbursementRequest {
export interface Indicator {
id: number | string;
tenantId?: number | string;
projectId: number | string;
name: string | null;
unitOfMeasure?: UnitOfMeasure | null;
@@ -608,6 +642,7 @@ export interface CreateIndicatorRequest {
export interface Risk {
id: number | string;
tenantId?: number | string;
projectId: number | string;
name: string | null;
description: string | null;
@@ -638,6 +673,7 @@ export interface UpdateRiskRequest {
export interface Evidence {
id: number | string;
tenantId?: number | string;
projectId: number | string;
milestoneId?: number | string | null;
indicatorId?: number | string | null;
@@ -663,6 +699,7 @@ export interface UpdateEvidenceRequest {
export interface Invite {
id: number | string;
tenantId?: number | string;
organisationId: number | string;
invitedOrganisationId: number | string;
awardId: number | string;
@@ -685,3 +722,254 @@ export interface InviteRequest {
message: string;
platform: NotificationPlatform;
}
// ==========================================
// New OpenAPI 3.1.1 Entities & Request Models
// ==========================================
export interface Tenant {
id: number | string;
name: string | null;
status?: ActivityStatus;
createdBy?: string;
createdAt?: string;
updatedBy?: string | null;
updatedAt?: string | null;
creator?: User | null;
updator?: User | null;
}
export interface CreateTenantRequest {
name: string;
}
export interface UpdateTenantRequest {
tenantId: number | string;
name: string;
status: ActivityStatus;
}
export interface Beneficiary {
id: number | string;
tenantId?: number | string;
projectId: number | string;
userId?: string;
createdBy?: string;
createdAt?: string;
name: string | null;
category: string | null;
targetCount?: number;
reachedCount?: number;
location: string | null;
}
export interface CreateBeneficiaryRequest {
projectId: number | string;
name: string;
category: string;
location: string;
targetCount: number;
reachedCount: number;
}
export interface UpdateBeneficiaryRequest {
beneficiaryId: number | string;
name: string;
category: string;
location: string;
targetCount: number;
reachedCount: number;
}
export interface Outcome {
id: number | string;
tenantId?: number | string;
beneficiaryId: number | string;
name: string | null;
description: string | null;
createdBy?: string;
createdAt?: string;
}
export interface CreateOutcomeRequest {
beneficiaryId: number | string;
name: string;
description: string;
}
export interface UpdateOutcomeRequest {
outcomeId: number | string;
name: string;
description: string;
}
export interface ChangeRequest {
id: number | string;
tenantId?: number | string;
projectId: number | string;
title: string | null;
justification: string | null;
revisedBudget?: number | null;
revisedEndedAt?: string | null;
status: ApprovalStatus;
createdBy: string;
approvedBy?: string | null;
createdAt: string;
updatedAt?: string | null;
}
export interface CreateChangeRequest {
projectId: number | string;
title: string;
justification: string;
revisedBudget: number;
revisionDate: string;
}
export interface UpdateChangeRequest {
changeRequestId: number | string;
title: string;
justification: string;
revisedBudget: number;
status: ApprovalStatus;
}
export interface ComplianceItem {
id: number | string;
tenantId?: number | string;
projectId: number | string;
title: string | null;
requirements: string | null;
status: ApprovalStatus;
createdBy: string;
verifiedBy?: string | null;
createdAt: string;
updatedAt?: string | null;
}
export interface CreateComplianceItemRequest {
projectId: number | string;
title: string;
requirements: string;
}
export interface UpdateComplianceItemRequest {
complianceItemId: number | string;
title: string;
requirements: string;
status: ApprovalStatus;
}
export interface Issue {
id: number | string;
tenantId?: number | string;
projectId: number | string;
title: string | null;
description: string | null;
priority: Priority;
status: ActivityStatus;
createdBy: string;
createdAt: string;
assignedTo?: string | null;
resolvedAt?: string | null;
resolution?: string | null;
}
export interface CreateIssueRequest {
projectId: number | string;
title: string;
description: string;
priority: Priority;
assignedTo: string;
}
export interface UpdateIssueRequest {
issueId: number | string;
title: string;
description: string;
resolution: string;
resolvedAt?: string | null;
priority: Priority;
status: ActivityStatus;
assignedTo: string;
}
export interface SiteVisit {
id: number | string;
tenantId?: number | string;
projectId: number | string;
visitedAt: string;
inspectorName: string | null;
findings: string | null;
status: ApprovalStatus;
createdBy: string;
createdAt: string;
}
export interface CreateSiteVisitRequest {
projectId: number | string;
inspectorName: string;
findings: string;
visitedAt: string;
}
export interface UpdateSiteVisitRequest {
siteVisitId: number | string;
inspectorName: string;
findings: string;
status: ApprovalStatus;
visitedAt: string;
}
export interface Rule {
id: number | string;
tenantId?: number | string;
programmeId: number | string;
createdBy: string;
updatedBy?: string | null;
createdAt: string;
updatedAt?: string | null;
name: string | null;
description: string | null;
version?: number;
status: ActivityStatus;
}
export interface CreateRuleRequest {
programmeId: number | string;
userId: string;
name: string;
description: string;
}
export interface UpdateRuleRequest {
ruleId: number | string;
userId: string;
name: string;
description: string;
status: ActivityStatus;
version: number;
programmeId?: number | string;
}
export interface Pagination {
index?: number | string;
page?: number;
pageSize?: number;
}
export interface Notification {
id: number | string;
tenantId?: number | string;
organisationId: number | string;
recipient: string;
platform: NotificationPlatform;
status: NotificationStatus;
subject: string | null;
message: string | null;
destination: string | null;
createdAt: string;
sentAt?: string | null;
updatedAt?: string | null;
error?: string | null;
}