{
  "version": "1.0.0",
  "project": {
    "name": "treetracker-field-data",
    "languages": [
      "dockerfile",
      "javascript",
      "json",
      "markdown",
      "shell",
      "sql",
      "yaml"
    ],
    "frameworks": [
      "Express",
      "Mocha",
      "Docker",
      "GitHub Actions"
    ],
    "description": "Field data service that owns the raw tree tracking data that the Treetracker app uploads: raw captures, sessions, tracks, device configurations, and wallet registrations. A layered Express service (routes, handlers, services, models, repositories) over PostgreSQL, which also writes the legacy tables.",
    "analyzedAt": "2026-11-02T23:49:48.000Z",
    "gitCommitHash": "8ffb53c98722c168f95e2a2a316198315547ce11"
  },
  "nodes": [
    {
      "id": "file:__tests__/clear-db.js",
      "type": "file",
      "name": "clear-db.js",
      "filePath": "__tests__/clear-db.js",
      "summary": "Test helper that empties the legacy tree_attributes, trees and planter tables and the field-data raw_capture, track, session, device_configuration and wallet_registration tables, in foreign-key-safe order, before each API spec suite.",
      "tags": [
        "test",
        "test-helper",
        "database",
        "fixture-cleanup"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:__tests__/clear-db.js:clearDB",
      "type": "function",
      "name": "clearDB",
      "filePath": "__tests__/clear-db.js",
      "lineRange": [
        1,
        10
      ],
      "summary": "Async function that takes the knex and knexLegacyDB clients and deletes all rows from tree_attributes, trees and planter (legacy DB), then raw_capture, track, session, device_configuration and wallet_registration (field-data DB).",
      "tags": [
        "test-helper",
        "database",
        "cleanup"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:__tests__/device-configuration-api.spec.js",
      "type": "file",
      "name": "device-configuration-api.spec.js",
      "filePath": "__tests__/device-configuration-api.spec.js",
      "summary": "Mocha and supertest integration spec for the /device-configuration API: POST a fixed device configuration expects 201, a repeated POST expects 200 (idempotent duplicate), and GET list plus GET /device-configuration/:id must return the stored id. It also exports deviceConfigurationObject as a shared fixture for the session and capture specs.",
      "tags": [
        "test",
        "integration-test",
        "api",
        "device-configuration",
        "fixture"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:__tests__/insert-test-capture.js",
      "type": "file",
      "name": "insert-test-capture.js",
      "filePath": "__tests__/insert-test-capture.js",
      "summary": "Shared capture fixture module: defines captureRequestObject (session_id, lat/lon, gps_accuracy, rotation_matrix, extra_attributes, captured_at), plus capture and captureWithExistingTree variants with fixed UUIDs, and a seeding function that builds the full planter, device, wallet, session, legacy tree and raw_capture chain.",
      "tags": [
        "test",
        "fixture",
        "test-helper",
        "raw-capture",
        "database"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:__tests__/insert-test-capture.js:insertTestCapture",
      "type": "function",
      "name": "insertTestCapture",
      "filePath": "__tests__/insert-test-capture.js",
      "lineRange": [
        38,
        70
      ],
      "summary": "Seeds both databases for capture tests: inserts a legacy planter whose email is the wallet, the device_configuration, wallet_registration and session rows, a legacy trees row for capture.id whose returned id becomes the raw_capture reference_id (status 'unprocessed', extra_attributes wrapped in entries), and a second legacy tree for captureWithExistingTree.",
      "tags": [
        "test-helper",
        "fixture",
        "database",
        "legacy-db"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:__tests__/legacy-table-creation.js",
      "type": "file",
      "name": "legacy-table-creation.js",
      "filePath": "__tests__/legacy-table-creation.js",
      "summary": "Mocha root-level before hook that runs raw CREATE TABLE IF NOT EXISTS SQL on knexLegacyDB to create the legacy trees (with uuid, status, images, domain_specific_data, PostGIS estimated_geometric_location), tree_attributes and planter tables, so the integration tests can run against an empty legacy database.",
      "tags": [
        "test",
        "test-setup",
        "legacy-db",
        "schema",
        "database"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:__tests__/raw-capture-api.spec.js",
      "type": "file",
      "name": "raw-capture-api.spec.js",
      "filePath": "__tests__/raw-capture-api.spec.js",
      "summary": "Integration spec for /raw-captures: covers 201 on first POST, 200 on duplicate POST, 200 for an already approved capture (reference_id 64864), 201 for a new capture whose uuid already has a legacy tree, list and single GET, and PATCH /raw-captures/:id/reject with a sinon stub on LegacyAPIService.rejectLegacyTree that checks the forwarded Authorization header, organizationId and rejectionReason and expects status 'rejected'.",
      "tags": [
        "test",
        "integration-test",
        "api",
        "raw-capture",
        "rejection"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:__tests__/session-api.spec.js",
      "type": "file",
      "name": "session-api.spec.js",
      "filePath": "__tests__/session-api.spec.js",
      "summary": "Integration spec for the /session API: seeds device_configuration and wallet_registration rows, then checks POST /session returns 201, a duplicate POST returns 200, and GET /session plus GET /session/:id return the stored session. It exports sessionObject (bulk_pack_version 'v2', originating_wallet_registration_id, target_wallet) for the track and capture specs.",
      "tags": [
        "test",
        "integration-test",
        "api",
        "session",
        "fixture"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:__tests__/track-api.spec.js",
      "type": "file",
      "name": "track-api.spec.js",
      "filePath": "__tests__/track-api.spec.js",
      "summary": "Integration spec for the /track API: after seeding via insertTestCapture, POST /track with locations_url, session_id and bulk_pack_file_name expects 201, then GET /track?session_id= must return one track with query count 1, limit 100 and offset 0, and GET /track/:id must return it.",
      "tags": [
        "test",
        "integration-test",
        "api",
        "track",
        "pagination"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:__tests__/wallet-registration-api.spec.js",
      "type": "file",
      "name": "wallet-registration-api.spec.js",
      "filePath": "__tests__/wallet-registration-api.spec.js",
      "summary": "Integration spec for /wallet-registration: POST expects 201, a second registration with the quasi-email 'mobile@test' also expects 201, a duplicate POST expects 200, and list plus single GET return the record. It exports walletRegistrationObject (wallet, grower_account_id, phone, email, v1_legacy_organization) as a shared fixture.",
      "tags": [
        "test",
        "integration-test",
        "api",
        "wallet-registration",
        "fixture"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:config/config.js",
      "type": "file",
      "name": "config.js",
      "filePath": "config/config.js",
      "summary": "Central runtime config that maps the DATABASE_URL env var to connectionString and DATABASE_URL_LEGACYDB to connectionStringLegacyDB for the two Postgres databases, and sets an empty sentryDSN.",
      "tags": [
        "config",
        "environment",
        "database",
        "utility"
      ],
      "complexity": "simple",
      "languageNotes": "Exports sentryDSN, but server/app.js reads config.sentry_dsn, so Sentry.init receives an undefined DSN."
    },
    {
      "id": "file:server/app.js",
      "type": "file",
      "name": "app.js",
      "filePath": "server/app.js",
      "summary": "Builds the Express app: initializes Sentry, enables CORS only when NODE_ENV is development, rejects POST/PATCH/PUT requests without an application/json content-type with HttpError 415, serves /assets statically and Swagger UI at /docs, mounts the main router at /, applies the global errorHandler, and answers any unmatched GET with the package.json version.",
      "tags": [
        "entry-point",
        "express",
        "middleware",
        "api",
        "validation",
        "tested"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/app.spec.js",
      "type": "file",
      "name": "app.spec.js",
      "filePath": "server/app.spec.js",
      "summary": "Small supertest spec for server/app.js: GET / must return 200 (the package version fallback) and an empty POST / must return 415 with a message that mentions application/json.",
      "tags": [
        "test",
        "unit-test",
        "express",
        "content-type"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/infra/database/knex.js",
      "type": "file",
      "name": "knex.js",
      "filePath": "server/infra/database/knex.js",
      "summary": "Creates the two Knex Postgres clients: knex for the field-data DB and knexLegacyDB for the legacy treetracker DB. It throws if either connection string does not start with postgresql:/, uses a pool of 0 to 10, enables debug when NODE_LOG_LEVEL is debug, and sets searchPath from DATABASE_SCHEMA on the field-data client only.",
      "tags": [
        "database",
        "knex",
        "postgres",
        "infrastructure",
        "singleton"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/infra/database/knex.js:connectionObject",
      "type": "function",
      "name": "connectionObject",
      "filePath": "server/infra/database/knex.js",
      "lineRange": [
        17,
        37
      ],
      "summary": "Parses a postgresql://user:pass@host:port/db?ssl=true URL with a regex into a pg connection object with ssl.rejectUnauthorized false, to avoid pg 8 SSL errors on newer Node versions; it returns the raw string when the URL has no ssl=true suffix.",
      "tags": [
        "database",
        "connection",
        "ssl",
        "parsing"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/server.js",
      "type": "file",
      "name": "server.js",
      "filePath": "server/server.js",
      "summary": "Process entry point: loads dotenv from .env.<NODE_ENV>, applies the log level via setup.js, starts the Express app on NODE_PORT (default 3006), and on SIGINT destroys both the knex and knexLegacyDB pools and closes the HTTP server.",
      "tags": [
        "entry-point",
        "server",
        "bootstrap",
        "graceful-shutdown"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/setup.js",
      "type": "file",
      "name": "setup.js",
      "filePath": "server/setup.js",
      "summary": "Global startup setting module that sets the loglevel default level from NODE_LOG_LEVEL, or to 'info' when the variable is unset.",
      "tags": [
        "config",
        "logging",
        "setup",
        "environment"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/models/LegacyTree.js",
      "type": "file",
      "name": "LegacyTree.js",
      "filePath": "server/models/LegacyTree.js",
      "summary": "Temporary backward-compatibility model that copies a field-data raw capture into the legacy treetracker main DB: it resolves the planter by wallet and writes rows to the legacy trees and tree_attributes tables.",
      "tags": [
        "data-model",
        "legacy-compatibility",
        "treetracker-db",
        "replication"
      ],
      "complexity": "moderate",
      "languageNotes": "The header comment documents the intent to delete this model once the monolith DB split is finished; legacy tree_attributes is described as future capture_metadata."
    },
    {
      "id": "class:server/models/LegacyTree.js:LegacyTree",
      "type": "class",
      "name": "LegacyTree",
      "filePath": "server/models/LegacyTree.js",
      "lineRange": [
        14,
        74
      ],
      "summary": "Legacy tree builder bound to a LegacySession; maps capture plus session fields to a frozen legacy trees row and inserts it idempotently by uuid together with its tree_attributes rows.",
      "tags": [
        "data-model",
        "legacy-compatibility",
        "idempotent-write"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/models/LegacyTree.js:legacyTree",
      "type": "function",
      "name": "legacyTree",
      "filePath": "server/models/LegacyTree.js",
      "lineRange": [
        20,
        53
      ],
      "summary": "Looks up the legacy planter whose phone or email equals the wallet and throws HttpError 422 'Legacy planter has not been created for the legacy tree' when none exists; otherwise returns a frozen trees row with lowercased uuid, planter_id, planter_identifier, planter_photo_url, note and time_created/time_updated set from captured_at.",
      "tags": [
        "mapping",
        "validation",
        "legacy-compatibility"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/models/LegacyTree.js:createTreesInLegacyDB",
      "type": "function",
      "name": "createTreesInLegacyDB",
      "filePath": "server/models/LegacyTree.js",
      "lineRange": [
        55,
        73
      ],
      "summary": "Returns the existing legacy trees row when one with the same uuid exists; otherwise inserts the tree through LegacyTreeRepository.create and inserts each extra attribute into tree_attributes with tree_id set to the new tree id.",
      "tags": [
        "persistence",
        "idempotent-write",
        "legacy-compatibility"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/models/RawCapture.js",
      "type": "file",
      "name": "RawCapture.js",
      "filePath": "server/models/RawCapture.js",
      "summary": "Domain model for field-data raw captures: shapes raw_capture rows into a frozen object, reads them with session, wallet and device joins, creates them idempotently with status 'unprocessed', and marks them 'rejected'.",
      "tags": [
        "data-model",
        "raw-capture",
        "domain-model",
        "idempotent-write"
      ],
      "complexity": "moderate"
    },
    {
      "id": "class:server/models/RawCapture.js:RawCapture",
      "type": "class",
      "name": "RawCapture",
      "filePath": "server/models/RawCapture.js",
      "lineRange": [
        3,
        119
      ],
      "summary": "Raw capture model class that wraps RawCaptureRepository for one DB session and exposes list, count, get-by-id, create and reject operations that return frozen raw capture objects.",
      "tags": [
        "data-model",
        "raw-capture",
        "repository-wrapper"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/models/RawCapture.js:RawCapture",
      "type": "function",
      "name": "RawCapture",
      "filePath": "server/models/RawCapture.js",
      "lineRange": [
        9,
        59
      ],
      "summary": "Static factory that freezes the public raw capture shape: id, reference_id, session_id, step counts, rotation_matrix, image_url, lat/lon, gps_accuracy, wallet and grower_account_id, extra_attributes, status, rejection_reason, captured_at and organization_id.",
      "tags": [
        "factory",
        "serialization",
        "immutability"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/models/RawCapture.js:createRawCapture",
      "type": "function",
      "name": "createRawCapture",
      "filePath": "server/models/RawCapture.js",
      "lineRange": [
        84,
        101
      ],
      "summary": "Returns the existing capture with status 200 when raw_capture.id already exists; otherwise inserts the capture with status 'unprocessed' and fresh created_at/updated_at timestamps and returns it with status 201.",
      "tags": [
        "idempotent-write",
        "persistence",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/models/RawCapture.js:rejectRawCapture",
      "type": "function",
      "name": "rejectRawCapture",
      "filePath": "server/models/RawCapture.js",
      "lineRange": [
        103,
        118
      ],
      "summary": "Sets a raw capture row to status 'rejected' with the given rejection_reason and a new updated_at, then returns the previously read capture merged with these updates.",
      "tags": [
        "state-transition",
        "persistence",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/models/SessionModel.js",
      "type": "file",
      "name": "SessionModel.js",
      "filePath": "server/models/SessionModel.js",
      "summary": "Domain model for field-data sessions: freezes session rows enriched with device_identifier and wallet data, lists and counts sessions, and creates a session only when its id is not already stored.",
      "tags": [
        "data-model",
        "session",
        "domain-model",
        "idempotent-write"
      ],
      "complexity": "moderate"
    },
    {
      "id": "class:server/models/SessionModel.js:SessionModel",
      "type": "class",
      "name": "SessionModel",
      "filePath": "server/models/SessionModel.js",
      "lineRange": [
        3,
        82
      ],
      "summary": "Session model class over SessionRepository that provides getSessions, getSessionsCount, getSessionById (limit 1 on session.id) and idempotent createSession, all returning frozen session objects.",
      "tags": [
        "data-model",
        "session",
        "repository-wrapper"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/models/SessionModel.js:SessionModel",
      "type": "function",
      "name": "SessionModel",
      "filePath": "server/models/SessionModel.js",
      "lineRange": [
        8,
        44
      ],
      "summary": "Static factory that freezes the session response shape: start_time, bulk_pack_version, device_configuration_id, originating_wallet_registration_id, target_wallet, check_in_photo_url, track_url, organization fields, wallet fields and created_at.",
      "tags": [
        "factory",
        "serialization",
        "immutability"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/models/SessionModel.js:createSession",
      "type": "function",
      "name": "createSession",
      "filePath": "server/models/SessionModel.js",
      "lineRange": [
        70,
        81
      ],
      "summary": "Inserts a new session row with created_at set to now and returns it with status 201, or returns the already stored session with status 200 when the id exists.",
      "tags": [
        "idempotent-write",
        "persistence",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/repositories/BaseRepository.js",
      "type": "file",
      "name": "BaseRepository.js",
      "filePath": "server/repositories/BaseRepository.js",
      "summary": "Generic Knex repository base class that every field-data and legacy repository extends; it provides table-scoped getById, nested and/or filter queries with limit/offset, counts, update and insert with runtime result checks.",
      "tags": [
        "repository",
        "data-access",
        "knex",
        "base-class",
        "tested"
      ],
      "complexity": "moderate",
      "languageNotes": "Uses expect-runtime assertions on query results instead of a schema validator; filters may nest and/or arrays recursively."
    },
    {
      "id": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "class",
      "name": "BaseRepository",
      "filePath": "server/repositories/BaseRepository.js",
      "lineRange": [
        4,
        123
      ],
      "summary": "Abstract-style repository bound to a table name and a Session; all queries go through session.getDB() so they join the caller's open transaction.",
      "tags": [
        "repository",
        "base-class",
        "data-access"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/repositories/BaseRepository.js:getById",
      "type": "function",
      "name": "getById",
      "filePath": "server/repositories/BaseRepository.js",
      "lineRange": [
        11,
        22
      ],
      "summary": "Selects the first row of the bound table with the given id and throws HttpError 404 'Can not found <table> by id' when no row matches.",
      "tags": [
        "query",
        "not-found",
        "data-access"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/repositories/BaseRepository.js:getByFilter",
      "type": "function",
      "name": "getByFilter",
      "filePath": "server/repositories/BaseRepository.js",
      "lineRange": [
        30,
        81
      ],
      "summary": "Builds a Knex where clause from a filter object that can nest 'and' and 'or' arrays of single-key conditions, applies optional limit and offset, and asserts that the result is an array.",
      "tags": [
        "query-builder",
        "filtering",
        "pagination"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/repositories/BaseRepository.js:countByFilter",
      "type": "function",
      "name": "countByFilter",
      "filePath": "server/repositories/BaseRepository.js",
      "lineRange": [
        83,
        95
      ],
      "summary": "Runs a COUNT on the bound table with a plain where filter, asserts the Postgres string count shape and returns it parsed as an integer.",
      "tags": [
        "query",
        "count",
        "pagination"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/repositories/BaseRepository.js:update",
      "type": "function",
      "name": "update",
      "filePath": "server/repositories/BaseRepository.js",
      "lineRange": [
        97,
        109
      ],
      "summary": "Updates the row whose id equals object.id with the given fields, returns the updated row via RETURNING *, and asserts that a row with an id came back.",
      "tags": [
        "persistence",
        "update",
        "data-access"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/repositories/BaseRepository.js:create",
      "type": "function",
      "name": "create",
      "filePath": "server/repositories/BaseRepository.js",
      "lineRange": [
        111,
        122
      ],
      "summary": "Inserts the given object (or array of objects) into the bound table with RETURNING *, asserts that the first result has an id, and returns that first row.",
      "tags": [
        "persistence",
        "insert",
        "data-access"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/repositories/Legacy/PlanterRepository.js",
      "type": "file",
      "name": "PlanterRepository.js",
      "filePath": "server/repositories/Legacy/PlanterRepository.js",
      "summary": "Legacy repository for the treetracker main DB planter table that finds a planter whose phone or email matches a wallet identifier.",
      "tags": [
        "repository",
        "legacy-compatibility",
        "treetracker-db",
        "lookup"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/repositories/Legacy/PlanterRepository.js:LegacyPlanterRepository",
      "type": "class",
      "name": "LegacyPlanterRepository",
      "filePath": "server/repositories/Legacy/PlanterRepository.js",
      "lineRange": [
        3,
        19
      ],
      "summary": "BaseRepository subclass for the legacy planter table whose findUser returns the first planter where phone or email equals the planter identifier.",
      "tags": [
        "repository",
        "legacy-compatibility",
        "lookup"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/repositories/Legacy/TreeAttributeRepository.js",
      "type": "file",
      "name": "TreeAttributeRepository.js",
      "filePath": "server/repositories/Legacy/TreeAttributeRepository.js",
      "summary": "Legacy repository for the treetracker main DB tree_attributes table, used to store per-capture extra attributes next to legacy trees rows.",
      "tags": [
        "repository",
        "legacy-compatibility",
        "treetracker-db",
        "attributes"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/repositories/Legacy/TreeAttributeRepository.js:LegacyTreeAttributeRepository",
      "type": "class",
      "name": "LegacyTreeAttributeRepository",
      "filePath": "server/repositories/Legacy/TreeAttributeRepository.js",
      "lineRange": [
        3,
        17
      ],
      "summary": "BaseRepository subclass bound to tree_attributes; its add method inserts each attribute row in parallel through the inherited create, but LegacyTree calls create with the whole array instead.",
      "tags": [
        "repository",
        "legacy-compatibility",
        "attributes"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/repositories/Legacy/TreeRepository.js",
      "type": "file",
      "name": "TreeRepository.js",
      "filePath": "server/repositories/Legacy/TreeRepository.js",
      "summary": "Legacy repository for the treetracker main DB trees table that inserts a tree with a PostGIS point geometry using a raw SQL statement.",
      "tags": [
        "repository",
        "legacy-compatibility",
        "treetracker-db",
        "postgis"
      ],
      "complexity": "simple",
      "languageNotes": "Uses knex.raw with positional bindings because ST_PointFromText cannot be expressed in the Knex insert builder."
    },
    {
      "id": "class:server/repositories/Legacy/TreeRepository.js:LegacyTreeRepository",
      "type": "class",
      "name": "LegacyTreeRepository",
      "filePath": "server/repositories/Legacy/TreeRepository.js",
      "lineRange": [
        3,
        47
      ],
      "summary": "BaseRepository subclass bound to the legacy trees table that overrides create with a geometry-aware raw insert.",
      "tags": [
        "repository",
        "legacy-compatibility",
        "postgis"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/repositories/Legacy/TreeRepository.js:create",
      "type": "function",
      "name": "create",
      "filePath": "server/repositories/Legacy/TreeRepository.js",
      "lineRange": [
        10,
        46
      ],
      "summary": "Inserts a legacy trees row (planter_id, lat, lon, planter_photo_url, planter_identifier, device_identifier, note, uuid, image_url, timestamps) and sets estimated_geometric_location to ST_PointFromText('POINT(lon lat)', 4326), returning the new id.",
      "tags": [
        "persistence",
        "postgis",
        "raw-sql"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/repositories/RawCaptureRepository.js",
      "type": "file",
      "name": "RawCaptureRepository.js",
      "filePath": "server/repositories/RawCaptureRepository.js",
      "summary": "Repository for the field-data raw_capture table that reads captures joined with session, wallet_registration and device_configuration, newest first, with optional limit/offset.",
      "tags": [
        "repository",
        "raw-capture",
        "data-access",
        "knex"
      ],
      "complexity": "moderate"
    },
    {
      "id": "class:server/repositories/RawCaptureRepository.js:RawCaptureRepository",
      "type": "class",
      "name": "RawCaptureRepository",
      "filePath": "server/repositories/RawCaptureRepository.js",
      "lineRange": [
        3,
        112
      ],
      "summary": "BaseRepository subclass bound to raw_capture that overrides getByFilter with a three-table left join and adds a CTE-based insert-and-read add method.",
      "tags": [
        "repository",
        "raw-capture",
        "join-query"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/repositories/RawCaptureRepository.js:getByFilter",
      "type": "function",
      "name": "getByFilter",
      "filePath": "server/repositories/RawCaptureRepository.js",
      "lineRange": [
        10,
        62
      ],
      "summary": "Selects raw_capture columns plus device_identifier, grower_account_id, wallet, user_photo_url and session.organization_id through left joins on session, wallet_registration and device_configuration, ordered by created_at descending with optional limit and offset.",
      "tags": [
        "query",
        "join-query",
        "pagination"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/repositories/RawCaptureRepository.js:add",
      "type": "function",
      "name": "add",
      "filePath": "server/repositories/RawCaptureRepository.js",
      "lineRange": [
        64,
        111
      ],
      "summary": "Inserts a raw capture inside a 'createdRawCapture' CTE and selects the new row joined with session, wallet_registration and device_configuration; the RawCapture model uses the inherited create instead, so no caller in server/ uses this method.",
      "tags": [
        "persistence",
        "cte",
        "join-query"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/repositories/SessionRepository.js",
      "type": "file",
      "name": "SessionRepository.js",
      "filePath": "server/repositories/SessionRepository.js",
      "summary": "Repository for the field-data session table that reads and counts sessions joined with wallet_registration and device_configuration for wallet and device details.",
      "tags": [
        "repository",
        "session",
        "data-access",
        "knex"
      ],
      "complexity": "moderate"
    },
    {
      "id": "class:server/repositories/SessionRepository.js:SessionRepository",
      "type": "class",
      "name": "SessionRepository",
      "filePath": "server/repositories/SessionRepository.js",
      "lineRange": [
        4,
        74
      ],
      "summary": "BaseRepository subclass bound to the session table that adds a joined getSessions query and overrides countByFilter so filters may use joined columns.",
      "tags": [
        "repository",
        "session",
        "join-query"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/repositories/SessionRepository.js:getSessions",
      "type": "function",
      "name": "getSessions",
      "filePath": "server/repositories/SessionRepository.js",
      "lineRange": [
        11,
        46
      ],
      "summary": "Selects session columns such as target_wallet, check_in_photo_url, track_url, bulk_pack_version and organization_id plus device_identifier and wallet fields via left joins, applying limitOptions.limit and limitOptions.offset unconditionally.",
      "tags": [
        "query",
        "join-query",
        "pagination"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/repositories/SessionRepository.js:countByFilter",
      "type": "function",
      "name": "countByFilter",
      "filePath": "server/repositories/SessionRepository.js",
      "lineRange": [
        48,
        73
      ],
      "summary": "Counts session rows after left joining wallet_registration and device_configuration so the filter can reference joined columns, and returns the Postgres count parsed as an integer.",
      "tags": [
        "query",
        "count",
        "join-query"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/services/LegacyAPIService.js",
      "type": "file",
      "name": "LegacyAPIService.js",
      "filePath": "server/services/LegacyAPIService.js",
      "summary": "HTTP client for the legacy treetracker admin API at TREETRACKER_LEGACY_API_URL (default http://treetracker-admin-api.admin-api) that rejects a legacy tree.",
      "tags": [
        "service",
        "http-client",
        "legacy-compatibility",
        "integration",
        "tested"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/services/LegacyAPIService.js:rejectLegacyTree",
      "type": "function",
      "name": "rejectLegacyTree",
      "filePath": "server/services/LegacyAPIService.js",
      "lineRange": [
        9,
        24
      ],
      "summary": "Sends an axios PATCH to /api/[organization/<id>/]trees/<id> with approved=false, active=false and the rejectionReason, forwarding the caller's legacy authorization header.",
      "tags": [
        "http-client",
        "legacy-compatibility",
        "rejection"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/services/RawCaptureService.js",
      "type": "file",
      "name": "RawCaptureService.js",
      "filePath": "server/services/RawCaptureService.js",
      "summary": "Service that coordinates raw capture use cases across two databases: it writes the legacy trees row and the field-data raw_capture row in paired transactions, and rejects captures through the legacy admin API.",
      "tags": [
        "service",
        "raw-capture",
        "transaction",
        "legacy-compatibility",
        "tested"
      ],
      "complexity": "moderate",
      "languageNotes": "Coordinates two independent DB transactions (Session and LegacySession) manually; this is not a distributed transaction, so the commit of one can succeed while the other fails."
    },
    {
      "id": "class:server/services/RawCaptureService.js:RawCaptureService",
      "type": "class",
      "name": "RawCaptureService",
      "filePath": "server/services/RawCaptureService.js",
      "lineRange": [
        9,
        115
      ],
      "summary": "Raw capture service class instantiated per request by the raw capture handler; it owns a field-data Session and a RawCapture model and passes list, count and get-by-id calls through to the model.",
      "tags": [
        "service",
        "raw-capture",
        "orchestration"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/services/RawCaptureService.js:createRawCapture",
      "type": "function",
      "name": "createRawCapture",
      "filePath": "server/services/RawCaptureService.js",
      "lineRange": [
        27,
        76
      ],
      "summary": "Throws HttpError 409 when the capture's session_id is not stored yet; otherwise creates or reuses the legacy trees row in a LegacySession transaction, stores the raw capture with reference_id set to the legacy tree id, commits both, and rolls back any open transaction on error.",
      "tags": [
        "transaction",
        "orchestration",
        "legacy-compatibility"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/services/RawCaptureService.js:rejectRawCapture",
      "type": "function",
      "name": "rejectRawCapture",
      "filePath": "server/services/RawCaptureService.js",
      "lineRange": [
        78,
        114
      ],
      "summary": "Inside a field-data transaction, reads the capture's reference_id, calls the legacy admin API to reject that legacy tree for the organization, then marks the raw capture rejected and commits, rolling back on failure.",
      "tags": [
        "transaction",
        "rejection",
        "integration"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/utils/HttpError.js",
      "type": "file",
      "name": "HttpError.js",
      "filePath": "server/utils/HttpError.js",
      "summary": "Shared error type for the service layers that carries an HTTP status code and a rollback flag; the Express error handler in server/utils/utils.js converts it to an HTTP response.",
      "tags": [
        "utility",
        "error-handling",
        "http",
        "shared"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/utils/HttpError.js:HttpError",
      "type": "class",
      "name": "HttpError",
      "filePath": "server/utils/HttpError.js",
      "lineRange": [
        8,
        20
      ],
      "summary": "Error subclass with a numeric code and shouldRollback(); because the constructor uses 'toRollback || true', shouldRollback always returns true even when false is passed.",
      "tags": [
        "error-handling",
        "http",
        "utility"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/rawCaptureHandler/index.js",
      "type": "file",
      "name": "index.js",
      "filePath": "server/handlers/rawCaptureHandler/index.js",
      "summary": "Express handlers for the /raw-captures API: list with filter and limit/offset paging, create a raw capture from the Treetracker app upload, fetch one by raw_capture_id, and reject a capture through the legacy admin API. Each handler validates input with the Joi schemas in ./schemas before it calls RawCaptureService.",
      "tags": [
        "api-handler",
        "raw-capture",
        "validation",
        "express",
        "pagination",
        "tested"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureGet",
      "type": "function",
      "name": "rawCaptureGet",
      "filePath": "server/handlers/rawCaptureHandler/index.js",
      "lineRange": [
        14,
        42
      ],
      "summary": "Validates req.query with rawCaptureGetQuerySchema, splits it into filter and limit/offset, reads matching raw captures and their total count from RawCaptureService, and responds with raw_captures, prev/next links for 'raw-captures', and the echoed query with count.",
      "tags": [
        "api-handler",
        "raw-capture",
        "pagination",
        "list-endpoint"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/rawCaptureHandler/index.js:rawCapturePost",
      "type": "function",
      "name": "rawCapturePost",
      "filePath": "server/handlers/rawCaptureHandler/index.js",
      "lineRange": [
        44,
        60
      ],
      "summary": "Handles POST /raw-captures: drops extra_attributes from the body (not yet sent by mobile), clamps rotation_matrix entries below 0.001 to 0, validates with rawCaptureSchema, then calls RawCaptureService.createRawCapture and replies with the returned status (201 new or 200 existing) and capture.",
      "tags": [
        "api-handler",
        "raw-capture",
        "create-endpoint",
        "data-cleanup"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureRejectPatch",
      "type": "function",
      "name": "rawCaptureRejectPatch",
      "filePath": "server/handlers/rawCaptureHandler/index.js",
      "lineRange": [
        62,
        86
      ],
      "summary": "Handles PATCH /raw-captures/:raw_capture_id/reject: validates rejection_reason/organization_id body and the id param, throws HttpError 422 when the Authorization header for the legacy admin API is missing, and passes the reason, organization, id, and header to RawCaptureService.rejectRawCapture.",
      "tags": [
        "api-handler",
        "raw-capture",
        "rejection",
        "legacy-api",
        "authorization"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureSingleGet",
      "type": "function",
      "name": "rawCaptureSingleGet",
      "filePath": "server/handlers/rawCaptureHandler/index.js",
      "lineRange": [
        88,
        106
      ],
      "summary": "Handles GET /raw-captures/:raw_capture_id: validates the id with rawCaptureIdParamSchema, loads the capture via RawCaptureService.getRawCaptureById, and throws HttpError 404 'raw capture with <id> not found' when no row has an id.",
      "tags": [
        "api-handler",
        "raw-capture",
        "lookup",
        "not-found"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/sessionHandler/index.js",
      "type": "file",
      "name": "index.js",
      "filePath": "server/handlers/sessionHandler/index.js",
      "summary": "Express handlers for the /session API that record and read field data collection sessions: create a session (idempotent on id), list sessions with filters and paging links, and fetch one session by session_id. Validation uses the Joi schemas in ./schemas and data access goes through SessionService.",
      "tags": [
        "api-handler",
        "session",
        "validation",
        "express",
        "tested"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/handlers/sessionHandler/index.js:sessionPost",
      "type": "function",
      "name": "sessionPost",
      "filePath": "server/handlers/sessionHandler/index.js",
      "lineRange": [
        13,
        22
      ],
      "summary": "Handles POST /session: validates the body with sessionPostSchema, calls SessionService.createSession inside a transaction, and replies with the status the model returns (201 when created, 200 when the session id already exists) and the session.",
      "tags": [
        "api-handler",
        "session",
        "create-endpoint",
        "idempotent"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/sessionHandler/index.js:sessionGet",
      "type": "function",
      "name": "sessionGet",
      "filePath": "server/handlers/sessionHandler/index.js",
      "lineRange": [
        24,
        45
      ],
      "summary": "Handles GET /session: validates query params with sessionGetQuerySchema, derives filter and limit/offset (default 100/0), fetches sessions and their count from SessionService, and returns sessions, prev/next links built on the 'session' url, and the query with count.",
      "tags": [
        "api-handler",
        "session",
        "pagination",
        "list-endpoint"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/sessionHandler/index.js:sessionSingleGet",
      "type": "function",
      "name": "sessionSingleGet",
      "filePath": "server/handlers/sessionHandler/index.js",
      "lineRange": [
        47,
        61
      ],
      "summary": "Handles GET /session/:session_id: validates the param with sessionIdParamSchema, loads the session through SessionService.getSessionById, and throws HttpError 404 'session with <id> not found' when the result has no id.",
      "tags": [
        "api-handler",
        "session",
        "lookup",
        "not-found"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/walletRegistrationHandler/index.js",
      "type": "file",
      "name": "index.js",
      "filePath": "server/handlers/walletRegistrationHandler/index.js",
      "summary": "Express handlers for the /wallet-registration API that store grower wallet registrations made on a device: create a registration (requires phone or email), list registrations with filters and paging, and fetch one by wallet_registration_id, all through WalletRegistrationService.",
      "tags": [
        "api-handler",
        "wallet-registration",
        "grower",
        "validation",
        "express",
        "tested"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationPost",
      "type": "function",
      "name": "walletRegistrationPost",
      "filePath": "server/handlers/walletRegistrationHandler/index.js",
      "lineRange": [
        13,
        28
      ],
      "summary": "Handles POST /wallet-registration: validates the body with walletRegistrationPostSchema, throws HttpError 422 'Either phone or email is required' when both are absent, then calls WalletRegistrationService.createWalletRegistration and returns its status and record as JSON.",
      "tags": [
        "api-handler",
        "wallet-registration",
        "create-endpoint",
        "validation"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationGet",
      "type": "function",
      "name": "walletRegistrationGet",
      "filePath": "server/handlers/walletRegistrationHandler/index.js",
      "lineRange": [
        30,
        61
      ],
      "summary": "Handles GET /wallet-registration: validates query params with walletRegistrationGetQuerySchema, reads filtered and paged wallet registrations plus their count, and responds with wallet_registrations, prev/next links for 'wallet-registration', and the query with count.",
      "tags": [
        "api-handler",
        "wallet-registration",
        "pagination",
        "list-endpoint"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationSingleGet",
      "type": "function",
      "name": "walletRegistrationSingleGet",
      "filePath": "server/handlers/walletRegistrationHandler/index.js",
      "lineRange": [
        63,
        82
      ],
      "summary": "Handles GET /wallet-registration/:wallet_registration_id: validates the id param, loads the record via WalletRegistrationService.getWalletRegistrationById, and throws HttpError 404 'wallet registration with <id> not found' when it is missing.",
      "tags": [
        "api-handler",
        "wallet-registration",
        "lookup",
        "not-found"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/routes/deviceConfigurationRoutes.js",
      "type": "file",
      "name": "deviceConfigurationRoutes.js",
      "filePath": "server/routes/deviceConfigurationRoutes.js",
      "summary": "Express router for device configurations: maps POST and GET /device-configuration and GET /device-configuration/:device_configuration_id to the deviceConfigurationHandler functions, each wrapped in handlerWrapper so async errors reach the global error handler.",
      "tags": [
        "routing",
        "express",
        "device-configuration",
        "api",
        "tested"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/routes/index.js",
      "type": "file",
      "name": "index.js",
      "filePath": "server/routes/index.js",
      "summary": "Route barrel that exports an array of the five Express routers (device-configuration, raw-captures, session, wallet-registration, track); server/app.js mounts this array at '/'.",
      "tags": [
        "barrel",
        "routing",
        "entry-point",
        "express"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/routes/rawCaptureRoutes.js",
      "type": "file",
      "name": "rawCaptureRoutes.js",
      "filePath": "server/routes/rawCaptureRoutes.js",
      "summary": "Express router for raw captures: POST and GET /raw-captures, GET /raw-captures/:raw_capture_id, and PATCH /raw-captures/:raw_capture_id/reject, each bound to a rawCaptureHandler function through handlerWrapper.",
      "tags": [
        "routing",
        "express",
        "raw-capture",
        "api",
        "tested"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/routes/sessionRoutes.js",
      "type": "file",
      "name": "sessionRoutes.js",
      "filePath": "server/routes/sessionRoutes.js",
      "summary": "Express router for sessions: binds POST and GET /session and GET /session/:session_id to sessionPost, sessionGet, and sessionSingleGet, wrapped by handlerWrapper for async error forwarding.",
      "tags": [
        "routing",
        "express",
        "session",
        "api",
        "tested"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/routes/walletRegistrationRoutes.js",
      "type": "file",
      "name": "walletRegistrationRoutes.js",
      "filePath": "server/routes/walletRegistrationRoutes.js",
      "summary": "Express router for wallet registrations: binds POST and GET /wallet-registration and GET /wallet-registration/:wallet_registration_id to the walletRegistrationHandler functions via handlerWrapper.",
      "tags": [
        "routing",
        "express",
        "wallet-registration",
        "api",
        "tested"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/services/SessionService.js",
      "type": "file",
      "name": "SessionService.js",
      "filePath": "server/services/SessionService.js",
      "summary": "Service layer for sessions: builds a Session database context and a SessionModel, prefixes filter keys with 'session.' or 'wallet_registration.' (for grower_account_id and wallet) before list and count queries, and wraps session creation in a begin/commit/rollback transaction.",
      "tags": [
        "service",
        "session",
        "transaction",
        "filtering"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/services/SessionService.js:SessionService",
      "type": "class",
      "name": "SessionService",
      "filePath": "server/services/SessionService.js",
      "lineRange": [
        4,
        51
      ],
      "summary": "Class exported as the module that sessionHandler instantiates per request; it holds a Session (Knex transaction wrapper) and SessionModel, and exposes getSessions, getSessionsCount, getSessionById, and createSession.",
      "tags": [
        "service",
        "session",
        "class",
        "data-access"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/services/SessionService.js:addTableNames",
      "type": "function",
      "name": "addTableNames",
      "filePath": "server/services/SessionService.js",
      "lineRange": [
        11,
        21
      ],
      "summary": "Rewrites a session filter object into table-qualified keys: grower_account_id and wallet become wallet_registration.<key>, every other key becomes session.<key>, so the joined session query can filter on both tables.",
      "tags": [
        "filtering",
        "query-building",
        "session",
        "wallet-registration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/services/SessionService.js:createSession",
      "type": "function",
      "name": "createSession",
      "filePath": "server/services/SessionService.js",
      "lineRange": [
        37,
        50
      ],
      "summary": "Opens a transaction on the Session context, calls SessionModel.createSession (which returns the existing session with 200 or inserts a new one with created_at and 201), commits, and rolls back on any error before it rethrows.",
      "tags": [
        "service",
        "session",
        "transaction",
        "create"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/utils/helper.js",
      "type": "file",
      "name": "helper.js",
      "filePath": "server/utils/helper.js",
      "summary": "Pagination helpers shared by the list handlers: getFilterAndLimitOptions separates limit/offset (defaults 100 and 0) from the query filter, and generatePrevAndNext builds relative prev/next URLs with URL-encoded query params.",
      "tags": [
        "utility",
        "pagination",
        "query-parsing"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/utils/helper.js:generatePrevAndNext",
      "type": "function",
      "name": "generatePrevAndNext",
      "filePath": "server/utils/helper.js",
      "lineRange": [
        1,
        30
      ],
      "summary": "Builds paging links for a list endpoint: encodes the query object (without offset) into '<url>?...&offset=', returns next with offset+limit while the current page index is below count/limit - 1, and prev with offset-limit when it stays at or above 0; null otherwise.",
      "tags": [
        "utility",
        "pagination",
        "url-building"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/utils/helper.js:getFilterAndLimitOptions",
      "type": "function",
      "name": "getFilterAndLimitOptions",
      "filePath": "server/utils/helper.js",
      "lineRange": [
        32,
        44
      ],
      "summary": "Copies req.query into a filter, coerces limit and offset to numbers with defaults of 100 and 0 into limitOptions, and deletes both keys from the filter so only column filters remain.",
      "tags": [
        "utility",
        "pagination",
        "query-parsing"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/utils/utils.js",
      "type": "file",
      "name": "utils.js",
      "filePath": "server/utils/utils.js",
      "summary": "Global Express error plumbing: handlerWrapper forwards rejected promises from async route handlers to next(), and errorHandler maps HttpError, Joi ValidationError (422), and Axios errors from external calls such as the legacy admin API to JSON {code, message} responses.",
      "tags": [
        "middleware",
        "error-handling",
        "express",
        "utility"
      ],
      "complexity": "moderate",
      "languageNotes": "Adapted from express-async-handler; exports are assigned with the CommonJS exports.<name> form, so they are not detected as named function declarations."
    },
    {
      "id": "function:server/utils/utils.js:handlerWrapper",
      "type": "function",
      "name": "handlerWrapper",
      "filePath": "server/utils/utils.js",
      "lineRange": [
        24,
        31
      ],
      "summary": "Wraps an Express handler so that its return value is resolved as a promise and any rejection or thrown error is passed to the last argument, next(e), letting async handlers throw HttpError directly.",
      "tags": [
        "middleware",
        "async",
        "error-handling",
        "wrapper"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/utils/utils.js:errorHandler",
      "type": "function",
      "name": "errorHandler",
      "filePath": "server/utils/utils.js",
      "lineRange": [
        33,
        70
      ],
      "summary": "Express error middleware: logs non-Axios errors, sends err.code for HttpError, 422 with joined Joi detail messages for ValidationError, 500 with the upstream message (and logs the microservice url and data) for Axios errors, and 500 'Unknown error (<message>)' otherwise.",
      "tags": [
        "middleware",
        "error-handling",
        "http-status",
        "validation",
        "logging"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:database/seeds/00_job_database_cleaner.js",
      "type": "file",
      "name": "00_job_database_cleaner.js",
      "filePath": "database/seeds/00_job_database_cleaner.js",
      "summary": "First Knex seed: it empties the field_data tables raw_capture, session, wallet_registration and device_configuration with raw DELETEs, then removes the legacy planter rows whose grower_account_uuid matches a seeded grower account and the trees rows of those planters.",
      "tags": [
        "seed",
        "database",
        "test-data",
        "cleanup"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/seeds/00_job_database_cleaner.js:seed",
      "type": "function",
      "name": "seed",
      "filePath": "database/seeds/00_job_database_cleaner.js",
      "lineRange": [
        3,
        20
      ],
      "summary": "Runs one raw SQL block that deletes all rows from raw_capture, session, wallet_registration and device_configuration, then deletes planter rows by grower_account_uuid (returning ids) and the trees rows with those planter_id values.",
      "tags": [
        "seed",
        "cleanup",
        "knex",
        "legacy-tables"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/01_table_device_configuration.js",
      "type": "file",
      "name": "01_table_device_configuration.js",
      "filePath": "database/seeds/01_table_device_configuration.js",
      "summary": "Knex seed that inserts one device_configuration row for each of the 100 fixed UUIDs in data/device_configuration.js, with Chance random strings for the device and app fields.",
      "tags": [
        "seed",
        "database",
        "test-data",
        "device-configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/seeds/01_table_device_configuration.js:seed",
      "type": "function",
      "name": "seed",
      "filePath": "database/seeds/01_table_device_configuration.js",
      "lineRange": [
        5,
        30
      ],
      "summary": "Inserts the device_configuration rows in parallel with Promise.all; device_identifier, brand, model, device, serial, hardware, manufacturer, app_build, app_version, os_version and sdk_version get random strings, and logged_at and created_at get the current time.",
      "tags": [
        "seed",
        "knex",
        "device-configuration",
        "random-data"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/02_table_wallet_registration.js",
      "type": "file",
      "name": "02_table_wallet_registration.js",
      "filePath": "database/seeds/02_table_wallet_registration.js",
      "summary": "Knex seed that creates 100 wallet_registration rows from the fixed walletRegistrationIds, each one copied from a random grower account in data/wallet_registration.js.",
      "tags": [
        "seed",
        "database",
        "test-data",
        "wallet-registration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/seeds/02_table_wallet_registration.js:seed",
      "type": "function",
      "name": "seed",
      "filePath": "database/seeds/02_table_wallet_registration.js",
      "lineRange": [
        8,
        41
      ],
      "summary": "For each walletRegistrationId, picks a random grower account and inserts wallet, user_photo_url (from image_url), grower_account_id, first_name, phone, lat and lon (default 0), email set to the wallet name and a Chance last_name.",
      "tags": [
        "seed",
        "knex",
        "wallet-registration",
        "random-data"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/03_table_session.js",
      "type": "file",
      "name": "03_table_session.js",
      "filePath": "database/seeds/03_table_session.js",
      "summary": "Knex seed that creates 100 session rows and pairs session i with device configuration i and wallet registration i from the seed data lists.",
      "tags": [
        "seed",
        "database",
        "test-data",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/seeds/03_table_session.js:seed",
      "type": "function",
      "name": "seed",
      "filePath": "database/seeds/03_table_session.js",
      "lineRange": [
        5,
        20
      ],
      "summary": "Loops i from 0 to 99 and inserts a session row with id sessionIds[i], device_configuration_id deviceConfigurationIds[i], originating_wallet_registration_id walletRegistrationIds[i] and created_at now.",
      "tags": [
        "seed",
        "knex",
        "session",
        "foreign-keys"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/04_table_raw_capture.js",
      "type": "file",
      "name": "04_table_raw_capture.js",
      "filePath": "database/seeds/04_table_raw_capture.js",
      "summary": "Knex seed that loads the 13537 capture-match records into field_data.raw_capture with status 'unprocessed'. For each record it also creates a planter if needed and a matching legacy trees row, and links that row through reference_id.",
      "tags": [
        "seed",
        "database",
        "raw-capture",
        "legacy-tables",
        "test-data"
      ],
      "complexity": "moderate",
      "languageNotes": "Uses a Knex CTE (knex.with('createdTree', insert ... returning id)) so the trees insert and the raw_capture insert run as one SQL statement, with reference_id taken from a subselect on the CTE."
    },
    {
      "id": "function:database/seeds/04_table_raw_capture.js:createRawCapture",
      "type": "function",
      "name": "createRawCapture",
      "filePath": "database/seeds/04_table_raw_capture.js",
      "lineRange": [
        5,
        103
      ],
      "summary": "Picks a random wallet registration and joins it to its session and to public.planter by grower_account_uuid; if no planter exists it inserts one. Then in one CTE statement it inserts a trees row (new uuid, time_created from captured_at, gps_accuracy default 0) and a field_data.raw_capture row with the same id, the session_id, reference_id set to the new tree id and status 'unprocessed'.",
      "tags": [
        "seed",
        "raw-capture",
        "planter",
        "trees",
        "cte"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:database/seeds/04_table_raw_capture.js:seed",
      "type": "function",
      "name": "seed",
      "filePath": "database/seeds/04_table_raw_capture.js",
      "lineRange": [
        105,
        109
      ],
      "summary": "Iterates over every record in capture_match_raw_captures and awaits createRawCapture for each one sequentially, so that planter creation for a grower account happens only once.",
      "tags": [
        "seed",
        "knex",
        "raw-capture",
        "sequential"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/data/capture_match_raw_captures.js",
      "type": "file",
      "name": "capture_match_raw_captures.js",
      "filePath": "database/seeds/data/capture_match_raw_captures.js",
      "summary": "Generated seed fixture that exports an array of 13537 capture records from February 2022 near Freetown, Sierra Leone (lat about 8.45, lon about -13.17). Each record has an image_url on the treetracker-production-images S3 bucket (eu-central-1), lat, lon, gps_accuracy ('' or 0), note 1, captured_at, time_created and time_updated.",
      "tags": [
        "seed-data",
        "fixture",
        "raw-capture",
        "generated",
        "capture-matching"
      ],
      "complexity": "moderate",
      "languageNotes": "Plain CommonJS module.exports of a literal array; at about 149k lines it is data, not logic."
    },
    {
      "id": "file:database/seeds/data/device_configuration.js",
      "type": "file",
      "name": "device_configuration.js",
      "filePath": "database/seeds/data/device_configuration.js",
      "summary": "Seed fixture that exports a plain array of 100 hard-coded device_configuration UUIDs, used as row ids by 01_table_device_configuration.js and as session foreign keys by 03_table_session.js.",
      "tags": [
        "seed-data",
        "fixture",
        "device-configuration",
        "uuid-list"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/data/session.js",
      "type": "file",
      "name": "session.js",
      "filePath": "database/seeds/data/session.js",
      "summary": "Seed fixture that exports sessionIds, a fixed list of 100 UUIDs that 03_table_session.js uses as the primary keys of the seeded session rows.",
      "tags": [
        "seed-data",
        "fixture",
        "session",
        "uuid-list"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/data/wallet_registration.js",
      "type": "file",
      "name": "wallet_registration.js",
      "filePath": "database/seeds/data/wallet_registration.js",
      "summary": "Seed fixture that exports growerAccounts (54 treetracker grower accounts with wallet names such as mobile1@test, wallet12 and walletPayToGrow, organization_id, first_name and dummy image_url; only the first six have lat and lon) and walletRegistrationIds (100 fixed UUIDs).",
      "tags": [
        "seed-data",
        "fixture",
        "wallet-registration",
        "grower-account"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/handlers/rawCaptureHandler/docs.js",
      "type": "file",
      "name": "docs.js",
      "filePath": "server/handlers/rawCaptureHandler/docs.js",
      "summary": "Builds the OpenAPI paths for raw captures (GET and POST /raw-captures, GET /raw-capture/{raw_capture_id}, PATCH /raw-capture/{raw_capture_id}/reject) by converting the Joi schemas with joi-to-swagger, and exports rawCaptureComponent listing the RawCapture fields such as session_id, lat, lon, image_url, status, rejection_reason and bulk_pack_file_name. The single-capture paths use the singular /raw-capture prefix while server/routes/rawCaptureRoutes.js mounts /raw-captures, and the reject operation documents the rejection body schema as a path parameter.",
      "tags": [
        "api-documentation",
        "swagger",
        "raw-capture",
        "openapi"
      ],
      "complexity": "moderate",
      "languageNotes": "joi-to-swagger turns each Joi validation schema into an OpenAPI schema, so request docs stay derived from the same objects the handler validates with."
    },
    {
      "id": "file:server/handlers/rawCaptureHandler/schemas.js",
      "type": "file",
      "name": "schemas.js",
      "filePath": "server/handlers/rawCaptureHandler/schemas.js",
      "summary": "Defines the Joi validation schemas for the raw capture endpoints: rawCaptureSchema for POST bodies (required uuid id and session_id, lat in -90..90, lon in -180..180, image_url URI, ISO captured_at, nullable step counts, rotation_matrix and unvalidated extra_attributes), rawCaptureGetQuerySchema (offset, limit, status of unprocessed/approved/rejected, bulk_pack_file_name), rawCaptureIdParamSchema and rawCaptureRejectionSchema (required rejection_reason plus integer organization_id for the legacy API call).",
      "tags": [
        "validation",
        "joi",
        "raw-capture",
        "schema-definition"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/sessionHandler/docs.js",
      "type": "file",
      "name": "docs.js",
      "filePath": "server/handlers/sessionHandler/docs.js",
      "summary": "Builds the OpenAPI paths for sessions (GET and POST /session, GET /session/{session_id}) from the session Joi schemas via joi-to-swagger, and exports sessionComponent describing the Session fields such as start_time, bulk_pack_version, device_configuration_id, originating_wallet_registration_id, target_wallet, check_in_photo_url and track_url.",
      "tags": [
        "api-documentation",
        "swagger",
        "session",
        "openapi"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/handlers/sessionHandler/schemas.js",
      "type": "file",
      "name": "schemas.js",
      "filePath": "server/handlers/sessionHandler/schemas.js",
      "summary": "Defines the Joi validation schemas for the session endpoints: sessionGetQuerySchema with filters on uuid ids, HH:MM start_time, YYYY-MM-DD created_at, organization_id arrays, offset/limit and whereNulls/whereNotNulls/whereIns arrays; sessionPostSchema requiring uuid id, device_configuration_id and originating_wallet_registration_id and restricting bulk_pack_version to v1 or v2; and sessionIdParamSchema for session_id.",
      "tags": [
        "validation",
        "joi",
        "session",
        "schema-definition"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/swaggerDoc.js",
      "type": "file",
      "name": "swaggerDoc.js",
      "filePath": "server/handlers/swaggerDoc.js",
      "summary": "Assembles the OpenAPI 3.0.0 document titled 'Treetracker Field Data API' by merging the path objects from the device configuration, raw capture, session, wallet registration and track docs modules, registers the DeviceConfiguration, RawCapture, Session, WalletRegistration and Track component schemas, and reads the version from package.json. It also exports swaggerOptions with custom CSS that swaps the Swagger UI top-bar logo for assets/greenstand.webp, which server/app.js serves at /docs.",
      "tags": [
        "api-documentation",
        "swagger",
        "openapi",
        "aggregator",
        "entry-point"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/walletRegistrationHandler/docs.js",
      "type": "file",
      "name": "docs.js",
      "filePath": "server/handlers/walletRegistrationHandler/docs.js",
      "summary": "Builds the OpenAPI paths for wallet registrations (GET and POST /wallet-registration, GET /wallet-registration/{wallet_registration_id}) from the wallet registration Joi schemas via joi-to-swagger, and exports walletRegistrationComponent describing grower registration fields such as wallet, user_photo_url, grower_account_id, first_name, last_name, phone, email, lat, lon, registered_at and v1_legacy_organization.",
      "tags": [
        "api-documentation",
        "swagger",
        "wallet-registration",
        "openapi"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/handlers/walletRegistrationHandler/schemas.js",
      "type": "file",
      "name": "schemas.js",
      "filePath": "server/handlers/walletRegistrationHandler/schemas.js",
      "summary": "Defines the Joi validation schemas for wallet registration endpoints: walletRegistrationPostSchema requiring uuid id and grower_account_id, wallet, user_photo_url URI, first_name, last_name and bounded lat/lon, with nullable phone, an email that must contain '@', ISO registered_at and optional v1_legacy_organization; plus walletRegistrationIdParamSchema and a GET query schema limited to offset, limit and bulk_pack_file_name.",
      "tags": [
        "validation",
        "joi",
        "wallet-registration",
        "schema-definition"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/tracksHandler/docs.js",
      "type": "file",
      "name": "docs.js",
      "filePath": "server/handlers/tracksHandler/docs.js",
      "summary": "Builds the OpenAPI fragment for the track API: converts the Joi schemas from schemas.js with joi-to-swagger and exports trackSwagger (GET/POST /track and GET /track/{track_id}, with 201/200 responses that reference #/components/schemas/Track) plus trackComponent describing id, session_id, locations_url, created_at and bulk_pack_file_name. swaggerDoc.js merges both into the service's Swagger document.",
      "tags": [
        "api-schema",
        "documentation",
        "swagger",
        "track"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/handlers/tracksHandler/index.js",
      "type": "file",
      "name": "index.js",
      "filePath": "server/handlers/tracksHandler/index.js",
      "summary": "Express handlers for the track resource: trackPost validates the body and creates a track row (201), trackGet validates query filters and returns a paginated tracks list with prev/next links and a count, and trackSingleGet validates track_id and returns one track or a 404 HttpError. Each handler builds a new TrackService per request.",
      "tags": [
        "api-handler",
        "track",
        "pagination",
        "validation",
        "tested"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/handlers/tracksHandler/schemas.js",
      "type": "file",
      "name": "schemas.js",
      "filePath": "server/handlers/tracksHandler/schemas.js",
      "summary": "Joi validation schemas for the track API: trackGetQuerySchema (optional offset >= 0, limit > 0, bulk_pack_file_name string, session_id uuid), trackPostSchema (required locations_url URI, session_id uuid and bulk_pack_file_name, no unknown keys) and trackIdParamSchema (required track_id uuid).",
      "tags": [
        "validation",
        "schema-definition",
        "joi",
        "track"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/models/Track.js",
      "type": "file",
      "name": "Track.js",
      "filePath": "server/models/Track.js",
      "summary": "Domain model for the track table that wraps TrackRepository: lists tracks as frozen objects with id, locations_url, bulk_pack_file_name, session_id and created_at, counts tracks by filter, fetches one track by id and inserts a new track row.",
      "tags": [
        "data-model",
        "track",
        "domain-model"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/repositories/TrackRepository.js",
      "type": "file",
      "name": "TrackRepository.js",
      "filePath": "server/repositories/TrackRepository.js",
      "summary": "Knex repository bound to the 'track' table; it adds nothing beyond the generic getById, getByFilter, countByFilter, update and create queries it inherits from BaseRepository.",
      "tags": [
        "data-access",
        "repository",
        "track",
        "database"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/routes/trackRoutes.js",
      "type": "file",
      "name": "trackRoutes.js",
      "filePath": "server/routes/trackRoutes.js",
      "summary": "Express router that mounts the track endpoints: POST /track to trackPost, GET /track to trackGet and GET /track/:track_id to trackSingleGet, each wrapped by handlerWrapper so async errors reach the error middleware. routes/index.js registers this router.",
      "tags": [
        "routing",
        "express",
        "track",
        "api-handler",
        "tested"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/services/TrackService.js",
      "type": "file",
      "name": "TrackService.js",
      "filePath": "server/services/TrackService.js",
      "summary": "Service layer for tracks that opens a database Session and delegates list, count and get-by-id reads to the Track model; createTrack runs the insert inside an explicit transaction and rolls back on error.",
      "tags": [
        "service",
        "transaction",
        "track"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/tracksHandler/index.js:trackPost",
      "type": "function",
      "name": "trackPost",
      "filePath": "server/handlers/tracksHandler/index.js",
      "lineRange": [
        13,
        22
      ],
      "summary": "Handles POST /track: validates req.body against trackPostSchema with abortEarly false, calls TrackService.createTrack to insert the track row and responds 201 with the created record.",
      "tags": [
        "api-handler",
        "create",
        "validation"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/tracksHandler/index.js:trackGet",
      "type": "function",
      "name": "trackGet",
      "filePath": "server/handlers/tracksHandler/index.js",
      "lineRange": [
        24,
        45
      ],
      "summary": "Handles GET /track: validates query params, splits them into filter and limit options with getFilterAndLimitOptions, loads tracks and their total count from TrackService, and responds with tracks, prev/next links for the 'track' URL and the echoed query with count.",
      "tags": [
        "api-handler",
        "pagination",
        "query"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/tracksHandler/index.js:trackSingleGet",
      "type": "function",
      "name": "trackSingleGet",
      "filePath": "server/handlers/tracksHandler/index.js",
      "lineRange": [
        47,
        60
      ],
      "summary": "Handles GET /track/:track_id: validates the track_id uuid, loads the track through TrackService.getTrackById and throws a 404 HttpError naming the id when no track with an id comes back.",
      "tags": [
        "api-handler",
        "lookup",
        "error-handling"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/models/Track.js:Track",
      "type": "class",
      "name": "Track",
      "filePath": "server/models/Track.js",
      "lineRange": [
        3,
        49
      ],
      "summary": "Track model class built on a session-bound TrackRepository; its static Track() factory freezes the five public track fields, getTracks maps repository rows through that factory, while getTrackById and createTrack return raw repository rows and getTracksCount returns countByFilter.",
      "tags": [
        "data-model",
        "factory",
        "immutability"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/repositories/TrackRepository.js:TrackRepository",
      "type": "class",
      "name": "TrackRepository",
      "filePath": "server/repositories/TrackRepository.js",
      "lineRange": [
        3,
        9
      ],
      "summary": "Subclass of BaseRepository whose constructor passes the table name 'track' and the database session to the base class, so getById raises a 404 HttpError when no track row matches.",
      "tags": [
        "repository",
        "data-access",
        "inheritance"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/services/TrackService.js:TrackService",
      "type": "class",
      "name": "TrackService",
      "filePath": "server/services/TrackService.js",
      "lineRange": [
        4,
        36
      ],
      "summary": "Creates a new Session and Track model per instance; exposes getTracks, getTracksCount and getTrackById as pass-through reads, and createTrack wraps the insert in beginTransaction/commitTransaction with rollback when a transaction is still in progress.",
      "tags": [
        "service",
        "transaction",
        "orchestration"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/infra/database/Sessions/BaseSession.js",
      "type": "file",
      "name": "BaseSession.js",
      "filePath": "server/infra/database/Sessions/BaseSession.js",
      "summary": "Defines the BaseSession unit-of-work wrapper that holds one Knex instance and an optional open transaction in this.thx, so every repository that shares the session runs its queries either on the plain connection or inside the same transaction.",
      "tags": [
        "database",
        "transaction",
        "unit-of-work",
        "infrastructure"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/infra/database/Sessions/BaseSession.js:BaseSession",
      "type": "class",
      "name": "BaseSession",
      "filePath": "server/infra/database/Sessions/BaseSession.js",
      "lineRange": [
        1,
        40
      ],
      "summary": "Session base class: getDB() returns the open transaction or the raw Knex instance, isTransactionInProgress() checks thx, and beginTransaction/commitTransaction/rollbackTransaction throw 'Can not start transaction in transaction' or 'Can not commit/rollback transaction before start it!' on misuse and reset thx to undefined after commit or rollback.",
      "tags": [
        "database",
        "transaction",
        "base-class",
        "unit-of-work"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/infra/database/Sessions/LegacySession.js",
      "type": "file",
      "name": "LegacySession.js",
      "filePath": "server/infra/database/Sessions/LegacySession.js",
      "summary": "Exports LegacySession, a BaseSession bound to the knexLegacyDB connection from server/infra/database/knex.js, which RawCaptureService uses to write the legacy treetracker main DB tables trees and tree_attributes.",
      "tags": [
        "database",
        "legacy-db",
        "transaction",
        "infrastructure"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/infra/database/Sessions/LegacySession.js:LegacySession",
      "type": "class",
      "name": "LegacySession",
      "filePath": "server/infra/database/Sessions/LegacySession.js",
      "lineRange": [
        4,
        8
      ],
      "summary": "Subclass whose constructor calls super(knexLegacyDB), so getDB() and its transaction methods target the legacy treetracker database instead of the field data database.",
      "tags": [
        "database",
        "legacy-db",
        "session",
        "subclass"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/infra/database/Sessions/Session.js",
      "type": "file",
      "name": "Session.js",
      "filePath": "server/infra/database/Sessions/Session.js",
      "summary": "Exports Session, the default BaseSession bound to the field data Knex instance (knex from server/infra/database/knex.js, with the DATABASE_SCHEMA search path) that the field data services construct for their repositories and transactions.",
      "tags": [
        "database",
        "session",
        "transaction",
        "infrastructure"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/infra/database/Sessions/Session.js:Session",
      "type": "class",
      "name": "Session",
      "filePath": "server/infra/database/Sessions/Session.js",
      "lineRange": [
        4,
        8
      ],
      "summary": "Subclass whose constructor calls super(knex) with the field data database connection; it takes no arguments, so callers such as BaseRepository.spec.js that pass new Session(false) have the argument ignored.",
      "tags": [
        "database",
        "session",
        "subclass",
        "unit-of-work"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/models/WalletRegistration.js",
      "type": "file",
      "name": "WalletRegistration.js",
      "filePath": "server/models/WalletRegistration.js",
      "summary": "Wallet registration domain model that wraps WalletRegistrationRepository with a session and shapes rows into frozen objects with the grower fields id, wallet, user_photo_url, grower_account_id, first_name, last_name, phone, email, lat, lon, registered_at, bulk_pack_file_name and v1_legacy_organization; it also gives filtered listing, counting, lookup by id and idempotent creation.",
      "tags": [
        "data-model",
        "wallet-registration",
        "domain-model",
        "idempotency"
      ],
      "complexity": "moderate"
    },
    {
      "id": "class:server/models/WalletRegistration.js:WalletRegistration",
      "type": "class",
      "name": "WalletRegistration",
      "filePath": "server/models/WalletRegistration.js",
      "lineRange": [
        3,
        82
      ],
      "summary": "Model class holding a WalletRegistrationRepository built from the injected session; getWalletRegistrations maps getByFilter rows through _response, getWalletRegistrationsCount delegates to countByFilter, and getWalletRegistrationById filters on id and returns the first row or undefined.",
      "tags": [
        "data-model",
        "wallet-registration",
        "repository-client",
        "serialization"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/models/WalletRegistration.js:WalletRegistration",
      "type": "function",
      "name": "WalletRegistration",
      "filePath": "server/models/WalletRegistration.js",
      "lineRange": [
        11,
        41
      ],
      "summary": "Static factory that picks the 13 wallet_registration response fields (from id and wallet through bulk_pack_file_name and v1_legacy_organization) out of a row and returns them as an Object.freeze'd value, dropping any other columns.",
      "tags": [
        "factory",
        "serialization",
        "wallet-registration",
        "immutability"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/models/WalletRegistration.js:createWalletRegistration",
      "type": "function",
      "name": "createWalletRegistration",
      "filePath": "server/models/WalletRegistration.js",
      "lineRange": [
        66,
        81
      ],
      "summary": "Idempotent insert: looks up the incoming id first and, when no row exists, creates it through the repository and returns { walletRegistration, status: 201 }; when the id already exists it returns the stored record with status 200 and writes nothing.",
      "tags": [
        "idempotency",
        "create",
        "wallet-registration",
        "http-status"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/repositories/BaseRepository.spec.js",
      "type": "file",
      "name": "BaseRepository.spec.js",
      "filePath": "server/repositories/BaseRepository.spec.js",
      "summary": "Mocha unit tests for BaseRepository that mock the field data knex instance with mock-knex and assert the generated SQL against a 'testTable' table: getById, getByFilter with plain columns, a limit option and nested and/or filter objects, update, create with returning, and countByFilter parsing count '1' to 1; the getById 404 case and and/or support in countByFilter are skipped TODOs.",
      "tags": [
        "test",
        "repository",
        "mock-knex",
        "query-builder",
        "sql"
      ],
      "complexity": "moderate",
      "languageNotes": "Each test reinstalls the mock-knex tracker and checks query.sql with regexes, so the tests verify the Knex SQL text without a live PostgreSQL database."
    },
    {
      "id": "file:server/repositories/WalletRegistrationRepository.js",
      "type": "file",
      "name": "WalletRegistrationRepository.js",
      "filePath": "server/repositories/WalletRegistrationRepository.js",
      "summary": "Repository for the wallet_registration table; it only passes 'wallet_registration' and the session to BaseRepository, so wallet registrations use the generic getById, getByFilter, countByFilter, create and update queries.",
      "tags": [
        "repository",
        "wallet-registration",
        "database",
        "data-access"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/repositories/WalletRegistrationRepository.js:WalletRegistrationRepository",
      "type": "class",
      "name": "WalletRegistrationRepository",
      "filePath": "server/repositories/WalletRegistrationRepository.js",
      "lineRange": [
        3,
        9
      ],
      "summary": "BaseRepository subclass whose constructor binds the table name 'wallet_registration' and the session, and sets _tableName and _session again after super() even though the base constructor already set them.",
      "tags": [
        "repository",
        "wallet-registration",
        "subclass",
        "table-binding"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/services/WalletRegistrationService.js",
      "type": "file",
      "name": "WalletRegistrationService.js",
      "filePath": "server/services/WalletRegistrationService.js",
      "summary": "Service layer for the wallet registration endpoints in server/handlers/walletRegistrationHandler: it creates one field data Session and a WalletRegistration model per service instance and wraps only the create path in a database transaction.",
      "tags": [
        "service",
        "wallet-registration",
        "transaction",
        "business-logic"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/services/WalletRegistrationService.js:WalletRegistrationService",
      "type": "class",
      "name": "WalletRegistrationService",
      "filePath": "server/services/WalletRegistrationService.js",
      "lineRange": [
        4,
        43
      ],
      "summary": "Service class whose getWalletRegistrations, getWalletRegistrationsCount and getWalletRegistrationById pass straight through to the WalletRegistration model on a shared Session, while createWalletRegistration runs in a transaction.",
      "tags": [
        "service",
        "wallet-registration",
        "facade",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/services/WalletRegistrationService.js:createWalletRegistration",
      "type": "function",
      "name": "createWalletRegistration",
      "filePath": "server/services/WalletRegistrationService.js",
      "lineRange": [
        27,
        42
      ],
      "summary": "Begins a transaction on the service Session, runs the model's idempotent createWalletRegistration (existence check plus insert), commits and returns { walletRegistration, status }; on any error it rolls back when isTransactionInProgress() is true and rethrows.",
      "tags": [
        "transaction",
        "create",
        "wallet-registration",
        "error-handling"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/handlers/deviceConfigurationHandler/docs.js",
      "type": "file",
      "name": "docs.js",
      "filePath": "server/handlers/deviceConfigurationHandler/docs.js",
      "summary": "Builds the OpenAPI fragment for the device-configuration routes: GET and POST /device-configuration (201 on create, 200 on an existing id) and GET /device-configuration/{device_configuration_id}, with parameter and request schemas converted from the Joi schemas by joi-to-swagger. It also exports the DeviceConfiguration component with fields such as device_identifier, brand, model, serial, app_version, os_version, sdk_version, logged_at and bulk_pack_file_name.",
      "tags": [
        "api-schema",
        "documentation",
        "swagger",
        "device-configuration"
      ],
      "complexity": "moderate",
      "languageNotes": "joi-to-swagger derives the Swagger parameter schemas from the same Joi objects that the handlers use for validation, so docs and validation do not drift."
    },
    {
      "id": "file:server/handlers/deviceConfigurationHandler/index.js",
      "type": "file",
      "name": "index.js",
      "filePath": "server/handlers/deviceConfigurationHandler/index.js",
      "summary": "Express handlers for the device-configuration resource: deviceConfigurationPost validates the body and returns 201 or 200 from DeviceConfigurationService, deviceConfigurationGet returns a paginated device_configurations list with prev/next links and count, and deviceConfigurationSingleGet returns one record or throws HttpError 404.",
      "tags": [
        "api-handler",
        "device-configuration",
        "validation",
        "pagination",
        "tested"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/handlers/deviceConfigurationHandler/schemas.js",
      "type": "file",
      "name": "schemas.js",
      "filePath": "server/handlers/deviceConfigurationHandler/schemas.js",
      "summary": "Joi validation schemas for device configurations: the POST body requires a uuid id, device_identifier, brand, model, device, hardware, manufacturer, app_build, app_version, os_version, sdk_version and an ISO logged_at, allows an empty serial, and rejects unknown keys; also the uuid device_configuration_id path param and the offset/limit/bulk_pack_file_name list query.",
      "tags": [
        "validation",
        "joi",
        "schema-definition",
        "device-configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/models/DeviceConfiguration.js",
      "type": "file",
      "name": "DeviceConfiguration.js",
      "filePath": "server/models/DeviceConfiguration.js",
      "summary": "Domain model for device configurations that maps device_configuration rows to frozen objects and implements idempotent creation: createDeviceConfiguration looks up the id first and returns the existing row with status 200, or inserts it with a created_at timestamp and returns status 201.",
      "tags": [
        "data-model",
        "device-configuration",
        "idempotency",
        "domain-logic"
      ],
      "complexity": "moderate"
    },
    {
      "id": "file:server/repositories/DeviceConfigurationRepository.js",
      "type": "file",
      "name": "DeviceConfigurationRepository.js",
      "filePath": "server/repositories/DeviceConfigurationRepository.js",
      "summary": "Repository for the device_configuration PostgreSQL table; it only passes the table name and the Knex session to BaseRepository, which supplies getByFilter, countByFilter and create.",
      "tags": [
        "repository",
        "database",
        "device-configuration",
        "data-access"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:server/services/DeviceConfigurationService.js",
      "type": "file",
      "name": "DeviceConfigurationService.js",
      "filePath": "server/services/DeviceConfigurationService.js",
      "summary": "Service layer for device configurations that opens a new database Session per instance, delegates list, count and get-by-id reads to the DeviceConfiguration model, and wraps createDeviceConfiguration in a transaction with rollback on error.",
      "tags": [
        "service",
        "transaction",
        "device-configuration",
        "data-access"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationPost",
      "type": "function",
      "name": "deviceConfigurationPost",
      "filePath": "server/handlers/deviceConfigurationHandler/index.js",
      "lineRange": [
        13,
        24
      ],
      "summary": "POST /device-configuration handler: validates req.body against deviceConfigurationPostSchema with abortEarly false, calls createDeviceConfiguration and responds with the status (201 new, 200 existing) and the record.",
      "tags": [
        "api-handler",
        "create",
        "validation"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationGet",
      "type": "function",
      "name": "deviceConfigurationGet",
      "filePath": "server/handlers/deviceConfigurationHandler/index.js",
      "lineRange": [
        26,
        57
      ],
      "summary": "GET /device-configuration handler: validates offset, limit and bulk_pack_file_name, fetches the filtered page and total count, and responds with device_configurations, prev/next links from generatePrevAndNext, and the echoed query with count.",
      "tags": [
        "api-handler",
        "pagination",
        "list"
      ],
      "complexity": "moderate"
    },
    {
      "id": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationSingleGet",
      "type": "function",
      "name": "deviceConfigurationSingleGet",
      "filePath": "server/handlers/deviceConfigurationHandler/index.js",
      "lineRange": [
        59,
        78
      ],
      "summary": "GET /device-configuration/{device_configuration_id} handler: validates the uuid path param, loads the record by id, and throws HttpError 404 with a not-found message when no record has an id.",
      "tags": [
        "api-handler",
        "lookup",
        "error-handling"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/models/DeviceConfiguration.js:DeviceConfiguration",
      "type": "class",
      "name": "DeviceConfiguration",
      "filePath": "server/models/DeviceConfiguration.js",
      "lineRange": [
        3,
        89
      ],
      "summary": "Model class over DeviceConfigurationRepository: a static factory freezes the 15 device fields plus created_at, list and count methods pass filters to the repository, and createDeviceConfiguration skips the insert when a row with the same id already exists.",
      "tags": [
        "data-model",
        "factory",
        "idempotency"
      ],
      "complexity": "moderate"
    },
    {
      "id": "class:server/repositories/DeviceConfigurationRepository.js:DeviceConfigurationRepository",
      "type": "class",
      "name": "DeviceConfigurationRepository",
      "filePath": "server/repositories/DeviceConfigurationRepository.js",
      "lineRange": [
        3,
        9
      ],
      "summary": "BaseRepository subclass bound to the device_configuration table; its constructor only sets _tableName and _session and adds no custom queries.",
      "tags": [
        "repository",
        "database",
        "inheritance"
      ],
      "complexity": "simple"
    },
    {
      "id": "class:server/services/DeviceConfigurationService.js:DeviceConfigurationService",
      "type": "class",
      "name": "DeviceConfigurationService",
      "filePath": "server/services/DeviceConfigurationService.js",
      "lineRange": [
        4,
        43
      ],
      "summary": "Service class used by the device-configuration handlers; it owns a Session and a DeviceConfiguration model, and runs creation inside beginTransaction/commitTransaction with rollbackTransaction when a transaction is still in progress after an error.",
      "tags": [
        "service",
        "transaction",
        "orchestration"
      ],
      "complexity": "simple"
    },
    {
      "id": "service:.dockerignore",
      "type": "service",
      "name": ".dockerignore",
      "filePath": ".dockerignore",
      "summary": "Single-entry Docker ignore list that keeps the host node_modules directory out of the build context, so the Dockerfile's COPY . ./ step does not overwrite the dependencies installed by npm ci inside the image.",
      "tags": [
        "containerization",
        "infrastructure",
        "build-system",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "service:Dockerfile",
      "type": "service",
      "name": "Dockerfile",
      "filePath": "Dockerfile",
      "summary": "Single-stage node:16-alpine image build for the field data API: it sets WORKDIR /app, adds /app/node_modules/.bin to PATH, copies package.json and package-lock.json, runs npm ci --silent, copies the source, and starts the service with node . (package.json main is server/server.js). The dev build-deploy workflow builds this file and pushes it as greenstand/<repo>:<version>.",
      "tags": [
        "containerization",
        "infrastructure",
        "deployment",
        "nodejs"
      ],
      "complexity": "simple",
      "languageNotes": "The two package manifests are copied and npm ci runs before COPY . ./, so Docker reuses the cached dependency layer when only source files change. No EXPOSE or HEALTHCHECK is declared; the port comes from the runtime environment."
    },
    {
      "id": "service:Dockerfile:node",
      "type": "service",
      "name": "node",
      "filePath": "Dockerfile",
      "summary": "The only build stage of the Dockerfile, based on node:16-alpine with no exposed ports, which produces the runtime container that runs server/server.js from /app.",
      "tags": [
        "containerization",
        "build-stage",
        "nodejs",
        "alpine"
      ],
      "complexity": "simple"
    },
    {
      "id": "pipeline:.github/workflows/pull-request-ci.yml",
      "type": "pipeline",
      "name": "pull-request-ci.yml",
      "filePath": ".github/workflows/pull-request-ci.yml",
      "summary": "GitHub Actions workflow 'CI for New Pull Requests' that runs on pull requests to main inside a node:20.16.0-alpine3.20 container with a postgis/postgis service. It runs npm ci, npm run lint (ESLint), npm run db-migrate-ci against DATABASE_URL, and npm run test with DATABASE_URL and DATABASE_URL_LEGACYDB both pointing at the same postgres service.",
      "tags": [
        "ci-cd",
        "pull-request",
        "testing",
        "postgis",
        "github-actions"
      ],
      "complexity": "simple",
      "languageNotes": "The job runs in a container, so the postgres service container is reached by its label hostname 'postgres' rather than localhost."
    },
    {
      "id": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "type": "pipeline",
      "name": "treetracker-api-build-deploy-dev.yml",
      "filePath": ".github/workflows/treetracker-api-build-deploy-dev.yml",
      "summary": "GitHub Actions 'Service CI/CD Pipeline' on push to main: a test job repeats lint, db-migrate-ci and npm run test against a postgis service, then a release job (Greenstand repos only, skipped on 'skip-ci' commits) runs semantic-release, builds and pushes the Dockerfile image as greenstand/<repo>:<package.json version>, and uses kustomize to set that tag in deployment/overlays/development before it commits and pushes the bump.",
      "tags": [
        "ci-cd",
        "deployment",
        "semantic-release",
        "docker",
        "kustomize"
      ],
      "complexity": "moderate",
      "languageNotes": "The release job exports the version through the deprecated '::set-output' command and gates the kustomization commit on the head commit message not containing 'chore', which avoids a loop with semantic-release's own chore(release) commit."
    },
    {
      "id": "pipeline:.github/workflows/treetracker-api-deploy-dev.yml",
      "type": "pipeline",
      "name": "treetracker-api-deploy-dev.yml",
      "filePath": ".github/workflows/treetracker-api-deploy-dev.yml",
      "summary": "Manual workflow_dispatch 'Deploy Service to Dev Env' that takes a git-tag input, runs kustomize edit set image in deployment/overlays/development to point greenstand/<repo> at that tag, and commits and pushes the change with a '[skip ci]' chore message.",
      "tags": [
        "ci-cd",
        "deployment",
        "gitops",
        "kustomize",
        "development-env"
      ],
      "complexity": "simple",
      "languageNotes": "The commit step is named 'Commit prod kustomization file' although it edits the development overlay, a copy-paste leftover from the prod workflow."
    },
    {
      "id": "pipeline:.github/workflows/treetracker-api-deploy-prod.yml",
      "type": "pipeline",
      "name": "treetracker-api-deploy-prod.yml",
      "filePath": ".github/workflows/treetracker-api-deploy-prod.yml",
      "summary": "Manual workflow_dispatch 'Deploy Service to Prod Env' that promotes a given git-tag to production by running kustomize edit set image in deployment/overlays/production and pushing the resulting kustomization commit; it only runs in the Greenstand-owned repository.",
      "tags": [
        "ci-cd",
        "deployment",
        "gitops",
        "kustomize",
        "production-env"
      ],
      "complexity": "simple"
    },
    {
      "id": "pipeline:.github/workflows/treetracker-api-deploy-test.yml",
      "type": "pipeline",
      "name": "treetracker-api-deploy-test.yml",
      "filePath": ".github/workflows/treetracker-api-deploy-test.yml",
      "summary": "Manual workflow_dispatch 'Deploy Service to Test Env' that sets the greenstand/<repo> image tag in deployment/overlays/test to the git-tag input with kustomize and commits and pushes a '[skip ci]' bump, so the cluster GitOps sync rolls the test environment.",
      "tags": [
        "ci-cd",
        "deployment",
        "gitops",
        "kustomize",
        "test-env"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:.env.example",
      "type": "config",
      "name": ".env.example",
      "filePath": ".env.example",
      "summary": "Template env file listing DATABASE_URL, DATABASE_SCHEMA (field_data) and DATABASE_URL_MAINDB with placeholder values. The legacy URL name is stale: config/config.js reads DATABASE_URL_LEGACYDB, not DATABASE_URL_MAINDB.",
      "tags": [
        "configuration",
        "environment",
        "database",
        "template"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:.env.test.example",
      "type": "config",
      "name": ".env.test.example",
      "filePath": ".env.test.example",
      "summary": "Template for the .env.test file that the mocha npm scripts load: DATABASE_URL and DATABASE_URL_SEEDER point at the shared DigitalOcean integration_test Postgres with {PASSWORD} and {SCHEMA} placeholders, plus NODE_LOG_LEVEL=debug. It omits DATABASE_URL_LEGACYDB and sets TREETRACKER_API_URL and REACT_APP_STAKEHOLDER_API_ROOT, which no server code reads.",
      "tags": [
        "configuration",
        "environment",
        "test",
        "database"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:.prettierrc.json",
      "type": "config",
      "name": ".prettierrc.json",
      "filePath": ".prettierrc.json",
      "summary": "Prettier formatting rules for the repo: semicolons on, trailing commas everywhere, single quotes. The npm prettier-fix and lint:fix scripts apply them.",
      "tags": [
        "configuration",
        "code-style",
        "formatting",
        "prettier"
      ],
      "complexity": "simple"
    },
    {
      "id": "document:CHANGELOG.md",
      "type": "document",
      "name": "CHANGELOG.md",
      "filePath": "CHANGELOG.md",
      "summary": "semantic-release changelog from 1.0.0 (2021-02-03) to 1.15.0 (2026-10-27, root check columns). It records the raw-capture reject endpoint (1.10.0), legacy admin API calls (1.10.1), bulk-pack v2 endpoints (1.7.0), tracks and session endpoints (1.12/1.13), session_segment tables (1.14.0) and many sealed-secret and kustomize deployment fixes.",
      "tags": [
        "documentation",
        "changelog",
        "release-history",
        "semantic-release"
      ],
      "complexity": "complex",
      "languageNotes": "Generated by semantic-release from conventional commits; entries mention RabbitMQ and event replay, which no longer exist in the runtime code."
    },
    {
      "id": "document:README.md",
      "type": "document",
      "name": "README.md",
      "filePath": "README.md",
      "summary": "Developer guide for the field data service: clone and npm install, dev DB passwords via doctl and scripts/setup-dev-database-passwords.sh, npm run server on port 3006, local Postgres with database/db_init.sql and db-migrate, and the protocol/service/model/repository layering. Some parts are stale: it names DATABASE_URL_LEGACYDB and RabbitMQ, a missing layers.png, a test-seedDB script and wallet API Postman specs.",
      "tags": [
        "documentation",
        "entry-point",
        "getting-started",
        "architecture"
      ],
      "complexity": "moderate"
    },
    {
      "id": "config:api.json",
      "type": "config",
      "name": "api.json",
      "filePath": "api.json",
      "summary": "Early OpenAPI 3.0.3 draft (Jan 2021) for a /captures resource: GET with status, planter_contact, planter_id, limit (default 1000) and offset query parameters, empty POST and PATCH stubs, and a Capture schema with reference_id to the legacy trees table and attributes.entries key/value pairs. No code loads it; the live routes use /raw-captures and swaggerDoc.js builds the served spec from Joi schemas.",
      "tags": [
        "api-schema",
        "openapi",
        "configuration",
        "legacy"
      ],
      "complexity": "moderate"
    },
    {
      "id": "endpoint:api.json:GET /captures",
      "type": "endpoint",
      "name": "GET /captures",
      "filePath": "api.json",
      "summary": "Draft spec operation getCaptures that lists capture objects filtered by status, planter_contact and planter_id, paginated by limit and offset, with sample unverified captures that carry dbh, abs_step_count, delta_step_count and rotation_matrix attributes.",
      "tags": [
        "api-schema",
        "endpoint",
        "captures",
        "pagination"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:package.json",
      "type": "config",
      "name": "package.json",
      "filePath": "package.json",
      "summary": "npm manifest (name treetracker, version 1.15.0, Node >=16, main server/server.js) with Express, Knex/pg, Joi, joi-to-swagger, swagger-ui-express, axios, db-migrate and Sentry. Scripts run nodemon for the server, mocha with .env.test for __tests__ and repository specs, db-migrate-ci from database/, and knex seed:run for dev and usertest; app.js and swaggerDoc.js read its version field.",
      "tags": [
        "configuration",
        "build-system",
        "dependencies",
        "npm-scripts"
      ],
      "complexity": "moderate",
      "languageNotes": "The test-unit glob targets server/models/**/*.spec.js and server-test targets server/serverTest.js; neither path exists at this commit."
    },
    {
      "id": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql",
      "type": "table",
      "name": "20201225201548-createCaptures-up.sql",
      "filePath": "database/migrations/sqls/20201225201548-createCaptures-up.sql",
      "summary": "Initial field-data migration that creates the raw_capture table: uuid id, reference_id int8, image_url, numeric lat/lon, smallint gps_accuracy, field_user_id, field_username, field_user_photo_url, device_identifier, note, jsonb attributes, status, rejection_reason, and timestamptz created_at/updated_at, plus five btree indexes on status, field_user_id, field_username, created_at and updated_at.",
      "tags": [
        "migration",
        "database",
        "raw-capture",
        "schema-definition",
        "index"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20201225201548-createCaptures-down.sql",
      "type": "table",
      "name": "20201225201548-createCaptures-down.sql",
      "filePath": "database/migrations/sqls/20201225201548-createCaptures-down.sql",
      "summary": "Rollback for the createCaptures migration: drops the five raw_capture indexes (rcapture_status_idx, rcapture_fieldusr_idx, rcapture_fieldusrname_idx, rcapture_crdate_idx, rcapture_update_idx) and then drops the raw_capture table itself.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql",
      "type": "table",
      "name": "20201231060447-domainEvents-up.sql",
      "filePath": "database/migrations/sqls/20201231060447-domainEvents-up.sql",
      "summary": "Creates the domain_event table (uuid id, jsonb payload, status, created_at, updated_at; composite primary key id+status+created_at) LIST-partitioned by status into raised, received, sent and handled, where sent and handled are further RANGE-partitioned by created_at into yearly 2021, 2022 and 2023 tables; adds a status index and a GIN jsonb_path_ops index on payload. No runtime code in this commit writes the table.",
      "tags": [
        "migration",
        "database",
        "partitioning",
        "domain-event",
        "schema-definition"
      ],
      "complexity": "moderate",
      "languageNotes": "PostgreSQL declarative partitioning: a LIST partition (sent, handled) can itself be RANGE-partitioned, and the primary key must include every partition key column (status, created_at)."
    },
    {
      "id": "table:database/migrations/sqls/20201231060447-domainEvents-down.sql",
      "type": "table",
      "name": "20201231060447-domainEvents-down.sql",
      "filePath": "database/migrations/sqls/20201231060447-domainEvents-down.sql",
      "summary": "Rollback for the domainEvents migration: drops event_status_idx and the GIN index event_pyld_idx, then drops the partitioned domain_event table, which removes its raised/received/sent/handled and yearly child partitions with it.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "domain-event"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-up.sql",
      "type": "table",
      "name": "20210513114937-addCaptureTakenColumn-up.sql",
      "filePath": "database/migrations/sqls/20210513114937-addCaptureTakenColumn-up.sql",
      "summary": "Adds a nullable capture_taken_at timestamptz column to raw_capture so the service can record when the phone took the photo, separate from created_at.",
      "tags": [
        "migration",
        "database",
        "raw-capture",
        "alter-table"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-down.sql",
      "type": "table",
      "name": "20210513114937-addCaptureTakenColumn-down.sql",
      "filePath": "database/migrations/sqls/20210513114937-addCaptureTakenColumn-down.sql",
      "summary": "Reverts the addCaptureTakenColumn migration by dropping the capture_taken_at column from raw_capture.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-up.sql",
      "type": "table",
      "name": "20210513233959-updateCaptureTakenColumn-up.sql",
      "filePath": "database/migrations/sqls/20210513233959-updateCaptureTakenColumn-up.sql",
      "summary": "Data backfill migration that runs UPDATE raw_capture SET capture_taken_at = created_at, so existing captures get a value before the column becomes NOT NULL.",
      "tags": [
        "migration",
        "database",
        "data-backfill",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-down.sql",
      "type": "table",
      "name": "20210513233959-updateCaptureTakenColumn-down.sql",
      "filePath": "database/migrations/sqls/20210513233959-updateCaptureTakenColumn-down.sql",
      "summary": "Empty rollback for the updateCaptureTakenColumn backfill: it holds only the db-migrate placeholder comment, so a revert leaves the copied capture_taken_at values in raw_capture.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "no-op"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-up.sql",
      "type": "table",
      "name": "20210513234014-modifyCaptureTakenColumn-up.sql",
      "filePath": "database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-up.sql",
      "summary": "Tightens raw_capture.capture_taken_at with ALTER COLUMN ... SET NOT NULL, after the previous migration backfilled the column from created_at.",
      "tags": [
        "migration",
        "database",
        "raw-capture",
        "constraint"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-down.sql",
      "type": "table",
      "name": "20210513234014-modifyCaptureTakenColumn-down.sql",
      "filePath": "database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-down.sql",
      "summary": "Empty rollback for the modifyCaptureTakenColumn migration: it holds only the placeholder comment, so the NOT NULL constraint on raw_capture.capture_taken_at stays after a revert.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "no-op"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql",
      "type": "table",
      "name": "20220120081019-wallet-registration-up.sql",
      "filePath": "database/migrations/sqls/20220120081019-wallet-registration-up.sql",
      "summary": "Enables the uuid-ossp extension and creates the wallet_registration table: uuid id defaulting to uuid_generate_v4(), wallet, user_photo_url, grower_account_id uuid, first_name, last_name, optional phone and email, numeric lat/lon, registered_at timestamptz and optional v1_legacy_organization.",
      "tags": [
        "migration",
        "database",
        "wallet-registration",
        "schema-definition"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220120081019-wallet-registration-down.sql",
      "type": "table",
      "name": "20220120081019-wallet-registration-down.sql",
      "filePath": "database/migrations/sqls/20220120081019-wallet-registration-down.sql",
      "summary": "Rollback for the wallet-registration migration: a single DROP TABLE wallet_registration; it leaves the uuid-ossp extension installed.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "wallet-registration"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql",
      "type": "table",
      "name": "20220124224437-device-configuration-up.sql",
      "filePath": "database/migrations/sqls/20220124224437-device-configuration-up.sql",
      "summary": "Creates the device_configuration table that stores the phone profile the Treetracker app reports: device_identifier, brand, model, device, serial, hardware, manufacturer, app_build, app_version, os_version, sdk_version (all NOT NULL varchar), logged_at timestamptz and created_at defaulting to now().",
      "tags": [
        "migration",
        "database",
        "device-configuration",
        "schema-definition"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220124224437-device-configuration-down.sql",
      "type": "table",
      "name": "20220124224437-device-configuration-down.sql",
      "filePath": "database/migrations/sqls/20220124224437-device-configuration-down.sql",
      "summary": "Rollback for the device-configuration migration that runs DROP TABLE device_configuration.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "device-configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220125153204-session-up.sql",
      "type": "table",
      "name": "20220125153204-session-up.sql",
      "filePath": "database/migrations/sqls/20220125153204-session-up.sql",
      "summary": "Creates the session table that links one upload session to its device and grower: uuid id, device_configuration_id foreign key to device_configuration(id), originating_wallet_registration_id foreign key to wallet_registration(id), optional target_wallet, check_in_photo_url, track_url, organization, and created_at defaulting to now().",
      "tags": [
        "migration",
        "database",
        "session",
        "foreign-key",
        "schema-definition"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220125153204-session-down.sql",
      "type": "table",
      "name": "20220125153204-session-down.sql",
      "filePath": "database/migrations/sqls/20220125153204-session-down.sql",
      "summary": "Rollback for the session migration that runs DROP TABLE session, removing the foreign keys to device_configuration and wallet_registration with it.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "type": "table",
      "name": "20220126225534-bulk-pack-capture-updates-up.sql",
      "filePath": "database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "summary": "Reshapes raw_capture for the bulk-pack upload format: drops field_user_id, field_user_photo_url, field_username and device_identifier (now carried by session), adds session_id uuid referencing session(id), abs_step_count int, delta_step_count int and rotation_matrix int[], and renames attributes to extra_attributes.",
      "tags": [
        "migration",
        "database",
        "raw-capture",
        "bulk-pack",
        "alter-table"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-down.sql",
      "type": "table",
      "name": "20220126225534-bulk-pack-capture-updates-down.sql",
      "filePath": "database/migrations/sqls/20220126225534-bulk-pack-capture-updates-down.sql",
      "summary": "Reverts the bulk-pack raw_capture reshape: re-adds field_user_id int8, field_user_photo_url, field_username and device_identifier as nullable columns, drops session_id, abs_step_count, delta_step_count and rotation_matrix, and renames extra_attributes back to attributes.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "raw-capture",
        "bulk-pack"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
      "type": "table",
      "name": "20220227163837-rename-capture-taken-at-up.sql",
      "filePath": "database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
      "summary": "Renames raw_capture.capture_taken_at to captured_at, the column name that RawCaptureRepository selects and the raw capture API schema requires.",
      "tags": [
        "migration",
        "database",
        "raw-capture",
        "rename-column"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-down.sql",
      "type": "table",
      "name": "20220227163837-rename-capture-taken-at-down.sql",
      "filePath": "database/migrations/sqls/20220227163837-rename-capture-taken-at-down.sql",
      "summary": "Reverts the column rename by changing raw_capture.captured_at back to capture_taken_at.",
      "tags": [
        "migration",
        "database",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "table",
      "name": "raw_capture",
      "filePath": "database/migrations/sqls/20201225201548-createCaptures-up.sql",
      "lineRange": [
        2,
        20
      ],
      "summary": "Table definition for raw_capture as first created: one row per tree photo uploaded by a field user, with GPS lat/lon, image_url, reference_id, review status and rejection_reason; later migrations add captured_at and session_id and drop the field_user columns.",
      "tags": [
        "data-model",
        "raw-capture",
        "table"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql:domain_event",
      "type": "table",
      "name": "domain_event",
      "filePath": "database/migrations/sqls/20201231060447-domainEvents-up.sql",
      "lineRange": [
        2,
        24
      ],
      "summary": "Table definition for domain_event, a status-partitioned jsonb event log with raised, received, sent and handled partitions and yearly 2021-2023 sub-partitions for sent and handled.",
      "tags": [
        "data-model",
        "domain-event",
        "partitioning"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "table",
      "name": "wallet_registration",
      "filePath": "database/migrations/sqls/20220120081019-wallet-registration-up.sql",
      "lineRange": [
        3,
        17
      ],
      "summary": "Table definition for wallet_registration: one row per grower wallet sign-up with names, phone, email, photo URL, grower_account_id, location and registered_at.",
      "tags": [
        "data-model",
        "wallet-registration",
        "table"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
      "type": "table",
      "name": "device_configuration",
      "filePath": "database/migrations/sqls/20220124224437-device-configuration-up.sql",
      "lineRange": [
        1,
        17
      ],
      "summary": "Table definition for device_configuration: hardware and app version details (brand, model, serial, app_build, os_version, sdk_version) logged by each phone.",
      "tags": [
        "data-model",
        "device-configuration",
        "table"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "table",
      "name": "session",
      "filePath": "database/migrations/sqls/20220125153204-session-up.sql",
      "lineRange": [
        1,
        11
      ],
      "summary": "Table definition for session: ties a device_configuration and an originating wallet_registration to a target_wallet, organization, check-in photo and track_url.",
      "tags": [
        "data-model",
        "session",
        "table"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-down.sql",
      "type": "table",
      "name": "20220304112209-change-rotation-matrix-down.sql",
      "filePath": "database/migrations/sqls/20220304112209-change-rotation-matrix-down.sql",
      "summary": "Down migration that reverts raw_capture.rotation_matrix from float[] back to an integer array (int[]), which truncates the fractional device rotation values.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-up.sql",
      "type": "table",
      "name": "20220304112209-change-rotation-matrix-up.sql",
      "filePath": "database/migrations/sqls/20220304112209-change-rotation-matrix-up.sql",
      "summary": "Up migration that changes raw_capture.rotation_matrix from int[] to float[] so the capture's device rotation matrix keeps decimal precision; the raw capture handler validates it as an array of numbers.",
      "tags": [
        "database",
        "migration",
        "raw-capture",
        "schema-change"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-down.sql",
      "type": "table",
      "name": "20220324190653-AddOrganizationIdToSession-down.sql",
      "filePath": "database/migrations/sqls/20220324190653-AddOrganizationIdToSession-down.sql",
      "summary": "Down migration that drops the organization_id column from the session table.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-up.sql",
      "type": "table",
      "name": "20220324190653-AddOrganizationIdToSession-up.sql",
      "filePath": "database/migrations/sqls/20220324190653-AddOrganizationIdToSession-up.sql",
      "summary": "Up migration that adds a nullable organization_id varchar column to the session table, so a field session can record the organization it belongs to.",
      "tags": [
        "database",
        "migration",
        "session",
        "organization"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "type": "table",
      "name": "20220411001144-addBulkPackFileName-down.sql",
      "filePath": "database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "summary": "Down migration that drops bulk_pack_file_name from the four upload tables raw_capture, wallet_registration, device_configuration and session.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "bulk-pack"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "type": "table",
      "name": "20220411001144-addBulkPackFileName-up.sql",
      "filePath": "database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "summary": "Up migration that adds a bulk_pack_file_name varchar column to raw_capture, wallet_registration, device_configuration and session, so each row records the uploaded bulk pack file it came from.",
      "tags": [
        "database",
        "migration",
        "bulk-pack",
        "traceability"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220601165814-change-gps-data-type-down.sql",
      "type": "table",
      "name": "20220601165814-change-gps-data-type-down.sql",
      "filePath": "database/migrations/sqls/20220601165814-change-gps-data-type-down.sql",
      "summary": "Down migration that narrows raw_capture.gps_accuracy back from numeric to smallint, dropping any decimal part of the accuracy value.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "gps"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220601165814-change-gps-data-type-up.sql",
      "type": "table",
      "name": "20220601165814-change-gps-data-type-up.sql",
      "filePath": "database/migrations/sqls/20220601165814-change-gps-data-type-up.sql",
      "summary": "Up migration that widens raw_capture.gps_accuracy from smallint to numeric, so captures can store fractional GPS accuracy values sent by the app.",
      "tags": [
        "database",
        "migration",
        "gps",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-down.sql",
      "type": "table",
      "name": "20220618045205-add-wallet-registration-created-at-down.sql",
      "filePath": "database/migrations/sqls/20220618045205-add-wallet-registration-created-at-down.sql",
      "summary": "Down migration that drops the created_at column from the wallet_registration table.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "wallet-registration"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-up.sql",
      "type": "table",
      "name": "20220618045205-add-wallet-registration-created-at-up.sql",
      "filePath": "database/migrations/sqls/20220618045205-add-wallet-registration-created-at-up.sql",
      "summary": "Up migration that adds wallet_registration.created_at as timestamptz with DEFAULT now(), giving each wallet registration an insert timestamp.",
      "tags": [
        "database",
        "migration",
        "wallet-registration",
        "timestamp"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20221105211652-add-session-start-time-down.sql",
      "type": "table",
      "name": "20221105211652-add-session-start-time-down.sql",
      "filePath": "database/migrations/sqls/20221105211652-add-session-start-time-down.sql",
      "summary": "Down migration that drops the start_time column from the session table.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20221105211652-add-session-start-time-up.sql",
      "type": "table",
      "name": "20221105211652-add-session-start-time-up.sql",
      "filePath": "database/migrations/sqls/20221105211652-add-session-start-time-up.sql",
      "summary": "Up migration that adds a nullable session.start_time timestamptz column; the session handler schema accepts it as an ISO date.",
      "tags": [
        "database",
        "migration",
        "session",
        "timestamp"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20230302214605-bulk-pack-version-down.sql",
      "type": "table",
      "name": "20230302214605-bulk-pack-version-down.sql",
      "filePath": "database/migrations/sqls/20230302214605-bulk-pack-version-down.sql",
      "summary": "Down migration that drops the bulk_pack_version column from the session table.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "bulk-pack"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20230302214605-bulk-pack-version-up.sql",
      "type": "table",
      "name": "20230302214605-bulk-pack-version-up.sql",
      "filePath": "database/migrations/sqls/20230302214605-bulk-pack-version-up.sql",
      "summary": "Up migration that adds a session.bulk_pack_version varchar column; the session handler schema restricts its values to 'v1' or 'v2'.",
      "tags": [
        "database",
        "migration",
        "session",
        "bulk-pack"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20230906143147-create-track-table-down.sql",
      "type": "table",
      "name": "20230906143147-create-track-table-down.sql",
      "filePath": "database/migrations/sqls/20230906143147-create-track-table-down.sql",
      "summary": "Down migration that drops the whole track table, deleting all stored session GPS track records.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "track"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20230906143147-create-track-table-up.sql",
      "type": "table",
      "name": "20230906143147-create-track-table-up.sql",
      "filePath": "database/migrations/sqls/20230906143147-create-track-table-up.sql",
      "summary": "Up migration that creates the track table (uuid id, session_id FK to session, locations_url, bulk_pack_file_name, created_at timestamptz), which stores a pointer to each session's uploaded GPS track file.",
      "tags": [
        "database",
        "migration",
        "track",
        "schema-definition"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "type": "table",
      "name": "20240105095545-domainEventsNewPartition-down.sql",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "summary": "Down migration that drops the six yearly partitions domain_event_sent_2024..2026 and domain_event_handled_2024..2026.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "partitioning"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "type": "table",
      "name": "20240105095545-domainEventsNewPartition-up.sql",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "summary": "Up migration that adds yearly range partitions for 2024, 2025 and 2026 to the domain_event_sent and domain_event_handled tables; no runtime code writes these tables at this commit.",
      "tags": [
        "database",
        "migration",
        "partitioning",
        "domain-event"
      ],
      "complexity": "simple",
      "languageNotes": "PostgreSQL declarative partitioning: CREATE TABLE ... PARTITION OF ... FOR VALUES FROM .. TO .. attaches a yearly range partition to a parent table."
    },
    {
      "id": "table:database/migrations/sqls/20240722001220-add-session-segment-table-down.sql",
      "type": "table",
      "name": "20240722001220-add-session-segment-table-down.sql",
      "filePath": "database/migrations/sqls/20240722001220-add-session-segment-table-down.sql",
      "summary": "Down migration that drops raw_capture.session_segment_id first and then drops the session_segment table, in FK-safe order.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "session-segment"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql",
      "type": "table",
      "name": "20240722001220-add-session-segment-table-up.sql",
      "filePath": "database/migrations/sqls/20240722001220-add-session-segment-table-up.sql",
      "summary": "Up migration that creates session_segment (session_id FK, starts_at, ends_at, processed_at, PostGIS convex_hull Polygon in SRID 4326) and adds raw_capture.session_segment_id referencing it; no server code reads the table yet.",
      "tags": [
        "database",
        "migration",
        "session-segment",
        "postgis"
      ],
      "complexity": "simple",
      "languageNotes": "geometry(Polygon, 4326) is a PostGIS typed geometry column constrained to polygons in WGS 84 coordinates."
    },
    {
      "id": "table:database/migrations/sqls/20230906143147-create-track-table-up.sql:track",
      "type": "table",
      "name": "track",
      "filePath": "database/migrations/sqls/20230906143147-create-track-table-up.sql",
      "lineRange": [
        1,
        8
      ],
      "summary": "track table: one row per uploaded session track, with a uuid_generate_v4() id, a NOT NULL session_id FK, the locations_url of the track file, the source bulk_pack_file_name and created_at.",
      "tags": [
        "database",
        "track",
        "data-model",
        "gps"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
      "type": "table",
      "name": "session_segment",
      "filePath": "database/migrations/sqls/20240722001220-add-session-segment-table-up.sql",
      "lineRange": [
        1,
        10
      ],
      "summary": "session_segment table: a time-bounded slice of a session (starts_at, ends_at, processed_at) with a NOT NULL convex_hull polygon that outlines the captures in the segment.",
      "tags": [
        "database",
        "session-segment",
        "data-model",
        "postgis"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2024",
      "type": "table",
      "name": "domain_event_sent_2024",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "lineRange": [
        1,
        1
      ],
      "summary": "Range partition of domain_event_sent that holds sent domain event rows from 2024-01-01 up to 2025-01-01.",
      "tags": [
        "database",
        "partitioning",
        "domain-event",
        "year-2024"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2025",
      "type": "table",
      "name": "domain_event_sent_2025",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "lineRange": [
        2,
        2
      ],
      "summary": "Range partition of domain_event_sent that holds sent domain event rows from 2025-01-01 up to 2026-01-01.",
      "tags": [
        "database",
        "partitioning",
        "domain-event",
        "year-2025"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2026",
      "type": "table",
      "name": "domain_event_sent_2026",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "lineRange": [
        3,
        3
      ],
      "summary": "Range partition of domain_event_sent that holds sent domain event rows from 2026-01-01 up to 2027-01-01.",
      "tags": [
        "database",
        "partitioning",
        "domain-event",
        "year-2026"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2024",
      "type": "table",
      "name": "domain_event_handled_2024",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "lineRange": [
        4,
        4
      ],
      "summary": "Range partition of domain_event_handled that holds handled domain event rows from 2024-01-01 up to 2025-01-01.",
      "tags": [
        "database",
        "partitioning",
        "domain-event",
        "year-2024"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2025",
      "type": "table",
      "name": "domain_event_handled_2025",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "lineRange": [
        5,
        5
      ],
      "summary": "Range partition of domain_event_handled that holds handled domain event rows from 2025-01-01 up to 2026-01-01.",
      "tags": [
        "database",
        "partitioning",
        "domain-event",
        "year-2025"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2026",
      "type": "table",
      "name": "domain_event_handled_2026",
      "filePath": "database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "lineRange": [
        6,
        6
      ],
      "summary": "Range partition of domain_event_handled that holds handled domain event rows from 2026-01-01 up to 2027-01-01.",
      "tags": [
        "database",
        "partitioning",
        "domain-event",
        "year-2026"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-down.sql:session",
      "type": "table",
      "name": "20241122090004-add-columns-to-session-table-down.sql",
      "filePath": "database/migrations/sqls/20241122090004-add-columns-to-session-table-down.sql",
      "summary": "Down migration for 20241122090004 that runs ALTER TABLE session DROP COLUMN processed_at, removing the processing timestamp column from the session table.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-up.sql:session",
      "type": "table",
      "name": "20241122090004-add-columns-to-session-table-up.sql",
      "filePath": "database/migrations/sqls/20241122090004-add-columns-to-session-table-up.sql",
      "summary": "Up migration for 20241122090004 that adds a nullable processed_at timestamptz column to the session table to record when a session was processed; no server code at this commit reads or writes it.",
      "tags": [
        "database",
        "migration",
        "session",
        "schema-change"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-down.sql:session_segment",
      "type": "table",
      "name": "20241122090641-remove-session-segments-time-defaults-down.sql",
      "filePath": "database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-down.sql",
      "summary": "Down migration for 20241122090641 that restores DEFAULT now() on the starts_at, ends_at and processed_at columns of the session_segment table.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "session-segment"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-up.sql:session_segment",
      "type": "table",
      "name": "20241122090641-remove-session-segments-time-defaults-up.sql",
      "filePath": "database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-up.sql",
      "summary": "Up migration for 20241122090641 that drops the DEFAULT now() on session_segment.starts_at, ends_at and processed_at, so inserts must supply these timestamps explicitly instead of getting the insert time.",
      "tags": [
        "database",
        "migration",
        "session-segment",
        "schema-change"
      ],
      "complexity": "simple",
      "languageNotes": "A single ALTER TABLE statement carries three comma-separated ALTER COLUMN ... DROP DEFAULT actions; the NOT NULL constraints from the original CREATE TABLE stay in place."
    },
    {
      "id": "table:database/migrations/sqls/20250527074027-add-root-capture-columns-down.sql:raw_capture",
      "type": "table",
      "name": "20250527074027-add-root-capture-columns-down.sql",
      "filePath": "database/migrations/sqls/20250527074027-add-root-capture-columns-down.sql",
      "summary": "Down migration for 20250527074027 that drops the root and root_check_processed_at columns from the raw_capture table.",
      "tags": [
        "database",
        "migration",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/migrations/sqls/20250527074027-add-root-capture-columns-up.sql:raw_capture",
      "type": "table",
      "name": "20250527074027-add-root-capture-columns-up.sql",
      "filePath": "database/migrations/sqls/20250527074027-add-root-capture-columns-up.sql",
      "summary": "Up migration for 20250527074027 that adds a nullable root boolean flag and a root_check_processed_at timestamptz column to the raw_capture table to hold a root-check result and the time that check was processed; no server code at this commit reads them.",
      "tags": [
        "database",
        "migration",
        "raw-capture",
        "schema-change"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/cluster-role-binding.yaml",
      "type": "config",
      "name": "cluster-role-binding.yaml",
      "filePath": "deployment/base/cluster-role-binding.yaml",
      "summary": "ClusterRoleBinding named k8s-wait-for that grants the k8s-wait-for ClusterRole to the default ServiceAccount in the field-data-api namespace; ArgoCD creates it as a PostSync hook with the BeforeHookCreation delete policy.",
      "tags": [
        "kubernetes",
        "rbac",
        "security",
        "argocd-hook",
        "deployment"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/cluster-role.yaml",
      "type": "config",
      "name": "cluster-role.yaml",
      "filePath": "deployment/base/cluster-role.yaml",
      "summary": "ClusterRole named k8s-wait-for that allows get, watch and list on services, pods and jobs in the core and batch API groups, so a wait-for helper can poll the migration job; deployed as an ArgoCD PostSync hook.",
      "tags": [
        "kubernetes",
        "rbac",
        "security",
        "argocd-hook",
        "deployment"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/database-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-connection-sealed-secret.yaml",
      "filePath": "deployment/base/database-connection-sealed-secret.yaml",
      "summary": "Base Bitnami SealedSecret named database-connection in namespace field-data-api with one encrypted key db; the base value is the literal PLACEHOLDER, which the development, test and production overlays replace with real ciphertext for the API connection string.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "security",
        "database",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/database-migration-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-migration-connection-sealed-secret.yaml",
      "filePath": "deployment/base/database-migration-connection-sealed-secret.yaml",
      "summary": "Base Bitnami SealedSecret named database-migration-connection in namespace field-data-api that holds an encrypted db key with the connection string the migration job uses; unlike the database-connection secret, the base copy carries real sealed ciphertext and creationTimestamp null.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "security",
        "migration",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/database-migration-job.yaml",
      "type": "config",
      "name": "database-migration-job.yaml",
      "filePath": "deployment/base/database-migration-job.yaml",
      "summary": "Kubernetes Job database-migration-job, run as an ArgoCD PostSync hook, that starts the greenstand/treetracker-field-data:VERSION image on the microservices-node-pool and runs db-migrate up against database/migrations/ with DATABASE_URL from the database-migration-connection secret key db; backoffLimit 1 and restartPolicy Never.",
      "tags": [
        "kubernetes",
        "migration",
        "database",
        "argocd-hook",
        "deployment"
      ],
      "complexity": "simple",
      "languageNotes": "ArgoCD hook annotations (argocd.argoproj.io/hook: PostSync) make the Job run after each sync, and BeforeHookCreation deletes the old Job first so the fixed Job name can be reused."
    },
    {
      "id": "config:deployment/base/deployment.yaml",
      "type": "config",
      "name": "deployment.yaml",
      "filePath": "deployment/base/deployment.yaml",
      "summary": "Kubernetes Deployment treetracker-field-data with 2 replicas pinned to the DigitalOcean microservices-node-pool; it runs the greenstand/treetracker-field-data:latest container on port 3006 and sets DATABASE_URL and DATABASE_URL_LEGACYDB from the database-connection secret key db plus DATABASE_SCHEMA=field_data.",
      "tags": [
        "kubernetes",
        "deployment",
        "containerization",
        "environment-config",
        "database"
      ],
      "complexity": "moderate",
      "languageNotes": "Both DATABASE_URL and DATABASE_URL_LEGACYDB read the same secret key, so in this base the field data DB and the legacy treetracker DB share one connection string."
    },
    {
      "id": "config:deployment/base/kustomization.yaml",
      "type": "config",
      "name": "kustomization.yaml",
      "filePath": "deployment/base/kustomization.yaml",
      "summary": "Base Kustomize manifest that lists the nine field-data resources (deployment, mapping, service, the database-connection and database-migration-connection sealed secrets, the field-data-api namespace, the k8s-wait-for ClusterRole and binding, and the migration job) that the development, test and production overlays build on.",
      "tags": [
        "kustomize",
        "kubernetes",
        "build-system",
        "deployment",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/mapping.yaml",
      "type": "config",
      "name": "mapping.yaml",
      "filePath": "deployment/base/mapping.yaml",
      "summary": "Ambassador getambassador.io/v2 Mapping named treetracker-field-data that routes the public /field-data/ path prefix to the treetracker-field-data Service and rewrites the prefix to /.",
      "tags": [
        "kubernetes",
        "api-gateway",
        "routing",
        "ambassador",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/namespace.yaml",
      "type": "config",
      "name": "namespace.yaml",
      "filePath": "deployment/base/namespace.yaml",
      "summary": "Four-line Kubernetes Namespace manifest that creates the field-data-api namespace, which the sealed secrets and the k8s-wait-for role binding reference.",
      "tags": [
        "kubernetes",
        "namespace",
        "infrastructure",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/base/service.yaml",
      "type": "config",
      "name": "service.yaml",
      "filePath": "deployment/base/service.yaml",
      "summary": "Kubernetes Service treetracker-field-data that selects pods labelled app: treetracker-field-data and exposes TCP port 80 (named http) to the container targetPort 3006.",
      "tags": [
        "kubernetes",
        "networking",
        "service-discovery",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/development/database-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-connection-sealed-secret.yaml",
      "filePath": "deployment/overlays/development/database-connection-sealed-secret.yaml",
      "summary": "Development-cluster Bitnami SealedSecret named database-connection in namespace field-data-api; holds the encrypted db key that the base Deployment reads into DATABASE_URL and DATABASE_URL_LEGACYDB for the development API pods.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "development",
        "database",
        "security"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/development/database-migration-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-migration-connection-sealed-secret.yaml",
      "filePath": "deployment/overlays/development/database-migration-connection-sealed-secret.yaml",
      "summary": "Development-cluster SealedSecret database-migration-connection (namespace field-data-api) with an encrypted db key for the db-migrate Job's DATABASE_URL; unlike the test and production copies, its template sets data: null explicitly.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "development",
        "migration",
        "security"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/development/kustomization.yaml",
      "type": "config",
      "name": "kustomization.yaml",
      "filePath": "deployment/overlays/development/kustomization.yaml",
      "summary": "Development Kustomize overlay that builds on ../../base, pins image greenstand/treetracker-field-data to tag 1.15.0, and strategic-merge patches the dev database-connection and database-migration-connection sealed secrets plus a mapping.yaml with open CORS.",
      "tags": [
        "kubernetes",
        "kustomize",
        "development",
        "deployment",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/development/mapping.yaml",
      "type": "config",
      "name": "mapping.yaml",
      "filePath": "deployment/overlays/development/mapping.yaml",
      "summary": "Development patch for the Ambassador v2 Mapping treetracker-field-data that adds CORS allowing any origin ('*') for GET, POST, PATCH, OPTIONS with Content-Type and Authorization headers; the /field-data/ prefix comes from base.",
      "tags": [
        "kubernetes",
        "ambassador",
        "cors",
        "development",
        "routing"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/production/database-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-connection-sealed-secret.yaml",
      "filePath": "deployment/overlays/production/database-connection-sealed-secret.yaml",
      "summary": "Production overlay Bitnami SealedSecret named database-connection in namespace field-data-api that replaces the base secret with the production-cluster-encrypted 'db' key; the treetracker-field-data Deployment reads that key into both DATABASE_URL and DATABASE_URL_LEGACYDB.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "production",
        "security",
        "configuration"
      ],
      "complexity": "simple",
      "languageNotes": "SealedSecret encryptedData is decryptable only by the sealed-secrets controller in the target cluster, so each environment overlay carries its own ciphertext for the same key."
    },
    {
      "id": "config:deployment/overlays/production/database-migration-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-migration-connection-sealed-secret.yaml",
      "filePath": "deployment/overlays/production/database-migration-connection-sealed-secret.yaml",
      "summary": "Production overlay SealedSecret database-migration-connection in namespace field-data-api holding the encrypted 'db' connection string that the database-migration-job injects as DATABASE_URL when it runs db-migrate up against the production field_data schema.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "production",
        "migration",
        "security"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/production/kustomization.yaml",
      "type": "config",
      "name": "kustomization.yaml",
      "filePath": "deployment/overlays/production/kustomization.yaml",
      "summary": "Production Kustomize overlay that builds on ../../base, strategic-merge patches only the two production sealed secrets (database-connection, database-migration-connection) and pins image greenstand/treetracker-field-data to tag 1.15.0; unlike the development and test overlays it adds no mapping.yaml patch, so the base Ambassador Mapping prefix /field-data/ is kept.",
      "tags": [
        "kubernetes",
        "kustomize",
        "production",
        "deployment",
        "configuration"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/test/database-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-connection-sealed-secret.yaml",
      "filePath": "deployment/overlays/test/database-connection-sealed-secret.yaml",
      "summary": "Test overlay Bitnami SealedSecret (bitnami.com/v1alpha1) named database-connection in namespace field-data-api; it holds the test-environment encrypted key db that the base Deployment reads into DATABASE_URL and DATABASE_URL_LEGACYDB for the treetracker-field-data API container.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "test-environment",
        "database",
        "security"
      ],
      "complexity": "simple",
      "languageNotes": "SealedSecrets are encrypted per cluster, so each overlay (test, development, production) carries its own ciphertext for the same secret name and key."
    },
    {
      "id": "config:deployment/overlays/test/database-migration-connection-sealed-secret.yaml",
      "type": "config",
      "name": "database-migration-connection-sealed-secret.yaml",
      "filePath": "deployment/overlays/test/database-migration-connection-sealed-secret.yaml",
      "summary": "Test overlay Bitnami SealedSecret named database-migration-connection in namespace field-data-api; its encrypted key db supplies DATABASE_URL to the base migration Job that runs db-migrate up against the test database.",
      "tags": [
        "kubernetes",
        "sealed-secret",
        "test-environment",
        "migration",
        "security"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/test/kustomization.yaml",
      "type": "config",
      "name": "kustomization.yaml",
      "filePath": "deployment/overlays/test/kustomization.yaml",
      "summary": "Kustomize overlay for the test environment: builds on ../../base, applies strategic-merge patches from the test database-connection and database-migration-connection sealed secrets plus mapping.yaml, and pins image greenstand/treetracker-field-data to tag 1.13.3 (older than the 1.15.0 tag in development and production).",
      "tags": [
        "kustomize",
        "test-environment",
        "deployment",
        "configuration",
        "image-pinning"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:deployment/overlays/test/mapping.yaml",
      "type": "config",
      "name": "mapping.yaml",
      "filePath": "deployment/overlays/test/mapping.yaml",
      "summary": "Test overlay patch for the Ambassador getambassador.io/v2 Mapping treetracker-field-data that adds CORS rules: only origin https://test-admin.treetracker.org, methods GET, POST, PATCH, OPTIONS, and headers Content-Type and Authorization.",
      "tags": [
        "ambassador",
        "cors",
        "test-environment",
        "routing",
        "kubernetes"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:.eslintignore",
      "type": "file",
      "name": ".eslintignore",
      "filePath": ".eslintignore",
      "summary": "ESLint ignore list that excludes every **/*.spec.js test file and every **/data.js fixture file from the `npm run eslint` check that the husky pre-commit hook runs.",
      "tags": [
        "configuration",
        "linting",
        "eslint",
        "tooling"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:.huskyrc",
      "type": "file",
      "name": ".huskyrc",
      "filePath": ".huskyrc",
      "summary": "Husky git hook config: the commit-msg hook runs `commitlint -E HUSKY_GIT_PARAMS` to enforce conventional commit messages, and the pre-commit hook runs `npm run eslint`.",
      "tags": [
        "configuration",
        "git-hooks",
        "husky",
        "commitlint",
        "linting"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:.npmrc",
      "type": "file",
      "name": ".npmrc",
      "filePath": ".npmrc",
      "summary": "npm config with a single `engine-strict=true` line, so npm refuses to install when the runtime does not meet the package.json engines (node >=16.0.0, npm >=7.0.0).",
      "tags": [
        "configuration",
        "npm",
        "build-system",
        "tooling"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:.releaserc",
      "type": "file",
      "name": ".releaserc",
      "filePath": ".releaserc",
      "summary": "semantic-release config for the `main` branch: commit-analyzer, release-notes-generator, changelog, npm and github plugins, plus @semantic-release/git that commits docs, package.json and CHANGELOG.md as `chore(release): ${nextRelease.version} [skip ci]`.",
      "tags": [
        "configuration",
        "release",
        "semantic-release",
        "ci-cd",
        "versioning"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:assets/greenstand.webp",
      "type": "file",
      "name": "greenstand.webp",
      "filePath": "assets/greenstand.webp",
      "summary": "Green Greenstand leaf-and-person logo image (5.5 KB WebP). server/app.js serves it under /assets, and the swaggerDoc customCss puts it in the Swagger UI top bar at 80px width.",
      "tags": [
        "asset",
        "image",
        "branding",
        "swagger-ui"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:commitlint.config.js",
      "type": "file",
      "name": "commitlint.config.js",
      "filePath": "commitlint.config.js",
      "summary": "One-line commitlint config that extends @commitlint/config-conventional; the husky commit-msg hook uses it to reject commit messages that are not conventional commits.",
      "tags": [
        "configuration",
        "commitlint",
        "git-hooks",
        "tooling"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/database.json.example",
      "type": "file",
      "name": "database.json.example",
      "filePath": "database/database.json.example",
      "summary": "db-migrate connection template with `dev` and `integration` pg environments on the Greenstand DigitalOcean Postgres host (port 25060, ssl rejectUnauthorized false); {SCHEMA}, {MIGRATION_PASSWORD} and {INTEGRATION_PASSWORD} placeholders are filled in by scripts/setup-dev-database-passwords.sh.",
      "tags": [
        "configuration",
        "database",
        "db-migrate",
        "template",
        "postgres"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/db_init.sql",
      "type": "table",
      "name": "db_init.sql",
      "filePath": "database/db_init.sql",
      "summary": "Local Postgres bootstrap SQL that creates the `field_db` database and a `doadmin` SUPERUSER role; README tells developers to run it before they use a locally running field database.",
      "tags": [
        "database",
        "setup",
        "postgres",
        "local-development"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/etl/create-legacy-session-ids.js",
      "type": "file",
      "name": "create-legacy-session-ids.js",
      "filePath": "database/etl/create-legacy-session-ids.js",
      "summary": "One-off ETL script on DATABASE_URL (Knex pg pool max 4) that selects 1000 active legacy `trees` rows with null session_id and non-null device_identifier and planter_identifier, and sets session_id to uuid-by-string(device_identifier + planter_identifier).",
      "tags": [
        "etl",
        "script",
        "legacy-data",
        "session",
        "database"
      ],
      "complexity": "moderate",
      "languageNotes": "The loop counter `const j = 0` never changes, so `while (j < 500)` never ends; the async callbacks in rows.forEach are not awaited, so the next query can run before the updates finish."
    },
    {
      "id": "table:database/etl/create-wallet-registration-from-legacy-2.sql",
      "type": "table",
      "name": "create-wallet-registration-from-legacy-2.sql",
      "filePath": "database/etl/create-wallet-registration-from-legacy-2.sql",
      "summary": "Second version of the legacy ETL that inserts field_data.wallet_registration rows from planter_registrations, joined to treetracker.grower_account by phone or email and to the newest ACTIVE (active = true) tree with a session_id per planter; it skips session_ids already present.",
      "tags": [
        "etl",
        "database",
        "wallet-registration",
        "legacy-data",
        "migration"
      ],
      "complexity": "moderate",
      "languageNotes": "Differs from the first version only in the `active = true` filter on trees and the unqualified `session_id NOT IN` check."
    },
    {
      "id": "table:database/etl/create-wallet-registration-from-legacy.sql",
      "type": "table",
      "name": "create-wallet-registration-from-legacy.sql",
      "filePath": "database/etl/create-wallet-registration-from-legacy.sql",
      "summary": "Legacy ETL that fills field_data.wallet_registration (id = session_id, wallet = phone or email, user_photo_url default 'none', grower_account_id, names, lat/lon, registered_at, v1_legacy_organization) from planter_registrations and the newest tree with any session_id per planter, DISTINCT ON wallet.",
      "tags": [
        "etl",
        "database",
        "wallet-registration",
        "legacy-data",
        "migration"
      ],
      "complexity": "moderate",
      "languageNotes": "Uses Postgres DISTINCT ON with ORDER BY time_created DESC to pick one latest tree photo per planter."
    },
    {
      "id": "file:database/etl/make-legacy-session-id.js",
      "type": "file",
      "name": "make-legacy-session-id.js",
      "filePath": "database/etl/make-legacy-session-id.js",
      "summary": "Debug helper that computes and logs the legacy session UUID for the hard-coded device_identifier '3581468e31e2c74a' and planter_identifier '0784589075' with uuid-by-string, the same derivation as create-legacy-session-ids.js.",
      "tags": [
        "etl",
        "script",
        "debugging",
        "session",
        "utility"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20201225201548-createCaptures.js",
      "type": "file",
      "name": "20201225201548-createCaptures.js",
      "filePath": "database/migrations/20201225201548-createCaptures.js",
      "summary": "db-migrate wrapper for the createCaptures migration: up() runs sqls/20201225201548-createCaptures-up.sql, which creates the raw_capture table (uuid id, reference_id, image_url, lat, lon, gps_accuracy, field_user_id, field_username, device_identifier, note, attributes jsonb, status, rejection_reason, timestamps) with five indexes on status, field_user_id, field_username, created_at and updated_at; down() runs sqls/20201225201548-createCaptures-down.sql, which drops the five rcapture_* indexes and the raw_capture table.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "schema-creation"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20201225201548-createCaptures.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20201225201548-createCaptures.js",
      "summary": "db-migrate setup hook of the createCaptures migration (20201225201548-createCaptures): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20201225201548-createCaptures.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20201225201548-createCaptures.js",
      "summary": "Forward step of the createCaptures migration: reads sqls/20201225201548-createCaptures-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which creates the raw_capture table (uuid id, reference_id, image_url, lat, lon, gps_accuracy, field_user_id, field_username, device_identifier, note, attributes jsonb, status, rejection_reason, timestamps) with five indexes on status, field_user_id, field_username, created_at and updated_at.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20201225201548-createCaptures.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20201225201548-createCaptures.js",
      "summary": "Rollback step of the createCaptures migration: reads sqls/20201225201548-createCaptures-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops the five rcapture_* indexes and the raw_capture table.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20201231060447-domainEvents.js",
      "type": "file",
      "name": "20201231060447-domainEvents.js",
      "filePath": "database/migrations/20201231060447-domainEvents.js",
      "summary": "db-migrate wrapper for the domainEvents migration: up() runs sqls/20201231060447-domainEvents-up.sql, which creates the domain_event table LIST-partitioned by status into raised, received, sent and handled partitions, with yearly 2021-2023 RANGE sub-partitions on created_at for sent and handled, plus a status index and a GIN payload index; down() runs sqls/20201231060447-domainEvents-down.sql, which drops event_status_idx, event_pyld_idx and the domain_event table.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "domain-event",
        "partitioning"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20201231060447-domainEvents.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20201231060447-domainEvents.js",
      "summary": "db-migrate setup hook of the domainEvents migration (20201231060447-domainEvents): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "domain-event"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20201231060447-domainEvents.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20201231060447-domainEvents.js",
      "summary": "Forward step of the domainEvents migration: reads sqls/20201231060447-domainEvents-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which creates the domain_event table LIST-partitioned by status into raised, received, sent and handled partitions, with yearly 2021-2023 RANGE sub-partitions on created_at for sent and handled, plus a status index and a GIN payload index.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "domain-event"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20201231060447-domainEvents.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20201231060447-domainEvents.js",
      "summary": "Rollback step of the domainEvents migration: reads sqls/20201231060447-domainEvents-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops event_status_idx, event_pyld_idx and the domain_event table.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "domain-event"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "type": "file",
      "name": "20210513114937-addCaptureTakenColumn.js",
      "filePath": "database/migrations/20210513114937-addCaptureTakenColumn.js",
      "summary": "db-migrate wrapper for the addCaptureTakenColumn migration: up() runs sqls/20210513114937-addCaptureTakenColumn-up.sql, which adds a nullable capture_taken_at timestamptz column to raw_capture; down() runs sqls/20210513114937-addCaptureTakenColumn-down.sql, which drops the capture_taken_at column from raw_capture.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "add-column"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20210513114937-addCaptureTakenColumn.js",
      "summary": "db-migrate setup hook of the addCaptureTakenColumn migration (20210513114937-addCaptureTakenColumn): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20210513114937-addCaptureTakenColumn.js",
      "summary": "Forward step of the addCaptureTakenColumn migration: reads sqls/20210513114937-addCaptureTakenColumn-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which adds a nullable capture_taken_at timestamptz column to raw_capture.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20210513114937-addCaptureTakenColumn.js",
      "summary": "Rollback step of the addCaptureTakenColumn migration: reads sqls/20210513114937-addCaptureTakenColumn-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops the capture_taken_at column from raw_capture.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "type": "file",
      "name": "20210513233959-updateCaptureTakenColumn.js",
      "filePath": "database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "summary": "db-migrate wrapper for the updateCaptureTakenColumn migration: up() runs sqls/20210513233959-updateCaptureTakenColumn-up.sql, which backfills raw_capture.capture_taken_at with the created_at value of each row; down() runs sqls/20210513233959-updateCaptureTakenColumn-down.sql, which runs a comment-only SQL file, so the backfill is not reverted.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "data-backfill"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "summary": "db-migrate setup hook of the updateCaptureTakenColumn migration (20210513233959-updateCaptureTakenColumn): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "summary": "Forward step of the updateCaptureTakenColumn migration: reads sqls/20210513233959-updateCaptureTakenColumn-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which backfills raw_capture.capture_taken_at with the created_at value of each row.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "summary": "Rollback step of the updateCaptureTakenColumn migration: reads sqls/20210513233959-updateCaptureTakenColumn-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which runs a comment-only SQL file, so the backfill is not reverted.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "type": "file",
      "name": "20210513234014-modifyCaptureTakenColumn.js",
      "filePath": "database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "summary": "db-migrate wrapper for the modifyCaptureTakenColumn migration: up() runs sqls/20210513234014-modifyCaptureTakenColumn-up.sql, which sets raw_capture.capture_taken_at to NOT NULL after the backfill; down() runs sqls/20210513234014-modifyCaptureTakenColumn-down.sql, which runs a comment-only SQL file, so the NOT NULL constraint stays.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "constraint"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "summary": "db-migrate setup hook of the modifyCaptureTakenColumn migration (20210513234014-modifyCaptureTakenColumn): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "summary": "Forward step of the modifyCaptureTakenColumn migration: reads sqls/20210513234014-modifyCaptureTakenColumn-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which sets raw_capture.capture_taken_at to NOT NULL after the backfill.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "summary": "Rollback step of the modifyCaptureTakenColumn migration: reads sqls/20210513234014-modifyCaptureTakenColumn-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which runs a comment-only SQL file, so the NOT NULL constraint stays.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20220120081019-wallet-registration.js",
      "type": "file",
      "name": "20220120081019-wallet-registration.js",
      "filePath": "database/migrations/20220120081019-wallet-registration.js",
      "summary": "db-migrate wrapper for the wallet-registration migration: up() runs sqls/20220120081019-wallet-registration-up.sql, which enables the uuid-ossp extension and creates the wallet_registration table (uuid_generate_v4 id, wallet, user_photo_url, grower_account_id, first_name, last_name, phone, email, lat, lon, registered_at, v1_legacy_organization); down() runs sqls/20220120081019-wallet-registration-down.sql, which drops the wallet_registration table.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "wallet-registration",
        "schema-creation"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220120081019-wallet-registration.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220120081019-wallet-registration.js",
      "summary": "db-migrate setup hook of the wallet-registration migration (20220120081019-wallet-registration): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "wallet-registration"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20220120081019-wallet-registration.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220120081019-wallet-registration.js",
      "summary": "Forward step of the wallet-registration migration: reads sqls/20220120081019-wallet-registration-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which enables the uuid-ossp extension and creates the wallet_registration table (uuid_generate_v4 id, wallet, user_photo_url, grower_account_id, first_name, last_name, phone, email, lat, lon, registered_at, v1_legacy_organization).",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "wallet-registration"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20220120081019-wallet-registration.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220120081019-wallet-registration.js",
      "summary": "Rollback step of the wallet-registration migration: reads sqls/20220120081019-wallet-registration-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops the wallet_registration table.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "wallet-registration"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20220124224437-device-configuration.js",
      "type": "file",
      "name": "20220124224437-device-configuration.js",
      "filePath": "database/migrations/20220124224437-device-configuration.js",
      "summary": "db-migrate wrapper for the device-configuration migration: up() runs sqls/20220124224437-device-configuration-up.sql, which creates the device_configuration table with device_identifier, brand, model, device, serial, hardware, manufacturer, app_build, app_version, os_version, sdk_version, logged_at and created_at default now(); down() runs sqls/20220124224437-device-configuration-down.sql, which drops the device_configuration table.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "device-configuration",
        "schema-creation"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220124224437-device-configuration.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220124224437-device-configuration.js",
      "summary": "db-migrate setup hook of the device-configuration migration (20220124224437-device-configuration): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "device-configuration"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20220124224437-device-configuration.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220124224437-device-configuration.js",
      "summary": "Forward step of the device-configuration migration: reads sqls/20220124224437-device-configuration-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which creates the device_configuration table with device_identifier, brand, model, device, serial, hardware, manufacturer, app_build, app_version, os_version, sdk_version, logged_at and created_at default now().",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "device-configuration"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20220124224437-device-configuration.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220124224437-device-configuration.js",
      "summary": "Rollback step of the device-configuration migration: reads sqls/20220124224437-device-configuration-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops the device_configuration table.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "device-configuration"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20220125153204-session.js",
      "type": "file",
      "name": "20220125153204-session.js",
      "filePath": "database/migrations/20220125153204-session.js",
      "summary": "db-migrate wrapper for the session migration: up() runs sqls/20220125153204-session-up.sql, which creates the session table with foreign keys device_configuration_id to device_configuration and originating_wallet_registration_id to wallet_registration, plus target_wallet, check_in_photo_url, track_url, organization and created_at; down() runs sqls/20220125153204-session-down.sql, which drops the session table.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "session",
        "schema-creation"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220125153204-session.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220125153204-session.js",
      "summary": "db-migrate setup hook of the session migration (20220125153204-session): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "session"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20220125153204-session.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220125153204-session.js",
      "summary": "Forward step of the session migration: reads sqls/20220125153204-session-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which creates the session table with foreign keys device_configuration_id to device_configuration and originating_wallet_registration_id to wallet_registration, plus target_wallet, check_in_photo_url, track_url, organization and created_at.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "session"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20220125153204-session.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220125153204-session.js",
      "summary": "Rollback step of the session migration: reads sqls/20220125153204-session-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops the session table.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "session"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "type": "file",
      "name": "20220126225534-bulk-pack-capture-updates.js",
      "filePath": "database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "summary": "db-migrate wrapper for the bulk-pack-capture-updates migration: up() runs sqls/20220126225534-bulk-pack-capture-updates-up.sql, which reshapes raw_capture for bulk packs: drops field_user_id, field_user_photo_url, field_username and device_identifier, adds session_id (FK to session), abs_step_count, delta_step_count and int[] rotation_matrix, and renames attributes to extra_attributes; down() runs sqls/20220126225534-bulk-pack-capture-updates-down.sql, which re-adds the four field_user/device columns, drops session_id, the step counts and rotation_matrix, and renames extra_attributes back to attributes.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "bulk-pack"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "summary": "db-migrate setup hook of the bulk-pack-capture-updates migration (20220126225534-bulk-pack-capture-updates): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "summary": "Forward step of the bulk-pack-capture-updates migration: reads sqls/20220126225534-bulk-pack-capture-updates-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which reshapes raw_capture for bulk packs: drops field_user_id, field_user_photo_url, field_username and device_identifier, adds session_id (FK to session), abs_step_count, delta_step_count and int[] rotation_matrix, and renames attributes to extra_attributes.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "summary": "Rollback step of the bulk-pack-capture-updates migration: reads sqls/20220126225534-bulk-pack-capture-updates-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which re-adds the four field_user/device columns, drops session_id, the step counts and rotation_matrix, and renames extra_attributes back to attributes.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "type": "file",
      "name": "20220227163837-rename-capture-taken-at.js",
      "filePath": "database/migrations/20220227163837-rename-capture-taken-at.js",
      "summary": "db-migrate wrapper for the rename-capture-taken-at migration: up() runs sqls/20220227163837-rename-capture-taken-at-up.sql, which renames raw_capture.capture_taken_at to captured_at; down() runs sqls/20220227163837-rename-capture-taken-at-down.sql, which renames raw_capture.captured_at back to capture_taken_at.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "rename-column"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220227163837-rename-capture-taken-at.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220227163837-rename-capture-taken-at.js",
      "summary": "db-migrate setup hook of the rename-capture-taken-at migration (20220227163837-rename-capture-taken-at): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        13,
        18
      ]
    },
    {
      "id": "function:database/migrations/20220227163837-rename-capture-taken-at.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220227163837-rename-capture-taken-at.js",
      "summary": "Forward step of the rename-capture-taken-at migration: reads sqls/20220227163837-rename-capture-taken-at-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which renames raw_capture.capture_taken_at to captured_at.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        20,
        36
      ]
    },
    {
      "id": "function:database/migrations/20220227163837-rename-capture-taken-at.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220227163837-rename-capture-taken-at.js",
      "summary": "Rollback step of the rename-capture-taken-at migration: reads sqls/20220227163837-rename-capture-taken-at-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which renames raw_capture.captured_at back to capture_taken_at.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        38,
        54
      ]
    },
    {
      "id": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "type": "file",
      "name": "20220304112209-change-rotation-matrix.js",
      "filePath": "database/migrations/20220304112209-change-rotation-matrix.js",
      "summary": "db-migrate wrapper for the change-rotation-matrix migration: up() runs sqls/20220304112209-change-rotation-matrix-up.sql, which changes the raw_capture.rotation_matrix column type from int[] to float[]; down() runs sqls/20220304112209-change-rotation-matrix-down.sql, which changes raw_capture.rotation_matrix back to int[].",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "column-type"
      ],
      "complexity": "simple",
      "languageNotes": "This wrapper uses `use strict`, var declarations and string concatenation in its console.log."
    },
    {
      "id": "function:database/migrations/20220304112209-change-rotation-matrix.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220304112209-change-rotation-matrix.js",
      "summary": "db-migrate setup hook of the change-rotation-matrix migration (20220304112209-change-rotation-matrix): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        14,
        19
      ]
    },
    {
      "id": "function:database/migrations/20220304112209-change-rotation-matrix.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220304112209-change-rotation-matrix.js",
      "summary": "Forward step of the change-rotation-matrix migration: reads sqls/20220304112209-change-rotation-matrix-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which changes the raw_capture.rotation_matrix column type from int[] to float[].",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        21,
        37
      ]
    },
    {
      "id": "function:database/migrations/20220304112209-change-rotation-matrix.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220304112209-change-rotation-matrix.js",
      "summary": "Rollback step of the change-rotation-matrix migration: reads sqls/20220304112209-change-rotation-matrix-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which changes raw_capture.rotation_matrix back to int[].",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "raw-capture"
      ],
      "complexity": "simple",
      "lineRange": [
        39,
        55
      ]
    },
    {
      "id": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "type": "file",
      "name": "20220324190653-AddOrganizationIdToSession.js",
      "filePath": "database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "summary": "db-migrate wrapper for the AddOrganizationIdToSession migration: up() runs sqls/20220324190653-AddOrganizationIdToSession-up.sql, which adds a varchar organization_id column to the session table; down() runs sqls/20220324190653-AddOrganizationIdToSession-down.sql, which drops the organization_id column from session.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "session",
        "organization"
      ],
      "complexity": "simple",
      "languageNotes": "This wrapper uses `use strict`, var declarations and string concatenation in its console.log."
    },
    {
      "id": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "summary": "db-migrate setup hook of the AddOrganizationIdToSession migration (20220324190653-AddOrganizationIdToSession): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "session"
      ],
      "complexity": "simple",
      "lineRange": [
        14,
        19
      ]
    },
    {
      "id": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "summary": "Forward step of the AddOrganizationIdToSession migration: reads sqls/20220324190653-AddOrganizationIdToSession-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which adds a varchar organization_id column to the session table.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "session"
      ],
      "complexity": "simple",
      "lineRange": [
        21,
        34
      ]
    },
    {
      "id": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "summary": "Rollback step of the AddOrganizationIdToSession migration: reads sqls/20220324190653-AddOrganizationIdToSession-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops the organization_id column from session.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "session"
      ],
      "complexity": "simple",
      "lineRange": [
        36,
        49
      ]
    },
    {
      "id": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "type": "file",
      "name": "20220411001144-addBulkPackFileName.js",
      "filePath": "database/migrations/20220411001144-addBulkPackFileName.js",
      "summary": "db-migrate wrapper for the addBulkPackFileName migration: up() runs sqls/20220411001144-addBulkPackFileName-up.sql, which adds a varchar bulk_pack_file_name column to raw_capture, wallet_registration, device_configuration and session; down() runs sqls/20220411001144-addBulkPackFileName-down.sql, which drops bulk_pack_file_name from raw_capture, wallet_registration, device_configuration and session.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "bulk-pack",
        "add-column"
      ],
      "complexity": "simple",
      "languageNotes": "This wrapper uses `use strict`, var declarations and string concatenation in its console.log."
    },
    {
      "id": "function:database/migrations/20220411001144-addBulkPackFileName.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220411001144-addBulkPackFileName.js",
      "summary": "db-migrate setup hook of the addBulkPackFileName migration (20220411001144-addBulkPackFileName): stores options.dbmigrate, its dataType, the seedLink and options.Promise in module variables before up() or down() run.",
      "tags": [
        "migration",
        "db-migrate",
        "lifecycle-hook",
        "bulk-pack"
      ],
      "complexity": "simple",
      "lineRange": [
        14,
        19
      ]
    },
    {
      "id": "function:database/migrations/20220411001144-addBulkPackFileName.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220411001144-addBulkPackFileName.js",
      "summary": "Forward step of the addBulkPackFileName migration: reads sqls/20220411001144-addBulkPackFileName-up.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which adds a varchar bulk_pack_file_name column to raw_capture, wallet_registration, device_configuration and session.",
      "tags": [
        "migration",
        "db-migrate",
        "schema-change",
        "bulk-pack"
      ],
      "complexity": "simple",
      "lineRange": [
        21,
        34
      ]
    },
    {
      "id": "function:database/migrations/20220411001144-addBulkPackFileName.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220411001144-addBulkPackFileName.js",
      "summary": "Rollback step of the addBulkPackFileName migration: reads sqls/20220411001144-addBulkPackFileName-down.sql with fs.readFile, logs the SQL text to the console, and passes it to db.runSql, which drops bulk_pack_file_name from raw_capture, wallet_registration, device_configuration and session.",
      "tags": [
        "migration",
        "db-migrate",
        "rollback",
        "bulk-pack"
      ],
      "complexity": "simple",
      "lineRange": [
        36,
        49
      ]
    },
    {
      "id": "file:database/migrations/20220601165814-change-gps-data-type.js",
      "type": "file",
      "name": "20220601165814-change-gps-data-type.js",
      "filePath": "database/migrations/20220601165814-change-gps-data-type.js",
      "summary": "db-migrate wrapper that loads sqls/20220601165814-change-gps-data-type-up.sql and sqls/20220601165814-change-gps-data-type-down.sql and runs them with db.runSql. Converts raw_capture.gps_accuracy from smallint to numeric so fractional GPS accuracy values from devices fit; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "gps-accuracy",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220601165814-change-gps-data-type.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220601165814-change-gps-data-type.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20220601165814-change-gps-data-type: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the raw_capture change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220601165814-change-gps-data-type.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220601165814-change-gps-data-type.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20220601165814-change-gps-data-type: reads sqls/20220601165814-change-gps-data-type-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE raw_capture ALTER COLUMN gps_accuracy TYPE numeric.",
      "tags": [
        "migration",
        "migrate-up",
        "gps-accuracy"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220601165814-change-gps-data-type.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220601165814-change-gps-data-type.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20220601165814-change-gps-data-type: reads sqls/20220601165814-change-gps-data-type-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE raw_capture ALTER COLUMN gps_accuracy TYPE smallint, which reverts the column to whole numbers.",
      "tags": [
        "migration",
        "migrate-down",
        "gps-accuracy"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "type": "file",
      "name": "20220618045205-add-wallet-registration-created-at.js",
      "filePath": "database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "summary": "db-migrate wrapper that loads sqls/20220618045205-add-wallet-registration-created-at-up.sql and sqls/20220618045205-add-wallet-registration-created-at-down.sql and runs them with db.runSql. Adds a created_at timestamptz column with DEFAULT now() to wallet_registration; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "wallet-registration",
        "timestamps"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20220618045205-add-wallet-registration-created-at: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the wallet_registration change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20220618045205-add-wallet-registration-created-at: reads sqls/20220618045205-add-wallet-registration-created-at-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE wallet_registration ADD created_at timestamptz DEFAULT now().",
      "tags": [
        "migration",
        "migrate-up",
        "wallet-registration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20220618045205-add-wallet-registration-created-at: reads sqls/20220618045205-add-wallet-registration-created-at-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE wallet_registration DROP COLUMN created_at.",
      "tags": [
        "migration",
        "migrate-down",
        "wallet-registration"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20221105211652-add-session-start-time.js",
      "type": "file",
      "name": "20221105211652-add-session-start-time.js",
      "filePath": "database/migrations/20221105211652-add-session-start-time.js",
      "summary": "db-migrate wrapper that loads sqls/20221105211652-add-session-start-time-up.sql and sqls/20221105211652-add-session-start-time-down.sql and runs them with db.runSql. Adds a nullable start_time timestamptz column to the session table to record when a planting session began; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "session",
        "start-time"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20221105211652-add-session-start-time.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20221105211652-add-session-start-time.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20221105211652-add-session-start-time: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the session change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20221105211652-add-session-start-time.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20221105211652-add-session-start-time.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20221105211652-add-session-start-time: reads sqls/20221105211652-add-session-start-time-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session ADD start_time timestamptz.",
      "tags": [
        "migration",
        "migrate-up",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20221105211652-add-session-start-time.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20221105211652-add-session-start-time.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20221105211652-add-session-start-time: reads sqls/20221105211652-add-session-start-time-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session DROP start_time.",
      "tags": [
        "migration",
        "migrate-down",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20230302214605-bulk-pack-version.js",
      "type": "file",
      "name": "20230302214605-bulk-pack-version.js",
      "filePath": "database/migrations/20230302214605-bulk-pack-version.js",
      "summary": "db-migrate wrapper that loads sqls/20230302214605-bulk-pack-version-up.sql and sqls/20230302214605-bulk-pack-version-down.sql and runs them with db.runSql. Adds a bulk_pack_version varchar column to session so each session records the bulk pack format (v1 or v2 in the API spec) it arrived in; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "session",
        "bulk-pack"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20230302214605-bulk-pack-version.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20230302214605-bulk-pack-version.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20230302214605-bulk-pack-version: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the session change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20230302214605-bulk-pack-version.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20230302214605-bulk-pack-version.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20230302214605-bulk-pack-version: reads sqls/20230302214605-bulk-pack-version-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session ADD bulk_pack_version varchar.",
      "tags": [
        "migration",
        "migrate-up",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20230302214605-bulk-pack-version.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20230302214605-bulk-pack-version.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20230302214605-bulk-pack-version: reads sqls/20230302214605-bulk-pack-version-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session DROP bulk_pack_version.",
      "tags": [
        "migration",
        "migrate-down",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20230906143147-create-track-table.js",
      "type": "file",
      "name": "20230906143147-create-track-table.js",
      "filePath": "database/migrations/20230906143147-create-track-table.js",
      "summary": "db-migrate wrapper that loads sqls/20230906143147-create-track-table-up.sql and sqls/20230906143147-create-track-table-down.sql and runs them with db.runSql. Creates the track table (id uuid default uuid_generate_v4(), session_id FK to session(id), locations_url, bulk_pack_file_name, created_at default now()) that stores GPS track uploads per session; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "track",
        "create-table"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20230906143147-create-track-table.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20230906143147-create-track-table.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20230906143147-create-track-table: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the track change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20230906143147-create-track-table.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20230906143147-create-track-table.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20230906143147-create-track-table: reads sqls/20230906143147-create-track-table-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs CREATE TABLE track with id, session_id REFERENCES session(id), locations_url, bulk_pack_file_name and created_at columns.",
      "tags": [
        "migration",
        "migrate-up",
        "track"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20230906143147-create-track-table.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20230906143147-create-track-table.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20230906143147-create-track-table: reads sqls/20230906143147-create-track-table-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs DROP TABLE track.",
      "tags": [
        "migration",
        "migrate-down",
        "track"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20240105095545-domainEventsNewPartition.js",
      "type": "file",
      "name": "20240105095545-domainEventsNewPartition.js",
      "filePath": "database/migrations/20240105095545-domainEventsNewPartition.js",
      "summary": "db-migrate wrapper that loads sqls/20240105095545-domainEventsNewPartition-up.sql and sqls/20240105095545-domainEventsNewPartition-down.sql and runs them with db.runSql. Creates yearly range partitions domain_event_sent_2024/2025/2026 and domain_event_handled_2024/2025/2026 on the domain_event_sent and domain_event_handled tables, which no runtime code writes at this commit; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "domain-event",
        "partitioning"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20240105095545-domainEventsNewPartition.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20240105095545-domainEventsNewPartition.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20240105095545-domainEventsNewPartition: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the domain_event change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20240105095545-domainEventsNewPartition.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20240105095545-domainEventsNewPartition.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20240105095545-domainEventsNewPartition: reads sqls/20240105095545-domainEventsNewPartition-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs six CREATE TABLE ... PARTITION OF statements for domain_event_sent and domain_event_handled covering 2024-01-01 to 2027-01-01.",
      "tags": [
        "migration",
        "migrate-up",
        "domain-event"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20240105095545-domainEventsNewPartition.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20240105095545-domainEventsNewPartition.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20240105095545-domainEventsNewPartition: reads sqls/20240105095545-domainEventsNewPartition-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs DROP TABLE for all six partitions domain_event_sent_2024..2026 and domain_event_handled_2024..2026.",
      "tags": [
        "migration",
        "migrate-down",
        "domain-event"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20240722001220-add-session-segment-table.js",
      "type": "file",
      "name": "20240722001220-add-session-segment-table.js",
      "filePath": "database/migrations/20240722001220-add-session-segment-table.js",
      "summary": "db-migrate wrapper that loads sqls/20240722001220-add-session-segment-table-up.sql and sqls/20240722001220-add-session-segment-table-down.sql and runs them with db.runSql. Creates the session_segment table (session_id FK, starts_at, ends_at, processed_at, convex_hull geometry(Polygon, 4326), created_at) and adds a nullable raw_capture.session_segment_id FK to it; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "session-segment",
        "postgis"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20240722001220-add-session-segment-table.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20240722001220-add-session-segment-table.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20240722001220-add-session-segment-table: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the session_segment change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20240722001220-add-session-segment-table.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20240722001220-add-session-segment-table.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20240722001220-add-session-segment-table: reads sqls/20240722001220-add-session-segment-table-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs CREATE TABLE session_segment with a PostGIS convex_hull polygon, then ALTER TABLE raw_capture ADD COLUMN session_segment_id REFERENCES session_segment(id).",
      "tags": [
        "migration",
        "migrate-up",
        "session-segment"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20240722001220-add-session-segment-table.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20240722001220-add-session-segment-table.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20240722001220-add-session-segment-table: reads sqls/20240722001220-add-session-segment-table-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE raw_capture DROP COLUMN session_segment_id, then DROP TABLE session_segment.",
      "tags": [
        "migration",
        "migrate-down",
        "session-segment"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20241122090004-add-columns-to-session-table.js",
      "type": "file",
      "name": "20241122090004-add-columns-to-session-table.js",
      "filePath": "database/migrations/20241122090004-add-columns-to-session-table.js",
      "summary": "db-migrate wrapper that loads sqls/20241122090004-add-columns-to-session-table-up.sql and sqls/20241122090004-add-columns-to-session-table-down.sql and runs them with db.runSql. Adds a nullable processed_at timestamptz column to the session table to mark when a session was processed; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "session",
        "processed-at"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20241122090004-add-columns-to-session-table.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20241122090004-add-columns-to-session-table.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20241122090004-add-columns-to-session-table: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the session change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20241122090004-add-columns-to-session-table.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20241122090004-add-columns-to-session-table.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20241122090004-add-columns-to-session-table: reads sqls/20241122090004-add-columns-to-session-table-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session ADD COLUMN processed_at timestamptz.",
      "tags": [
        "migration",
        "migrate-up",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20241122090004-add-columns-to-session-table.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20241122090004-add-columns-to-session-table.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20241122090004-add-columns-to-session-table: reads sqls/20241122090004-add-columns-to-session-table-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session DROP COLUMN processed_at.",
      "tags": [
        "migration",
        "migrate-down",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "type": "file",
      "name": "20241122090641-remove-session-segments-time-defaults.js",
      "filePath": "database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "summary": "db-migrate wrapper that loads sqls/20241122090641-remove-session-segments-time-defaults-up.sql and sqls/20241122090641-remove-session-segments-time-defaults-down.sql and runs them with db.runSql. Removes the DEFAULT now() from session_segment.starts_at, ends_at and processed_at so callers must supply real segment times; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "session-segment",
        "defaults"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20241122090641-remove-session-segments-time-defaults: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the session_segment change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20241122090641-remove-session-segments-time-defaults: reads sqls/20241122090641-remove-session-segments-time-defaults-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session_segment ALTER COLUMN starts_at, ends_at and processed_at DROP DEFAULT.",
      "tags": [
        "migration",
        "migrate-up",
        "session-segment"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20241122090641-remove-session-segments-time-defaults: reads sqls/20241122090641-remove-session-segments-time-defaults-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE session_segment ALTER COLUMN starts_at, ends_at and processed_at SET DEFAULT now().",
      "tags": [
        "migration",
        "migrate-down",
        "session-segment"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/migrations/20250527074027-add-root-capture-columns.js",
      "type": "file",
      "name": "20250527074027-add-root-capture-columns.js",
      "filePath": "database/migrations/20250527074027-add-root-capture-columns.js",
      "summary": "db-migrate wrapper that loads sqls/20250527074027-add-root-capture-columns-up.sql and sqls/20250527074027-add-root-capture-columns-down.sql and runs them with db.runSql. Adds raw_capture.root (boolean) and raw_capture.root_check_processed_at (timestamptz) to flag root captures and record when the root check ran; down reverts it.",
      "tags": [
        "migration",
        "db-migrate",
        "database",
        "raw-capture",
        "root-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20250527074027-add-root-capture-columns.js:setup",
      "type": "function",
      "name": "setup",
      "filePath": "database/migrations/20250527074027-add-root-capture-columns.js",
      "lineRange": [
        14,
        19
      ],
      "summary": "db-migrate setup hook of migration 20250527074027-add-root-capture-columns: stores options.dbmigrate, its dataType, the seed link and options.Promise in module variables before the raw_capture change runs.",
      "tags": [
        "db-migrate",
        "setup-hook",
        "migration"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20250527074027-add-root-capture-columns.js:up",
      "type": "function",
      "name": "up",
      "filePath": "database/migrations/20250527074027-add-root-capture-columns.js",
      "lineRange": [
        21,
        34
      ],
      "summary": "Forward step of migration 20250527074027-add-root-capture-columns: reads sqls/20250527074027-add-root-capture-columns-up.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE raw_capture ADD COLUMN root boolean, ADD COLUMN root_check_processed_at timestamptz.",
      "tags": [
        "migration",
        "migrate-up",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "function:database/migrations/20250527074027-add-root-capture-columns.js:down",
      "type": "function",
      "name": "down",
      "filePath": "database/migrations/20250527074027-add-root-capture-columns.js",
      "lineRange": [
        36,
        49
      ],
      "summary": "Rollback step of migration 20250527074027-add-root-capture-columns: reads sqls/20250527074027-add-root-capture-columns-down.sql with fs.readFile, logs it, and executes it via db.runSql, which runs ALTER TABLE raw_capture DROP COLUMN root, DROP COLUMN root_check_processed_at.",
      "tags": [
        "migration",
        "migrate-down",
        "raw-capture"
      ],
      "complexity": "simple"
    },
    {
      "id": "table:database/seed.sql",
      "type": "table",
      "name": "seed.sql",
      "filePath": "database/seed.sql",
      "summary": "Empty placeholder SQL seed file in database/ with zero lines; no script or package.json command loads it, since dev seeding runs through knex seeds in database/seeds.",
      "tags": [
        "database",
        "seed-data",
        "placeholder"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:database/seeds/data/duplicate_raw_captures.js",
      "type": "file",
      "name": "duplicate_raw_captures.js",
      "filePath": "database/seeds/data/duplicate_raw_captures.js",
      "summary": "Generated fixture array of 1407 raw capture records (image_url on treetracker-production-images S3, lat, lon, gps_accuracy, note, captured_at) from 2020 to 2022, clustered near lat -3/lon 36 and lat 8/lon -13 to exercise duplicate capture detection; no seed file in database/seeds requires it.",
      "tags": [
        "seed-data",
        "fixture",
        "raw-capture",
        "duplicate-detection"
      ],
      "complexity": "complex",
      "languageNotes": "About 480 later records carry swapped values (gps_accuracy is an empty string and note is the number 2022), so consumers must not assume field types."
    },
    {
      "id": "document:docs/adr/0001-organization-by-session-bridge.md",
      "type": "document",
      "name": "0001-organization-by-session-bridge.md",
      "filePath": "docs/adr/0001-organization-by-session-bridge.md",
      "summary": "Accepted ADR (2022-03-15, Zaven and Seb) that bridges Android v2.0 per-session organization strings by adding an organization_id column to field_data.session that operators fill by hand, then copy to legacy trees.planting_organization_id until Android v2.2 sends real organization keys.",
      "tags": [
        "documentation",
        "adr",
        "organization",
        "session"
      ],
      "complexity": "simple"
    },
    {
      "id": "config:docs/api/spec/api.json",
      "type": "config",
      "name": "api.json",
      "filePath": "docs/api/spec/api.json",
      "summary": "Early OpenAPI 3.0.3 draft (title API, version 1.0) for /raw-captures (GET with status, limit default 1000, offset, grower_account_id; POST), /raw-captures/raw_capture_id and its /reject PATCH (rejection_reason, organization_id), /session, /device-configuration and /wallet-registration list, create and get-by-id routes, with schemas Raw-Capture, Session, Device-Configuration and Wallet-Registration.",
      "tags": [
        "api-schema",
        "openapi",
        "documentation",
        "legacy-spec"
      ],
      "complexity": "complex",
      "languageNotes": "Path params use Express-style :session_id and literal raw_capture_id segments instead of OpenAPI {param} templates, so the draft does not validate as real path templates."
    },
    {
      "id": "config:docs/api/spec/treetracker-field-data.yaml",
      "type": "config",
      "name": "treetracker-field-data.yaml",
      "filePath": "docs/api/spec/treetracker-field-data.yaml",
      "summary": "OpenAPI 3.0.0 spec 'Treetracker Field Data API' v1.12.0 for https://{dev|test|prod}-k8s.treetracker.org/field-data covering GET/POST /raw-captures, GET /raw-captures/{raw_capture_id}, PATCH /raw-captures/{raw_capture_id}/reject, /session, /device-configuration, /wallet-registration and /track (each with list paged by limit default 100, offset and bulk_pack_file_name, plus get by id), with schemas RawCapture, RawCaptureStatus (unprocessed, approved, rejected), Session, BulkPackVersion (v1, v2), DeviceConfiguration, WalletRegistration and Track, and 404/409/415/422 error responses.",
      "tags": [
        "api-schema",
        "openapi",
        "documentation",
        "rest-api"
      ],
      "complexity": "complex",
      "languageNotes": "The GET /track 200 schema names its array 'sessions' while the TrackGet example uses 'tracks', so the schema and example disagree."
    },
    {
      "id": "file:knexfile.js",
      "type": "file",
      "name": "knexfile.js",
      "filePath": "knexfile.js",
      "summary": "Knex CLI config used by npm run seed-dev and seed-usertest: loads .env.<NODE_ENV>, requires DATABASE_URL_SEEDER to start with postgresql:/ (throws otherwise), and defines development and usertest pg profiles with searchPath [DATABASE_SCHEMA, public], pool 1 to 10, seeds directory database/seeds, and debug when NODE_LOG_LEVEL is debug.",
      "tags": [
        "configuration",
        "knex",
        "database",
        "seed-data"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:scripts/setup-dev-database-passwords.sh",
      "type": "file",
      "name": "setup-dev-database-passwords.sh",
      "filePath": "scripts/setup-dev-database-passwords.sh",
      "summary": "Developer bootstrap script from the README: runs doctl auth init, sources scripts/vars.sh for SCHEMA, fetches the s_<schema>, m_<schema> and integration user passwords from a DigitalOcean managed database, and fills {SCHEMA}/{PASSWORD} placeholders in .env.test, .env.development and database/database.json copied from their example files.",
      "tags": [
        "script",
        "dev-setup",
        "digitalocean",
        "credentials"
      ],
      "complexity": "simple",
      "languageNotes": "Uses BSD/macOS sed -i '' syntax, so it fails with GNU sed on Linux."
    },
    {
      "id": "file:scripts/vars.sh",
      "type": "file",
      "name": "vars.sh",
      "filePath": "scripts/vars.sh",
      "summary": "One-line shell variables file that sets SCHEMA=field_data, sourced by setup-dev-database-passwords.sh to build the s_field_data and m_field_data database user names.",
      "tags": [
        "script",
        "configuration",
        "database-schema"
      ],
      "complexity": "simple"
    },
    {
      "id": "file:seed.spec.js",
      "type": "file",
      "name": "seed.spec.js",
      "filePath": "seed.spec.js",
      "summary": "Stale root-level mocha test that runs seed.clear()/seed.seed() and checks that the seeded token row has tree_id equal to seed.tree.id and entity_id equal to seed.wallet.id; it requires ./seed and ../server/database modules that do not exist in this repo and no npm test script runs it.",
      "tags": [
        "test",
        "seed-data",
        "stale",
        "mocha"
      ],
      "complexity": "simple"
    }
  ],
  "edges": [
    {
      "source": "file:__tests__/device-configuration-api.spec.js",
      "target": "file:__tests__/clear-db.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/device-configuration-api.spec.js",
      "target": "file:server/app.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/device-configuration-api.spec.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/insert-test-capture.js",
      "target": "file:__tests__/device-configuration-api.spec.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/insert-test-capture.js",
      "target": "file:__tests__/session-api.spec.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/insert-test-capture.js",
      "target": "file:__tests__/wallet-registration-api.spec.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/legacy-table-creation.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/raw-capture-api.spec.js",
      "target": "file:__tests__/clear-db.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/raw-capture-api.spec.js",
      "target": "file:__tests__/insert-test-capture.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/raw-capture-api.spec.js",
      "target": "file:server/app.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/raw-capture-api.spec.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/raw-capture-api.spec.js",
      "target": "file:server/services/LegacyAPIService.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/session-api.spec.js",
      "target": "file:__tests__/clear-db.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/session-api.spec.js",
      "target": "file:__tests__/device-configuration-api.spec.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/session-api.spec.js",
      "target": "file:__tests__/wallet-registration-api.spec.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/session-api.spec.js",
      "target": "file:server/app.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/session-api.spec.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/track-api.spec.js",
      "target": "file:__tests__/clear-db.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/track-api.spec.js",
      "target": "file:__tests__/insert-test-capture.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/track-api.spec.js",
      "target": "file:__tests__/session-api.spec.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/track-api.spec.js",
      "target": "file:server/app.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/track-api.spec.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/wallet-registration-api.spec.js",
      "target": "file:__tests__/clear-db.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/wallet-registration-api.spec.js",
      "target": "file:server/app.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/wallet-registration-api.spec.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/app.js",
      "target": "file:config/config.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/app.js",
      "target": "file:server/handlers/swaggerDoc.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/app.js",
      "target": "file:server/routes/index.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/app.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/app.js",
      "target": "file:server/utils/utils.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/app.spec.js",
      "target": "file:server/app.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/infra/database/knex.js",
      "target": "file:config/config.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/server.js",
      "target": "file:server/app.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/server.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/server.js",
      "target": "file:server/setup.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:__tests__/clear-db.js",
      "target": "function:__tests__/clear-db.js:clearDB",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:__tests__/insert-test-capture.js",
      "target": "function:__tests__/insert-test-capture.js:insertTestCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/infra/database/knex.js",
      "target": "function:server/infra/database/knex.js:connectionObject",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:__tests__/clear-db.js",
      "target": "function:__tests__/clear-db.js:clearDB",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/insert-test-capture.js",
      "target": "function:__tests__/insert-test-capture.js:insertTestCapture",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/device-configuration-api.spec.js",
      "target": "function:__tests__/clear-db.js:clearDB",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/raw-capture-api.spec.js",
      "target": "function:__tests__/clear-db.js:clearDB",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/session-api.spec.js",
      "target": "function:__tests__/clear-db.js:clearDB",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/track-api.spec.js",
      "target": "function:__tests__/clear-db.js:clearDB",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/wallet-registration-api.spec.js",
      "target": "function:__tests__/clear-db.js:clearDB",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/raw-capture-api.spec.js",
      "target": "function:__tests__/insert-test-capture.js:insertTestCapture",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:__tests__/track-api.spec.js",
      "target": "function:__tests__/insert-test-capture.js:insertTestCapture",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/app.js",
      "target": "file:__tests__/device-configuration-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/app.js",
      "target": "file:__tests__/raw-capture-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/app.js",
      "target": "file:__tests__/session-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/app.js",
      "target": "file:__tests__/track-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/app.js",
      "target": "file:__tests__/wallet-registration-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/app.js",
      "target": "file:server/app.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/services/LegacyAPIService.js",
      "target": "file:__tests__/raw-capture-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/server.js",
      "target": "file:server/setup.js",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "class:server/models/LegacyTree.js:LegacyTree",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "class:server/models/LegacyTree.js:LegacyTree",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "function:server/models/LegacyTree.js:legacyTree",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "function:server/models/LegacyTree.js:createTreesInLegacyDB",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/RawCapture.js",
      "target": "class:server/models/RawCapture.js:RawCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/RawCapture.js",
      "target": "class:server/models/RawCapture.js:RawCapture",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/RawCapture.js",
      "target": "function:server/models/RawCapture.js:RawCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/RawCapture.js",
      "target": "function:server/models/RawCapture.js:createRawCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/RawCapture.js",
      "target": "function:server/models/RawCapture.js:rejectRawCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/SessionModel.js",
      "target": "class:server/models/SessionModel.js:SessionModel",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/SessionModel.js",
      "target": "class:server/models/SessionModel.js:SessionModel",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/SessionModel.js",
      "target": "function:server/models/SessionModel.js:SessionModel",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/SessionModel.js",
      "target": "function:server/models/SessionModel.js:createSession",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "function:server/repositories/BaseRepository.js:getById",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "function:server/repositories/BaseRepository.js:getByFilter",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "function:server/repositories/BaseRepository.js:countByFilter",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "function:server/repositories/BaseRepository.js:update",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "function:server/repositories/BaseRepository.js:create",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/Legacy/PlanterRepository.js",
      "target": "class:server/repositories/Legacy/PlanterRepository.js:LegacyPlanterRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/Legacy/PlanterRepository.js",
      "target": "class:server/repositories/Legacy/PlanterRepository.js:LegacyPlanterRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/Legacy/TreeAttributeRepository.js",
      "target": "class:server/repositories/Legacy/TreeAttributeRepository.js:LegacyTreeAttributeRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/Legacy/TreeAttributeRepository.js",
      "target": "class:server/repositories/Legacy/TreeAttributeRepository.js:LegacyTreeAttributeRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/Legacy/TreeRepository.js",
      "target": "class:server/repositories/Legacy/TreeRepository.js:LegacyTreeRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/Legacy/TreeRepository.js",
      "target": "class:server/repositories/Legacy/TreeRepository.js:LegacyTreeRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/Legacy/TreeRepository.js",
      "target": "function:server/repositories/Legacy/TreeRepository.js:create",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/RawCaptureRepository.js",
      "target": "class:server/repositories/RawCaptureRepository.js:RawCaptureRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/RawCaptureRepository.js",
      "target": "class:server/repositories/RawCaptureRepository.js:RawCaptureRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/RawCaptureRepository.js",
      "target": "function:server/repositories/RawCaptureRepository.js:getByFilter",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/RawCaptureRepository.js",
      "target": "function:server/repositories/RawCaptureRepository.js:add",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/SessionRepository.js",
      "target": "class:server/repositories/SessionRepository.js:SessionRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/SessionRepository.js",
      "target": "class:server/repositories/SessionRepository.js:SessionRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/SessionRepository.js",
      "target": "function:server/repositories/SessionRepository.js:getSessions",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/SessionRepository.js",
      "target": "function:server/repositories/SessionRepository.js:countByFilter",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/LegacyAPIService.js",
      "target": "function:server/services/LegacyAPIService.js:rejectLegacyTree",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/LegacyAPIService.js",
      "target": "function:server/services/LegacyAPIService.js:rejectLegacyTree",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "class:server/services/RawCaptureService.js:RawCaptureService",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "class:server/services/RawCaptureService.js:RawCaptureService",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "function:server/services/RawCaptureService.js:createRawCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "function:server/services/RawCaptureService.js:rejectRawCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/utils/HttpError.js",
      "target": "class:server/utils/HttpError.js:HttpError",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/utils/HttpError.js",
      "target": "class:server/utils/HttpError.js:HttpError",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "file:server/repositories/Legacy/PlanterRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "file:server/repositories/Legacy/TreeAttributeRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "file:server/repositories/Legacy/TreeRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/LegacyTree.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/RawCapture.js",
      "target": "file:server/repositories/RawCaptureRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/SessionModel.js",
      "target": "file:server/repositories/SessionRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/Legacy/PlanterRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/Legacy/TreeAttributeRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/Legacy/TreeRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/RawCaptureRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/SessionRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:server/infra/database/Sessions/LegacySession.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:server/infra/database/Sessions/Session.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:server/models/LegacyTree.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:server/models/RawCapture.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:server/models/SessionModel.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:server/services/LegacyAPIService.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "class:server/repositories/Legacy/PlanterRepository.js:LegacyPlanterRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "class:server/repositories/Legacy/TreeAttributeRepository.js:LegacyTreeAttributeRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "class:server/repositories/Legacy/TreeRepository.js:LegacyTreeRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "class:server/repositories/RawCaptureRepository.js:RawCaptureRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "class:server/repositories/SessionRepository.js:SessionRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "function:server/models/LegacyTree.js:createTreesInLegacyDB",
      "target": "function:server/repositories/Legacy/TreeRepository.js:create",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/models/LegacyTree.js:createTreesInLegacyDB",
      "target": "function:server/repositories/BaseRepository.js:getByFilter",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/models/LegacyTree.js:createTreesInLegacyDB",
      "target": "function:server/repositories/BaseRepository.js:create",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/models/RawCapture.js:createRawCapture",
      "target": "function:server/repositories/BaseRepository.js:create",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/models/RawCapture.js:rejectRawCapture",
      "target": "function:server/repositories/BaseRepository.js:update",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/models/SessionModel.js:createSession",
      "target": "function:server/repositories/BaseRepository.js:create",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/services/RawCaptureService.js:createRawCapture",
      "target": "function:server/models/LegacyTree.js:legacyTree",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/services/RawCaptureService.js:createRawCapture",
      "target": "function:server/models/LegacyTree.js:createTreesInLegacyDB",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/services/RawCaptureService.js:createRawCapture",
      "target": "function:server/models/RawCapture.js:createRawCapture",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/services/RawCaptureService.js:rejectRawCapture",
      "target": "function:server/services/LegacyAPIService.js:rejectLegacyTree",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/services/RawCaptureService.js:rejectRawCapture",
      "target": "function:server/models/RawCapture.js:rejectRawCapture",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/BaseRepository.js",
      "target": "file:server/repositories/BaseRepository.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/services/RawCaptureService.js",
      "target": "file:__tests__/raw-capture-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCapturePost",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCapturePost",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureRejectPatch",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureRejectPatch",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureSingleGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureSingleGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureGet",
      "target": "function:server/utils/helper.js:getFilterAndLimitOptions",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureGet",
      "target": "function:server/utils/helper.js:generatePrevAndNext",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionPost",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionPost",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionSingleGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionSingleGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/sessionHandler/index.js:sessionGet",
      "target": "function:server/utils/helper.js:getFilterAndLimitOptions",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/sessionHandler/index.js:sessionGet",
      "target": "function:server/utils/helper.js:generatePrevAndNext",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/sessionHandler/index.js:sessionPost",
      "target": "function:server/services/SessionService.js:createSession",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationPost",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationPost",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationSingleGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationSingleGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationGet",
      "target": "function:server/utils/helper.js:getFilterAndLimitOptions",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationGet",
      "target": "function:server/utils/helper.js:generatePrevAndNext",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/routes/deviceConfigurationRoutes.js",
      "target": "function:server/utils/utils.js:handlerWrapper",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "function:server/utils/utils.js:handlerWrapper",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/sessionRoutes.js",
      "target": "function:server/utils/utils.js:handlerWrapper",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/walletRegistrationRoutes.js",
      "target": "function:server/utils/utils.js:handlerWrapper",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCapturePost",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureRejectPatch",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "function:server/handlers/rawCaptureHandler/index.js:rawCaptureSingleGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/sessionRoutes.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionPost",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/sessionRoutes.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/sessionRoutes.js",
      "target": "function:server/handlers/sessionHandler/index.js:sessionSingleGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/walletRegistrationRoutes.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationPost",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/walletRegistrationRoutes.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/walletRegistrationRoutes.js",
      "target": "function:server/handlers/walletRegistrationHandler/index.js:walletRegistrationSingleGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/services/SessionService.js",
      "target": "class:server/services/SessionService.js:SessionService",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/SessionService.js",
      "target": "class:server/services/SessionService.js:SessionService",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/services/SessionService.js",
      "target": "function:server/services/SessionService.js:addTableNames",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/SessionService.js",
      "target": "function:server/services/SessionService.js:createSession",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/utils/helper.js",
      "target": "function:server/utils/helper.js:generatePrevAndNext",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/utils/helper.js",
      "target": "function:server/utils/helper.js:generatePrevAndNext",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/utils/helper.js",
      "target": "function:server/utils/helper.js:getFilterAndLimitOptions",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/utils/helper.js",
      "target": "function:server/utils/helper.js:getFilterAndLimitOptions",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/utils/utils.js",
      "target": "function:server/utils/utils.js:handlerWrapper",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/utils/utils.js",
      "target": "function:server/utils/utils.js:handlerWrapper",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/utils/utils.js",
      "target": "function:server/utils/utils.js:errorHandler",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/utils/utils.js",
      "target": "function:server/utils/utils.js:errorHandler",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/utils/utils.js:errorHandler",
      "target": "file:server/utils/HttpError.js",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "file:server/handlers/rawCaptureHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "file:server/services/RawCaptureService.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "file:server/utils/helper.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "file:server/handlers/sessionHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "file:server/services/SessionService.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "file:server/utils/helper.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "file:server/handlers/walletRegistrationHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "file:server/services/WalletRegistrationService.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "file:server/utils/helper.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/deviceConfigurationRoutes.js",
      "target": "file:server/handlers/deviceConfigurationHandler/index.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/deviceConfigurationRoutes.js",
      "target": "file:server/utils/utils.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/index.js",
      "target": "file:server/routes/deviceConfigurationRoutes.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/index.js",
      "target": "file:server/routes/rawCaptureRoutes.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/index.js",
      "target": "file:server/routes/sessionRoutes.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/index.js",
      "target": "file:server/routes/trackRoutes.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/index.js",
      "target": "file:server/routes/walletRegistrationRoutes.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "file:server/handlers/rawCaptureHandler/index.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "file:server/utils/utils.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/sessionRoutes.js",
      "target": "file:server/handlers/sessionHandler/index.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/sessionRoutes.js",
      "target": "file:server/utils/utils.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/walletRegistrationRoutes.js",
      "target": "file:server/handlers/walletRegistrationHandler/index.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/walletRegistrationRoutes.js",
      "target": "file:server/utils/utils.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/SessionService.js",
      "target": "file:server/infra/database/Sessions/Session.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/SessionService.js",
      "target": "file:server/models/SessionModel.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/utils/utils.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/00_job_database_cleaner.js",
      "target": "function:database/seeds/00_job_database_cleaner.js:seed",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/seeds/00_job_database_cleaner.js",
      "target": "function:database/seeds/00_job_database_cleaner.js:seed",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/seeds/01_table_device_configuration.js",
      "target": "function:database/seeds/01_table_device_configuration.js:seed",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/seeds/01_table_device_configuration.js",
      "target": "function:database/seeds/01_table_device_configuration.js:seed",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/seeds/02_table_wallet_registration.js",
      "target": "function:database/seeds/02_table_wallet_registration.js:seed",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/seeds/02_table_wallet_registration.js",
      "target": "function:database/seeds/02_table_wallet_registration.js:seed",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/seeds/03_table_session.js",
      "target": "function:database/seeds/03_table_session.js:seed",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/seeds/03_table_session.js",
      "target": "function:database/seeds/03_table_session.js:seed",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/seeds/04_table_raw_capture.js",
      "target": "function:database/seeds/04_table_raw_capture.js:createRawCapture",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/seeds/04_table_raw_capture.js",
      "target": "function:database/seeds/04_table_raw_capture.js:seed",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/seeds/04_table_raw_capture.js",
      "target": "function:database/seeds/04_table_raw_capture.js:seed",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/seeds/04_table_raw_capture.js:seed",
      "target": "function:database/seeds/04_table_raw_capture.js:createRawCapture",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/seeds/00_job_database_cleaner.js",
      "target": "file:database/seeds/data/wallet_registration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/01_table_device_configuration.js",
      "target": "file:database/seeds/data/device_configuration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/02_table_wallet_registration.js",
      "target": "file:database/seeds/data/wallet_registration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/03_table_session.js",
      "target": "file:database/seeds/data/device_configuration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/03_table_session.js",
      "target": "file:database/seeds/data/session.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/03_table_session.js",
      "target": "file:database/seeds/data/wallet_registration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/04_table_raw_capture.js",
      "target": "file:database/seeds/data/capture_match_raw_captures.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:database/seeds/04_table_raw_capture.js",
      "target": "file:database/seeds/data/wallet_registration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/docs.js",
      "target": "file:server/handlers/rawCaptureHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/sessionHandler/docs.js",
      "target": "file:server/handlers/sessionHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/swaggerDoc.js",
      "target": "file:server/handlers/deviceConfigurationHandler/docs.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/swaggerDoc.js",
      "target": "file:server/handlers/rawCaptureHandler/docs.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/swaggerDoc.js",
      "target": "file:server/handlers/sessionHandler/docs.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/swaggerDoc.js",
      "target": "file:server/handlers/tracksHandler/docs.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/swaggerDoc.js",
      "target": "file:server/handlers/walletRegistrationHandler/docs.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/docs.js",
      "target": "file:server/handlers/walletRegistrationHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackPost",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackPost",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackSingleGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackSingleGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/Track.js",
      "target": "class:server/models/Track.js:Track",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/Track.js",
      "target": "class:server/models/Track.js:Track",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/TrackRepository.js",
      "target": "class:server/repositories/TrackRepository.js:TrackRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/TrackRepository.js",
      "target": "class:server/repositories/TrackRepository.js:TrackRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/services/TrackService.js",
      "target": "class:server/services/TrackService.js:TrackService",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/TrackService.js",
      "target": "class:server/services/TrackService.js:TrackService",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/tracksHandler/docs.js",
      "target": "file:server/handlers/tracksHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "file:server/handlers/tracksHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "file:server/services/TrackService.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "file:server/utils/helper.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/Track.js",
      "target": "file:server/repositories/TrackRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/TrackRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/trackRoutes.js",
      "target": "file:server/handlers/tracksHandler/index.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/routes/trackRoutes.js",
      "target": "file:server/utils/utils.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/TrackService.js",
      "target": "file:server/infra/database/Sessions/Session.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/TrackService.js",
      "target": "file:server/models/Track.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "function:server/handlers/tracksHandler/index.js:trackPost",
      "target": "class:server/services/TrackService.js:TrackService",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/tracksHandler/index.js:trackGet",
      "target": "class:server/services/TrackService.js:TrackService",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/tracksHandler/index.js:trackSingleGet",
      "target": "class:server/services/TrackService.js:TrackService",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "class:server/services/TrackService.js:TrackService",
      "target": "class:server/models/Track.js:Track",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "class:server/models/Track.js:Track",
      "target": "class:server/repositories/TrackRepository.js:TrackRepository",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/routes/trackRoutes.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackPost",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/trackRoutes.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/routes/trackRoutes.js",
      "target": "function:server/handlers/tracksHandler/index.js:trackSingleGet",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/infra/database/Sessions/LegacySession.js",
      "target": "file:server/infra/database/Sessions/BaseSession.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/infra/database/Sessions/LegacySession.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/infra/database/Sessions/Session.js",
      "target": "file:server/infra/database/Sessions/BaseSession.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/infra/database/Sessions/Session.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/WalletRegistration.js",
      "target": "file:server/repositories/WalletRegistrationRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/BaseRepository.spec.js",
      "target": "file:server/infra/database/Sessions/Session.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/BaseRepository.spec.js",
      "target": "file:server/infra/database/knex.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/BaseRepository.spec.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/WalletRegistrationRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/WalletRegistrationService.js",
      "target": "file:server/infra/database/Sessions/Session.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/WalletRegistrationService.js",
      "target": "file:server/models/WalletRegistration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/infra/database/Sessions/BaseSession.js",
      "target": "class:server/infra/database/Sessions/BaseSession.js:BaseSession",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/infra/database/Sessions/BaseSession.js",
      "target": "class:server/infra/database/Sessions/BaseSession.js:BaseSession",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/infra/database/Sessions/LegacySession.js",
      "target": "class:server/infra/database/Sessions/LegacySession.js:LegacySession",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/infra/database/Sessions/LegacySession.js",
      "target": "class:server/infra/database/Sessions/LegacySession.js:LegacySession",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/infra/database/Sessions/Session.js",
      "target": "class:server/infra/database/Sessions/Session.js:Session",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/infra/database/Sessions/Session.js",
      "target": "class:server/infra/database/Sessions/Session.js:Session",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/WalletRegistration.js",
      "target": "class:server/models/WalletRegistration.js:WalletRegistration",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/WalletRegistration.js",
      "target": "class:server/models/WalletRegistration.js:WalletRegistration",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/WalletRegistration.js",
      "target": "function:server/models/WalletRegistration.js:WalletRegistration",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/WalletRegistration.js",
      "target": "function:server/models/WalletRegistration.js:createWalletRegistration",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/WalletRegistrationRepository.js",
      "target": "class:server/repositories/WalletRegistrationRepository.js:WalletRegistrationRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/WalletRegistrationRepository.js",
      "target": "class:server/repositories/WalletRegistrationRepository.js:WalletRegistrationRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/services/WalletRegistrationService.js",
      "target": "class:server/services/WalletRegistrationService.js:WalletRegistrationService",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/WalletRegistrationService.js",
      "target": "class:server/services/WalletRegistrationService.js:WalletRegistrationService",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/services/WalletRegistrationService.js",
      "target": "function:server/services/WalletRegistrationService.js:createWalletRegistration",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "class:server/infra/database/Sessions/LegacySession.js:LegacySession",
      "target": "class:server/infra/database/Sessions/BaseSession.js:BaseSession",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "class:server/infra/database/Sessions/Session.js:Session",
      "target": "class:server/infra/database/Sessions/BaseSession.js:BaseSession",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "function:server/services/WalletRegistrationService.js:createWalletRegistration",
      "target": "function:server/models/WalletRegistration.js:createWalletRegistration",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationPost",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationPost",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationSingleGet",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationSingleGet",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/models/DeviceConfiguration.js",
      "target": "class:server/models/DeviceConfiguration.js:DeviceConfiguration",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/models/DeviceConfiguration.js",
      "target": "class:server/models/DeviceConfiguration.js:DeviceConfiguration",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/DeviceConfigurationRepository.js",
      "target": "class:server/repositories/DeviceConfigurationRepository.js:DeviceConfigurationRepository",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/repositories/DeviceConfigurationRepository.js",
      "target": "class:server/repositories/DeviceConfigurationRepository.js:DeviceConfigurationRepository",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/services/DeviceConfigurationService.js",
      "target": "class:server/services/DeviceConfigurationService.js:DeviceConfigurationService",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:server/services/DeviceConfigurationService.js",
      "target": "class:server/services/DeviceConfigurationService.js:DeviceConfigurationService",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/docs.js",
      "target": "file:server/handlers/deviceConfigurationHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "file:server/handlers/deviceConfigurationHandler/schemas.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "file:server/services/DeviceConfigurationService.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "file:server/utils/HttpError.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "file:server/utils/helper.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/models/DeviceConfiguration.js",
      "target": "file:server/repositories/DeviceConfigurationRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/repositories/DeviceConfigurationRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/DeviceConfigurationService.js",
      "target": "file:server/infra/database/Sessions/Session.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/services/DeviceConfigurationService.js",
      "target": "file:server/models/DeviceConfiguration.js",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationPost",
      "target": "class:server/services/DeviceConfigurationService.js:DeviceConfigurationService",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationGet",
      "target": "class:server/services/DeviceConfigurationService.js:DeviceConfigurationService",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:server/handlers/deviceConfigurationHandler/index.js:deviceConfigurationSingleGet",
      "target": "class:server/services/DeviceConfigurationService.js:DeviceConfigurationService",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "class:server/services/DeviceConfigurationService.js:DeviceConfigurationService",
      "target": "class:server/models/DeviceConfiguration.js:DeviceConfiguration",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "class:server/models/DeviceConfiguration.js:DeviceConfiguration",
      "target": "class:server/repositories/DeviceConfigurationRepository.js:DeviceConfigurationRepository",
      "type": "calls",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:server/repositories/DeviceConfigurationRepository.js",
      "target": "file:server/repositories/BaseRepository.js",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/docs.js",
      "target": "file:server/handlers/deviceConfigurationHandler/index.js",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "service:Dockerfile",
      "target": "service:Dockerfile:node",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "service:Dockerfile",
      "target": "file:server/server.js",
      "type": "deploys",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "service:Dockerfile",
      "target": "config:package.json",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "service:.dockerignore",
      "target": "service:Dockerfile",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/pull-request-ci.yml",
      "target": "config:package.json",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/pull-request-ci.yml",
      "target": "file:__tests__/raw-capture-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/pull-request-ci.yml",
      "target": "file:__tests__/session-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/pull-request-ci.yml",
      "target": "file:__tests__/track-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/pull-request-ci.yml",
      "target": "file:__tests__/device-configuration-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/pull-request-ci.yml",
      "target": "file:__tests__/wallet-registration-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/pull-request-ci.yml",
      "target": "file:server/repositories/BaseRepository.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "config:package.json",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "file:__tests__/raw-capture-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "file:__tests__/session-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "file:__tests__/track-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "file:__tests__/device-configuration-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "file:__tests__/wallet-registration-api.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "file:server/repositories/BaseRepository.spec.js",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "service:Dockerfile",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "file:.releaserc",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "config:deployment/overlays/development/kustomization.yaml",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-deploy-dev.yml",
      "target": "config:deployment/overlays/development/kustomization.yaml",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-deploy-prod.yml",
      "target": "config:deployment/overlays/production/kustomization.yaml",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-deploy-test.yml",
      "target": "config:deployment/overlays/test/kustomization.yaml",
      "type": "triggers",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-deploy-dev.yml",
      "target": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-deploy-test.yml",
      "target": "pipeline:.github/workflows/treetracker-api-deploy-prod.yml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "target": "pipeline:.github/workflows/pull-request-ci.yml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:.env.example",
      "target": "file:config/config.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:.env.example",
      "target": "file:server/infra/database/knex.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:.env.test.example",
      "target": "file:knexfile.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:.env.test.example",
      "target": "file:server/infra/database/knex.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:.env.test.example",
      "target": "file:server/setup.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:.prettierrc.json",
      "target": "config:package.json",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "document:README.md",
      "target": "file:server/server.js",
      "type": "documents",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "document:README.md",
      "target": "file:scripts/setup-dev-database-passwords.sh",
      "type": "documents",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "document:README.md",
      "target": "config:.env.example",
      "type": "documents",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "document:README.md",
      "target": "config:package.json",
      "type": "documents",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "document:CHANGELOG.md",
      "target": "config:package.json",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "document:CHANGELOG.md",
      "target": "document:docs/adr/0001-organization-by-session-bridge.md",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "document:CHANGELOG.md",
      "target": "file:server/services/LegacyAPIService.js",
      "type": "documents",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:api.json",
      "target": "endpoint:api.json:GET /captures",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "config:api.json",
      "target": "config:docs/api/spec/api.json",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "endpoint:api.json:GET /captures",
      "target": "file:server/routes/rawCaptureRoutes.js",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:package.json",
      "target": "file:server/server.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:package.json",
      "target": "file:server/app.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:package.json",
      "target": "file:server/handlers/swaggerDoc.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:package.json",
      "target": "file:knexfile.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:package.json",
      "target": "file:server/repositories/BaseRepository.spec.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20201225201548-createCaptures-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql:domain_event",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20201231060447-domainEvents-down.sql",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql:domain_event",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220120081019-wallet-registration-down.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220124224437-device-configuration-down.sql",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220125153204-session-up.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220125153204-session-down.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20201225201548-createCaptures-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20201231060447-domainEvents-down.sql",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-down.sql",
      "target": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-down.sql",
      "target": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-down.sql",
      "target": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220120081019-wallet-registration-down.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220124224437-device-configuration-down.sql",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220125153204-session-down.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-down.sql",
      "target": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-down.sql",
      "target": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "target": "file:server/repositories/RawCaptureRepository.js",
      "type": "defines_schema",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "target": "file:server/repositories/WalletRegistrationRepository.js",
      "type": "defines_schema",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
      "target": "file:server/repositories/DeviceConfigurationRepository.js",
      "type": "defines_schema",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "target": "file:server/repositories/SessionRepository.js",
      "type": "defines_schema",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
      "target": "file:server/repositories/RawCaptureRepository.js",
      "type": "defines_schema",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "target": "file:server/repositories/RawCaptureRepository.js",
      "type": "defines_schema",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-down.sql",
      "target": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-down.sql",
      "target": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "target": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220601165814-change-gps-data-type-down.sql",
      "target": "table:database/migrations/sqls/20220601165814-change-gps-data-type-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-down.sql",
      "target": "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20221105211652-add-session-start-time-down.sql",
      "target": "table:database/migrations/sqls/20221105211652-add-session-start-time-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20230302214605-bulk-pack-version-down.sql",
      "target": "table:database/migrations/sqls/20230302214605-bulk-pack-version-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20230906143147-create-track-table-down.sql",
      "target": "table:database/migrations/sqls/20230906143147-create-track-table-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20240722001220-add-session-segment-table-down.sql",
      "target": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20230906143147-create-track-table-up.sql",
      "target": "table:database/migrations/sqls/20230906143147-create-track-table-up.sql:track",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20230906143147-create-track-table-down.sql",
      "target": "table:database/migrations/sqls/20230906143147-create-track-table-up.sql:track",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql",
      "target": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240722001220-add-session-segment-table-down.sql",
      "target": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2024",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2024",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2025",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2025",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2026",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2026",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2024",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2024",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2025",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2025",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2026",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2026",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-down.sql:session",
      "target": "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-up.sql:session",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-down.sql:session_segment",
      "target": "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-up.sql:session_segment",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20250527074027-add-root-capture-columns-down.sql:raw_capture",
      "target": "table:database/migrations/sqls/20250527074027-add-root-capture-columns-up.sql:raw_capture",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/deployment.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/mapping.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/service.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/database-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/database-migration-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/namespace.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/cluster-role.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/cluster-role-binding.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/kustomization.yaml",
      "target": "config:deployment/base/database-migration-job.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/cluster-role-binding.yaml",
      "target": "config:deployment/base/cluster-role.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/cluster-role-binding.yaml",
      "target": "config:deployment/base/namespace.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/database-connection-sealed-secret.yaml",
      "target": "config:deployment/base/namespace.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/database-migration-connection-sealed-secret.yaml",
      "target": "config:deployment/base/namespace.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/database-migration-job.yaml",
      "target": "config:deployment/base/database-migration-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/database-migration-job.yaml",
      "target": "service:Dockerfile",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/deployment.yaml",
      "target": "config:deployment/base/database-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/deployment.yaml",
      "target": "service:Dockerfile",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/deployment.yaml",
      "target": "file:server/server.js",
      "type": "deploys",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "config:deployment/base/deployment.yaml",
      "target": "file:config/config.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/deployment.yaml",
      "target": "file:server/infra/database/knex.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/base/service.yaml",
      "target": "config:deployment/base/deployment.yaml",
      "type": "serves",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "config:deployment/base/service.yaml",
      "target": "file:server/server.js",
      "type": "serves",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "config:deployment/base/mapping.yaml",
      "target": "config:deployment/base/service.yaml",
      "type": "routes",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/development/kustomization.yaml",
      "target": "config:deployment/overlays/development/database-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/development/kustomization.yaml",
      "target": "config:deployment/overlays/development/database-migration-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/development/kustomization.yaml",
      "target": "config:deployment/overlays/development/mapping.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/development/kustomization.yaml",
      "target": "config:deployment/base/kustomization.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/development/database-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-connection-sealed-secret.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/development/database-connection-sealed-secret.yaml",
      "target": "config:deployment/base/deployment.yaml",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/development/database-migration-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-migration-connection-sealed-secret.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/development/database-migration-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-migration-job.yaml",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/development/mapping.yaml",
      "target": "config:deployment/base/mapping.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/production/kustomization.yaml",
      "target": "config:deployment/base/kustomization.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/production/kustomization.yaml",
      "target": "config:deployment/overlays/production/database-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/production/kustomization.yaml",
      "target": "config:deployment/overlays/production/database-migration-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/production/kustomization.yaml",
      "target": "config:deployment/base/deployment.yaml",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/production/database-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-connection-sealed-secret.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/production/database-connection-sealed-secret.yaml",
      "target": "config:deployment/base/deployment.yaml",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/production/database-migration-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-migration-connection-sealed-secret.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/production/database-migration-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-migration-job.yaml",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/test/kustomization.yaml",
      "target": "config:deployment/overlays/test/database-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/test/kustomization.yaml",
      "target": "config:deployment/overlays/test/database-migration-connection-sealed-secret.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/test/kustomization.yaml",
      "target": "config:deployment/overlays/test/mapping.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:.eslintignore",
      "target": "config:package.json",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:.huskyrc",
      "target": "file:commitlint.config.js",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:.huskyrc",
      "target": "config:package.json",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:.npmrc",
      "target": "config:package.json",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:.releaserc",
      "target": "document:CHANGELOG.md",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:.releaserc",
      "target": "config:package.json",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:.releaserc",
      "target": "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:assets/greenstand.webp",
      "target": "file:server/handlers/swaggerDoc.js",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:assets/greenstand.webp",
      "target": "file:server/app.js",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:scripts/setup-dev-database-passwords.sh",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/db_init.sql",
      "target": "document:README.md",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:database/etl/create-legacy-session-ids.js",
      "target": "file:server/repositories/Legacy/TreeRepository.js",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/etl/create-wallet-registration-from-legacy-2.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/etl/create-wallet-registration-from-legacy-2.sql",
      "target": "table:database/etl/create-wallet-registration-from-legacy.sql",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/etl/create-wallet-registration-from-legacy-2.sql",
      "target": "file:database/etl/create-legacy-session-ids.js",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "table:database/etl/create-wallet-registration-from-legacy.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/etl/create-wallet-registration-from-legacy.sql",
      "target": "file:database/etl/create-legacy-session-ids.js",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/etl/make-legacy-session-id.js",
      "target": "file:database/etl/create-legacy-session-ids.js",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20201225201548-createCaptures.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "function:database/migrations/20201225201548-createCaptures.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "function:database/migrations/20201225201548-createCaptures.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "function:database/migrations/20201225201548-createCaptures.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "function:database/migrations/20201225201548-createCaptures.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "function:database/migrations/20201225201548-createCaptures.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20201225201548-createCaptures.js",
      "target": "function:database/migrations/20201225201548-createCaptures.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20201225201548-createCaptures.js:up",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20201225201548-createCaptures.js:down",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20201231060447-domainEvents.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220120081019-wallet-registration.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220124224437-device-configuration.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220125153204-session.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/database.json.example",
      "target": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "function:database/migrations/20201231060447-domainEvents.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "function:database/migrations/20201231060447-domainEvents.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "function:database/migrations/20201231060447-domainEvents.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "function:database/migrations/20201231060447-domainEvents.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "function:database/migrations/20201231060447-domainEvents.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20201231060447-domainEvents.js",
      "target": "function:database/migrations/20201231060447-domainEvents.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20201231060447-domainEvents.js:up",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20201231060447-domainEvents.js:down",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:up",
      "target": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20210513114937-addCaptureTakenColumn.js:down",
      "target": "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:up",
      "target": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20210513233959-updateCaptureTakenColumn.js:down",
      "target": "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
      "target": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:up",
      "target": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20210513234014-modifyCaptureTakenColumn.js:down",
      "target": "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "function:database/migrations/20220120081019-wallet-registration.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "function:database/migrations/20220120081019-wallet-registration.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "function:database/migrations/20220120081019-wallet-registration.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "function:database/migrations/20220120081019-wallet-registration.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "function:database/migrations/20220120081019-wallet-registration.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220120081019-wallet-registration.js",
      "target": "function:database/migrations/20220120081019-wallet-registration.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220120081019-wallet-registration.js:up",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220120081019-wallet-registration.js:down",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "function:database/migrations/20220124224437-device-configuration.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "function:database/migrations/20220124224437-device-configuration.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "function:database/migrations/20220124224437-device-configuration.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "function:database/migrations/20220124224437-device-configuration.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "function:database/migrations/20220124224437-device-configuration.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220124224437-device-configuration.js",
      "target": "function:database/migrations/20220124224437-device-configuration.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220124224437-device-configuration.js:up",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220124224437-device-configuration.js:down",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "table:database/migrations/sqls/20220125153204-session-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "function:database/migrations/20220125153204-session.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "function:database/migrations/20220125153204-session.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "function:database/migrations/20220125153204-session.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "function:database/migrations/20220125153204-session.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "function:database/migrations/20220125153204-session.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220125153204-session.js",
      "target": "function:database/migrations/20220125153204-session.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220125153204-session.js:up",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220125153204-session.js:down",
      "target": "table:database/migrations/sqls/20220125153204-session-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
      "target": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:up",
      "target": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220126225534-bulk-pack-capture-updates.js:down",
      "target": "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "function:database/migrations/20220227163837-rename-capture-taken-at.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "function:database/migrations/20220227163837-rename-capture-taken-at.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "function:database/migrations/20220227163837-rename-capture-taken-at.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "function:database/migrations/20220227163837-rename-capture-taken-at.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "function:database/migrations/20220227163837-rename-capture-taken-at.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220227163837-rename-capture-taken-at.js",
      "target": "function:database/migrations/20220227163837-rename-capture-taken-at.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220227163837-rename-capture-taken-at.js:up",
      "target": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220227163837-rename-capture-taken-at.js:down",
      "target": "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "function:database/migrations/20220304112209-change-rotation-matrix.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "function:database/migrations/20220304112209-change-rotation-matrix.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "function:database/migrations/20220304112209-change-rotation-matrix.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "function:database/migrations/20220304112209-change-rotation-matrix.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "function:database/migrations/20220304112209-change-rotation-matrix.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220304112209-change-rotation-matrix.js",
      "target": "function:database/migrations/20220304112209-change-rotation-matrix.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220304112209-change-rotation-matrix.js:up",
      "target": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220304112209-change-rotation-matrix.js:down",
      "target": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
      "target": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:up",
      "target": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220324190653-AddOrganizationIdToSession.js:down",
      "target": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "function:database/migrations/20220411001144-addBulkPackFileName.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "function:database/migrations/20220411001144-addBulkPackFileName.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "function:database/migrations/20220411001144-addBulkPackFileName.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "function:database/migrations/20220411001144-addBulkPackFileName.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "function:database/migrations/20220411001144-addBulkPackFileName.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220411001144-addBulkPackFileName.js",
      "target": "function:database/migrations/20220411001144-addBulkPackFileName.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "function:database/migrations/20220411001144-addBulkPackFileName.js:up",
      "target": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "function:database/migrations/20220411001144-addBulkPackFileName.js:down",
      "target": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "file:database/migrations/20220601165814-change-gps-data-type.js",
      "target": "function:database/migrations/20220601165814-change-gps-data-type.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220601165814-change-gps-data-type.js",
      "target": "function:database/migrations/20220601165814-change-gps-data-type.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220601165814-change-gps-data-type.js",
      "target": "function:database/migrations/20220601165814-change-gps-data-type.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220601165814-change-gps-data-type.js",
      "target": "function:database/migrations/20220601165814-change-gps-data-type.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220601165814-change-gps-data-type.js",
      "target": "function:database/migrations/20220601165814-change-gps-data-type.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220601165814-change-gps-data-type.js",
      "target": "function:database/migrations/20220601165814-change-gps-data-type.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "target": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "target": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "target": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "target": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "target": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
      "target": "function:database/migrations/20220618045205-add-wallet-registration-created-at.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20221105211652-add-session-start-time.js",
      "target": "function:database/migrations/20221105211652-add-session-start-time.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20221105211652-add-session-start-time.js",
      "target": "function:database/migrations/20221105211652-add-session-start-time.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20221105211652-add-session-start-time.js",
      "target": "function:database/migrations/20221105211652-add-session-start-time.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20221105211652-add-session-start-time.js",
      "target": "function:database/migrations/20221105211652-add-session-start-time.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20221105211652-add-session-start-time.js",
      "target": "function:database/migrations/20221105211652-add-session-start-time.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20221105211652-add-session-start-time.js",
      "target": "function:database/migrations/20221105211652-add-session-start-time.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20230302214605-bulk-pack-version.js",
      "target": "function:database/migrations/20230302214605-bulk-pack-version.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20230302214605-bulk-pack-version.js",
      "target": "function:database/migrations/20230302214605-bulk-pack-version.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20230302214605-bulk-pack-version.js",
      "target": "function:database/migrations/20230302214605-bulk-pack-version.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20230302214605-bulk-pack-version.js",
      "target": "function:database/migrations/20230302214605-bulk-pack-version.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20230302214605-bulk-pack-version.js",
      "target": "function:database/migrations/20230302214605-bulk-pack-version.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20230302214605-bulk-pack-version.js",
      "target": "function:database/migrations/20230302214605-bulk-pack-version.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20230906143147-create-track-table.js",
      "target": "function:database/migrations/20230906143147-create-track-table.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20230906143147-create-track-table.js",
      "target": "function:database/migrations/20230906143147-create-track-table.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20230906143147-create-track-table.js",
      "target": "function:database/migrations/20230906143147-create-track-table.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20230906143147-create-track-table.js",
      "target": "function:database/migrations/20230906143147-create-track-table.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20230906143147-create-track-table.js",
      "target": "function:database/migrations/20230906143147-create-track-table.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20230906143147-create-track-table.js",
      "target": "function:database/migrations/20230906143147-create-track-table.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20240105095545-domainEventsNewPartition.js",
      "target": "function:database/migrations/20240105095545-domainEventsNewPartition.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20240105095545-domainEventsNewPartition.js",
      "target": "function:database/migrations/20240105095545-domainEventsNewPartition.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20240105095545-domainEventsNewPartition.js",
      "target": "function:database/migrations/20240105095545-domainEventsNewPartition.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20240105095545-domainEventsNewPartition.js",
      "target": "function:database/migrations/20240105095545-domainEventsNewPartition.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20240105095545-domainEventsNewPartition.js",
      "target": "function:database/migrations/20240105095545-domainEventsNewPartition.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20240105095545-domainEventsNewPartition.js",
      "target": "function:database/migrations/20240105095545-domainEventsNewPartition.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20240722001220-add-session-segment-table.js",
      "target": "function:database/migrations/20240722001220-add-session-segment-table.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20240722001220-add-session-segment-table.js",
      "target": "function:database/migrations/20240722001220-add-session-segment-table.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20240722001220-add-session-segment-table.js",
      "target": "function:database/migrations/20240722001220-add-session-segment-table.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20240722001220-add-session-segment-table.js",
      "target": "function:database/migrations/20240722001220-add-session-segment-table.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20240722001220-add-session-segment-table.js",
      "target": "function:database/migrations/20240722001220-add-session-segment-table.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20240722001220-add-session-segment-table.js",
      "target": "function:database/migrations/20240722001220-add-session-segment-table.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20241122090004-add-columns-to-session-table.js",
      "target": "function:database/migrations/20241122090004-add-columns-to-session-table.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20241122090004-add-columns-to-session-table.js",
      "target": "function:database/migrations/20241122090004-add-columns-to-session-table.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20241122090004-add-columns-to-session-table.js",
      "target": "function:database/migrations/20241122090004-add-columns-to-session-table.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20241122090004-add-columns-to-session-table.js",
      "target": "function:database/migrations/20241122090004-add-columns-to-session-table.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20241122090004-add-columns-to-session-table.js",
      "target": "function:database/migrations/20241122090004-add-columns-to-session-table.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20241122090004-add-columns-to-session-table.js",
      "target": "function:database/migrations/20241122090004-add-columns-to-session-table.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "target": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "target": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "target": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "target": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "target": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
      "target": "function:database/migrations/20241122090641-remove-session-segments-time-defaults.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20250527074027-add-root-capture-columns.js",
      "target": "function:database/migrations/20250527074027-add-root-capture-columns.js:setup",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20250527074027-add-root-capture-columns.js",
      "target": "function:database/migrations/20250527074027-add-root-capture-columns.js:setup",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20250527074027-add-root-capture-columns.js",
      "target": "function:database/migrations/20250527074027-add-root-capture-columns.js:up",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20250527074027-add-root-capture-columns.js",
      "target": "function:database/migrations/20250527074027-add-root-capture-columns.js:up",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:database/migrations/20250527074027-add-root-capture-columns.js",
      "target": "function:database/migrations/20250527074027-add-root-capture-columns.js:down",
      "type": "contains",
      "direction": "forward",
      "weight": 1.0
    },
    {
      "source": "file:database/migrations/20250527074027-add-root-capture-columns.js",
      "target": "function:database/migrations/20250527074027-add-root-capture-columns.js:down",
      "type": "exports",
      "direction": "forward",
      "weight": 0.8
    },
    {
      "source": "file:scripts/setup-dev-database-passwords.sh",
      "target": "file:scripts/vars.sh",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:docs/api/spec/api.json",
      "target": "config:docs/api/spec/treetracker-field-data.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/app.js",
      "target": "config:package.json",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "file:server/handlers/swaggerDoc.js",
      "target": "config:package.json",
      "type": "imports",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "class:server/repositories/TrackRepository.js:TrackRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "class:server/repositories/WalletRegistrationRepository.js:WalletRegistrationRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "class:server/repositories/DeviceConfigurationRepository.js:DeviceConfigurationRepository",
      "target": "class:server/repositories/BaseRepository.js:BaseRepository",
      "type": "inherits",
      "direction": "forward",
      "weight": 0.9
    },
    {
      "source": "file:server/routes/deviceConfigurationRoutes.js",
      "target": "file:__tests__/device-configuration-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/handlers/deviceConfigurationHandler/index.js",
      "target": "file:__tests__/device-configuration-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/routes/rawCaptureRoutes.js",
      "target": "file:__tests__/raw-capture-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/handlers/rawCaptureHandler/index.js",
      "target": "file:__tests__/raw-capture-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/routes/sessionRoutes.js",
      "target": "file:__tests__/session-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/handlers/sessionHandler/index.js",
      "target": "file:__tests__/session-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/routes/walletRegistrationRoutes.js",
      "target": "file:__tests__/wallet-registration-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/handlers/walletRegistrationHandler/index.js",
      "target": "file:__tests__/wallet-registration-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/routes/trackRoutes.js",
      "target": "file:__tests__/track-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "file:server/handlers/tracksHandler/index.js",
      "target": "file:__tests__/track-api.spec.js",
      "type": "tested_by",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/test/kustomization.yaml",
      "target": "config:deployment/base/kustomization.yaml",
      "type": "depends_on",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/test/database-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-connection-sealed-secret.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/test/database-connection-sealed-secret.yaml",
      "target": "config:deployment/base/deployment.yaml",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/test/database-migration-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-migration-connection-sealed-secret.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "config:deployment/overlays/test/database-migration-connection-sealed-secret.yaml",
      "target": "config:deployment/base/database-migration-job.yaml",
      "type": "configures",
      "direction": "forward",
      "weight": 0.6
    },
    {
      "source": "config:deployment/overlays/test/mapping.yaml",
      "target": "config:deployment/base/mapping.yaml",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220304112209-change-rotation-matrix-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-up.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-down.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "target": "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220601165814-change-gps-data-type-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220601165814-change-gps-data-type-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-up.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-down.sql",
      "target": "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20221105211652-add-session-start-time-up.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20221105211652-add-session-start-time-down.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20230302214605-bulk-pack-version-up.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20230302214605-bulk-pack-version-down.sql",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql:domain_event",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
      "target": "table:database/migrations/sqls/20201231060447-domainEvents-up.sql:domain_event",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20240722001220-add-session-segment-table-down.sql",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-up.sql:session",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-down.sql:session",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-up.sql:session_segment",
      "target": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-down.sql:session_segment",
      "target": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20250527074027-add-root-capture-columns-up.sql:raw_capture",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20250527074027-add-root-capture-columns-down.sql:raw_capture",
      "target": "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
      "type": "migrates",
      "direction": "forward",
      "weight": 0.7
    },
    {
      "source": "table:database/migrations/sqls/20230906143147-create-track-table-up.sql:track",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    },
    {
      "source": "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
      "target": "table:database/migrations/sqls/20220125153204-session-up.sql:session",
      "type": "related",
      "direction": "forward",
      "weight": 0.5
    }
  ],
  "layers": [
    {
      "id": "layer:bootstrap",
      "name": "Bootstrap & Configuration",
      "description": "Process entry (server/server.js, setup.js), the Express app assembly in server/app.js with its served logo asset, config/config.js mapping DATABASE_URL and DATABASE_URL_LEGACYDB, plus the npm manifest, env templates, and lint, commit and release tooling.",
      "nodeIds": [
        "file:config/config.js",
        "file:server/app.js",
        "file:server/server.js",
        "file:server/setup.js",
        "config:.env.example",
        "config:.env.test.example",
        "config:.prettierrc.json",
        "config:package.json",
        "file:.eslintignore",
        "file:.huskyrc",
        "file:.npmrc",
        "file:.releaserc",
        "file:assets/greenstand.webp",
        "file:commitlint.config.js"
      ]
    },
    {
      "id": "layer:api",
      "name": "API Layer",
      "description": "Express routers for raw captures, sessions, tracks, device configurations and wallet registrations, with their per-resource handlers, Joi request schemas, and joi-to-swagger docs assembled into the Swagger UI.",
      "nodeIds": [
        "file:server/handlers/rawCaptureHandler/index.js",
        "file:server/handlers/sessionHandler/index.js",
        "file:server/handlers/walletRegistrationHandler/index.js",
        "file:server/routes/deviceConfigurationRoutes.js",
        "file:server/routes/index.js",
        "file:server/routes/rawCaptureRoutes.js",
        "file:server/routes/sessionRoutes.js",
        "file:server/routes/walletRegistrationRoutes.js",
        "file:server/handlers/rawCaptureHandler/docs.js",
        "file:server/handlers/rawCaptureHandler/schemas.js",
        "file:server/handlers/sessionHandler/docs.js",
        "file:server/handlers/sessionHandler/schemas.js",
        "file:server/handlers/swaggerDoc.js",
        "file:server/handlers/walletRegistrationHandler/docs.js",
        "file:server/handlers/walletRegistrationHandler/schemas.js",
        "file:server/handlers/tracksHandler/docs.js",
        "file:server/handlers/tracksHandler/index.js",
        "file:server/handlers/tracksHandler/schemas.js",
        "file:server/routes/trackRoutes.js",
        "file:server/handlers/deviceConfigurationHandler/docs.js",
        "file:server/handlers/deviceConfigurationHandler/index.js",
        "file:server/handlers/deviceConfigurationHandler/schemas.js"
      ]
    },
    {
      "id": "layer:service",
      "name": "Service Layer",
      "description": "Per-resource services that open field-data and legacy database sessions, run transactions, and orchestrate domain models, including the RawCaptureService path that also writes legacy treetracker tables.",
      "nodeIds": [
        "file:server/services/LegacyAPIService.js",
        "file:server/services/RawCaptureService.js",
        "file:server/services/SessionService.js",
        "file:server/services/TrackService.js",
        "file:server/services/WalletRegistrationService.js",
        "file:server/services/DeviceConfigurationService.js"
      ]
    },
    {
      "id": "layer:domain",
      "name": "Domain Models",
      "description": "Domain models that shape raw_capture, session, track, device_configuration and wallet_registration rows into frozen objects, implement idempotent creation, and copy captures into the legacy trees table (LegacyTree).",
      "nodeIds": [
        "file:server/models/LegacyTree.js",
        "file:server/models/RawCapture.js",
        "file:server/models/SessionModel.js",
        "file:server/models/Track.js",
        "file:server/models/WalletRegistration.js",
        "file:server/models/DeviceConfiguration.js"
      ]
    },
    {
      "id": "layer:data-access",
      "name": "Data Access",
      "description": "Knex repositories over the field_data schema and the Legacy planter, tree and tree-attribute repositories, on top of the two Knex Postgres clients and the BaseSession unit-of-work wrappers in server/infra/database.",
      "nodeIds": [
        "file:server/infra/database/knex.js",
        "file:server/repositories/BaseRepository.js",
        "file:server/repositories/Legacy/PlanterRepository.js",
        "file:server/repositories/Legacy/TreeAttributeRepository.js",
        "file:server/repositories/Legacy/TreeRepository.js",
        "file:server/repositories/RawCaptureRepository.js",
        "file:server/repositories/SessionRepository.js",
        "file:server/repositories/TrackRepository.js",
        "file:server/infra/database/Sessions/BaseSession.js",
        "file:server/infra/database/Sessions/LegacySession.js",
        "file:server/infra/database/Sessions/Session.js",
        "file:server/repositories/WalletRegistrationRepository.js",
        "file:server/repositories/DeviceConfigurationRepository.js"
      ]
    },
    {
      "id": "layer:utility",
      "name": "Shared Utilities",
      "description": "Cross-cutting HttpError type with rollback flag, the async handlerWrapper and global Express errorHandler, and pagination helpers used by routes, handlers, services and repositories.",
      "nodeIds": [
        "file:server/utils/HttpError.js",
        "file:server/utils/helper.js",
        "file:server/utils/utils.js"
      ]
    },
    {
      "id": "layer:database",
      "name": "Database Schema & Data",
      "description": "db-migrate migrations and their up/down SQL that define raw_capture, session, session_segment, track, wallet_registration, device_configuration and partitioned domain_event tables, plus knex seeds, the knexfile, local DB bootstrap SQL, and one-off legacy ETL scripts.",
      "nodeIds": [
        "file:database/seeds/00_job_database_cleaner.js",
        "file:database/seeds/01_table_device_configuration.js",
        "file:database/seeds/02_table_wallet_registration.js",
        "file:database/seeds/03_table_session.js",
        "file:database/seeds/04_table_raw_capture.js",
        "file:database/seeds/data/capture_match_raw_captures.js",
        "file:database/seeds/data/device_configuration.js",
        "file:database/seeds/data/session.js",
        "file:database/seeds/data/wallet_registration.js",
        "table:database/migrations/sqls/20201225201548-createCaptures-up.sql",
        "table:database/migrations/sqls/20201225201548-createCaptures-down.sql",
        "table:database/migrations/sqls/20201231060447-domainEvents-up.sql",
        "table:database/migrations/sqls/20201231060447-domainEvents-down.sql",
        "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-up.sql",
        "table:database/migrations/sqls/20210513114937-addCaptureTakenColumn-down.sql",
        "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-up.sql",
        "table:database/migrations/sqls/20210513233959-updateCaptureTakenColumn-down.sql",
        "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-up.sql",
        "table:database/migrations/sqls/20210513234014-modifyCaptureTakenColumn-down.sql",
        "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql",
        "table:database/migrations/sqls/20220120081019-wallet-registration-down.sql",
        "table:database/migrations/sqls/20220124224437-device-configuration-up.sql",
        "table:database/migrations/sqls/20220124224437-device-configuration-down.sql",
        "table:database/migrations/sqls/20220125153204-session-up.sql",
        "table:database/migrations/sqls/20220125153204-session-down.sql",
        "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-up.sql",
        "table:database/migrations/sqls/20220126225534-bulk-pack-capture-updates-down.sql",
        "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-up.sql",
        "table:database/migrations/sqls/20220227163837-rename-capture-taken-at-down.sql",
        "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
        "table:database/migrations/sqls/20201231060447-domainEvents-up.sql:domain_event",
        "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
        "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
        "table:database/migrations/sqls/20220125153204-session-up.sql:session",
        "table:database/migrations/sqls/20220304112209-change-rotation-matrix-down.sql",
        "table:database/migrations/sqls/20220304112209-change-rotation-matrix-up.sql",
        "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-down.sql",
        "table:database/migrations/sqls/20220324190653-AddOrganizationIdToSession-up.sql",
        "table:database/migrations/sqls/20220411001144-addBulkPackFileName-down.sql",
        "table:database/migrations/sqls/20220411001144-addBulkPackFileName-up.sql",
        "table:database/migrations/sqls/20220601165814-change-gps-data-type-down.sql",
        "table:database/migrations/sqls/20220601165814-change-gps-data-type-up.sql",
        "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-down.sql",
        "table:database/migrations/sqls/20220618045205-add-wallet-registration-created-at-up.sql",
        "table:database/migrations/sqls/20221105211652-add-session-start-time-down.sql",
        "table:database/migrations/sqls/20221105211652-add-session-start-time-up.sql",
        "table:database/migrations/sqls/20230302214605-bulk-pack-version-down.sql",
        "table:database/migrations/sqls/20230302214605-bulk-pack-version-up.sql",
        "table:database/migrations/sqls/20230906143147-create-track-table-down.sql",
        "table:database/migrations/sqls/20230906143147-create-track-table-up.sql",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-down.sql",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql",
        "table:database/migrations/sqls/20240722001220-add-session-segment-table-down.sql",
        "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql",
        "table:database/migrations/sqls/20230906143147-create-track-table-up.sql:track",
        "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2024",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2025",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_sent_2026",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2024",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2025",
        "table:database/migrations/sqls/20240105095545-domainEventsNewPartition-up.sql:domain_event_handled_2026",
        "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-down.sql:session",
        "table:database/migrations/sqls/20241122090004-add-columns-to-session-table-up.sql:session",
        "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-down.sql:session_segment",
        "table:database/migrations/sqls/20241122090641-remove-session-segments-time-defaults-up.sql:session_segment",
        "table:database/migrations/sqls/20250527074027-add-root-capture-columns-down.sql:raw_capture",
        "table:database/migrations/sqls/20250527074027-add-root-capture-columns-up.sql:raw_capture",
        "file:database/database.json.example",
        "table:database/db_init.sql",
        "file:database/etl/create-legacy-session-ids.js",
        "table:database/etl/create-wallet-registration-from-legacy-2.sql",
        "table:database/etl/create-wallet-registration-from-legacy.sql",
        "file:database/etl/make-legacy-session-id.js",
        "file:database/migrations/20201225201548-createCaptures.js",
        "file:database/migrations/20201231060447-domainEvents.js",
        "file:database/migrations/20210513114937-addCaptureTakenColumn.js",
        "file:database/migrations/20210513233959-updateCaptureTakenColumn.js",
        "file:database/migrations/20210513234014-modifyCaptureTakenColumn.js",
        "file:database/migrations/20220120081019-wallet-registration.js",
        "file:database/migrations/20220124224437-device-configuration.js",
        "file:database/migrations/20220125153204-session.js",
        "file:database/migrations/20220126225534-bulk-pack-capture-updates.js",
        "file:database/migrations/20220227163837-rename-capture-taken-at.js",
        "file:database/migrations/20220304112209-change-rotation-matrix.js",
        "file:database/migrations/20220324190653-AddOrganizationIdToSession.js",
        "file:database/migrations/20220411001144-addBulkPackFileName.js",
        "file:database/migrations/20220601165814-change-gps-data-type.js",
        "file:database/migrations/20220618045205-add-wallet-registration-created-at.js",
        "file:database/migrations/20221105211652-add-session-start-time.js",
        "file:database/migrations/20230302214605-bulk-pack-version.js",
        "file:database/migrations/20230906143147-create-track-table.js",
        "file:database/migrations/20240105095545-domainEventsNewPartition.js",
        "file:database/migrations/20240722001220-add-session-segment-table.js",
        "file:database/migrations/20241122090004-add-columns-to-session-table.js",
        "file:database/migrations/20241122090641-remove-session-segments-time-defaults.js",
        "file:database/migrations/20250527074027-add-root-capture-columns.js",
        "table:database/seed.sql",
        "file:database/seeds/data/duplicate_raw_captures.js",
        "file:knexfile.js"
      ]
    },
    {
      "id": "layer:test",
      "name": "Tests",
      "description": "Mocha and supertest API specs per resource, unit specs for the app and BaseRepository, and the test helpers that clear the database, create legacy tables, and insert test captures.",
      "nodeIds": [
        "file:__tests__/clear-db.js",
        "file:__tests__/device-configuration-api.spec.js",
        "file:__tests__/insert-test-capture.js",
        "file:__tests__/legacy-table-creation.js",
        "file:__tests__/raw-capture-api.spec.js",
        "file:__tests__/session-api.spec.js",
        "file:__tests__/track-api.spec.js",
        "file:__tests__/wallet-registration-api.spec.js",
        "file:server/app.spec.js",
        "file:server/repositories/BaseRepository.spec.js",
        "file:seed.spec.js"
      ]
    },
    {
      "id": "layer:infrastructure",
      "name": "Infrastructure & CI/CD",
      "description": "Docker image build, Kustomize base and development/test/production overlays with sealed database secrets and the migration job, GitHub Actions for PR checks and dev/test/prod deploys, and the developer database password scripts.",
      "nodeIds": [
        "service:.dockerignore",
        "service:Dockerfile",
        "service:Dockerfile:node",
        "pipeline:.github/workflows/pull-request-ci.yml",
        "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
        "pipeline:.github/workflows/treetracker-api-deploy-dev.yml",
        "pipeline:.github/workflows/treetracker-api-deploy-prod.yml",
        "pipeline:.github/workflows/treetracker-api-deploy-test.yml",
        "config:deployment/base/cluster-role-binding.yaml",
        "config:deployment/base/cluster-role.yaml",
        "config:deployment/base/database-connection-sealed-secret.yaml",
        "config:deployment/base/database-migration-connection-sealed-secret.yaml",
        "config:deployment/base/database-migration-job.yaml",
        "config:deployment/base/deployment.yaml",
        "config:deployment/base/kustomization.yaml",
        "config:deployment/base/mapping.yaml",
        "config:deployment/base/namespace.yaml",
        "config:deployment/base/service.yaml",
        "config:deployment/overlays/development/database-connection-sealed-secret.yaml",
        "config:deployment/overlays/development/database-migration-connection-sealed-secret.yaml",
        "config:deployment/overlays/development/kustomization.yaml",
        "config:deployment/overlays/development/mapping.yaml",
        "config:deployment/overlays/production/database-connection-sealed-secret.yaml",
        "config:deployment/overlays/production/database-migration-connection-sealed-secret.yaml",
        "config:deployment/overlays/production/kustomization.yaml",
        "config:deployment/overlays/test/database-connection-sealed-secret.yaml",
        "config:deployment/overlays/test/database-migration-connection-sealed-secret.yaml",
        "config:deployment/overlays/test/kustomization.yaml",
        "config:deployment/overlays/test/mapping.yaml",
        "file:scripts/setup-dev-database-passwords.sh",
        "file:scripts/vars.sh"
      ]
    },
    {
      "id": "layer:documentation",
      "name": "Documentation & API Specs",
      "description": "README, CHANGELOG, the organization-by-session ADR, and the OpenAPI drafts and the Treetracker Field Data API spec under docs/api/spec and api.json.",
      "nodeIds": [
        "document:CHANGELOG.md",
        "document:README.md",
        "config:api.json",
        "endpoint:api.json:GET /captures",
        "document:docs/adr/0001-organization-by-session-bridge.md",
        "config:docs/api/spec/api.json",
        "config:docs/api/spec/treetracker-field-data.yaml"
      ]
    }
  ],
  "tour": [
    {
      "order": 1,
      "title": "Process Entry Point",
      "description": "The service starts in server/server.js, which package.json names as its main file. It loads the .env.<NODE_ENV> file, sets the log level, and starts the Express app on NODE_PORT (default 3006). On SIGINT, it destroys both Knex connection pools, one for the field-data database and one for the legacy treetracker database, which is a first sign that this service talks to two databases.",
      "nodeIds": [
        "file:server/server.js",
        "config:package.json",
        "file:server/setup.js"
      ],
      "languageLesson": "In Node.js, the package.json \"main\" field tells `node .` which file to run. The Dockerfile in a later step starts the service with exactly that command."
    },
    {
      "order": 2,
      "title": "Express App Assembly",
      "description": "server/app.js builds the Express application that server.js starts. It initializes Sentry, enables CORS only in development, rejects write requests without an application/json content type (HTTP 415), serves Swagger UI at /docs, mounts all routers at '/', and installs the global error handler. config/config.js maps DATABASE_URL and DATABASE_URL_LEGACYDB to the two connection strings that the data layer uses later.",
      "nodeIds": [
        "file:server/app.js",
        "file:config/config.js"
      ],
      "languageLesson": "Express runs middleware in registration order. A function with four parameters (err, req, res, next) is an error-handling middleware, so app.js registers it after the routers to catch errors from all of them."
    },
    {
      "order": 3,
      "title": "Routers and Error Plumbing",
      "description": "server/routes/index.js is a barrel that exports the five resource routers: raw captures, sessions, tracks, device configurations, and wallet registrations. Each router, such as rawCaptureRoutes.js, binds HTTP verbs to handler functions through handlerWrapper from utils.js. That wrapper forwards rejected promises to the errorHandler, which converts HttpError, Joi validation errors (422), and Axios errors into JSON {code, message} responses.",
      "nodeIds": [
        "file:server/routes/index.js",
        "file:server/routes/rawCaptureRoutes.js",
        "file:server/utils/utils.js",
        "file:server/utils/HttpError.js"
      ],
      "languageLesson": "Express 4 does not catch rejected promises from async handlers. A small higher-order function like handlerWrapper, `fn => (req, res, next) => fn(req, res, next).catch(next)`, closes that gap for every route in one place."
    },
    {
      "order": 4,
      "title": "Handlers and Joi Validation",
      "description": "Handlers are the protocol layer: they validate input, call a service, and shape the HTTP response. The raw capture handler validates the Treetracker app upload with Joi schemas (UUID ids, lat/lon ranges, image URL, ISO captured_at) before it calls RawCaptureService. The list handlers share helper.js, which separates limit/offset (defaults 100 and 0) from filters and builds prev/next links.",
      "nodeIds": [
        "file:server/handlers/rawCaptureHandler/index.js",
        "file:server/handlers/rawCaptureHandler/schemas.js",
        "file:server/handlers/sessionHandler/index.js",
        "file:server/utils/helper.js"
      ],
      "languageLesson": "Joi schemas are declarative validators. A call to schema.validateAsync(body) either returns the cleaned value or throws a ValidationError, which the global errorHandler from Step 3 maps to HTTP 422."
    },
    {
      "order": 5,
      "title": "API Documentation Contract",
      "description": "The Joi schemas from Step 4 also generate the API docs. Each handler folder has a docs.js that converts its schemas with joi-to-swagger, and swaggerDoc.js merges them into the 'Treetracker Field Data API' OpenAPI document that app.js serves at /docs. The hand-written spec under docs/api/spec is a separate reference copy, so check paths carefully: the generated raw capture docs use a singular /raw-capture prefix for single-capture paths while the router mounts /raw-captures.",
      "nodeIds": [
        "file:server/handlers/swaggerDoc.js",
        "file:server/handlers/rawCaptureHandler/docs.js",
        "config:docs/api/spec/treetracker-field-data.yaml"
      ]
    },
    {
      "order": 6,
      "title": "Service Layer",
      "description": "Services own use cases and transactions. Most services, such as SessionService and WalletRegistrationService, open one field-data database session and wrap the create path in begin/commit/rollback. RawCaptureService is the most important one: it writes the legacy trees row and the field-data raw_capture row in paired transactions across two databases, and it rejects captures through LegacyAPIService, an HTTP client for the legacy admin API.",
      "nodeIds": [
        "file:server/services/RawCaptureService.js",
        "file:server/services/SessionService.js",
        "file:server/services/WalletRegistrationService.js",
        "file:server/services/LegacyAPIService.js"
      ]
    },
    {
      "order": 7,
      "title": "Database Sessions and Knex",
      "description": "The services from Step 6 do not use Knex directly. They use BaseSession, a unit-of-work wrapper that holds one Knex instance and an optional open transaction, so all repositories that share a session run in the same transaction. Session.js binds it to the field-data client, and LegacySession.js binds it to the legacy client. Both clients come from knex.js, which validates the connection strings and sets the DATABASE_SCHEMA search path on the field-data client only.",
      "nodeIds": [
        "file:server/infra/database/Sessions/BaseSession.js",
        "file:server/infra/database/Sessions/Session.js",
        "file:server/infra/database/Sessions/LegacySession.js",
        "file:server/infra/database/knex.js"
      ],
      "languageLesson": "The unit-of-work pattern passes one shared context object to many repositories. Knex makes this simple because a transaction object (trx) has the same query-builder API as the base knex instance."
    },
    {
      "order": 8,
      "title": "Domain Models",
      "description": "Models sit between services and repositories and give each resource its business rules. They shape database rows into frozen objects and implement idempotent creation: if the id already exists, they return the stored row with status 200 instead of 201. This rule matters because the Treetracker app can upload the same capture, session, or registration more than once. RawCapture.js also sets new captures to 'unprocessed' and marks rejected ones 'rejected'.",
      "nodeIds": [
        "file:server/models/RawCapture.js",
        "file:server/models/SessionModel.js",
        "file:server/models/WalletRegistration.js",
        "file:server/models/DeviceConfiguration.js",
        "file:server/models/Track.js"
      ],
      "languageLesson": "Object.freeze() makes an object shallowly immutable. Models return frozen objects so that callers cannot change a domain value by accident after it leaves the model."
    },
    {
      "order": 9,
      "title": "The Legacy Database Bridge",
      "description": "During the domain migration, every new raw capture must also appear in the legacy treetracker database. LegacyTree.js resolves the planter by wallet (PlanterRepository) and writes the trees and tree_attributes rows, and TreeRepository inserts the tree with a PostGIS point. The ADR records a related bridge decision: a hand-filled session.organization_id that operators copy to the legacy trees.planting_organization_id until the Android app sends real organization keys.",
      "nodeIds": [
        "file:server/models/LegacyTree.js",
        "file:server/repositories/Legacy/TreeRepository.js",
        "file:server/repositories/Legacy/PlanterRepository.js",
        "document:docs/adr/0001-organization-by-session-bridge.md"
      ]
    },
    {
      "order": 10,
      "title": "Repositories",
      "description": "Repositories are the lowest code layer and the only place that builds SQL. BaseRepository, which every field-data and legacy repository extends, gives table-scoped getById, nested and/or filters with limit/offset, counts, update, and insert. Concrete repositories add joins: RawCaptureRepository and SessionRepository join session, wallet_registration, and device_configuration so that the API returns device and wallet details with each row.",
      "nodeIds": [
        "file:server/repositories/BaseRepository.js",
        "file:server/repositories/RawCaptureRepository.js",
        "file:server/repositories/SessionRepository.js"
      ],
      "languageLesson": "JavaScript classes support inheritance with `extends` and `super()`. A generic base class that receives the table name and session in its constructor removes most per-table boilerplate."
    },
    {
      "order": 11,
      "title": "Field Data Schema",
      "description": "These tables are the data that the repositories from Step 10 read and write. A raw_capture is one tree photo with GPS data and a review status, and it belongs to a session. A session ties a device_configuration (the phone and app build) to the wallet_registration that started it, and a track stores the location file for a session. Note that raw_capture has the highest fan-in in the graph, because most of the code and later migrations depend on it.",
      "nodeIds": [
        "table:database/migrations/sqls/20201225201548-createCaptures-up.sql:raw_capture",
        "table:database/migrations/sqls/20220125153204-session-up.sql:session",
        "table:database/migrations/sqls/20220124224437-device-configuration-up.sql:device_configuration",
        "table:database/migrations/sqls/20220120081019-wallet-registration-up.sql:wallet_registration",
        "table:database/migrations/sqls/20230906143147-create-track-table-up.sql:track"
      ],
      "languageLesson": "Foreign keys (for example session.device_configuration_id to device_configuration.id) make the database reject orphan rows. This is also why the test helper must delete tables in a foreign-key-safe order."
    },
    {
      "order": 12,
      "title": "Migrations and Local Setup",
      "description": "The schema evolves through db-migrate: each JavaScript migration loads an up and a down SQL file, such as the newest one that adds root-check columns to raw_capture (no server code reads them at this commit). The README explains the local workflow: run database/db_init.sql, fill database.json from the example, run migrations, and start the server with npm run server. Some README parts are stale, so trust the code over the README when they disagree.",
      "nodeIds": [
        "document:README.md",
        "file:database/migrations/20250527074027-add-root-capture-columns.js",
        "table:database/migrations/sqls/20240722001220-add-session-segment-table-up.sql:session_segment",
        "file:database/database.json.example",
        "table:database/db_init.sql"
      ],
      "languageLesson": "Paired up/down migrations make schema changes reversible. Never edit a migration that already ran in a shared environment; add a new one instead."
    },
    {
      "order": 13,
      "title": "Integration Tests",
      "description": "The tests exercise the full stack from Steps 2 to 11 through HTTP with Mocha and supertest. legacy-table-creation.js creates the legacy trees, tree_attributes, and planter tables, clear-db.js empties all tables before each suite, and insert-test-capture.js seeds the full planter, device, wallet, session, tree, and capture chain. The raw capture spec checks the idempotent 201/200 behavior and stubs LegacyAPIService with sinon for the reject path.",
      "nodeIds": [
        "file:__tests__/raw-capture-api.spec.js",
        "file:__tests__/clear-db.js",
        "file:__tests__/insert-test-capture.js",
        "file:__tests__/legacy-table-creation.js"
      ],
      "languageLesson": "A sinon stub replaces a real method for one test, so the test can check the arguments (here the Authorization header and rejection reason) without a call to the real legacy admin API."
    },
    {
      "order": 14,
      "title": "Container and Kubernetes Deployment",
      "description": "The Dockerfile packages the service into a node:16-alpine image and starts it with `node .`, which runs server/server.js from Step 1. Kustomize manifests describe the cluster: the Deployment runs two replicas on port 3006 with both database URLs from a sealed secret, and a migration Job runs db-migrate up as an ArgoCD PostSync hook. The development, test, and production overlays only change the image tag and secrets.",
      "nodeIds": [
        "service:Dockerfile",
        "config:deployment/base/kustomization.yaml",
        "config:deployment/base/deployment.yaml",
        "config:deployment/base/database-migration-job.yaml"
      ],
      "languageLesson": "In a Dockerfile, copying package.json and package-lock.json and running npm ci before copying the source lets Docker cache the dependency layer, so code-only changes rebuild quickly."
    },
    {
      "order": 15,
      "title": "CI/CD Pipelines",
      "description": "GitHub Actions close the loop. On each pull request, CI runs lint, the migrations, and the integration tests from Step 13 against a PostGIS service. On a push to main, the pipeline repeats the tests, runs semantic-release, pushes the Docker image from Step 14, and updates the development overlay tag. A manual workflow promotes a chosen git tag to production.",
      "nodeIds": [
        "pipeline:.github/workflows/pull-request-ci.yml",
        "pipeline:.github/workflows/treetracker-api-build-deploy-dev.yml",
        "pipeline:.github/workflows/treetracker-api-deploy-prod.yml"
      ],
      "languageLesson": "A GitHub Actions `services:` block starts sidecar containers, such as a PostGIS database, that the job steps can reach by service name. This gives the tests a real database without extra setup scripts."
    }
  ]
}