Skip to content

[codex] Surface merchant application submit failures#136

Draft
SanchezOLeary wants to merge 3 commits into
mainfrom
codex/merchant-application-submit-errors
Draft

[codex] Surface merchant application submit failures#136
SanchezOLeary wants to merge 3 commits into
mainfrom
codex/merchant-application-submit-errors

Conversation

@SanchezOLeary

@SanchezOLeary SanchezOLeary commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stops the merchant application form from resetting/redirecting unless /locations actually returns 201.
  • Propagates submit errors from LocationProvider.addLocation() back to the form.
  • Returns a plain backend error body when saving the location application fails.
  • Includes payment_wallets: [] in the create payload so the touched form matches the existing AuthedLocation type.
  • Matches the location upsert conflict target to the actual partial unique index: active = TRUE AND google_id IS NOT NULL.

Why

The Sheba place data is being found and populated correctly, but /locations is returning 400. The confirmed backend error is Postgres rejecting the upsert because there is no unique/exclusion constraint matching the ON CONFLICT target.

The schema creates a partial unique index on locations(google_id) only where active = TRUE AND google_id IS NOT NULL, but the save query was targeting only active = TRUE. Postgres requires the conflict target to match an eligible unique/exclusion constraint or index, so the insert failed before any pending merchant application could be created.

Validation

  • git diff --check
  • cd backend && go test -vet=off ./db ./handlers
  • cd frontend && npx tsc --noEmit --pretty false still fails only on existing unrelated role-management/mock merchant type errors; no errors remain in the touched merchant application form.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app-prod Ready Ready Preview, Comment Jun 26, 2026 1:10am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant