Create a new partner record ready for backoffice operations and frontoffice visibility rules.
- Invoked by GraphQL mutation
partner_create.
| Name | Required | Type | Description |
|---|---|---|---|
name |
Yes | string |
Partner display name. |
category |
Yes | PartnerCategory |
Enum category (RECOVERY, NUTRITION, EQUIPMENT, TRAINING, TECH_WEARABLES). |
shortDescription |
Yes | string |
Card description. |
websiteUrl |
Yes | string |
Absolute http(s) URL. |
promoCode |
No | string |
Optional promo code. |
logoImageName |
Yes | string |
Logo filename reference. |
coverImageName |
Yes | string |
Cover filename reference. |
displayOrder |
Yes | number |
Frontoffice display order. |
isActive |
No | boolean |
Visibility toggle; defaults to true. |
session |
Yes | UsecaseSession |
Actor context (actorId = session user id). |
- Required fields must be non-empty after trim.
websiteUrlmust match allowed absolute URL format.displayOrdermust be a non-negative integer.
- Validates and normalizes incoming payload.
- Delegates creation to repository with automatic slug generation.
- Initializes
linkClickCountat0.
- Persists a new partner entity in MongoDB.
- Returns created partner model.
- Throws
ERRORS.CONFLICT_ERRORwhen slug uniqueness collides after retries. - Normalizes unexpected failures to
ERRORS.CREATE_PARTNER_USECASE.
bddServiceloggerService
api/src/usecases/partner/create-partner.usecase.ts
- Slug is backend-generated and not user-editable through standard inputs.