Service Catalog
The service catalog manages the marketplace of services offered by sellers. It includes service creation, categorization, options (add-ons), pricing, and admin approval workflow.
Overview
Key features: - Service creation by KYC-verified users - Category organization with hierarchical structure - Service options (add-ons with extra cost/time) - Admin approval workflow (pending → active/rejected) - Service search and filtering - View tracking and analytics - Banner images and galleries
Service Lifecycle
1. Seller creates service (status = 'pending')
↓
2. Admin reviews service
↓
3a. Admin approves → status = 'active'
- Service visible in catalog
- Can receive orders
OR
3b. Admin rejects → status = 'rejected'
- Seller can edit and resubmit
↓
4. Seller can pause → status = 'paused'
↓
5. Seller can unpause → status = 'active'
Service Entity
export class Service {
id: string;
title: string;
description: string;
categoryId: string;
ownerId: string;
basicPrice: Decimal;
basicDeliveryTime: number; // in days
status: ServiceStatus; // 'pending' | 'active' | 'paused' | 'rejected'
averageRating: number | null;
salesCount: number;
viewsCount: number;
createdAt: Date;
updatedAt: Date;
}
Service Options
export class Option {
id: string;
title: string;
additionalPrice: Decimal;
additionalTime: number; // in days
}
// Add option to service
const service = await serviceRepository.get(serviceId);
const option = Option.create('option-1', 'Express Delivery', new Decimal(5000), -2);
await serviceRepository.addOption(service.id, option);
API Endpoints
Create Service
POST /services
Authorization: Bearer <access_token>
Content-Type: application/json
{
"title": "Logo Design",
"description": "Professional logo design...",
"categoryId": "cat-123",
"basicPrice": 15000,
"basicDeliveryTime": 3,
"banner": "upload-456"
}
List Services
Approve Service (Admin)
Add Service Option
POST /services/:id/options
Authorization: Bearer <access_token>
Content-Type: application/json
{
"title": "Express Delivery",
"additionalPrice": 5000,
"additionalTime": -2
}
Business Rules
- KYC required – Only KYC-verified users can create services
- Admin approval – All services require approval before going live
- Cannot delete – Services can only be paused, not deleted
- Options locked – Cannot modify options after service has orders
- Price validation – basicPrice must be positive
- Delivery time – Must be at least 1 day
Best Practices
✅ Do
- Require clear service descriptions
- Upload high-quality banner images
- Validate category exists before creation
- Track service views for analytics
- Allow service updates while pending
❌ Don't
- Don't allow service deletion (pause instead)
- Don't skip admin approval
- Don't allow zero/negative prices
- Don't modify options after orders exist