From 8b36cd9e4dd13604ebed5afa2f9291b792584e0c Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Sun, 1 Mar 2026 06:25:57 -0800 Subject: [PATCH] =?UTF-8?q?fix(marketplace):=20review=20pass=20=E2=80=94?= =?UTF-8?q?=20add=20ReportDoc=20type,=20fix=20table=20formatting,=20renumb?= =?UTF-8?q?er=20sections,=20add=20cost=20estimates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/MARKETPLACE_MODULE_DESIGN.md | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) 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 | | -------------- | --------------------------------------------- | ------------------------------------------------ |