diff --git a/app/javascript/src/pages/Home/PoolListing.tsx b/app/javascript/src/pages/Home/PoolListing.tsx
index e1764e1..f325630 100644
--- a/app/javascript/src/pages/Home/PoolListing.tsx
+++ b/app/javascript/src/pages/Home/PoolListing.tsx
@@ -1,6 +1,4 @@
-import { graphql } from "babel-plugin-relay/macro";
import React, { useEffect, useState } from "react";
-import { useLazyLoadQuery } from "react-relay";
import { ethers } from "ethers";
import { unfinishedPools } from "../../constants/Pools";
@@ -9,7 +7,6 @@ import type { PoolConfig } from "../../types";
import { Pool } from "./Pool";
import sousChef from "../../abi/sousChef.json";
import { getEndBlock } from "../../utils/getEndBlock";
-import type { PoolListingQuery } from "./__generated__/PoolListingQuery.graphql";
import { notEmpty } from "../../utils/notEmpty";
import { Spinner } from "../../components";
import { usePersistedState } from "../../hooks/usePersistedState";
@@ -24,20 +21,8 @@ export const PoolListing = () => {
const [isLoadingPools, setIsLoadingPools] = useState(true);
- const { currentUser } = useLazyLoadQuery
(
- graphql`
- query PoolListingQuery {
- currentUser {
- balance {
- amount
- }
- }
- }
- `,
- {}
- );
-
- const balance = currentUser?.balance.amount ?? "0";
+ // TODO: puxar valor da wallet
+ const balance = "0";
useEffect(() => {
(async () => {
diff --git a/app/javascript/src/pages/Home/__generated__/PoolListingQuery.graphql.ts b/app/javascript/src/pages/Home/__generated__/PoolListingQuery.graphql.ts
deleted file mode 100644
index 18e7ed0..0000000
--- a/app/javascript/src/pages/Home/__generated__/PoolListingQuery.graphql.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-/* tslint:disable */
-/* eslint-disable */
-// @ts-nocheck
-
-import { ConcreteRequest } from "relay-runtime";
-export type PoolListingQueryVariables = {};
-export type PoolListingQueryResponse = {
- readonly currentUser: {
- readonly balance: {
- readonly amount: string;
- };
- } | null;
-};
-export type PoolListingQuery = {
- readonly response: PoolListingQueryResponse;
- readonly variables: PoolListingQueryVariables;
-};
-
-
-
-/*
-query PoolListingQuery {
- currentUser {
- balance {
- amount
- id
- }
- id
- }
-}
-*/
-
-const node: ConcreteRequest = (function(){
-var v0 = {
- "alias": null,
- "args": null,
- "kind": "ScalarField",
- "name": "amount",
- "storageKey": null
-},
-v1 = {
- "alias": null,
- "args": null,
- "kind": "ScalarField",
- "name": "id",
- "storageKey": null
-};
-return {
- "fragment": {
- "argumentDefinitions": [],
- "kind": "Fragment",
- "metadata": null,
- "name": "PoolListingQuery",
- "selections": [
- {
- "alias": null,
- "args": null,
- "concreteType": "User",
- "kind": "LinkedField",
- "name": "currentUser",
- "plural": false,
- "selections": [
- {
- "alias": null,
- "args": null,
- "concreteType": "Balance",
- "kind": "LinkedField",
- "name": "balance",
- "plural": false,
- "selections": [
- (v0/*: any*/)
- ],
- "storageKey": null
- }
- ],
- "storageKey": null
- }
- ],
- "type": "Query",
- "abstractKey": null
- },
- "kind": "Request",
- "operation": {
- "argumentDefinitions": [],
- "kind": "Operation",
- "name": "PoolListingQuery",
- "selections": [
- {
- "alias": null,
- "args": null,
- "concreteType": "User",
- "kind": "LinkedField",
- "name": "currentUser",
- "plural": false,
- "selections": [
- {
- "alias": null,
- "args": null,
- "concreteType": "Balance",
- "kind": "LinkedField",
- "name": "balance",
- "plural": false,
- "selections": [
- (v0/*: any*/),
- (v1/*: any*/)
- ],
- "storageKey": null
- },
- (v1/*: any*/)
- ],
- "storageKey": null
- }
- ]
- },
- "params": {
- "cacheID": "6af4091073903ead7eb057e9f245a32c",
- "id": null,
- "metadata": {},
- "name": "PoolListingQuery",
- "operationKind": "query",
- "text": "query PoolListingQuery {\n currentUser {\n balance {\n amount\n id\n }\n id\n }\n}\n"
- }
-};
-})();
-(node as any).hash = 'e296b5abac1f659b33d8c77522fbfc55';
-export default node;
diff --git a/app/javascript/src/pages/Orders/Deposit/Deposit.tsx b/app/javascript/src/pages/Orders/Deposit/Deposit.tsx
index 99f18f9..28baeed 100644
--- a/app/javascript/src/pages/Orders/Deposit/Deposit.tsx
+++ b/app/javascript/src/pages/Orders/Deposit/Deposit.tsx
@@ -9,8 +9,10 @@ import { History } from "./History";
import { Create } from "./Create";
import { DepositProvider, useDepositContext } from "./DepositProvider";
import { Show } from "./Show";
+import { useCurrentUser } from "../../../contexts/UserProvider";
const Component: FC = () => {
+ const { isAuthenticated } = useCurrentUser();
const { fetchKey } = useDepositContext();
const { depositOrders } = useLazyLoadQuery(
@@ -29,6 +31,8 @@ const Component: FC = () => {
}
);
+ if (!isAuthenticated) return ;
+
if (!depositOrders.totalCount)
return (
diff --git a/app/javascript/src/pages/Orders/Exchange/Exchange.tsx b/app/javascript/src/pages/Orders/Exchange/Exchange.tsx
index bd4e91b..beedf3e 100644
--- a/app/javascript/src/pages/Orders/Exchange/Exchange.tsx
+++ b/app/javascript/src/pages/Orders/Exchange/Exchange.tsx
@@ -6,8 +6,11 @@ import { useLazyLoadQuery } from "react-relay";
import { ExchangePanel } from "./ExchangePanel";
import { ExchangeHistory } from "./ExchangeHistory";
import type { ExchangeQuery } from "./__generated__/ExchangeQuery.graphql";
+import { Messages } from "../../../messages";
+import { useCurrentUser } from "../../../contexts/UserProvider";
export const Exchange = () => {
+ const { isAuthenticated } = useCurrentUser();
const data = useLazyLoadQuery(
graphql`
query ExchangeQuery {
@@ -25,6 +28,8 @@ export const Exchange = () => {
{}
);
+ if (!isAuthenticated) return ;
+
return (
diff --git a/app/javascript/src/pages/Orders/Exchange/ExchangePanel/ExchangePanel.tsx b/app/javascript/src/pages/Orders/Exchange/ExchangePanel/ExchangePanel.tsx
index ad4a25c..fbf044f 100644
--- a/app/javascript/src/pages/Orders/Exchange/ExchangePanel/ExchangePanel.tsx
+++ b/app/javascript/src/pages/Orders/Exchange/ExchangePanel/ExchangePanel.tsx
@@ -32,15 +32,14 @@ export const ExchangePanel: FC
= ({ userRef }) => {
fiatBalance {
amountCents
}
- balance {
- amount
- }
}
`,
userRef
);
- const balanceAmount = user?.balance?.amount ?? 0;
+ // TODO: puxar valor da wallet
+ const balanceAmount = 0;
+
const fiatBalanceAmount = user?.fiatBalance.amountCents ?? 0;
const avaliableCrypto = new BigNumber(balanceAmount);
diff --git a/app/javascript/src/pages/Orders/Exchange/ExchangePanel/__generated__/ExchangePanel_user.graphql.ts b/app/javascript/src/pages/Orders/Exchange/ExchangePanel/__generated__/ExchangePanel_user.graphql.ts
index 8a7c3b5..93e06ba 100644
--- a/app/javascript/src/pages/Orders/Exchange/ExchangePanel/__generated__/ExchangePanel_user.graphql.ts
+++ b/app/javascript/src/pages/Orders/Exchange/ExchangePanel/__generated__/ExchangePanel_user.graphql.ts
@@ -8,9 +8,6 @@ export type ExchangePanel_user = {
readonly fiatBalance: {
readonly amountCents: number;
};
- readonly balance: {
- readonly amount: string;
- };
readonly " $refType": "ExchangePanel_user";
};
export type ExchangePanel_user$data = ExchangePanel_user;
@@ -44,28 +41,10 @@ const node: ReaderFragment = {
}
],
"storageKey": null
- },
- {
- "alias": null,
- "args": null,
- "concreteType": "Balance",
- "kind": "LinkedField",
- "name": "balance",
- "plural": false,
- "selections": [
- {
- "alias": null,
- "args": null,
- "kind": "ScalarField",
- "name": "amount",
- "storageKey": null
- }
- ],
- "storageKey": null
}
],
"type": "User",
"abstractKey": null
};
-(node as any).hash = '2d9248ccbe47532d3f3ac0f21f02a274';
+(node as any).hash = '2058ddb20a60f148a524083fa0a680ea';
export default node;
diff --git a/app/javascript/src/pages/Orders/Exchange/__generated__/ExchangeQuery.graphql.ts b/app/javascript/src/pages/Orders/Exchange/__generated__/ExchangeQuery.graphql.ts
index 78cfb3f..5adf7a5 100644
--- a/app/javascript/src/pages/Orders/Exchange/__generated__/ExchangeQuery.graphql.ts
+++ b/app/javascript/src/pages/Orders/Exchange/__generated__/ExchangeQuery.graphql.ts
@@ -68,10 +68,6 @@ fragment ExchangePanel_user on User {
amountCents
id
}
- balance {
- amount
- id
- }
}
*/
@@ -196,25 +192,6 @@ return {
],
"storageKey": null
},
- {
- "alias": null,
- "args": null,
- "concreteType": "Balance",
- "kind": "LinkedField",
- "name": "balance",
- "plural": false,
- "selections": [
- {
- "alias": null,
- "args": null,
- "kind": "ScalarField",
- "name": "amount",
- "storageKey": null
- },
- (v0/*: any*/)
- ],
- "storageKey": null
- },
(v0/*: any*/)
],
"storageKey": null
@@ -324,12 +301,12 @@ return {
]
},
"params": {
- "cacheID": "fdc958a4c6802df3461f7a625f94729c",
+ "cacheID": "30aa6f9d81cfe033aee64b8577d15936",
"id": null,
"metadata": {},
"name": "ExchangeQuery",
"operationKind": "query",
- "text": "query ExchangeQuery {\n currentUser {\n ...ExchangePanel_user\n id\n }\n buyCryptoOrders {\n ...ExchangeHistory_buyCryptoOrders\n }\n sellCryptoOrders {\n ...ExchangeHistory_sellCryptoOrders\n }\n}\n\nfragment ExchangeHistory_buyCryptoOrders on BuyCryptoOrderConnection {\n edges {\n node {\n id\n status\n createdAt\n paidAmountCents\n receivedAmount\n __typename\n }\n }\n}\n\nfragment ExchangeHistory_sellCryptoOrders on SellCryptoOrderConnection {\n edges {\n node {\n id\n status\n paidAmount\n receivedAmountCents\n createdAt\n __typename\n }\n }\n}\n\nfragment ExchangePanel_user on User {\n fiatBalance {\n amountCents\n id\n }\n balance {\n amount\n id\n }\n}\n"
+ "text": "query ExchangeQuery {\n currentUser {\n ...ExchangePanel_user\n id\n }\n buyCryptoOrders {\n ...ExchangeHistory_buyCryptoOrders\n }\n sellCryptoOrders {\n ...ExchangeHistory_sellCryptoOrders\n }\n}\n\nfragment ExchangeHistory_buyCryptoOrders on BuyCryptoOrderConnection {\n edges {\n node {\n id\n status\n createdAt\n paidAmountCents\n receivedAmount\n __typename\n }\n }\n}\n\nfragment ExchangeHistory_sellCryptoOrders on SellCryptoOrderConnection {\n edges {\n node {\n id\n status\n paidAmount\n receivedAmountCents\n createdAt\n __typename\n }\n }\n}\n\nfragment ExchangePanel_user on User {\n fiatBalance {\n amountCents\n id\n }\n}\n"
}
};
})();
diff --git a/app/javascript/src/pages/Orders/Stake/Stake.tsx b/app/javascript/src/pages/Orders/Stake/Stake.tsx
index 9a24b1a..94189b2 100644
--- a/app/javascript/src/pages/Orders/Stake/Stake.tsx
+++ b/app/javascript/src/pages/Orders/Stake/Stake.tsx
@@ -8,8 +8,10 @@ import { getStatusTextAndColors } from "../utils/processStatus";
import type { StakeQuery } from "./__generated__/StakeQuery.graphql";
import { Messages } from "../../../messages";
import { Table, TableRow } from "../../../components";
+import { useCurrentUser } from "../../../contexts/UserProvider";
export const Stake: FC = () => {
+ const { isAuthenticated } = useCurrentUser();
const { stakeOrders } = useLazyLoadQuery(
graphql`
query StakeQuery {
@@ -29,6 +31,8 @@ export const Stake: FC = () => {
{}
);
+ if (!isAuthenticated) return ;
+
if (!stakeOrders.edges.length)
return ;
diff --git a/app/javascript/src/pages/Wallet/Balance.tsx b/app/javascript/src/pages/Wallet/Balance.tsx
index 77c7a52..191b46f 100644
--- a/app/javascript/src/pages/Wallet/Balance.tsx
+++ b/app/javascript/src/pages/Wallet/Balance.tsx
@@ -1,26 +1,13 @@
-import { graphql } from "babel-plugin-relay/macro";
import type { FC } from "react";
import React from "react";
-import { useFragment } from "react-relay";
import { Table, TableRow } from "../../components";
import { getCurrencyLogo } from "../../utils/getCurrencyLogo";
-import type { Balance_balance$key } from "./__generated__/Balance_balance.graphql";
-type Props = {
- balancesRef: Balance_balance$key;
-};
-export const Balance: FC = ({ balancesRef }) => {
- const node = useFragment(
- graphql`
- fragment Balance_balance on Balance {
- amount
- }
- `,
- balancesRef
- );
-
- if (!node) return null;
+export const Balance: FC = () => {
+ const node = {
+ amount: "PUXAR VALOR DA CARTEIRA",
+ };
return (
diff --git a/app/javascript/src/pages/Wallet/Wallet.tsx b/app/javascript/src/pages/Wallet/Wallet.tsx
index 65dbac1..6222eeb 100644
--- a/app/javascript/src/pages/Wallet/Wallet.tsx
+++ b/app/javascript/src/pages/Wallet/Wallet.tsx
@@ -18,9 +18,6 @@ export const Wallet: FC = () => {
fiatBalance {
...FiatBalance_fiatBalance
}
- balance {
- ...Balance_balance
- }
}
}
`,
@@ -34,7 +31,7 @@ export const Wallet: FC = () => {
diff --git a/app/javascript/src/pages/Wallet/__generated__/Balance_balance.graphql.ts b/app/javascript/src/pages/Wallet/__generated__/Balance_balance.graphql.ts
deleted file mode 100644
index 4a7217b..0000000
--- a/app/javascript/src/pages/Wallet/__generated__/Balance_balance.graphql.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/* tslint:disable */
-/* eslint-disable */
-// @ts-nocheck
-
-import { ReaderFragment } from "relay-runtime";
-import { FragmentRefs } from "relay-runtime";
-export type Balance_balance = {
- readonly amount: string;
- readonly " $refType": "Balance_balance";
-};
-export type Balance_balance$data = Balance_balance;
-export type Balance_balance$key = {
- readonly " $data"?: Balance_balance$data;
- readonly " $fragmentRefs": FragmentRefs<"Balance_balance">;
-};
-
-
-
-const node: ReaderFragment = {
- "argumentDefinitions": [],
- "kind": "Fragment",
- "metadata": null,
- "name": "Balance_balance",
- "selections": [
- {
- "alias": null,
- "args": null,
- "kind": "ScalarField",
- "name": "amount",
- "storageKey": null
- }
- ],
- "type": "Balance",
- "abstractKey": null
-};
-(node as any).hash = '3f420063f1e6ebfcd91bd05b7bbb492a';
-export default node;
diff --git a/app/javascript/src/pages/Wallet/__generated__/WalletQuery.graphql.ts b/app/javascript/src/pages/Wallet/__generated__/WalletQuery.graphql.ts
index 9a892e7..224fb8a 100644
--- a/app/javascript/src/pages/Wallet/__generated__/WalletQuery.graphql.ts
+++ b/app/javascript/src/pages/Wallet/__generated__/WalletQuery.graphql.ts
@@ -10,9 +10,6 @@ export type WalletQueryResponse = {
readonly fiatBalance: {
readonly " $fragmentRefs": FragmentRefs<"FiatBalance_fiatBalance">;
};
- readonly balance: {
- readonly " $fragmentRefs": FragmentRefs<"Balance_balance">;
- };
} | null;
};
export type WalletQuery = {
@@ -29,18 +26,10 @@ query WalletQuery {
...FiatBalance_fiatBalance
id
}
- balance {
- ...Balance_balance
- id
- }
id
}
}
-fragment Balance_balance on Balance {
- amount
-}
-
fragment FiatBalance_fiatBalance on FiatBalance {
amountCents
amountCurrency
@@ -85,22 +74,6 @@ return {
}
],
"storageKey": null
- },
- {
- "alias": null,
- "args": null,
- "concreteType": "Balance",
- "kind": "LinkedField",
- "name": "balance",
- "plural": false,
- "selections": [
- {
- "args": null,
- "kind": "FragmentSpread",
- "name": "Balance_balance"
- }
- ],
- "storageKey": null
}
],
"storageKey": null
@@ -149,25 +122,6 @@ return {
],
"storageKey": null
},
- {
- "alias": null,
- "args": null,
- "concreteType": "Balance",
- "kind": "LinkedField",
- "name": "balance",
- "plural": false,
- "selections": [
- {
- "alias": null,
- "args": null,
- "kind": "ScalarField",
- "name": "amount",
- "storageKey": null
- },
- (v0/*: any*/)
- ],
- "storageKey": null
- },
(v0/*: any*/)
],
"storageKey": null
@@ -175,14 +129,14 @@ return {
]
},
"params": {
- "cacheID": "d0537f2712255befa46df80db6c7246b",
+ "cacheID": "4397ad78f82d23c0a186b71bea7c3898",
"id": null,
"metadata": {},
"name": "WalletQuery",
"operationKind": "query",
- "text": "query WalletQuery {\n currentUser {\n fiatBalance {\n ...FiatBalance_fiatBalance\n id\n }\n balance {\n ...Balance_balance\n id\n }\n id\n }\n}\n\nfragment Balance_balance on Balance {\n amount\n}\n\nfragment FiatBalance_fiatBalance on FiatBalance {\n amountCents\n amountCurrency\n}\n"
+ "text": "query WalletQuery {\n currentUser {\n fiatBalance {\n ...FiatBalance_fiatBalance\n id\n }\n id\n }\n}\n\nfragment FiatBalance_fiatBalance on FiatBalance {\n amountCents\n amountCurrency\n}\n"
}
};
})();
-(node as any).hash = '61fbc56a1e87c83a8a0a4460c231be53';
+(node as any).hash = '83fd609428103b13e79c14d20fefaabe';
export default node;
diff --git a/app/models/balance.rb b/app/models/balance.rb
deleted file mode 100644
index 65dde6e..0000000
--- a/app/models/balance.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-# == Schema Information
-#
-# Table name: balances
-#
-# id :bigint not null, primary key
-# amount :decimal(20, 10) default(0.0), not null
-# created_at :datetime not null
-# updated_at :datetime not null
-# user_id :bigint not null
-#
-# Indexes
-#
-# index_balances_on_user_id (user_id)
-#
-# Foreign Keys
-#
-# fk_rails_... (user_id => users.id)
-#
-class Balance < ApplicationRecord
- include Trackable
-
- belongs_to :user
-
- validates :amount, presence: true, numericality: { greater_than_or_equal_to: 0 }
-
- def withdrawal!(value)
- update!(amount: amount - value)
- end
-
- def deposit!(value)
- update!(amount: amount + value)
- end
-end
diff --git a/app/models/user.rb b/app/models/user.rb
index 380efb8..3023f3c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -29,7 +29,6 @@ class User < ApplicationRecord
has_many :documents, class_name: "UserDocument", dependent: :destroy
has_many :stake_orders, dependent: :restrict_with_error
- has_one :balance, dependent: :restrict_with_error
has_one :fiat_balance, dependent: :restrict_with_error
validates :first_name, :last_name, :email, presence: true
diff --git a/app/policies/balance_policy.rb b/app/policies/balance_policy.rb
deleted file mode 100644
index f867bb3..0000000
--- a/app/policies/balance_policy.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-class BalancePolicy < ApplicationPolicy
- class Scope < Scope
- def resolve
- return scope.none if user.nil?
-
- scope.where(user_id: user.id)
- end
- end
-end
diff --git a/app/services/create_user_balances.rb b/app/services/create_user_balances.rb
index 3fac56e..a4661a3 100644
--- a/app/services/create_user_balances.rb
+++ b/app/services/create_user_balances.rb
@@ -10,22 +10,9 @@ class CreateUserBalances
return nil if Rails.env.test?
ActiveRecord::Base.transaction do
- create_fiat_balance
- create_balances
+ FiatBalance.find_or_create_by!(
+ user_id: user.id
+ )
end
end
-
- private
-
- def create_fiat_balance
- FiatBalance.find_or_create_by!(
- user_id: user.id
- )
- end
-
- def create_balances
- Balance.find_or_create_by(
- user_id: user.id
- )
- end
end
diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml
index 1a8ffec..bf6acc9 100644
--- a/config/locales/pt-BR.yml
+++ b/config/locales/pt-BR.yml
@@ -9,10 +9,6 @@ pt-BR:
one: Administrador
other: Administradores
- balance:
- one: Saldo
- other: Saldos
-
fiat_balance:
one: Saldo Fiat
other: Saldos Fiat
@@ -39,19 +35,12 @@ pt-BR:
last_name: Último nome
full_name: Nome completo
- balance:
- amount: Quantia
-
fiat_balance:
amount_formatted: Quantia
amount_cents: Quantia
errors:
models:
- balance:
- attributes:
- amount:
- greater_than_or_equal_to: saldo insuficiente
fiat_balance:
attributes:
amount_cents:
diff --git a/config/routes.rb b/config/routes.rb
index 8b01275..ecfc3d9 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,7 +7,6 @@ Rails.application.routes.draw do
namespace :admin do
resources :users
- resources :balances
resources :fiat_balances
resources :buy_crypto_orders
resources :sell_crypto_orders
diff --git a/db/migrate/20210913231405_drop_balance.rb b/db/migrate/20210913231405_drop_balance.rb
new file mode 100644
index 0000000..ab63281
--- /dev/null
+++ b/db/migrate/20210913231405_drop_balance.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+class DropBalance < ActiveRecord::Migration[6.1]
+ def change
+ # rubocop:disable Rails/ReversibleMigration
+ drop_table(:balances)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index ee33d14..61e897d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_09_06_021610) do
+ActiveRecord::Schema.define(version: 2021_09_13_231405) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
@@ -56,14 +56,6 @@ ActiveRecord::Schema.define(version: 2021_09_06_021610) do
t.index ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true
end
- create_table "balances", force: :cascade do |t|
- t.bigint "user_id", null: false
- t.decimal "amount", precision: 20, scale: 10, default: "0.0", null: false
- t.datetime "created_at", precision: 6, null: false
- t.datetime "updated_at", precision: 6, null: false
- t.index ["user_id"], name: "index_balances_on_user_id"
- end
-
create_table "buy_crypto_orders", force: :cascade do |t|
t.bigint "user_id", null: false
t.string "status", null: false
@@ -149,7 +141,6 @@ ActiveRecord::Schema.define(version: 2021_09_06_021610) do
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
- add_foreign_key "balances", "users"
add_foreign_key "buy_crypto_orders", "users"
add_foreign_key "deposit_orders", "users"
add_foreign_key "fiat_balances", "users"
diff --git a/erd.svg b/erd.svg
index 1c4f24f..a1b037c 100644
--- a/erd.svg
+++ b/erd.svg
@@ -1,68 +1,34 @@
-
-