Partner Service¶
Backend service for managing partners, legal information, and service definitions.
Overview¶
The Partner Service handles: - Partner CRUD operations - Legal information management (company details, tax ID, banking info, certifications) - Service definition management with lifecycle hooks - RabbitMQ event publishing for partner lifecycle events - Service Text Management: Multilingual, AI-augmented workflow for service descriptions and content.
Key Features¶
Service Text Management¶
This service implements a dual-approval workflow for managing translatable and enhanced text content for services. It integrates with the AI Service for transformations like translation, sanitization, and enhancement.
See Service Text Management Guide for detailed documentation on workflows and data models.
Action Reasons¶
Admin-managed lookup tables for predefined reasons in contract workflows. When voiding a contract or requesting changes, admins can select from configurable reasons in addition to providing free-text comments.
See Action Reasons Guide for detailed documentation on the feature and API.
API Endpoints¶
Partners¶
GET /api/partners- List all partnersGET /api/partners/:id- Get partner by IDPOST /api/partners- Create new partnerPATCH /api/partners/:id- Update partnerDELETE /api/partners/:id- Delete partner
Partner Services¶
GET /api/partners/:partnerId/services- List all services for a partnerGET /api/partners/:partnerId/services/:id- Get service by IDPOST /api/partners/:partnerId/services- Create new service definitionPATCH /api/partners/:partnerId/services/:id- Update service definitionDELETE /api/partners/:partnerId/services/:id- Delete service definition
Action Reasons (Admin)¶
GET /api/partners/admin/action-reasons?context=:context- List reasons by contextGET /api/partners/admin/action-reasons/:id- Get reason by IDPOST /api/partners/admin/action-reasons- Create new reasonPATCH /api/partners/admin/action-reasons/:id- Update reasonDELETE /api/partners/admin/action-reasons/:id- Delete reasonPUT /api/partners/admin/action-reasons/reorder- Reorder reasons
Database Schema¶
See services/partner-service/src/common/database/database.service.ts for schema definitions.
Events Published¶
partner.created- When a new partner is createdpartner.activated- When a partner status changes to ACTIVEpartner.suspended- When a partner status changes to SUSPENDEDpartner.deleted- When a partner is deletedservice.defined- When a new service is definedservice.activated- When a service status changes to ACTIVEservice.deleted- When a service is deleted
Environment Variables¶
PORT- Service port (default: 3000)DATABASE_URL- PostgreSQL connection stringRABBITMQ_URL- RabbitMQ connection stringPARTNER_EXCHANGE- RabbitMQ exchange name (default:partner.events)