Bite 30G manual‐data seeder - RodrigoMattosoSilveira/EnterpriseRemoteSystems GitHub Wiki

From the repository root: cd /Users/rodrigosilveira/projects/EnterpriseRemoteSystems

export PORTABILITY_DB="$PWD/backend/data/bite327-valid-cpf.db"

rm -f \
  "$PORTABILITY_DB" \
  "$PORTABILITY_DB-wal" \
  "$PORTABILITY_DB-shm" \
  "$PORTABILITY_DB-journal"

DB_PATH="$PORTABILITY_DB" ./scripts/db-migrate.sh

Then seed the valid-CPF fixture:

python3 scripts/seed-bite30g-final-manual-testdata.py \
  --db-path "$PORTABILITY_DB" \
  --batch bite327 \
  --no-backup

That script's CPF generator explicitly computes valid CPF check digits, rather than using the intentionally invalid Brazilian-demo values. Then verify the seeded People:

sqlite3 -header -column "$PORTABILITY_DB" "
SELECT
    gp.first_name,
    gp.last_name,
    gp.cpf,
    gp.email,
    m.tenant_id,
    rd.code AS status
FROM global_people gp
JOIN person_tenant_memberships m
  ON m.person_id = gp.id
LEFT JOIN reference_data rd
  ON rd.id = m.status_id
WHERE gp.id LIKE 'manual30g-bite327-%'
ORDER BY m.tenant_id, gp.last_name, gp.first_name;
"

You should now see normal 11-digit CPFs belonging to the seeded bite327 People. Then start LOCAL using this database:

ERS_DATABASE_PATH="$PORTABILITY_DB" make local-backend

and your frontend normally in the other terminal:

make local-frontend