Add payment response object.

This commit is contained in:
Patrick Fic
2023-02-22 08:15:58 -08:00
parent 43e4ff911e
commit fea69fe3a5
3 changed files with 59 additions and 0 deletions

View File

@@ -4502,6 +4502,62 @@
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
name: payment_response
schema: public
object_relationships:
- name: bodyshop
using:
foreign_key_constraint_on: bodyshopid
- name: job
using:
foreign_key_constraint_on: jobid
- name: payment
using:
foreign_key_constraint_on: paymentid
insert_permissions:
- role: user
permission:
check:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- amount
- bodyshopid
- declinereason
- ext_paymentid
- jobid
- paymentid
- response
- successful
select_permissions:
- role: user
permission:
columns:
- successful
- response
- amount
- declinereason
- ext_paymentid
- bodyshopid
- id
- jobid
- paymentid
filter:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
name: payments
schema: public

View File

@@ -0,0 +1 @@
DROP TABLE "public"."payment_response";

View File

@@ -0,0 +1,2 @@
CREATE TABLE "public"."payment_response" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "bodyshopid" uuid NOT NULL, "jobid" uuid, "paymentid" uuid, "successful" boolean NOT NULL DEFAULT false, "ext_paymentid" text NOT NULL, "amount" numeric NOT NULL, "declinereason" text, "response" jsonb NOT NULL DEFAULT jsonb_build_object(), PRIMARY KEY ("id") , FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("jobid") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade, FOREIGN KEY ("paymentid") REFERENCES "public"."payments"("id") ON UPDATE cascade ON DELETE cascade);
CREATE EXTENSION IF NOT EXISTS pgcrypto;