feat(notify): branded notification mail through an outbox #35

Merged
sharang merged 6 commits from feat/notifications into main 2026-09-23 21:10:07 +00:00
6 Commits
Author SHA1 Message Date
Sharang Parnerkar 609d70972a chore: merge main into feat/notifications
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 23m20s
ci / image (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

# Conflicts:
#	cmd/server/main.go
#	internal/config/config.go
#	internal/server/documents.go
#	internal/server/openapi_test.go
#	internal/server/server.go
#	internal/store/memory.go
#	internal/store/store.go
#	internal/store/types.go
#	migrations/migrations_test.go
#	openapi.yaml
2026-09-23 22:32:06 +02:00
Sharang ParnerkarandClaude Opus 5.5 5af9526fd3 chore(merge): feat/documents into feat/notifications
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 23m21s
ci / image (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-23 21:58:38 +02:00
Sharang ParnerkarandClaude Opus 5.5 e99b79f3ff chore(merge): main into feat/documents after #33
ci / shared (pull_request) Successful in 12s
ci / test (pull_request) Successful in 23m3s
ci / image (pull_request) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-23 21:58:29 +02:00
Sharang ParnerkarandClaude Opus 5.5 6880f3afc2 feat(notify): branded notification mail through an outbox
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 23m15s
ci / image (pull_request) Skipped
Publishing a document now mails the workspace members who may read
documents, and products can POST /v1/notifications (route group
"notify") to report new findings, which reach IT_ADMIN, OWNER, CXO
and LEGAL. Demo tenants and tenants without an organization get
nothing.

Every mail is a mail_outbox row (migration 0009), one per recipient,
idempotent per key, sent by a worker with backoff and parked with its
error after twelve attempts. Messages are rendered when sent from
embedded German and English templates in the BreakPilot layout, as
multipart text + HTML, through the SMTP relay (SMTP_*).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-23 19:45:14 +02:00
Sharang ParnerkarandClaude Opus 5.5 da6eef6d30 feat(documents): tenant documents in object storage
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 23m11s
ci / image (pull_request) Skipped
Staff upload a file for a tenant as a draft (streamed to an S3 bucket,
hashed on the way, never buffered whole), publish it, or delete it;
the tenant lists its published documents and gets a five-minute
presigned download link. Uploads, publications and downloads are
audited, a download under the person the portal names.

Migration 0008 adds the documents table; internal/storage wraps
minio-go (Hetzner Object Storage, the bucket is created in its
region when missing). Without DOCUMENTS_S3_* the routes answer 503
and the rest of the registry is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-23 19:35:05 +02:00
Sharang ParnerkarandClaude Opus 5.5 bab7475a6c feat(admin): staff tenant list, detail, trial extension, invite resend
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 22m40s
ci / image (pull_request) Skipped
A new route group "admin" (the portal's service client only) serves
the staff admin area: tenant search with 30-day usage and last
activity, one detail call with entitlements, subscriptions, licences,
members and recent audit, trial extension (moves trial entitlements
with it and reopens a trial that expired into read-only), invite
resend, and the audit log across tenants.

Changes made from the admin area are audited under the staff member
the portal names in X-Staff-Subject / X-Staff-Email; the header only
counts from a client that holds the admin group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-23 19:23:00 +02:00