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 `