Skip to content
Updated Sep 26, 2026 by Barča Dvořáková · Owner: analysisactiveentity Edit on GitHub

Entity: clientGroup ​

Entity Definition ​

  • Entity Name: clientGroup
  • Entity Type: Database table, platform schema (platform.client_group)
  • Description: A named, flat grouping of client records (e.g. "Plzeňský kraj", "František Dobrota"), used for reporting and to scope a platform-level role's access to a bounded subset of clients. Membership is many-to-many — see clientGroupMembership; a client belongs to zero, one, or several groups, and a group holds zero or more clients up to its own capacity.
  • Not tenant data. clientGroup lives in the platform schema alongside platform.clients, with no tenantId — a group is not owned by, or scoped to, any one tenant; it exists to organise clients themselves. This is unrelated to the client → tenant ownership relationship (tenant.clientId, platform.tenants) — see docs/features/em3-44-clients/decision-client-tenant-relationship.md (EM3 code repo, origin/main, 968e59e) in the code repository, which retired the EM2-era hierarchical client_groups (client owning member clients) in favour of client → tenant ownership. This entity is a distinct, narrower concept revived for Client Management: a flat label/tag, never an ownership or delegation relationship, and never consulted for licence, module or billing entitlement.

Data Attributes Table ​

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary key of the entity.UUIDGenerated in code (app layer)YesYesUUID v7-Primary Key018fa51f-fda1-79f4-8461-2cb8f1cabc20
nameHuman-readable name of the client group.String-YesNo-Non-empty; max 255 charsname: idx_client_group_name_active, type: btree (active records)Plzeňský kraj
maxClientCountCapacity of the group: the maximum number of clients it may hold. Enforced on every membership add — see Client Groups — Functional Requirements.Integer-YesNo-Positive integer (≥ 1); no "unlimited" value — every group states a real cap-25
createdAtTimestamp of when the record was created. Immutable after insert.Timestamp with time zonenow() — set in codeYesNoISO 8601Cannot be null; cannot be modified after creation.-2026-09-16T00:00:00Z
updatedAtTimestamp of the last update. Set on insert (equal to createdAt) and updated on every change.Timestamp with time zonenow() — set in codeYesNoISO 8601Cannot be null.-2026-09-16T00:00:00Z
deletedAtTimestamp of soft deletion. Null means the record is active. Once set, immutable.Timestamp with time zone-NoNoISO 8601Immutable once set. Active records: WHERE deletedAt IS NULLIndexed (active records)-
createdByIdentifier of the actor who created the record.String-YesNotype:actorNon-empty.-user:018e...
updatedByIdentifier of the actor who last updated the record.String-YesNotype:actorNon-empty.-user:018e...

Deletion guard: a group cannot be deleted while it holds any active membership — see clientGroupMembership and Client Groups API-A.

Audited fields ​

Recorded (created/deleted: full set; updated: changed fields only): name, maxClientCount.

Excluded:

  • id, createdAt, updatedAt, deletedAt, createdBy, updatedBy — redundant with the audit entry's own entityId/createdAt/createdBy, which already identify the record and the write.

Not registered for entityName resolution — renders id-only in the audit trail (architecture 61-audit-log.md §7.4 in the code repo: a valid, permanent state, not a gap). If registered, name is the natural candidate.