Skip to content
Updated Sep 29, 2026 by Barča Dvořáková · Owner: analysisactiveentityconfluence-migration Edit on GitHub

Entity: client ​

Entity Definition ​

  • Entity Name: client
  • Entity Type: Database table
  • Description: The top-level organisational unit in the system. Every building, gauge, user, document and operational record belongs to exactly one client. The client record holds the organisation's identity, system-wide behavioural settings, licence terms and the set of add-on modules enabled for its users. Corresponds to Tenant in the Users & Access domain — one client = one tenant schema.

Note (Users & Access analysis): a client's grouping into client groups is a many-to-many relationship, not a single FK — see clientGroup and clientGroupMembership. This table has no clientGroupId column.

Data Attributes Table ​

clientGroupId removed. The single nullable FK this page previously carried is replaced by a many-to-many relationship — see clientGroup and clientGroupMembership, and the Client Groups feature analysis.

Attribute NameDescriptionData TypeDefault ValueRequired (= Nullable)UniqueFormatValidationsIndexExample
idPrimary keyUUIDGenerated in code (app layer)YesYesUUID v7-Primary Key018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
tenantIdTenant this record belongs to. Required on every entity for organisation-level data separation.UUID-YesNoUUID v7FK → tenant; must existname: idx_client_tenantId, type: btree018fa51f-fda1-79f4-8461-2cb8f1cabc10
nameDisplay name of the client organisationString-YesNo-Non-empty; max 255 charsname: idx_client_name, type: btreeMěsto Brno
typeClassification of the client organisation. Determines which form sections are shown.Enum-YesNoSee Enum - ClientTypeMust be a valid ClientType value-municipality
icoCzech company tax ID (IČO). Populated via ARES lookup.String-NoNo8-digit stringNullable; if set must be 8 digits-44992785
streetStreet name of the client's registered address.StringnullNoNo-Max 255 characters-Náměstí Svobody
houseNumberHouse / descriptive number (číslo popisné) of the client's registered address.StringnullNoNo-Max 20 characters-12
orientationNumberOrientation number (číslo orientační) of the client's registered address. Optional complement to houseNumber.StringnullNoNo-Max 20 characters-4a
zipPostal code of the client's registered address. Used to auto-populate municipality.StringnullNoNo-Exactly 5 digits-60200
municipalityMunicipality of the client's registered address. Auto-populated from zip via ZIP-to-city lookup; can be overridden manually.StringnullNoNo-Max 255 characters-Brno
latLatitude coordinate for meteogram GPS lookupFloat-NoNoWGS84 decimal degreesNullable; −90 to 90-49.1951
lngLongitude coordinate for meteogram GPS lookupFloat-NoNoWGS84 decimal degreesNullable; −180 to 180-16.6068
populationReference population count (municipalities). Manually entered.Integer-NoNo-Nullable; positive integer-380000
buildingCountOwnedTotal number of buildings owned by the client (manually entered reference value, not derived)Integer-NoNo-Nullable; positive integer-47
otherFacilityCountNumber of other facilities (e.g. shelters, kiosks) owned — manually enteredInteger-NoNo-Nullable; positive integer-12
medianClient-specific consumption baseline median used for comparison in reportsString-NoNo-Nullable-120
republicMedianRepublic-wide consumption baseline median for comparison in reportsString-NoNo-Nullable-145
regionIdCzech administrative region (kraj). Cross-domain reference — no entity page in this domain.UUID-NoNoUUID v7FK → region; nullable; onDelete SET NULLname: idx_client_regionId, type: btree018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
mainManagerIdDefault responsible person; their contact is shown to field workersUUID-NoNoUUID v7FK → user; nullable; onDelete SET NULLname: idx_client_mainManagerId, type: btree018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
defaultWeatherStationIdDefault weather station used for consumption normalisation (degree-days) across all buildings that have no building-level assignment in clientWeatherStation.UUID-NoNoUUID v7FK → weatherStation; nullable; onDelete SET NULLname: idx_client_defaultWeatherStationId, type: btree018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
electricityDistributorIdDefault electricity distributor (from price-decision domain). Fallback for all gauges without a per-gauge override. Cross-domain reference — no entity page in this domain.UUID-NoNoUUID v7FK → distributor; nullable; onDelete SET NULL-018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
singleElectricityDistributorWhen true, all gauges share the client's default electricity distributor; per-gauge overrides are hidden. Cross-feature dependency: when false, each electricity measuring point (OM) must expose an individual distributor field — see Gauge Management feature.BooleanfalseNoNo-Nullable-false
gasDistributorIdDefault gas distributor. Cross-domain reference — no entity page in this domain.UUID-NoNoUUID v7FK → gasDistributor; nullable; onDelete SET NULL-018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
singleGasDistributorWhen true, all gauges share the client's default gas distributor; per-gauge overrides are hidden. Cross-feature dependency: when false, each gas measuring point (OM) must expose an individual distributor field — see Gauge Management feature.BooleanfalseNoNo-Nullable-false
licenceTypeLicence renewal modelEnum-YesNoSee Enum - LicenceTypeMust be a valid LicenceType value-indefinitePeriod
licenceLevelFeature access level of the licenceEnum-YesNoSee Enum - LicenceLevelMust be a valid LicenceLevel value-basic
licenceValidToLicence expiry date. Required for timeLimit and autoExtension types; ignored for indefinitePeriod.Timestamp with time zone-NoNoISO 8601Nullable; if licenceType ≠ indefinitePeriod must be set-2026-12-31T23:59:59Z
defaultActionDeadlineDaysDefault number of days for auto-generated action deadlines. Falls back to 7 if null.Integer-NoNo-Nullable; positive integer-14
gaugeMonthControlDaySettingMode for the monthly reading cycle start dayEnumfirstDayYesNoSee Enum - GaugeMonthControlDaySettingMust be a valid GaugeMonthControlDaySetting value-firstDay
gaugeMonthControlDayCustom day of month for the reading cycle (1–28). Used only when gaugeMonthControlDaySetting = customDay.Integer1YesNo-1–28-15
gaugeWeekControlDayDay of the week on which the weekly reading cycle starts (1=Monday … 7=Sunday)Integer1YesNo-1–7-1
displayExpensesWithoutVatWhen true, all invoice and report expense values are shown excluding VATBooleanfalseYesNo---false
showPredictionHow many years of consumption prediction to display (0 = none)Integer1YesNo-Must be one of: 0, 1, 2, 3, 9-1
includeOtherElementsInPredictionWhen true, energy prices and weather data feed into consumption predictionsBoolean-NoNo-Nullable-true
defaultSourcePriorityTenant-level default trust priority for reading sources, used when a gauge's own sourcePriority is null.Stringremote_manual_invoiceYesNoSee enum pageMust be one of 6 permutations of remote, manual, invoice-remote_manual_invoice
gaugeReadingReminderMaster on/off for gauge reading reminder emails across the whole clientBooleantrueYesNo---true
gaugeLimitNotificationDelayHoursHours before the first limit-overflow notification fires. Falls back to system default if null.Integer-NoNo-Nullable; positive integer-4
gaugeLimitNotificationFrequencyHoursHours between repeated limit-overflow notifications. Falls back to system default if null.Integer-NoNo-Nullable; positive integer-24
createdAtTimestamp of when the record was created. Immutable after insert.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null; cannot be modified after creation-2025-03-16T18:00:00Z
updatedAtTimestamp of the last update to the record.Timestamp with time zonenow() — set in codeYesNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZCannot be null-2025-03-16T18:00:00Z
deletedAtTimestamp of soft deletion. Null means the record is active. Once set, this value is immutable.Timestamp with time zone-NoNoISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZImmutable once set. Active records: WHERE deletedAt IS NULL-2025-06-01T09:00:00Z
createdByIdentifier of the actor who created the recordString-YesNotype:actorNon-empty-user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2
updatedByIdentifier of the actor who last updated the recordString-YesNotype:actorNon-empty-system:migration-v25

Source note: the Confluence page describes client as corresponding 1:1 to Tenant/tenant schema, and does not itself mention any platform.clients schema placement — no internal inconsistency was found on the page regarding schema location; flagging per migration instructions only because the topic was called out as a known area of concern elsewhere.

Audited fields ​

Recorded on created (in full), updated (changed only) and deleted (in full): name, type, ico, street, houseNumber, orientationNumber, zip, municipality, lat, lng, population, buildingCountOwned, otherFacilityCount, median, republicMedian, regionId, mainManagerId, defaultWeatherStationId, electricityDistributorId, singleElectricityDistributor, gasDistributorId, singleGasDistributor, licenceType, licenceLevel, licenceValidTo, defaultActionDeadlineDays, gaugeMonthControlDaySetting, gaugeMonthControlDay, gaugeWeekControlDay, displayExpensesWithoutVat, showPrediction, includeOtherElementsInPrediction, defaultSourcePriority, gaugeReadingReminder, gaugeLimitNotificationDelayHours, gaugeLimitNotificationFrequencyHours.

Excluded: none.

As the top-level organisational unit (1 client = 1 tenant schema, per this entity's own description), a client entry effectively documents every tenant-wide settings change made through the client administration screens — licence terms, module defaults, reading-cycle and notification configuration included.

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.