> ## 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.

# User / Member

> Member account entity with profile and authentication fields

Member account entity with profile and authentication fields

The core entity representing member accounts in the system.

## Fields

### Member Profile Field Registry (from `workspace/sources/entity-registry.csv`)

| Field                               | Input Type         | Required     | Notes                                                                                                                    |
| ----------------------------------- | ------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------ |
| First Name                          | Text               | Required     | model: `firstName`, rel: string                                                                                          |
| Last Name                           | Text               | Required     | model: `lastName`, rel: string                                                                                           |
| Bio Description                     | WYSIWYG (Textarea) | Not Required | model: `bio`, rel: text                                                                                                  |
| Date of Birth                       | Date               | Required     | model: `dateOfBirth`, rel: date                                                                                          |
| Membership ID                       | Number             | Required     | Automatically Generated; model: `membership`, rel: OneToMany UserMembership                                              |
| CRM ID                              | Number             | Required     | Generated and locked to the CRM if it's connected                                                                        |
| Accounting ID                       | Number             | Required     | Generated and locked to the accounting software if it's connected                                                        |
| Email                               | Email              | Required     | model: `user.email`                                                                                                      |
| Contact Number                      | Number             | Required     | model: `contactNumber`                                                                                                   |
| Mobile                              | Number             | Required     | model: `mobile`                                                                                                          |
| Company                             | Text               | Required     | model: `company`                                                                                                         |
| Company Contact Number              | Text               | Required     | -                                                                                                                        |
| Company Address                     | Text               | Required     | -                                                                                                                        |
| Position                            | Text               | Required     | model: `position`                                                                                                        |
| Gender                              | Select             | Required     | Options are: Male, Female, Other, Not Specified; model: `gender`                                                         |
| Address                             | Text               | Required     | model: `address`                                                                                                         |
| City                                | Text               | Required     | model: `city`                                                                                                            |
| LinkedIn URL                        | URL                | Not Required | model: `linkedinUrl`                                                                                                     |
| Website URL                         | URL                | Not Required | model: `websiteUrl`                                                                                                      |
| Postcode                            | Number             | Required     | model: `postcode`                                                                                                        |
| State                               | Select             | Required     | model: `state`                                                                                                           |
| Country                             | Select             | Required     | model: `country`                                                                                                         |
| Interested In                       | Multi-select       | Required     | Allows the member to select all the types of categories they're interested in                                            |
| Events Interested In                | Multi-select       | Required     | Allows the member to select types of events they're interested in (eg. on-demand, online, conferences)                   |
| Make Profile Public                 | True / False       | Required     | Required so that their name is searchable in the business directory                                                      |
| Display Personal or Company Details | Select             | Required     | If "true" is selected above, it'll prompt the user to choose the company or user details to show                         |
| User Register Date                  | Date               | Required     | Date they registered the account; model: `memberProfile.registrationDate`                                                |
| Branch                              | Select             | Required     | Selects the main region / branch they're part of; model: `client`, rel: ManyToOne ClientProfile                          |
| Enquiry ID                          | Number             | Required     | For all enquiries submitted through the business directory                                                               |
| Enquiry Date                        | Date               | Required     | Date of the enquiry submission                                                                                           |
| Enquiry Name                        | Number             | Required     | -                                                                                                                        |
| Enquiry Email                       | Email              | Required     | -                                                                                                                        |
| Enquiry Contact Number              | Text               | Required     | -                                                                                                                        |
| Enquiry Message                     | Text               | Required     | -                                                                                                                        |
| Membership Plan                     | Selector           | Required     | Pull through a list of membership plan entities                                                                          |
| Membership Registration Date        | Date               | Required     | -                                                                                                                        |
| Membership Expiry Date              | Date               | Required     | Must be a setting that creates a "grace period" in the system which is automatically applied to a membership expiry date |
| Membership Status                   | Selector           | Required     | Automatically set based on membership plan but can be manually changed by the administrator                              |
| List of courses                     | Datatable          | -            | These need the ability to edit the entry and add an extra element here                                                   |
| List of events                      | Datatable          | -            | These need the ability to edit the entry and add an extra element here                                                   |
| CPD Points                          | Datatable          | -            | These need the ability to edit the entry and add an extra element here                                                   |
| Transactions                        | Datatable          | -            | These need the ability to edit the entry and add an extra element here                                                   |
| Support Tickets                     | Datatable          | -            | These need the ability to edit the entry and add an extra element here                                                   |
| Members                             | Datatable          | -            | This only displays if they are group admin                                                                               |
| Group ID                            | Number             | Required     | Connected to the group members entity                                                                                    |
| Is Group Admin                      | True / False       | Required     | -                                                                                                                        |
| Company Address                     | Text               | Required     | Use Google Maps to pull through addresses and save long/lat details                                                      |
| Company Contact Number              | Number             | Required     | -                                                                                                                        |
| Display Company in directory        | True / False       | Required     | Only available if they are the group admin                                                                               |

### User Account Field Registry (from `workspace/sources/entity-registry.csv`)

| Field      | Input Type | Required | Notes                                                                                                                                                                        |
| ---------- | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| User ID    | Number     | Required | -                                                                                                                                                                            |
| User Email | Email      | Required | Ties to member email if not admin                                                                                                                                            |
| User Type  | Selector   | Required | User Types are: Association Admin, Association Member, Association Sponsor, Association Job Poster - can be one to many, as a member can be a sponsor and job poster as well |

## Relationships

| Relation        | Type      | Target Entity      |
| --------------- | --------- | ------------------ |
| membershipPlan  | ManyToOne | MembershipPlan     |
| groupMembership | ManyToOne | GroupMembership    |
| tickets         | OneToMany | EventTicket        |
| enrollments     | OneToMany | CourseEnrollment   |
| cpdRecords      | OneToMany | CpdRecord          |
| transactions    | OneToMany | PaymentTransaction |
| supportTickets  | OneToMany | SupportTicket      |

## Access Control Notes

* `ROLE_CLIENT_USER` refers to **organization staff** in the Client Portal (limited permissions) — not association members.
* Association members update their own details via the **Member Portal**.
* Some workflows require `ROLE_CLIENT_USER` to update non-sensitive member profile fields (while `ROLE_CLIENT_ADMIN` retains full management permissions).

## API Resource

```php theme={null}
#[ApiResource(
    operations: [
        new GetCollection(security: "is_granted('ROLE_CLIENT_USER')"),
        new Post(security: "is_granted('ROLE_CLIENT_ADMIN')"),
        new Get(security: "is_granted('ROLE_CLIENT_USER')"),
        new Put(security: "is_granted('ROLE_CLIENT_ADMIN') or is_granted('ROLE_CLIENT_USER')"),
        new Delete(security: "is_granted('ROLE_CLIENT_ADMIN')"),
    ],
    paginationItemsPerPage: 30
)]
```

## Validation Rules

* Email must be valid format and unique
* Password minimum 8 characters (when not SSO)
* Status must be valid enum value
* First name and last name required

## Features

### User / Member

#### Acceptance Criteria

##### Frontend

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

##### Backend / API

* [ ] CRUD operations exist for `User / Member` (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 `User / Member`.

##### Error Handling

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