Content: admin approval queue + Brevo decision emails (Phase 4.3, 8.3)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- csharp, postgresql
调研方向
先阅读现有的 IEndpointModule.MapEndpoints 模块模式以及欢迎电子邮件中对 IEmailSender 的使用方式,然后查看 tests/CommunityPro.Tests/Members/MembersTestHarness.cs 了解测试设置。待 #3 和 #1 可用后,实现列出的管理员工作流和电子邮件行为,并验证验收标准,包括针对事件恰好发出一次以及电子邮件错误不导致失败的 xUnit 覆盖。
由索引模型根据 Issue 内容生成。
描述
Scope
Admin decision endpoints for the blog workflow, plus author notification emails.
| Method | Path | Notes |
|---|---|---|
| GET | /admin/posts?status=submitted |
approval queue, paginated, newest first |
| POST | /admin/posts/{id}/approve |
Submitted → Published (immediately — no scheduling in v1); sets PublishedAt; publishes PostPublished domain event |
| POST | /admin/posts/{id}/reject |
body requires reason; Submitted → Draft with RejectionReason |
| POST | /admin/posts/{id}/feature |
set IsFeatured (clears previous) |
Emails
On approve/reject, send the author a Brevo email with the decision (+ reason when rejected) via the existing IEmailSender abstraction (Identity module owns the SMTP relay — reuse the same best-effort, never-throw pattern as the welcome email).
Events
PostPublished (and PostUnpublished if unpublish is added later) are consumed by the search/revalidation ticket {{C3}} — this ticket only emits.
Error codes
content.not_found, content.invalid_state, content.rejection_reason_required
Dependencies
Blocked by #3 (submitted posts must exist) and #1 (admin policy + route group).
Acceptance criteria
- Approve/reject only valid from
Submitted; reason mandatory on reject - Approve sets
PublishedAtand emitsPostPublishedexactly once - Email failures are logged, never fail the request
- Feature clears the previously featured post
- xUnit coverage incl. the event emission
Conventions (project-wide, non-negotiable)
- .NET 9, records for immutable shapes, file-scoped namespaces, primary constructors where they read well. Minimal-API endpoints grouped per module via
IEndpointModule.MapEndpoints. Result<T>(SharedKernel) instead of exception-driven control flow. Endpoint results map failures to ProblemDetails with the stable error codes listed above — the frontend keys off them.- Module owns its EF Core
DbContextmapped to its own Postgres schema. Modules never reference each other's internals — cross-module needs go through a public contract interface or an in-process domain event (IEventPublisher). - All external calls (GitHub, Stripe, Brevo, Cloudinary, Meilisearch) behind interfaces owned by the consuming module.
- Every list endpoint paginated (offset is fine). xUnit tests in
tests/CommunityPro.Tests/<Module>/following the existing harness patterns (seeMembers/MembersTestHarness.cs).
- 主要语言
- C#
- 星标
- 0
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CommunityPro/community-pro-api 的其他 Issue
-
cross-cutting decision
难度 5/5 一周以上 新手友好度 35/100
-
cross-cutting
难度 4/5 3-5 天 新手友好度 58/100
-
admin
难度 5/5 一周以上 新手友好度 35/100
-
admin
难度 5/5 一周以上 新手友好度 35/100
-
sponsorship
难度 4/5 3-5 天 新手友好度 48/100
查看 CommunityPro/community-pro-api 的全部 Issue
相似的 Issue
-
bug 優先: 低
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
-
area-ai bug untriaged
难度 2/5 1-3 小时 新手友好度 67/100
dotnet/extensions#7893 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 85/100