Domain Model
Credential
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string.uuid | Yes | — | Id |
| createdAt | string.date-time | Yes | — | Created at |
| updatedAt | string.date-time | Yes | — | Updated at |
| workspaceId | string | Yes | — | ID of the associated workspace |
| siteId | string | Yes | — | ID of the associated site |
| systemId | string | No | — | ID of the associated system |
| credentialType | enum(card, pin, fob, biometric, master_code, installer_code, other) | Yes | — | Credential type |
| credentialIdentifier | string | Yes | — | Credential identifier |
| assignedPersonName | string | Yes | — | Assigned person name |
| assignedPersonType | enum(employee, customer_contact, vendor, temporary, system_account) | Yes | — | Assigned person type |
| contactId | string | No | — | ID of the associated contact |
| accessGroups | unknown | Yes | — | Access groups |
| activationDate | string.date-time | Yes | — | Activation date |
| expirationDate | string.date-time | No | — | Expiration date |
| approvalStatus | enum(pending, approved, denied) | Yes | — | Approval status |
| revocationStatus | enum(active, revoked, suspended, expired) | Yes | — | Revocation status |
| requestedBy | string | No | — | Requested by |
| approvedBy | string | No | — | Approved by |
| revokedBy | string | No | — | Revoked by |
| revokedAt | string.date-time | No | — | Revoked at |
| revocationReason | string | No | — | Revocation reason |
| auditNotes | string | No | — | Audit notes |
| metadata | unknown | No | — | Metadata |
| visibilityMode | enum(global, workspace_local, shared) | Yes | — | Visibility mode |
Create Schema
Fields accepted when creating a new record:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| workspaceId | string | No | — | ID of the associated workspace |
| siteId | string | Yes | — | ID of the associated site |
| systemId | string | No | — | ID of the associated system |
| credentialType | enum(card, pin, fob, biometric, master_code, installer_code, other) | Yes | — | Credential type |
| credentialIdentifier | string | Yes | — | Credential identifier |
| assignedPersonName | string | Yes | — | Assigned person name |
| assignedPersonType | enum(employee, customer_contact, vendor, temporary, system_account) | Yes | — | Assigned person type |
| contactId | string | No | — | ID of the associated contact |
| accessGroups | unknown | Yes | [] | Access groups |
| activationDate | string.date-time | Yes | — | Activation date |
| expirationDate | string.date-time | No | — | Expiration date |
| approvalStatus | enum(pending, approved, denied) | Yes | "pending" | Approval status |
| revocationStatus | enum(active, revoked, suspended, expired) | Yes | "active" | Revocation status |
| requestedBy | string | No | — | Requested by |
| approvedBy | string | No | — | Approved by |
| revokedBy | string | No | — | Revoked by |
| revokedAt | string.date-time | No | — | Revoked at |
| revocationReason | string | No | — | Revocation reason |
| auditNotes | string | No | — | Audit notes |
| metadata | unknown | No | — | Metadata |
| visibilityMode | enum(global, workspace_local, shared) | Yes | "workspace_local" | Visibility mode |
Update Schema
All fields are optional when updating:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| siteId | string | No | — | ID of the associated site |
| systemId | string | No | — | ID of the associated system |
| credentialType | enum(card, pin, fob, biometric, master_code, installer_code, other) | No | — | Credential type |
| credentialIdentifier | string | No | — | Credential identifier |
| assignedPersonName | string | No | — | Assigned person name |
| assignedPersonType | enum(employee, customer_contact, vendor, temporary, system_account) | No | — | Assigned person type |
| contactId | string | No | — | ID of the associated contact |
| accessGroups | unknown | No | [] | Access groups |
| activationDate | string.date-time | No | — | Activation date |
| expirationDate | string.date-time | No | — | Expiration date |
| approvalStatus | enum(pending, approved, denied) | No | "pending" | Approval status |
| revocationStatus | enum(active, revoked, suspended, expired) | No | "active" | Revocation status |
| requestedBy | string | No | — | Requested by |
| approvedBy | string | No | — | Approved by |
| revokedBy | string | No | — | Revoked by |
| revokedAt | string.date-time | No | — | Revoked at |
| revocationReason | string | No | — | Revocation reason |
| auditNotes | string | No | — | Audit notes |
| metadata | unknown | No | — | Metadata |