add order and payment

This commit is contained in:
aditya.siregar
2024-06-04 02:59:31 +07:00
parent 8a23e72230
commit 4ae9079ff9
34 changed files with 810 additions and 1172 deletions
+2
View File
@@ -1,3 +1,5 @@
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE users
(
id BIGSERIAL,
+1 -1
View File
@@ -1 +1 @@
DROP TABLE partners;
DROP TABLE partners CASCADE;
+1 -1
View File
@@ -1 +1 @@
DROP TABLE orders;
DROP TABLE orders cascade;
+2 -3
View File
@@ -1,9 +1,8 @@
CREATE TABLE orders
(
id BIGSERIAL PRIMARY KEY,
ref_id UUID,
external_id varchar,
branch_id INTEGER,
ref_id varchar,
partner_id INTEGER,
status VARCHAR,
amount DECIMAL NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
+1
View File
@@ -0,0 +1 @@
DROP TABLE wallets cascade;
@@ -0,0 +1 @@
DROP TABLE payments cascade;
@@ -0,0 +1,16 @@
CREATE TABLE public.payments
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
partner_id varchar NOT NULL,
order_id varchar NOT NULL,
reference_id varchar NOT NULL,
channel varchar NOT NULL,
payment_type varchar NOT NULL,
amount numeric NOT NULL,
state varchar NOT NULL,
request_metadata json NOT NULL,
created_at timestamp NOT NULL,
updated_at timestamp NOT NULL,
finished_at timestamp NOT NULL,
CONSTRAINT payment_pkey PRIMARY KEY (id)
);