Skip to content

QC-65: Owner shop profile API + settings UI + onboarding #124

@DarshanCode2005

Description

@DarshanCode2005

Summary

Owner shop profile API + settings UI + onboarding

Milestone: M3 Owner
Labels: backend, frontend, owner

Learn

  • Shop visibility rules in lib/shops-list.ts (non-empty name filter)
  • Owner-scoped PATCH patterns from lib/owner-products.ts
  • Cloudinary upload reuse from QC-34

Build

  • Add GET/PATCH /api/owner/shop scoped to session shopId + ownerId
  • Create lib/parse-shop-body.ts and lib/update-owner-shop.ts
  • Route /owner/settings with form: name (required), description, address, categories, isOpen toggle
  • Logo/cover upload via POST /api/upload (extend for shop assets folder quickcart/shops/{shopId})
  • On first owner visit when shop.name is whitespace-only: redirect to /owner/settings?onboarding=1
  • Dashboard/setup banner: 'Complete shop profile to appear in customer browse'
  • Add ownerSettings to lib/routes.ts
  • Script scripts/test-owner-shop-api.mts

Files

  • app/api/owner/shop/route.ts
  • lib/parse-shop-body.ts
  • lib/update-owner-shop.ts
  • app/(owner)/owner/settings/page.tsx
  • components/owner/ShopSettingsForm.tsx
  • lib/routes.ts
  • scripts/test-owner-shop-api.mts

Acceptance criteria

  • Owner sets shop name + isOpen from UI without touching MongoDB manually
  • Shop appears on GET /api/shops after name is set
  • Empty-name owner redirected to settings on dashboard/inventory/orders visit
  • Cross-owner shop PATCH returns 403
  • Closed shop (isOpen: false) still listed but checkout blocked

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendAPI routes and server logicfrontendUI pages and componentsownerShop owner features

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions