Sponsorship: logo upload + "Powered By" gallery endpoint (Phase 7.5)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu với các bài kiểm tra hiện có cho Members avatar signer và việc xác thực URL, sau đó kiểm tra các quy ước và bài kiểm tra của IEndpointModule.MapEndpoints cùng tests/CommunityPro.Tests/Members/MembersTestHarness.cs. Sau khi #14 và #1 khả dụng, hãy xác minh các đường dẫn được liệt kê, việc lọc Gallery ở cấp query, việc từ chối các host giả dạng và phạm vi bao phủ ổn định cho lỗi 503.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Scope
Sponsor logos (admin-managed in v1) and the public gallery feeding the home/sponsors pages.
| Method | Path | Auth | Notes |
|---|---|---|---|
| POST | /admin/sponsors/{id}/logo/sign |
admin | Cloudinary signed-upload payload (same hand-rolled SHA-1 signer pattern as Members avatars — module owns its own signer instance/folder; never proxy image bytes) |
| PUT | /admin/sponsors/{id} |
admin | set LogoUrl (validate https + allowed host, mirroring avatar URL validation) + ShowInGallery toggle |
| GET | /sponsorship/gallery |
anon | cacheable; Active sponsors with a logo and ShowInGallery == true; name + logo + tier only |
Error codes
sponsorship.not_found, sponsorship.invalid_logo_url, sponsorship.signing_unconfigured (503, mirroring members.avatar_signing_unconfigured)
Dependencies
Blocked by #14; admin endpoints need #1's policy/group.
Acceptance criteria
- Gallery excludes PastDue/Cancelled sponsors and hidden logos (query level)
- Logo URL host validation tested (lookalike hosts rejected)
- 503 with the stable code when Cloudinary creds absent
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).
- Ngôn ngữ chính
- C#
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommunityPro/community-pro-api
-
cross-cutting decision
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
cross-cutting
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
-
admin
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
admin
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
sponsorship
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
Tất cả issue của CommunityPro/community-pro-api
Issue tương tự
-
effort:S P3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightscout/nocturne#3243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
dasher-project/Dasher-Windows#84 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
libnativeapi/nativeapi#21 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement P3 performance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
thomhurst/TUnit#7380 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày