{"id":"697ab4c74bcd26c09b04d5fe","title":"2026 01 29 Input Source And Event Population","path":"how-to/technical-articles/2026-01-29-input-source-and-event-population","contentMarkdown":"# 29-Jan-2026 — Understanding InputSource and EventPopulation [#110](https://github.com/nbarrett/ngx-ramblers/issues/110) [#119](https://github.com/nbarrett/ngx-ramblers/issues/119)\n\n_____\n\nThis article explains the **InputSource** and **EventPopulation** enumerations, how they work together, and how their usage evolved through issues #110 and #119.\n\n## Overview\n\nNGX-Ramblers supports two main ways for groups to manage their walk and event data:\n\n1. **Local management** — Walks are created, imported, and maintained in the local database\n2. **Walks Manager sync** — Walks are synced from the Ramblers Walks Manager API to the local database\n\nTwo key enumerations control this behaviour:\n\n- **EventPopulation** — A group-level setting that determines how walks are sourced\n- **InputSource** — A per-event field that records how each event entered the system\n\n## EventPopulation (Group Configuration)\n\nThis setting is configured per-group in System Settings and determines how walks/events are sourced.\n\n### Before Issue #110\n\n| Value | Behaviour |\n|-------|-----------|\n| `LOCAL` | Walks created/imported locally, stored in local database |\n| `WALKS_MANAGER` | **Queried Ramblers API live for every request** — slow and lost local enrichments |\n| `HYBRID` | Blended local + live Ramblers data together |\n\n### After Issue #110\n\n| Value | Behaviour |\n|-------|-----------|\n| `LOCAL` | Unchanged — walks managed locally |\n| `WALKS_MANAGER` | **Syncs from Ramblers API to local database**, then queries locally — faster and preserves enrichments |\n| `HYBRID` | **Removed** — no longer needed as WALKS_MANAGER now syncs locally |\n\n### After Issue #119\n\n| Value | Behaviour |\n|-------|-----------|\n| `LOCAL` | Unchanged |\n| `WALKS_MANAGER` | **Queries local database only** — all API routing removed. Setting now only controls which sync job runs and UI display logic |\n\n## InputSource (Per-Event Metadata)\n\nThis field is stored on each event and records how that event entered the system.\n\n### Before Issue #110\n\n| Value | Meaning |\n|-------|---------|\n| `FILE_IMPORT` | Imported from a CSV file |\n| `WALKS_MANAGER_IMPORT` | Imported when switching from Walks Manager to Local population |\n| `URL_TO_ID_LOOKUP` | Minimal record linking SEO-friendly slug to Ramblers ID |\n| `MANUALLY_CREATED` | Created manually via the UI |\n| `UNKNOWN` | Legacy or unknown source |\n\n### After Issue #110\n\n| Value | Meaning |\n|-------|---------|\n| `FILE_IMPORT` | Unchanged |\n| `WALKS_MANAGER_IMPORT` | **Deprecated** — redundant with WALKS_MANAGER_CACHE |\n| `WALKS_MANAGER_CACHE` | **Added** — synced from Ramblers API to local cache |\n| `URL_TO_ID_LOOKUP` | **Removed** — no longer needed |\n| `MANUALLY_CREATED` | Unchanged |\n| `UNKNOWN` | Unchanged |\n\n### After Issue #119 (Current)\n\n| Value | Meaning |\n|-------|---------|\n| `FILE_IMPORT` | Imported from a CSV file |\n| `WALKS_MANAGER_CACHE` | Synced from Ramblers Walks Manager API |\n| `MANUALLY_CREATED` | Created manually via the UI |\n| `UNKNOWN` | Legacy or unknown source |\n\n## The Problem Solved by #110 and #119\n\n### Before #110\n\nGroups configured with `EventPopulation.WALKS_MANAGER` had a poor experience:\n\n- Every page view triggered a **live API call** to Ramblers\n- This was **slow** (network latency on every request)\n- Local enrichments were **lost** (edit history, custom fields, migration tracking)\n- The UI showed stale or incomplete data\n\n### After #110\n\nAll Walks Manager data is now **synced to the local database**:\n\n- A background sync job pulls data from the Ramblers API\n- Data is stored locally with `InputSource.WALKS_MANAGER_CACHE`\n- Queries are faster (local database)\n- Local enrichments are preserved\n\n**However**, some code still routed queries to the live API based on `EventPopulation`.\n\n### After #119\n\nAll routing logic was **removed**:\n\n- Every query goes to the local database regardless of `EventPopulation`\n- The `EventPopulation` setting now only controls:\n  - Which sync job runs (Ramblers API sync vs manual entry)\n  - UI display logic (e.g., showing \"Sync from Walks Manager\" button)\n\n## Current Valid Combinations\n\n| EventPopulation | InputSource Values | Meaning |\n|-----------------|-------------------|---------|\n| `LOCAL` | `FILE_IMPORT`, `MANUALLY_CREATED` | Group manages walks locally via CSV import or manual entry |\n| `WALKS_MANAGER` | `WALKS_MANAGER_CACHE`, `MANUALLY_CREATED` | Group syncs from Ramblers, can also create walks locally |\n\n## Technical Details\n\n### The Problematic Code (Before #119)\n\n```typescript\n// WalksAndEventsService - BEFORE\nasync queryById(walkId: string): Promise<ExtendedGroupEvent> {\n  switch (this?.group?.walkPopulation) {\n    case EventPopulation.WALKS_MANAGER:\n      // PROBLEM: Fetches from live API, losing local enrichments\n      return this.ramblersWalksAndEventsService.queryById(walkId);\n    case EventPopulation.LOCAL:\n      return this.localWalksAndEventsService.queryById(walkId);\n  }\n}\n```\n\n### The Fix (After #119)\n\n```typescript\n// WalksAndEventsService - AFTER\nasync queryById(walkId: string): Promise<ExtendedGroupEvent> {\n  // Always use local database\n  return this.localWalksAndEventsService.queryById(walkId);\n}\n```\n\n### Why Local Data Matters\n\nThe local database contains enriched data that the Ramblers API doesn't provide:\n\n| Field | Local Database | Ramblers API |\n|-------|---------------|--------------|\n| `events` | Edit history with timestamps | Not available |\n| `migratedFromId` | Migration tracking | Not available |\n| `fields.venue` | Local venue details | Not available |\n| `fields.riskAssessment` | Risk assessment data | Not available |\n\nBy always querying locally, we preserve all this enriched data.\n\n## Related Issues\n\n- [#110](https://github.com/nbarrett/ngx-ramblers/issues/110) — Server-side pagination and caching implementation\n- [#119](https://github.com/nbarrett/ngx-ramblers/issues/119) — Cleanup: Consolidate WALKS_MANAGER_IMPORT to WALKS_MANAGER_CACHE and remove interactive API queries\n","contentHtml":"<h1>29-Jan-2026 — Understanding InputSource and EventPopulation <a href=\"https://github.com/nbarrett/ngx-ramblers/issues/110\">#110</a> <a href=\"https://github.com/nbarrett/ngx-ramblers/issues/119\">#119</a></h1>\n<hr>\n<p>This article explains the <strong>InputSource</strong> and <strong>EventPopulation</strong> enumerations, how they work together, and how their usage evolved through issues #110 and #119.</p>\n<h2>Overview</h2>\n<p>NGX-Ramblers supports two main ways for groups to manage their walk and event data:</p>\n<ol>\n<li><strong>Local management</strong> — Walks are created, imported, and maintained in the local database</li>\n<li><strong>Walks Manager sync</strong> — Walks are synced from the Ramblers Walks Manager API to the local database</li>\n</ol>\n<p>Two key enumerations control this behaviour:</p>\n<ul>\n<li><strong>EventPopulation</strong> — A group-level setting that determines how walks are sourced</li>\n<li><strong>InputSource</strong> — A per-event field that records how each event entered the system</li>\n</ul>\n<h2>EventPopulation (Group Configuration)</h2>\n<p>This setting is configured per-group in System Settings and determines how walks/events are sourced.</p>\n<h3>Before Issue #110</h3>\n<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Behaviour</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>LOCAL</code></td>\n<td>Walks created/imported locally, stored in local database</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER</code></td>\n<td><strong>Queried Ramblers API live for every request</strong> — slow and lost local enrichments</td>\n</tr>\n<tr>\n<td><code>HYBRID</code></td>\n<td>Blended local + live Ramblers data together</td>\n</tr>\n</tbody></table>\n<h3>After Issue #110</h3>\n<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Behaviour</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>LOCAL</code></td>\n<td>Unchanged — walks managed locally</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER</code></td>\n<td><strong>Syncs from Ramblers API to local database</strong>, then queries locally — faster and preserves enrichments</td>\n</tr>\n<tr>\n<td><code>HYBRID</code></td>\n<td><strong>Removed</strong> — no longer needed as WALKS_MANAGER now syncs locally</td>\n</tr>\n</tbody></table>\n<h3>After Issue #119</h3>\n<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Behaviour</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>LOCAL</code></td>\n<td>Unchanged</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER</code></td>\n<td><strong>Queries local database only</strong> — all API routing removed. Setting now only controls which sync job runs and UI display logic</td>\n</tr>\n</tbody></table>\n<h2>InputSource (Per-Event Metadata)</h2>\n<p>This field is stored on each event and records how that event entered the system.</p>\n<h3>Before Issue #110</h3>\n<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>FILE_IMPORT</code></td>\n<td>Imported from a CSV file</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER_IMPORT</code></td>\n<td>Imported when switching from Walks Manager to Local population</td>\n</tr>\n<tr>\n<td><code>URL_TO_ID_LOOKUP</code></td>\n<td>Minimal record linking SEO-friendly slug to Ramblers ID</td>\n</tr>\n<tr>\n<td><code>MANUALLY_CREATED</code></td>\n<td>Created manually via the UI</td>\n</tr>\n<tr>\n<td><code>UNKNOWN</code></td>\n<td>Legacy or unknown source</td>\n</tr>\n</tbody></table>\n<h3>After Issue #110</h3>\n<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>FILE_IMPORT</code></td>\n<td>Unchanged</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER_IMPORT</code></td>\n<td><strong>Deprecated</strong> — redundant with WALKS_MANAGER_CACHE</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER_CACHE</code></td>\n<td><strong>Added</strong> — synced from Ramblers API to local cache</td>\n</tr>\n<tr>\n<td><code>URL_TO_ID_LOOKUP</code></td>\n<td><strong>Removed</strong> — no longer needed</td>\n</tr>\n<tr>\n<td><code>MANUALLY_CREATED</code></td>\n<td>Unchanged</td>\n</tr>\n<tr>\n<td><code>UNKNOWN</code></td>\n<td>Unchanged</td>\n</tr>\n</tbody></table>\n<h3>After Issue #119 (Current)</h3>\n<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>FILE_IMPORT</code></td>\n<td>Imported from a CSV file</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER_CACHE</code></td>\n<td>Synced from Ramblers Walks Manager API</td>\n</tr>\n<tr>\n<td><code>MANUALLY_CREATED</code></td>\n<td>Created manually via the UI</td>\n</tr>\n<tr>\n<td><code>UNKNOWN</code></td>\n<td>Legacy or unknown source</td>\n</tr>\n</tbody></table>\n<h2>The Problem Solved by #110 and #119</h2>\n<h3>Before #110</h3>\n<p>Groups configured with <code>EventPopulation.WALKS_MANAGER</code> had a poor experience:</p>\n<ul>\n<li>Every page view triggered a <strong>live API call</strong> to Ramblers</li>\n<li>This was <strong>slow</strong> (network latency on every request)</li>\n<li>Local enrichments were <strong>lost</strong> (edit history, custom fields, migration tracking)</li>\n<li>The UI showed stale or incomplete data</li>\n</ul>\n<h3>After #110</h3>\n<p>All Walks Manager data is now <strong>synced to the local database</strong>:</p>\n<ul>\n<li>A background sync job pulls data from the Ramblers API</li>\n<li>Data is stored locally with <code>InputSource.WALKS_MANAGER_CACHE</code></li>\n<li>Queries are faster (local database)</li>\n<li>Local enrichments are preserved</li>\n</ul>\n<p><strong>However</strong>, some code still routed queries to the live API based on <code>EventPopulation</code>.</p>\n<h3>After #119</h3>\n<p>All routing logic was <strong>removed</strong>:</p>\n<ul>\n<li>Every query goes to the local database regardless of <code>EventPopulation</code></li>\n<li>The <code>EventPopulation</code> setting now only controls:<ul>\n<li>Which sync job runs (Ramblers API sync vs manual entry)</li>\n<li>UI display logic (e.g., showing &quot;Sync from Walks Manager&quot; button)</li>\n</ul>\n</li>\n</ul>\n<h2>Current Valid Combinations</h2>\n<table>\n<thead>\n<tr>\n<th>EventPopulation</th>\n<th>InputSource Values</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>LOCAL</code></td>\n<td><code>FILE_IMPORT</code>, <code>MANUALLY_CREATED</code></td>\n<td>Group manages walks locally via CSV import or manual entry</td>\n</tr>\n<tr>\n<td><code>WALKS_MANAGER</code></td>\n<td><code>WALKS_MANAGER_CACHE</code>, <code>MANUALLY_CREATED</code></td>\n<td>Group syncs from Ramblers, can also create walks locally</td>\n</tr>\n</tbody></table>\n<h2>Technical Details</h2>\n<h3>The Problematic Code (Before #119)</h3>\n<pre><code class=\"language-typescript\">// WalksAndEventsService - BEFORE\nasync queryById(walkId: string): Promise&lt;ExtendedGroupEvent&gt; {\n  switch (this?.group?.walkPopulation) {\n    case EventPopulation.WALKS_MANAGER:\n      // PROBLEM: Fetches from live API, losing local enrichments\n      return this.ramblersWalksAndEventsService.queryById(walkId);\n    case EventPopulation.LOCAL:\n      return this.localWalksAndEventsService.queryById(walkId);\n  }\n}\n</code></pre>\n<h3>The Fix (After #119)</h3>\n<pre><code class=\"language-typescript\">// WalksAndEventsService - AFTER\nasync queryById(walkId: string): Promise&lt;ExtendedGroupEvent&gt; {\n  // Always use local database\n  return this.localWalksAndEventsService.queryById(walkId);\n}\n</code></pre>\n<h3>Why Local Data Matters</h3>\n<p>The local database contains enriched data that the Ramblers API doesn&#39;t provide:</p>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Local Database</th>\n<th>Ramblers API</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>events</code></td>\n<td>Edit history with timestamps</td>\n<td>Not available</td>\n</tr>\n<tr>\n<td><code>migratedFromId</code></td>\n<td>Migration tracking</td>\n<td>Not available</td>\n</tr>\n<tr>\n<td><code>fields.venue</code></td>\n<td>Local venue details</td>\n<td>Not available</td>\n</tr>\n<tr>\n<td><code>fields.riskAssessment</code></td>\n<td>Risk assessment data</td>\n<td>Not available</td>\n</tr>\n</tbody></table>\n<p>By always querying locally, we preserve all this enriched data.</p>\n<h2>Related Issues</h2>\n<ul>\n<li><a href=\"https://github.com/nbarrett/ngx-ramblers/issues/110\">#110</a> — Server-side pagination and caching implementation</li>\n<li><a href=\"https://github.com/nbarrett/ngx-ramblers/issues/119\">#119</a> — Cleanup: Consolidate WALKS_MANAGER_IMPORT to WALKS_MANAGER_CACHE and remove interactive API queries</li>\n</ul>\n"}