Skip to main content

Developer reference: Framework setup (/setup/frameworks)

This document covers the framework definition catalogue, org framework projects (OrgFramework), and the primary HTTP API under /api/frameworks. It summarizes the FrameworkList page at /setup/frameworks; it does not exhaust every control/evidence/risk sub-endpoint (see framework.routes.ts for the full tree).

Repository layout

  • Web client: gaicc-app/Clients
  • API server: gaicc-app/Servers

Routing and pages

ItemLocation
Framework setup UIgaicc-app/Clients/src/presentation/pages/setup/FrameworkList.tsx — route /setup/frameworks in App.tsx
Legacy detail routeFrameworkDetail.tsx redirects to /setup/frameworks (single-page UX)
Create / edit modalgaicc-app/Clients/src/presentation/components/CreateFrameworkModal.tsx
Tab navigationFrameworkTabNav.tsx; tab from ?tab= — valid: dashboard | risks | models | controls | settings (FrameworkList.tsx)

Client data layer

ConcernLocation
Query keysgaicc-app/Clients/src/application/queries/framework.queries.tsframeworkKeys (available, projects, project(id), controls(...))
CatalogueuseAvailableFrameworksGET /api/frameworks
Projects listuseFrameworkProjectsGET /api/frameworks/projects
Create projectuseCreateFrameworkProjectPOST /api/frameworks/projects; invalidates frameworkKeys.projects, available, qk.dashboard, plan usage
Repositorygaicc-app/Clients/src/infrastructure/repositories/framework.repository.ts

DTOsgaicc-app/Clients/src/domain/types/framework.types.tsCreateFrameworkProjectDto, UpdateFrameworkProjectDto, etc.


API surface (app.use("/api", frameworkRoutes))

All routes in framework.routes.ts run authenticateJWT, attachOrganizationId, enforceMutationBillingCompliance unless noted below. Static paths are registered before /:id routes.

MethodPathNotes
GET/frameworksGlobal catalogue of active Framework definitions; each row includes isActivated if the org already linked that definition via OrgFrameworkRegulation (framework.service getAvailableFrameworks)
GET/frameworks/projectsList OrgFramework projects for the tenant
POST/frameworks/projectsenforcePlanLimit("frameworks") — create project (Admin or Editor only in controller)
GET/frameworks/projects/:idSingle project
PUT/frameworks/projects/:idUpdate project (Admin or Editor)
DELETE/frameworks/projects/:idSoft-delete project
GET/frameworks/projects/:id/statsAggregated stats
GET/frameworks/projects/:id/controlsOptional query useCaseProjectId
PUT/frameworks/projects/:id/controls/:orgControlId/statusStatus-only patch
GET/PUT.../controls/:orgControlIdDetail + full update
Risks / evidenceAdditional GET/POST/DELETE routes under .../controls/:orgControlId/... and .../projects/:id/risks — many gated with enforceSubscription
RegulationsPOST/DELETE .../projects/:id/regulationsAdd/remove linked framework definitions on a project

Controllergaicc-app/Servers/src/controllers/framework.controller.ts

  • Uses Zod CreateProjectSchema / UpdateProjectSchema; errors often return { error: ... } (flatten or string) — not always { message } like some auth routes.
  • createFrameworkProject / updateFrameworkProject: 403 Insufficient permissions if role is not Admin or Editor.

Servicegaicc-app/Servers/src/services/framework.service.ts

  • getAvailableFrameworks: loads active Framework rows; marks isActivated when OrgFrameworkRegulation exists for this org.
  • createFrameworkProject: validates regulation UUIDs, creates OrgFramework, members, links regulations, instantiates control trees (e.g. ISO 27001 / ISO 42001 branches by fw.slug), large transactions (comment notes 60s timeout in code).

Testing notes (TestSprite / external)

  • Happy path: GET /api/frameworks + POST /api/frameworks/projects with a valid applicableRegulations array and Admin/Editor user.
  • GET /api/frameworks/projects returns [] until a project exists — matches FrameworkList empty state.
  • Configure scope in the TestSprite web portal; use this file and framework.routes.ts for exhaustive route lists.