Appearance
Entity: remoteSource
Entity Type: Database table
Description: Represents an automated data integration connector — a named connection to an external remote reading or invoice system. A single remoteSource is linked to one or more clients via a many-to-many join table and contains one or more remoteEndPoint records (individual data channels, each mapping to a gauge). The source type determines which protocol adapter is used to fetch data.
Data Attributes Table
| Attribute Name | Description | Data Type | Default Value | Required (= Nullable) | Unique | Format | Validations | Index | Example |
|---|---|---|---|---|---|---|---|---|---|
| id | Primary key. | UUID | Generated in code (app layer) | Yes | Yes | UUID v7 | - | Primary Key | 018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
| tenantId | Tenant this record belongs to. | UUID | - | Yes | No | UUID v7 | Foreign Key → tenant; must exist | name: idx_remoteSource_tenantId, type: btree | 018fa51f-fda1-79f4-8461-2cb8f1cabc10 |
| sourceIdentifier | Type of the external system this connector connects to. Determines the protocol adapter used during data collection. | Enum | - | Yes | No | enum | Must be a valid ConnectorSourceType value. | name: idx_remoteSource_sourceIdentifier, type: btree | mervis |
| name | Human-readable display name of the connector. | String | - | Yes | No | max 255 chars | Non-empty. | - | Mervis – Škola Brno |
| lastSuccessfulRequest | Timestamp of the most recent successful data pull from this source. Used to compute connector status (operational / warning / error) based on the outage threshold. | Timestamp with time zone | - | No | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Nullable; set automatically by the aggregator on each successful pull. | - | 2026-06-18T14:30:00Z |
| outageThresholdHours | Number of hours without a successful request after which the connector is considered in outage and a remoteEndpointUnmatched notification is triggered. Falls back to the system default if null. | Integer | - | No | No | - | Nullable; positive integer. | - | 24 |
| createdAt | Timestamp of when the record was created. Immutable after insert. | Timestamp with time zone | now() — set in code | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Cannot be null; cannot be modified after creation. | - | 2025-03-16T18:00:00Z |
| updatedAt | Timestamp of the last update. | Timestamp with time zone | now() — set in code | Yes | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Cannot be null. | - | 2025-03-16T18:00:00Z |
| deletedAt | Timestamp of soft deletion. Null means active. Once set, immutable. | Timestamp with time zone | - | No | No | ISO 8601 — YYYY-MM-DDTHH:mm:ss.SSSZ | Immutable once set. Active records: WHERE deletedAt IS NULL | - | 2025-06-01T09:00:00Z |
| createdBy | Identifier of the actor who created the record. | String | - | Yes | No | type:actor | Non-empty. | - | user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
| updatedBy | Identifier of the actor who last updated the record. | String | - | Yes | No | type:actor | Non-empty. | - | user:018ed0b3-c298-7c7a-96d5-8b36f5a7f8d2 |
Client relationship. The many-to-many relationship between remoteSource and client is stored in a join table client_remote_source. This join table has no additional attributes — it is a pure membership table.
Global (tenantless) weather stations. Connectors feeding global weather stations (weatherStation.tenantId IS NULL) are owned by a dedicated platform/system tenant and a corresponding system client row — not by any real customer. No schema change; this is a data convention, not a new column or table.
Discrepancy flagged during migration (per task brief). Index names on the source page used a remote_source (snake_case entity segment) naming style, e.g. idx_remote_source_tenantId; this migration normalises the entity segment to camelCase (idx_remoteSource_tenantId) to match this project's idx_entityName_attributeName convention, without changing the underlying meaning. Earlier auditing separately noted documentation drift on remoteEndPoint/remoteSource against the real schema — this migration carries the Confluence content as-is and does not attempt to reconcile that drift.
Audited fields
Recorded on created (in full), updated (changed only) and deleted (in full): sourceIdentifier, name, lastSuccessfulRequest, outageThresholdHours.
Excluded: none.
Not registered for entityName resolution (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. The client↔remoteSource many-to-many join table has no attributes of its own (per this entity's own description) and so has nothing to audit beyond membership rows, which this entity's own entries already capture via its lifecycle.