diff --git a/docs/MARKETPLACE_MODULE_DESIGN.md b/docs/MARKETPLACE_MODULE_DESIGN.md index 53f9bbf9..e49393dd 100644 --- a/docs/MARKETPLACE_MODULE_DESIGN.md +++ b/docs/MARKETPLACE_MODULE_DESIGN.md @@ -156,6 +156,22 @@ interface MarketplaceCertificationDoc { } | null; createdAt: string; } + +// ── Report (user abuse/flag) ────────────────────────────── + +interface MarketplaceReportDoc { + id: string; // rpt_ + listingId: string; + productId: string; + reporterId: string; // userId of reporter + reason: 'spam' | 'harmful' | 'misleading' | 'copyright' | 'inappropriate' | 'other'; + details: string; // Free text explanation + status: 'open' | 'resolved' | 'dismissed'; + resolvedBy: string | null; // Admin userId + resolutionNotes: string | null; + createdAt: string; + resolvedAt: string | null; +} ``` --- @@ -365,9 +381,9 @@ Each app defines what goes inside the `payload` field. The marketplace module tr ## 7. Reuse Strategy — Existing Modules | Existing Module | How Marketplace Reuses It | -| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | +| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | **comments** | **Decision: keep reviews separate.** Reviews are structurally different (star rating, verified install, helpful count). Comments remain tracker-only. | -| **votes** | Generalize to support `entityType: 'tracker_item' | 'marketplace_listing'`. Same toggle pattern. | +| **votes** | Generalize to support `entityType: 'tracker_item' \| 'marketplace_listing'`. Same toggle pattern. | | **blob** | Template screenshots upload via existing SAS token endpoints. New container: `marketplace_assets`. | | **stripe** | Paid template purchases via existing Stripe integration. New `line_item` type for marketplace. | | **flags** | Feature-flag new marketplace features per product. | @@ -409,7 +425,7 @@ New module: `services/platform-service/src/modules/marketplace/` ### Phase 4 — Discovery and Analytics (Sprint 5) -- Trending algorithm (installs _ recency _ rating) +- Trending algorithm (installs x recency x rating) - Featured curation (admin) - Author analytics dashboard - Recommendation engine ("Users who installed X also installed Y") @@ -424,6 +440,7 @@ New module: `services/platform-service/src/modules/marketplace/` | `marketplace_reviews` | ~20,000 | Low | | `marketplace_installs` | ~100,000 | Medium (high write volume) | | `marketplace_certifications` | ~10,000 | Low | +| `marketplace_reports` | ~2,000 | Low | Serverless Cosmos DB: ~$0.25/100K RU. Total estimated cost: **<$5/month** at launch scale. @@ -431,7 +448,7 @@ Additional blob container needed: `marketplace_assets` (screenshots, preview ima --- -## 9.1 Rate Limiting +## 10. Rate Limiting All public marketplace endpoints inherit the rate limiting from the `public` module pattern: @@ -445,7 +462,7 @@ All public marketplace endpoints inherit the rate limiting from the `public` mod --- -## 9.2 Versioning and Update Workflow +## 11. Versioning and Update Workflow When an author updates a published listing: @@ -459,7 +476,7 @@ When an author updates a published listing: --- -## 10. Dashboard UI (Admin + Tracker) +## 12. Dashboard UI (Admin + Tracker) ### Admin Dashboard — Marketplace Management @@ -486,7 +503,7 @@ Each app builds its own browse UI consuming the public API: --- -## 11. Cross-App Benefits Summary +## 13. Cross-App Benefits Summary | App | Without Generic Marketplace | With Generic Marketplace | | -------------- | --------------------------------------------- | ------------------------------------------------ |