Skip to content

May 22, 2026 — Backend

Release date: Friday, May 22, 2026

Summary

This week introduced a notification platform (queued delivery, templates, in-app feed, and user preferences) and routed welcome, untrusted-device, and inspection-assignment emails through it. Building risk profiles now hold befaring/underwriting inputs and project into insurance workbooks for open years. Coverage-line issuance gained stricter validation (valuation always enforced, non-overlapping BUILDING on-risk periods, shouldRenew tied to year-end dates) plus CoverageRate snapshot tables for issued ratings.

Shipped

  • Notifications: Prisma models, BullMQ/Redis (or inline) processing, multi-channel send, per-user preferences, in-app feed APIs, and seeded templates (USER_WELCOME, UNTRUSTED_DEVICE_SIGN_IN, BUILDING_INSPECTION_ASSIGNED).
  • Notifications — product hooks: Welcome email on user create; untrusted-device sign-in email via notification service; inspector notified (email + in-app) when buildings are assigned to an inspection.
  • Building risk profile: New BuildingRiskProfile resource; underwriting fields moved off BuildingInsuranceProfile; automatic sync into ACTIVE/PROJECTED year workbooks; workbook/coverage reads use coverage.view only.
  • Coverage lines: Reject overlapping BUILDING on-risk calendar days (409 with conflicting line id); validate shouldRenew against 31 December year-end; always run §5.4 valuation checks on preview and issue (removed strictIssue flag).
  • Insurance DB: CoverageRate snapshot tables migration for issued line × rate-type audit trails.
  • Permissions: Removed unused coverage.specialTariff.edit; clarified coverage.manage as issue/expire only.
  • Seeds: Full database seeding re-enabled; notification templates wired into seed; merge-conflict cleanup in prisma/seed.ts.

Engineering (commit recap)

Backend — week of May 18 – May 24, 2026

Window: 2026-05-15 < commit date < 2026-05-23 (git log --no-merges).

Summary

Seventeen non-merge commits landed, dominated by the new notification module (schema, queue, strategies, me/* APIs, and auth/user/inspection integrations) and a large building/insurance refactor that introduces BuildingRiskProfile with open-year workbook projection. Coverage-line services gained validation for BUILDING interval overlap, renewal flags, and consistent valuation enforcement; a CoverageRate migration adds persisted rating snapshots. Seeds and permissions were adjusted to match the new surfaces.

Themes

  • Notification platform: Prisma notification templates, delivery logs, in-app rows, and preferences; @nestjs/bullmq with Redis env config or inline dispatcher; NotificationService with channel strategies, job processor, preference service, and GET/PATCH me endpoints; docs/NOTIFICATIONS.md and http/api.http examples.
  • Auth and user email routing: Untrusted-device and welcome flows send through templated notification delivery instead of direct EmailService calls; manual test script for untrusted-device path.
  • Inspection assignments: After assign-inspector, enqueue BUILDING_INSPECTION_ASSIGNED email and in-app notification; failures are logged without rolling back assignment.
  • Building risk profile and workbook sync: Migrations and APIs for BuildingRiskProfile; inspection draft/diff and snapshot merge read risk fields; BuildingInsuranceProfile slimmed; open-year-workbook-sync-patch projects risk (including priceTableLineId) into open insurance years.
  • Coverage-line validation and snapshots: shouldRenew only when endDate is omitted or year-end 31 December; BUILDING on-risk overlap guard on issue/preview; valuation validation always on preview/issue; CoverageRate tables migration for issued rating audit.
  • Permissions and seeds: Drop coverage.specialTariff.edit from seeds and PermissionKeys; relabel coverage.manage; re-enable full prisma/seed.ts pipeline and notification template seeding.

Notable fixes or risks (if any)

  • Redis for notifications: Queue mode requires Redis (REDIS_* in .env.example); without Redis, inline processing is used—confirm ops config for production throughput.
  • Breaking modeling: Underwriting/befaring fields live on BuildingRiskProfile; clients must use the new endpoints and expect workbook sync from risk, not only insurance profile PATCHes.
  • BUILDING coverage overlap: Issuing or previewing a second BUILDING line on the same calendar day for a building × year returns 409 with the conflicting line id.