remove currency model and all references

This commit is contained in:
João Geonizeli
2021-08-28 01:29:07 -03:00
parent 31078f87ae
commit 0d10e86526
74 changed files with 665 additions and 1561 deletions

View File

@@ -8,10 +8,5 @@ module Types
field :id, ID, null: false
field :amount, String, null: false
field :currency, CurrencyType, null: false
def currency
dataloader.with(Dataloader::Source, Currency).load(object.currency_id)
end
end
end

View File

@@ -7,12 +7,6 @@ module Types
graphql_name "BuyCryptoOrder"
field :id, ID, null: false
field :currency, CurrencyType, null: false
def currency
dataloader.with(Dataloader::Source, Currency).load(object.currency_id)
end
field :status, ProcessStatusEnum, null: false
field :paid_amount_cents, Integer, null: false
field :received_amount, String, null: true

View File

@@ -1,12 +0,0 @@
# frozen_string_literal: true
module Types
class CurrencyType < Types::BaseObject
implements GraphQL::Types::Relay::Node
global_id_field :id
graphql_name "Currency"
field :id, ID, null: false
field :name, String, null: false
end
end

View File

@@ -10,16 +10,6 @@ module Types
context[:current_user]
end
field :balances, BalanceType.connection_type, null: false
def balances
Pundit.policy_scope(current_user, Balance)
end
field :fiat_balances, FiatBalanceType.connection_type, null: false
def fiat_balances
Pundit.policy_scope(current_user, FiatBalance)
end
field :sell_crypto_orders, SellCryptoOrderType.connection_type, null: false
def sell_crypto_orders
Pundit.policy_scope(current_user, SellCryptoOrder)

View File

@@ -7,12 +7,6 @@ module Types
graphql_name "SellCryptoOrder"
field :id, ID, null: false
field :currency, CurrencyType, null: false
def currency
dataloader.with(Dataloader::Source, Currency).load(object.currency_id)
end
field :status, ProcessStatusEnum, null: false
field :paid_amount, String, null: false
field :received_amount_cents, Integer, null: true

View File

@@ -11,5 +11,8 @@ module Types
field :first_name, String, null: false
field :last_name, String, null: false
field :wallet_address, String, null: true
field :balance, BalanceType, null: false
field :fiat_balance, FiatBalanceType, null: false
end
end