Anon key não tinha permissão de INSERT em reserva_hotel.unidades — RLS exige authenticated + tenant_member, não atendido. POST direto falhava sem feedback útil. Solução: RPC reserva_hotel.provision_unidade(...) com SECURITY DEFINER que faz upsert idempotente bypassando RLS, com validações de tenant + marca dentro da função. EXECUTE granted to anon. Service agora chama /rpc/provision_unidade em vez de POST /unidades. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| config | ||
| lib | ||
| LICENSE | ||
| tasks_railtie.rb | ||