Nano Banana Pro
Agent skill for nano-banana-pro
This file tracks the status of database migrations for the Audit Application.
Sign in to like and favorite skills
This file tracks the status of database migrations for the Audit Application.
audit.AuditUniverse - Master list of auditable entitiesaudit.RiskCriteria - Risk assessment criteria and weightsaudit.RiskAssessments - Risk evaluations for audit universe itemsaudit.AnnualPlans - Annual audit plans with versioningaudit.AnnualPlanItems - Individual audit items within plansaudit.ResourceCapacity - Resource planning and capacity managementaudit.PlanApprovals - Approval workflow audit trailaudit.PlanBaselines - Immutable snapshots of approved plansdb/migrations/0002_rbia.sql(No pending migrations at this time)
/api/audit-universe) - GET/POST endpoints for universe management/api/risk/criteria) - Manage risk criteria and weights/api/risk/assess) - Calculate and store risk assessments/api/plan/items) - Manage annual plan items/app/(app)/rbia/plan/page.tsx) - Complete UI with 5 tabs:
/api/plan/[id]/submit-review) - Changes status to 'under_review'/api/plan/[id]/approve) - Changes status to 'approved'/api/plan/[id]/baseline) - Creates immutable snapshot with SHA256 hash
PlanBaselines table/api/plan/[id]/generate-engagements)
/app/(app)/rbia/plan/RbiaPlanView.tsx)
mode?: 'home' | 'plan' prop/app/page.tsx) - Displays annual plan with MODE=home/app/(app)/rbia/plan/page.tsx) - Uses RbiaPlanView with MODE=planProblem: During RBIA plan integration, home page was completely replaced with RbiaPlanView, removing original redirect to
/shell and navigation structure.
Solution: (October 20, 2025)
/app/page.tsx) - Reverted to redirect('/shell') patternrbiaplan route in AppShell:
rbiaplan to Route type union['IA_Manager', 'IA_Lead', 'IA_Auditor']{route === 'rbiaplan' && <RbiaPlanView mode="plan" />}/lib/i18n.ts) - Added translations:
rbiaplan: 'الخطة السنوية RBIA'rbiaplan: 'RBIA Annual Plan'/ → redirects to /shell (Dashboard)/rbia/plan (standalone page)Feature: Two-step wizard for creating annual audit plans with UI integration in Dashboard and RBIA Plan page.
Implementation: (October 20, 2025)
POST /api/plan - Create new plan with {year, version?, owner_id?}, defaults to status='draft' and version='v1'GET /api/plan/:id - Retrieve plan details by IDPUT /api/plan/:id - Update plan owner/version, returns 403 if status='baselined' (prevents editing approved plans)GET /api/plan/:id/capacity - Get resource capacity or return default values (2080 total hours, 1500 audit, 300 advisory, 180 training, 100 admin)/app/(app)/rbia/plan/CreatePlanWizard.tsx):
/app/(app)/shell/DashboardView.tsx):
/app/(app)/rbia/plan/page.tsx):
?new=1 query parameterFeature: KPI metrics dashboard displaying key performance indicators for annual audit plans on the home page.
Implementation: (October 20, 2025)
lib/plan-metrics.ts):
getPlanItems(planId) - Fetches all AuditTasks for a given annual plan using PrismacalcKpis(items) - Calculates metrics from plan items:
completionPct - Percentage of completed tasks (0-100)totalHours - Sum of estimatedHours for all tasksitemsCount - Total number of tasks in planstatus - Overall plan status (draft/in_progress/nearly_complete/completed)getPlanKpis(planId) - Convenience function combining fetch and calculationAuditTask modelGET /api/plan/latest - Returns the most recent annual plan (ordered by fiscalYear DESC, createdAt DESC)GET /api/plan/:id/kpis - Returns KPI metrics for a specific planapp/(components)/KpiCards.tsx):
app/(app)/shell/DashboardView.tsx):
<KpiCards /> at top of dashboard000X_description.sqlIF NOT EXISTS for CREATE statementsADD COLUMN IF NOT EXISTS for ALTER TABLE statements