Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.

Phase 5: migrate certifications to live typed data contract#182

Merged
Shannon1980 merged 1 commit into
mainfrom
feat/phase5-certifications-live-data
Mar 13, 2026
Merged

Phase 5: migrate certifications to live typed data contract#182
Shannon1980 merged 1 commit into
mainfrom
feat/phase5-certifications-live-data

Conversation

@Shannon1980

Copy link
Copy Markdown
Owner

Summary

  • remove runtime dependency on mock-certifications for the certifications UI
  • introduce shared typed certifications model contract for UI + API in src/lib/certifications/model.ts
  • harden /certifications live-data UX with loading/error/empty handling, last-updated timestamp, and manual refresh state
  • standardize certifications API response contract with data + meta.lastUpdated and typed normalization
  • preserve existing CRUD fields/behavior (create, edit, delete, status, docs, key dates, notes)

What changed

UI

  • src/app/certifications/page.tsx now consumes parsed live API contract via parseCertificationsApiResponse
  • added explicit refreshing and lastUpdated state
  • manual refresh button shows active state
  • error-first empty view now includes retry CTA
  • auto-refresh remains at 15s
  • CertEditModal now remounts per selected cert (key={editingCert.id}) to keep edit behavior deterministic

Model

  • new src/lib/certifications/model.ts contains:
    • core types: Certification, CertStatus, CertLevel, CertDocument
    • API envelope types: CertificationsApiResponse
    • runtime guards/parsers: isCertStatus, isCertLevel, toCertification, parseCertificationsApiResponse
    • health helper migrated from mock module
  • removed src/lib/mock-certifications.ts

API

  • GET /api/certifications now returns { data, meta: { lastUpdated, source } }
  • POST /api/certifications validates level/status and returns normalized typed record from DB RETURNING
  • PATCH /api/certifications/[id] validates level/status updates
  • both API route mappers now normalize/fallback invalid DB values via model guards

Checks

  • ✅ Targeted eslint on touched certifications files:
    • src/app/certifications/page.tsx
    • src/components/certifications/CertCard.tsx
    • src/components/certifications/CertEditModal.tsx
    • src/app/api/certifications/route.ts
    • src/app/api/certifications/[id]/route.ts
    • src/lib/certifications/model.ts
  • ℹ️ Full repo npm run lint currently fails due pre-existing unrelated issues in other modules

@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
claw-command Error Error Mar 13, 2026 11:51pm

Request Review

@Shannon1980 Shannon1980 merged commit adef61d into main Mar 13, 2026
2 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant