feat: incorporation type as a dropdown backed by a reference table #11

Merged
julian merged 2 commits from feat/supabase-database into main 2026-06-16 16:29:26 +02:00
Owner

Summary

Makes the incorporation type (legal form) a dropdown backed by a new reference table, replacing the free-text field. Builds on the Supabase backend already merged via #10.

Schema

  • New incorporation_types table: GmbH, AG, GmbH & Co. KG, Inc., GbR, each with attributes (jurisdiction, min capital + currency, liability, register/notary required) and a requirements checklist. RLS: read for authenticated users.
  • Clean FK: profiles.legal_form_code → incorporation_types.code; free-text legal_form dropped.
  • apply_all.sql regenerated from migrations (was stale).

App

  • StoreProfile.legalForm → legalFormCode; IncorporationType type + cached AppData slice; db.ts fetches/maps the table.
  • New SelectField UI primitive + IncorporationInfo panel (shows the picked type's attributes & requirements).
  • Dropdown replaces the free-text input in the onboarding company step and the account → store profile.

Verification

  • tsc --noEmit clean; expo lint 0 errors.
  • Migration applied to the hosted DB (5 rows seeded, legal_form_code present); app runs in the iOS simulator and hydrates the types.

🤖 Generated with Claude Code

## Summary Makes the incorporation type (legal form) a **dropdown** backed by a new reference table, replacing the free-text field. Builds on the Supabase backend already merged via #10. ### Schema - New `incorporation_types` table: **GmbH, AG, GmbH & Co. KG, Inc., GbR**, each with attributes (jurisdiction, min capital + currency, liability, register/notary required) and a `requirements` checklist. RLS: read for authenticated users. - Clean FK: `profiles.legal_form_code → incorporation_types.code`; free-text `legal_form` dropped. - `apply_all.sql` regenerated from migrations (was stale). ### App - `StoreProfile.legalForm → legalFormCode`; `IncorporationType` type + cached AppData slice; `db.ts` fetches/maps the table. - New `SelectField` UI primitive + `IncorporationInfo` panel (shows the picked type's attributes & requirements). - Dropdown replaces the free-text input in the onboarding company step and the account → store profile. ## Verification - `tsc --noEmit` clean; `expo lint` 0 errors. - Migration applied to the hosted DB (5 rows seeded, `legal_form_code` present); app runs in the iOS simulator and hydrates the types. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Replace the free-text legal-form field with a dropdown sourced from a new
incorporation_types reference table (GmbH, AG, GmbH & Co. KG, Inc., GbR), each
row carrying attributes (jurisdiction, min capital, liability, register/notary)
and a requirements checklist. Profiles now reference it via a clean FK.

- supabase/migrations/…_incorporation_types.sql: reference table + RLS read
  policy, seed rows, profiles.legal_form_code FK (drops free-text legal_form)
- supabase/apply_all.sql: regenerated from migrations (was stale)
- types: StoreProfile.legalForm -> legalFormCode; add IncorporationType + AppData slice
- db.ts: fetch + map incorporation_types; profile maps legal_form_code
- store/seed: new shape; cache the reference data
- ui/SelectField: reusable labelled dropdown primitive
- components/IncorporationInfo: attributes + requirements panel for the picked type
- onboarding + account/store: dropdown replaces the free-text input

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
julian changed title from feat: Supabase backend, onboarding & incorporation-type dropdown to feat: incorporation type as a dropdown backed by a reference table 2026-06-15 13:05:48 +02:00
- Add inline country-prefix PhoneField (flag + dial code) to the personal
  phone input in onboarding and the account screen
- Make all personal and business fields mandatory: gate onboarding Next and
  disable Save in the account edit modals on empty input
- Expand the incorporation_types reference table (UG, OHG, KG, e.K., SE, Ltd)
  and add a country selector that filters the legal-form list by jurisdiction
- Reorder the business step (country + legal form under zip/city) and add a
  "Firmierung / Incorporation" section header between them
- Extract shared country metadata into src/lib/countries.ts; refresh CLAUDE.md
  for the Supabase backing and regenerate apply_all.sql

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
julian merged commit bf796fcd15 into main 2026-06-16 16:29:26 +02:00
julian deleted branch feat/supabase-database 2026-06-16 16:29:40 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
julian/quickfin!11
No description provided.