Skip to main content

saasframe example seed-todos

yarn saasframe example seed-todos populates example Todos for a tenant/organization pair and ensures the module’s custom entity definitions are installed.

Usage

yarn saasframe example seed-todos --org <organizationId> --tenant <tenantId>

Aliases:

  • --organizationId for --org
  • --tenantId for --tenant

Behavior

  1. Installs or refreshes the example module’s custom entities and fields for the tenant (installCustomEntitiesFromModules).
  2. Creates 10 Todo records with alternating completion states scoped to the provided organization and tenant.
  3. Applies custom field values (priority, severity, blocked, labels) using the shared Data Engine.
  4. Logs progress and finishes with Seeded 10 todos with custom fields for org=<id>, tenant=<id>.

Example

ORG_ID=$(yarn saasframe auth list-orgs | awk 'NR==5 {print $1}')
TENANT_ID=$(yarn saasframe auth list-tenants | awk 'NR==5 {print $1}')
yarn saasframe example seed-todos --org "$ORG_ID" --tenant "$TENANT_ID"

Troubleshooting

  • Missing arguments – the command prints usage instructions and exits when either --org or --tenant is omitted.
  • Custom entity sync errors – ensure migrations ran and that Redis (if configured) is reachable; rerun the command after resolving connectivity issues.
  • Duplicate data – rerunning the command adds another batch of Todos. Delete or truncate the table if you want to reset the sample dataset.