Skip to content

Seed Refactor Group org data + jimrg-james relationship - #373

Merged
jhodapp merged 2 commits into
mainfrom
feat/seed-refactor-group-data
Jul 22, 2026
Merged

Seed Refactor Group org data + jimrg-james relationship#373
jhodapp merged 2 commits into
mainfrom
feat/seed-refactor-group-data

Conversation

@jhodapp

@jhodapp jhodapp commented Jul 22, 2026

Copy link
Copy Markdown
Member

Description

Splits the seed-data changes out of the docs-collab deployment PR (#371) so that PR stays focused on deployment.

Changes

  • Reuse the migration-created Refactor Group organization (m20250509_164646_add_initial_user) as the primary seed org, instead of creating a separate "Refactor Coaching" org.
  • Add jim@refactorgroup.com as an Admin of Refactor Group, coaching james.hodapp@gmail.com via the new jimrg-james coaching relationship, with two seeded sessions.
  • Make Caleb an Admin of Acme Corp (was User).

Notes

  • seed_database now depends on the initial-admin migration having created the Refactor Group org (looked up by slug). This is consistent with the seed's existing dev-only, unwrap-heavy style (it always runs after migrations).
  • A follow-up will seed local collab notes content for some of these sessions; that work lands with the docs-collab PR (Self-hosted docs-collab-server + deployment (replaces TipTap Cloud) #371) because the collab_documents table only exists there.

Reuse the migration-created Refactor Group organization as the primary seed
org (previously a separate Refactor Coaching org), add jim@refactorgroup.com
as an admin coaching james.hodapp@gmail.com via the jimrg-james relationship
with two sessions, and make Caleb an admin of Acme Corp. Split out of the
docs-collab deployment work to keep that change focused.
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the dev-only seed_database function to reuse the migration-created "Refactor Group" organization (looked up by slug "refactor-group") instead of creating a separate "Refactor Coaching" org, and introduces a new seeded user and coaching relationship to represent a real-world jimrg-james coaching scenario.

  • Org lookup migration dependency: refactor_group_id is now resolved via a DB lookup (expect-gated) rather than an INSERT, with a clear error message naming the required migration. This is consistent with the seed's dev-only contract.
  • New user + relationship: jim@refactorgroup.com is created as an Admin of Refactor Group, coaching james.hodapp@gmail.com (jim_hodapp) via the new jimrg_james coaching relationship with two seeded sessions (today and 7 days ago).
  • Role update: Caleb's Acme Corp role is promoted from User to Admin.

Confidence Score: 5/5

Safe to merge — all changes are confined to the dev-only seed function and introduce no production code paths.

The change touches only seed_database, a dev-only helper that runs after migrations and is intentionally unwrap-heavy. The new org lookup, user, coaching relationship, sessions, and role assignments are straightforward and consistent with the existing seed style. No production logic, schema, or API surface is affected.

No files require special attention.

Important Files Changed

Filename Overview
entity_api/src/lib.rs Seed data updated: reuses migration-created Refactor Group org, adds jim@refactorgroup.com user + Admin role, adds jimrg-james coaching relationship with two sessions, promotes Caleb to Acme Corp Admin. No logic errors introduced.

Entity Relationship Diagram

%%{init: {'theme': 'neutral'}}%%
erDiagram
    ORGANIZATIONS ||--o{ USER_ROLES : "org_id"
    ORGANIZATIONS ||--o{ COACHING_RELATIONSHIPS : "org_id"
    USERS ||--o{ USER_ROLES : "user_id"
    USERS ||--o{ COACHING_RELATIONSHIPS : "coach_id"
    USERS ||--o{ COACHING_RELATIONSHIPS : "coachee_id"
    COACHING_RELATIONSHIPS ||--o{ COACHING_SESSIONS : "relationship_id"

    ORGANIZATIONS {
        uuid id
        string name
        string slug
    }
    USERS {
        uuid id
        string email
        string first_name
        string last_name
    }
    USER_ROLES {
        uuid id
        role role
        uuid organization_id
        uuid user_id
    }
    COACHING_RELATIONSHIPS {
        uuid id
        string slug
        uuid coach_id
        uuid coachee_id
        uuid organization_id
    }
    COACHING_SESSIONS {
        uuid id
        uuid coaching_relationship_id
        date date
    }
Loading

Reviews (2): Last reviewed commit: "chore(seed): disambiguate Refactor Group..." | Re-trigger Greptile

Comment thread entity_api/src/lib.rs
@jhodapp jhodapp self-assigned this Jul 22, 2026
@jhodapp jhodapp added the enhancement Improves existing functionality or feature label Jul 22, 2026
@jhodapp jhodapp moved this to 🏗 In progress in Refactor Coaching Platform Jul 22, 2026
@jhodapp jhodapp added this to the 1.0.0-beta3 milestone Jul 22, 2026
Give jim@refactorgroup.com a distinct last name so it no longer collides with
james.hodapp@gmail.com (both were "Jim Hodapp") in first+last name views and
logs, per PR review.
@jhodapp
jhodapp merged commit d5e69c2 into main Jul 22, 2026
6 checks passed
@jhodapp
jhodapp deleted the feat/seed-refactor-group-data branch July 22, 2026 15:38
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in Refactor Coaching Platform Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improves existing functionality or feature

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant