> ## Documentation Index
> Fetch the complete documentation index at: https://memberpulseptyltd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CRM Tag

> Predefined tagging system for consistent CRM synchronization

Predefined tagging system for consistent CRM synchronization

CRM Tags provide a predefined, reviewable tagging system that associations/clients can use to keep CRM sync consistent across modules (Members, Events, Courses, Orders).

## Fields

### Core Fields

| Field       | Type    | Required | Description                            |
| ----------- | ------- | -------- | -------------------------------------- |
| id          | UUID    | Auto     | Primary key                            |
| name        | string  | Yes      | Human-readable tag name                |
| slug        | string  | Yes      | Stable identifier used in rules/sync   |
| description | text    | No       | What the tag means / when to apply     |
| category    | enum    | Yes      | member, event, course, order, system   |
| appliesTo   | array   | Yes      | Entity types the tag can be applied to |
| isActive    | boolean | Yes      | Whether the tag is available for use   |

### Governance

| Field    | Type    | Required | Description                      |
| -------- | ------- | -------- | -------------------------------- |
| isSystem | boolean | Yes      | True for platform-provided tags  |
| clientId | UUID    | No       | If present, tag is tenant-scoped |

### System Fields

| Field     | Type     | Required | Description        |
| --------- | -------- | -------- | ------------------ |
| createdAt | datetime | Auto     | Creation timestamp |
| updatedAt | datetime | Auto     | Last update        |

## Relationships

| Relation    | Type      | Target Entity |
| ----------- | --------- | ------------- |
| syncRecords | OneToMany | CrmSyncRecord |
| client      | ManyToOne | ClientProfile |

## Notes

* Tags should be **predefined and stable** (prefer `slug` for integrations) so mappings and downstream CRM automation don’t break.
* Associations/clients should be able to **review and enable/disable** the platform-provided tags, but the tag catalog itself is intended to be **hardcoded/system-controlled** to keep CRM automation predictable.

## System Tag Catalog (recommended)

These example tags are intended to cover the most common UAT workflows.

### Membership tags

| slug                                   | Meaning                                                |
| -------------------------------------- | ------------------------------------------------------ |
| member.membership.active               | Member has an active membership                        |
| member.membership.expiring             | Membership is within the client-defined renewal window |
| member.membership.expired              | Membership is expired                                  |
| member.membership.upgraded             | Member upgraded plans                                  |
| member.membership.downgrade\_scheduled | Member scheduled a downgrade for renewal               |

### Event tags (pre/post)

| slug                 | Meaning                                           |
| -------------------- | ------------------------------------------------- |
| event.registered.pre | Member registered for an event (pre-event)        |
| event.attended.post  | Member attended / checked-in (post-event)         |
| event.no\_show\.post | Member registered but did not attend (post-event) |

### Course tags

| slug                  | Meaning                     |
| --------------------- | --------------------------- |
| course.enrolled.pre   | Member enrolled in a course |
| course.completed.post | Member completed a course   |

### Support ticket tags / notes

| slug                    | Meaning                            |
| ----------------------- | ---------------------------------- |
| support.ticket.created  | Member created a support ticket    |
| support.ticket.resolved | Support ticket was resolved/closed |

## Features

### CRM Tag

#### Acceptance Criteria

##### Frontend

* [ ] Admin/client UI can view and manage `CRM Tag` records where applicable.

##### Backend / API

* [ ] CRUD operations exist for `CRM Tag` (create, read, update, delete/archive).

##### Permissions

* [ ] Access is restricted to appropriate roles (tenant-scoped).

##### Business Rules

* [ ] Fields and relationships documented on this page are enforced for `CRM Tag`.

##### Error Handling

* [ ] Invalid payloads return field-level validation errors.
