All Posts
February 12, 20260.1.4Calmony Sanctions Monitor

v0.1.4 — feat: MVP database schema upgrade, constants, validators & services

Release v0.1.4: MVP Database Schema, Constants, Validators & Services

12 February 2026

This release lays the foundational layer for the Calmony Sanction Monitor MVP.

What changed

  • Database schema: Expanded to 12 tables — new tables for creditTransactions, screeningResults, screeningCertificates, and notifications. Existing tables (users, people, matches, auditLog) gained fields for credit balances, entity types, screening counts, match reasons (JSONB), reviewer tracking, and IP/user-agent logging. 4 PostgreSQL enums defined.
  • Application constants (constants.ts): Credit pricing tiers, confidence thresholds, 30+ audit action types, status configs with labels and CSS classes, pagination defaults, certificate reference generator.
  • Shared Zod validators (validators.ts): Input schemas for person CRUD, match review, credit purchases, screening, audit queries, bulk upload (up to 1,000 records), and CSV column mapping.
  • Audit log service: Fire-and-forget createAuditLog(), request-aware createAuditLogFromRequest() (captures IP + user agent), and createBatchAuditLog() for bulk ops.
  • Credit system service: getCreditBalance() with usage estimates, deductCredits() with atomic transactions, addCredits() with automatic bonus tier calculation.
  • API route upgrades: All existing routes now use shared validators, constants, and services. Screening endpoint tracks duration and creates screeningResults records. Match review records status transitions. GDPR delete covers all new tables. Sanctions sync filters by isActive.
  • Environment placeholders: Added Resend (email) and Stripe (payments) env vars to .env.example.

Why it matters

This is the internal foundation that all upcoming features — tRPC routers, CSV bulk upload, credit management UI, screening certificates, and email notifications — will build on. No user-facing UI changes, but the data model and service layer are now ready for the full MVP.

Technical notes

  • Requires npm run db:push to sync schema changes
  • Status fields use text columns (not enum columns) for backward compatibility
  • New columns have sensible defaults (isMonitored: true, screeningCount: 0, isActive: true)
  • No breaking changes to existing pages

Release Notes

Release v0.1.4 Published ✅

PR #13: feat: MVP database schema upgrade, constants, validators & services

Merge Status: The PR could not be merged via the GitHub API because the changes were already present on the main branch (the content was identical, causing a merge conflict with itself). The code from PR #13 is fully incorporated into main.

Release Created:

Key Changes in This Release:

  1. Database Schema — 12 tables with comprehensive indexes, 4 PostgreSQL enums, TypeScript type exports
  2. Application Constants — Credit pricing, confidence thresholds, status configs, audit actions, and more
  3. Shared Zod Validators — Person CRUD, match review, credit, screening, audit, and bulk upload schemas
  4. Audit Log Service — Fire-and-forget logging with request context and batch support
  5. Credit System Service — Balance queries, atomic deductions, purchases with bonus tiers
  6. Updated API Routes — All existing routes upgraded to use the new foundation
  7. Environment Variables — Resend email and Stripe payment placeholders added