From b18e2e625afe3f027183c383a4ceab3802b1ecad Mon Sep 17 00:00:00 2001 From: ngqile Date: Mon, 30 Nov 2026 11:36:10 +0800 Subject: [PATCH] docs(openspec): propose add-admin-email-listing Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM --- .../add-admin-email-listing/.openspec.yaml | 2 + .../changes/add-admin-email-listing/design.md | 58 ++++++++++++++ .../add-admin-email-listing/proposal.md | 36 +++++++++ .../specs/admin-emails/spec.md | 65 ++++++++++++++++ .../sql/01-email-module.sql | 7 ++ .../changes/add-admin-email-listing/tasks.md | 76 +++++++++++++++++++ 6 files changed, 244 insertions(+) create mode 100644 openspec/changes/add-admin-email-listing/.openspec.yaml create mode 100644 openspec/changes/add-admin-email-listing/design.md create mode 100644 openspec/changes/add-admin-email-listing/proposal.md create mode 100644 openspec/changes/add-admin-email-listing/specs/admin-emails/spec.md create mode 100644 openspec/changes/add-admin-email-listing/sql/01-email-module.sql create mode 100644 openspec/changes/add-admin-email-listing/tasks.md diff --git a/openspec/changes/add-admin-email-listing/.openspec.yaml b/openspec/changes/add-admin-email-listing/.openspec.yaml new file mode 100644 index 0000000..4a154df --- /dev/null +++ b/openspec/changes/add-admin-email-listing/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-11-30 diff --git a/openspec/changes/add-admin-email-listing/design.md b/openspec/changes/add-admin-email-listing/design.md new file mode 100644 index 0000000..55704c5 --- /dev/null +++ b/openspec/changes/add-admin-email-listing/design.md @@ -0,0 +1,58 @@ +# Design + +## Context + +- **Storage:** `service-email`'s `/email/send` saves the email (subject, body, recipients, status) before it publishes it for sending. Every email is in `service-email`.`email`, with its recipients in `recipient`, whether or not a provider delivered it. +- **Existing queries in service-email:** + - `/email/findByPropertyAndPageable` takes `{property, pageableRest}`. The supported properties are `id`, `sender`, `subject`, `recipient` (a join, matched with like) and `startDate`/`endDate` (dd/MM/yyyy). + - `/email/findById/{id}` returns the email with its body and recipients, or an empty body when there is none. +- **Who sends password emails:** services-system's `resetAdminPassword` (admin reset and admin forgot-password) and the member password paths. +- **Access model:** `@AdminModule` on mobile-api handlers. A super admin (role id 1) passes every module check and sees every menu entry. The portal menu comes from the `module` table (`url`, `icon_name`). +- **Reference:** babyboo's `AdminEmailTemplateController` (`/email-logs`, `/email-logs/{id}`) and `app/email-templates/logs/[id]`, which renders the body in an `