Skip to content

Development/services#21

Open
vugarsafarzada wants to merge 27 commits into
mainfrom
development/services
Open

Development/services#21
vugarsafarzada wants to merge 27 commits into
mainfrom
development/services

Conversation

@vugarsafarzada
Copy link
Copy Markdown
Member

@vugarsafarzada vugarsafarzada commented May 5, 2026

Summary

This PR introduces the service marketplace backend layer and the supporting moderation, discovery, rating, favorites, category, and social profile changes needed for it to work end to end.

Linked Issues

Closes #9
Closes #11

Partially addresses #7 and #12.

What Changed

Service domain

  • Added the Service domain with lifecycle statuses: DRAFT, PENDING, ACTIVE, REJECTED, PAUSED, and ARCHIVED.
  • Added service CRUD endpoints, service media upload, public listing, owner-specific listing, and service detail retrieval.
  • Added lifecycle actions for submit, pause, resume, archive, and unarchive.
  • Added support for direct/individual services through address-based services, plus branch-linked services for brand/team contexts.
  • Added service image handling with the new service_image media kind.

Service categories and marketplace discovery

  • Added ServiceCategory and refactored BrandCategory from name to key.
  • Added marketplace endpoints for home, search, and facets/discovery data.
  • Added filtering and pagination support across service and brand listings, including service category, branch, brand, owner, direct-only, and text search filters.
  • Added richer DTOs for marketplace responses, including nested brand/branch data, image URLs, ratings, and pagination metadata.

Ratings and favorites

  • Added service ratings with one rating per user/service and aggregate rating metadata in service responses.
  • Added favorite APIs for brands and services.
  • Added favorite database tables with uniqueness constraints and indexes for user-facing favorite lists.

Moderation workflow

  • Added admin moderation APIs for brands and services.
  • Added moderation queue/detail endpoints and approve/reject actions.
  • Added checklist support for moderation reviews.
  • Added ModerationReview persistence for audit/history.
  • Added notifications when brands or services are approved or rejected.
  • Updated brand update behavior so active/rejected brands return to PENDING for re-review after meaningful edits.
  • Updated non-active brand visibility so admins can inspect pending/rejected records.

Social links and user profile updates

  • Added social/website URL fields for users and brands:
    • Instagram
    • Facebook
    • YouTube
    • WhatsApp
    • LinkedIn
    • X
    • Website
  • Added schema validation requiring social URLs to use http:// or https://.
  • Updated brand and user controllers to persist and return these fields.

Auth, request safety, and tooling

  • Added auth rate limiting via express-rate-limit.
  • Added request body size limits for JSON and URL-encoded payloads.
  • Updated auth/user age validation from 13+ to 18+.
  • Added marketplace/category seed scripts.
  • Enabled Express types and ts-node file resolution in tsconfig.json.

Database Changes

New/updated Prisma models and migrations include:

  • Service
  • ServiceMedia
  • ServiceCategory
  • ServiceRating
  • FavoriteBrand
  • FavoriteService
  • ModerationReview
  • ServiceStatus, PriceType, ModerationEntityType, and ModerationOutcome enums
  • MediaKind.service_image
  • Social URL columns on User and Brand
  • BrandCategory.name renamed to BrandCategory.key

Routes Added

  • Service routes under /services and /service-categories
  • Moderation routes for admin review flows
  • Marketplace routes for home/search/facets
  • Favorite routes for brand/service favorites

Verification

  • Resolved merge conflicts from main
  • pnpm prisma validate
  • pnpm build
  • Confirmed working tree is clean after conflict resolution

Notes for Reviewers

  • This PR is migration-heavy; please review migration order carefully before applying to shared environments.
  • The service domain is intentionally connected to moderation, marketplace search, ratings, and favorites, so those files are part of the same feature set rather than unrelated changes.
  • The merge from main was resolved by preserving the service-domain implementation and keeping the newer main updates already present in the branch history.

vugarsafarzada and others added 22 commits April 27, 2026 00:08
feat(moderation): add admin moderation APIs with checklist workflow
…ng details and update visibility logic for non-active brands
@vugarsafarzada vugarsafarzada self-assigned this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant