Service Catalog - pratchaya-maneechot/service-exchange GitHub Wiki

Service Catalog

1. User & Identity Service

Responsibilities:

  • User registration and authentication
  • Profile management
  • Identity verification
  • Role-based access control

Core Entities:

  • User (Root Aggregate)
  • Profile
  • Role
  • IdentityVerification

Key APIs:

service UserService {
  rpc RegisterUser(RegisterUserRequest) returns (RegisterUserResponse);
  rpc UserLogin(UserLoginRequest) returns (UserLoginResponse);
  rpc LineLogin(LineLoginRequest) returns (LineLoginResponse);
  rpc UpdateUserProfile(UpdateUserProfileRequest) returns (google.protobuf.Empty);
  rpc SubmitIdentityVerification(SubmitIdentityVerificationRequest) returns (google.protobuf.Empty);

  rpc GetUserProfile(GetUserProfileRequest) returns (UserProfileDTO);
  rpc GetUserIdentityVerification(GetUserIdentityVerificationRequest) returns (IdentityVerificationDTO);
}

Events Published:

  • UserRegistered
  • UserVerified
  • ProfileUpdated
  • UserDeactivated

Database: PostgreSQL

2. Task Management Service

Responsibilities:

  • Task creation and lifecycle management
  • Task categorization and validation
  • Task search and filtering
  • Status transitions

Core Entities:

  • Task (Root Aggregate)
  • TaskCategory
  • TaskRequirement

Key APIs:

  • POST /tasks - Create new task
  • GET /tasks/{id} - Get task details
  • PUT /tasks/{id} - Update task
  • GET /tasks/search - Search and filter tasks
  • PUT /tasks/{id}/status - Update task status

Events Published:

  • TaskCreated
  • TaskUpdated
  • TaskAssigned
  • TaskCompleted
  • TaskCancelled

Database: PostgreSQL

3. Bidding & Negotiation Service

Responsibilities:

  • Bid submission and management
  • Pre-hiring communication
  • Bid selection process
  • Negotiation workflows

Core Entities:

  • Bid (Root Aggregate)
  • Conversation
  • Message

Key APIs:

  • POST /bids - Submit bid
  • GET /tasks/{id}/bids - Get task bids
  • POST /bids/{id}/accept - Accept bid
  • POST /conversations - Start conversation
  • GET /conversations/{id}/messages - Get messages

Events Published:

  • BidPlaced
  • BidAccepted
  • BidRejected
  • ConversationStarted
  • MessageSent

Database: PostgreSQL

4. Payment Service

Responsibilities:

  • Payment processing
  • Escrow management
  • Fee calculations
  • Payouts and withdrawals
  • Refund processing

Core Entities:

  • Transaction (Root Aggregate)
  • EscrowAccount
  • Fee

Key APIs:

  • POST /payments/escrow - Create escrow transaction
  • POST /payments/release - Release escrow funds
  • GET /payments/history - Transaction history
  • POST /payments/withdraw - Withdraw funds
  • POST /payments/refund - Process refund

Events Published:

  • PaymentProcessed
  • EscrowCreated
  • FundsReleased
  • WithdrawalCompleted

Database: PostgreSQL (ACID compliance critical)

5. Review & Rating Service

Responsibilities:

  • Review submission and management
  • Rating calculations
  • Reputation scoring
  • Review authenticity validation

Core Entities:

  • Review (Root Aggregate)
  • Rating

Key APIs:

  • POST /reviews - Submit review
  • GET /users/{id}/reviews - Get user reviews
  • GET /users/{id}/rating - Get user rating summary
  • GET /tasks/{id}/reviews - Get task reviews

Events Published:

  • ReviewSubmitted
  • RatingUpdated

Database: MongoDB

6. Notification & Communication Service

Responsibilities:

  • Multi-channel notification delivery
  • Message management
  • Template management
  • Delivery tracking

Core Entities:

  • Notification (Root Aggregate)
  • Message
  • Template

Key APIs:

  • POST /notifications/send - Send notification
  • GET /notifications/{userId} - Get user notifications
  • PUT /notifications/{id}/read - Mark as read
  • POST /messages - Send message

Channels Supported:

  • In-app notifications
  • Push notifications (FCM, APNS)
  • Email notifications
  • SMS notifications

Database: MongoDB

7. Location & Mapping Service

Responsibilities:

  • Geospatial data management
  • Proximity calculations
  • Location-based matching
  • Distance calculations

Core Entities:

  • Location (Root Aggregate)
  • GeoFence

Key APIs:

  • POST /locations - Store location data
  • GET /locations/nearby - Find nearby locations
  • GET /locations/distance - Calculate distance
  • POST /locations/geocode - Geocode address

Events Published:

  • LocationUpdated
  • ProximityMatch

Database: PostGIS

8. Support & Dispute Service

Responsibilities:

  • Support ticket management
  • Dispute resolution
  • FAQ management
  • SLA tracking

Core Entities:

  • SupportTicket (Root Aggregate)
  • Dispute

Key APIs:

  • POST /support/tickets - Create support ticket
  • GET /support/tickets/{id} - Get ticket details
  • POST /disputes - File dispute
  • PUT /disputes/{id}/resolve - Resolve dispute

Database: MongoDB