add wallet address to user

This commit is contained in:
João Geonizeli
2021-08-18 15:58:04 -03:00
parent 00337665bd
commit d21bd33436
14 changed files with 125 additions and 86 deletions

View File

@@ -10,10 +10,10 @@ class UserDashboard < Administrate::BaseDashboard
# on pages throughout the dashboard. # on pages throughout the dashboard.
ATTRIBUTE_TYPES = { ATTRIBUTE_TYPES = {
id: Field::Number, id: Field::Number,
full_name: Field::String, email: Field::String,
first_name: Field::String, first_name: Field::String,
last_name: Field::String, last_name: Field::String,
email: Field::String, wallet_address: Field::String,
created_at: Field::DateTime, created_at: Field::DateTime,
updated_at: Field::DateTime, updated_at: Field::DateTime,
}.freeze }.freeze
@@ -23,16 +23,16 @@ class UserDashboard < Administrate::BaseDashboard
# #
# By default, it's limited to four items to reduce clutter on index pages. # By default, it's limited to four items to reduce clutter on index pages.
# Feel free to add, remove, or rearrange items. # Feel free to add, remove, or rearrange items.
COLLECTION_ATTRIBUTES = [:full_name, :email].freeze COLLECTION_ATTRIBUTES = [:id, :first_name, :last_name, :wallet_address, :email].freeze
# SHOW_PAGE_ATTRIBUTES # SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page. # an array of attributes that will be displayed on the model's show page.
SHOW_PAGE_ATTRIBUTES = [:id, :first_name, :last_name, :email, :created_at, :updated_at].freeze SHOW_PAGE_ATTRIBUTES = [:id, :first_name, :last_name, :wallet_address, :email, :created_at, :updated_at].freeze
# FORM_ATTRIBUTES # FORM_ATTRIBUTES
# an array of attributes that will be displayed # an array of attributes that will be displayed
# on the model's form (`new` and `edit`) pages. # on the model's form (`new` and `edit`) pages.
FORM_ATTRIBUTES = [:first_name, :last_name].freeze FORM_ATTRIBUTES = [:first_name, :last_name, :wallet_address].freeze
# COLLECTION_FILTERS # COLLECTION_FILTERS
# a hash that defines filters that can be used while searching via the search # a hash that defines filters that can be used while searching via the search

View File

@@ -7,9 +7,9 @@ module Types
graphql_name "User" graphql_name "User"
field :id, ID, null: false field :id, ID, null: false
field :email, String, null: false
field :first_name, String, null: false field :first_name, String, null: false
field :last_name, String, null: false field :last_name, String, null: false
field :full_name, String, null: false field :wallet_address, String, null: true
field :email, String, null: false
end end
end end

View File

@@ -506,7 +506,7 @@ type StakeOrderEdge {
type User { type User {
email: String! email: String!
firstName: String! firstName: String!
fullName: String!
id: ID! id: ID!
lastName: String! lastName: String!
walletAddress: String
} }

View File

@@ -27,6 +27,7 @@ query AppQuery {
fragment UserProvider_user on User { fragment UserProvider_user on User {
firstName firstName
walletAddress
} }
*/ */
@@ -78,6 +79,13 @@ const node: ConcreteRequest = {
"name": "firstName", "name": "firstName",
"storageKey": null "storageKey": null
}, },
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "walletAddress",
"storageKey": null
},
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -91,12 +99,12 @@ const node: ConcreteRequest = {
] ]
}, },
"params": { "params": {
"cacheID": "ce9692d3fdea00e7368e2a6404748f16", "cacheID": "56b4be302cf9b9ec226ad8145170961b",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "AppQuery", "name": "AppQuery",
"operationKind": "query", "operationKind": "query",
"text": "query AppQuery {\n currentUser {\n ...UserProvider_user\n id\n }\n}\n\nfragment UserProvider_user on User {\n firstName\n}\n" "text": "query AppQuery {\n currentUser {\n ...UserProvider_user\n id\n }\n}\n\nfragment UserProvider_user on User {\n firstName\n walletAddress\n}\n"
} }
}; };
(node as any).hash = 'aac57a65620cf50754d54f3c8d6495cf'; (node as any).hash = 'aac57a65620cf50754d54f3c8d6495cf';

View File

@@ -8,6 +8,7 @@ import type { UserProvider_user$key } from "./__generated__/UserProvider_user.gr
type CurrentUserContext = { type CurrentUserContext = {
user: { user: {
firstName: string; firstName: string;
walletAddress: string | null;
} | null; } | null;
isAuthenticated: boolean; isAuthenticated: boolean;
}; };
@@ -32,6 +33,7 @@ export const UserProvider: FC<Props> = ({ userRef, children }) => {
graphql` graphql`
fragment UserProvider_user on User { fragment UserProvider_user on User {
firstName firstName
walletAddress
} }
`, `,
userRef userRef
@@ -40,6 +42,7 @@ export const UserProvider: FC<Props> = ({ userRef, children }) => {
const user = userData const user = userData
? { ? {
firstName: userData.firstName, firstName: userData.firstName,
walletAddress: userData.walletAddress,
} }
: null; : null;

View File

@@ -6,6 +6,7 @@ import { ReaderFragment } from "relay-runtime";
import { FragmentRefs } from "relay-runtime"; import { FragmentRefs } from "relay-runtime";
export type UserProvider_user = { export type UserProvider_user = {
readonly firstName: string; readonly firstName: string;
readonly walletAddress: string | null;
readonly " $refType": "UserProvider_user"; readonly " $refType": "UserProvider_user";
}; };
export type UserProvider_user$data = UserProvider_user; export type UserProvider_user$data = UserProvider_user;
@@ -28,10 +29,17 @@ const node: ReaderFragment = {
"kind": "ScalarField", "kind": "ScalarField",
"name": "firstName", "name": "firstName",
"storageKey": null "storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "walletAddress",
"storageKey": null
} }
], ],
"type": "User", "type": "User",
"abstractKey": null "abstractKey": null
}; };
(node as any).hash = '352cdd208485d062f3f7c2e22e287a99'; (node as any).hash = 'ef997d2646b4d39178c6f3318509a7cb';
export default node; export default node;

View File

@@ -12,6 +12,7 @@
# remember_created_at :datetime # remember_created_at :datetime
# reset_password_sent_at :datetime # reset_password_sent_at :datetime
# reset_password_token :string # reset_password_token :string
# wallet_address :string
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# #
@@ -34,10 +35,6 @@ class User < ApplicationRecord
validates :first_name, :last_name, :email, presence: true validates :first_name, :last_name, :email, presence: true
validates :email, uniqueness: true validates :email, uniqueness: true
def full_name
"#{first_name} #{last_name}"
end
after_create do after_create do
create_balances create_balances
end end

View File

@@ -0,0 +1,6 @@
# frozen_string_literal: true
class AddWalletAddressToUser < ActiveRecord::Migration[6.1]
def change
add_column(:users, :wallet_address, :string)
end
end

3
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_08_17_233439) do ActiveRecord::Schema.define(version: 2021_08_18_185019) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@@ -134,6 +134,7 @@ ActiveRecord::Schema.define(version: 2021_08_17_233439) do
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at"
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.string "wallet_address"
t.index ["email"], name: "index_users_on_email", unique: true t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end end

146
erd.svg
View File

@@ -4,28 +4,28 @@
<!-- Generated by graphviz version 2.48.0 (0) <!-- Generated by graphviz version 2.48.0 (0)
--> -->
<!-- Title: XStake Pages: 1 --> <!-- Title: XStake Pages: 1 -->
<svg width="426pt" height="724pt" <svg width="606pt" height="724pt"
viewBox="0.00 0.00 425.60 724.10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> viewBox="0.00 0.00 605.60 724.10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(28.8 695.3)"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(28.8 695.3)">
<title>XStake</title> <title>XStake</title>
<polygon fill="white" stroke="transparent" points="-28.8,28.8 -28.8,-695.3 396.8,-695.3 396.8,28.8 -28.8,28.8"/> <polygon fill="white" stroke="transparent" points="-28.8,28.8 -28.8,-695.3 576.8,-695.3 576.8,28.8 -28.8,28.8"/>
<text text-anchor="middle" x="184" y="-652.1" font-family="Arial Bold" font-size="13.00">XStake domain model</text> <text text-anchor="middle" x="274" y="-652.1" font-family="Arial Bold" font-size="13.00">XStake domain model</text>
<!-- m_AdminUser --> <!-- m_AdminUser -->
<g id="node1" class="node"> <g id="node1" class="node">
<title>m_AdminUser</title> <title>m_AdminUser</title>
<path fill="none" stroke="black" d="M12,-47C12,-47 150,-47 150,-47 156,-47 162,-53 162,-59 162,-59 162,-130 162,-130 162,-136 156,-142 150,-142 150,-142 12,-142 12,-142 6,-142 0,-136 0,-130 0,-130 0,-59 0,-59 0,-53 6,-47 12,-47"/> <path fill="none" stroke="black" d="M12,-40C12,-40 150,-40 150,-40 156,-40 162,-46 162,-52 162,-52 162,-123 162,-123 162,-129 156,-135 150,-135 150,-135 12,-135 12,-135 6,-135 0,-129 0,-123 0,-123 0,-52 0,-52 0,-46 6,-40 12,-40"/>
<text text-anchor="start" x="49" y="-129.2" font-family="Arial Bold" font-size="11.00">AdminUser</text> <text text-anchor="start" x="49" y="-122.2" font-family="Arial Bold" font-size="11.00">AdminUser</text>
<polyline fill="none" stroke="black" points="0,-122 162,-122 "/> <polyline fill="none" stroke="black" points="0,-115 162,-115 "/>
<text text-anchor="start" x="7" y="-108.5" font-family="Arial" font-size="10.00">email </text> <text text-anchor="start" x="7" y="-101.5" font-family="Arial" font-size="10.00">email </text>
<text text-anchor="start" x="34" y="-108.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text> <text text-anchor="start" x="34" y="-101.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text>
<text text-anchor="start" x="7" y="-95.5" font-family="Arial" font-size="10.00">encrypted_password </text> <text text-anchor="start" x="7" y="-88.5" font-family="Arial" font-size="10.00">encrypted_password </text>
<text text-anchor="start" x="101" y="-95.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text> <text text-anchor="start" x="101" y="-88.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-82.5" font-family="Arial" font-size="10.00">remember_created_at </text> <text text-anchor="start" x="7" y="-75.5" font-family="Arial" font-size="10.00">remember_created_at </text>
<text text-anchor="start" x="105" y="-82.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text> <text text-anchor="start" x="105" y="-75.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text>
<text text-anchor="start" x="7" y="-69.5" font-family="Arial" font-size="10.00">reset_password_sent_at </text> <text text-anchor="start" x="7" y="-62.5" font-family="Arial" font-size="10.00">reset_password_sent_at </text>
<text text-anchor="start" x="117" y="-69.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text> <text text-anchor="start" x="117" y="-62.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text>
<text text-anchor="start" x="7" y="-56.5" font-family="Arial" font-size="10.00">reset_password_token </text> <text text-anchor="start" x="7" y="-49.5" font-family="Arial" font-size="10.00">reset_password_token </text>
<text text-anchor="start" x="109" y="-56.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text> <text text-anchor="start" x="109" y="-49.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g> </g>
<!-- m_Balance --> <!-- m_Balance -->
<g id="node2" class="node"> <g id="node2" class="node">
@@ -40,6 +40,29 @@
<text text-anchor="start" x="218" y="-569.5" font-family="Arial" font-size="10.00">user_id </text> <text text-anchor="start" x="218" y="-569.5" font-family="Arial" font-size="10.00">user_id </text>
<text text-anchor="start" x="253" y="-569.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text> <text text-anchor="start" x="253" y="-569.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text>
</g> </g>
<!-- m_PaperTrail::Version -->
<g id="node6" class="node">
<title>m_PaperTrail::Version</title>
<path fill="none" stroke="black" d="M416,-310C416,-310 536,-310 536,-310 542,-310 548,-316 548,-322 548,-322 548,-393 548,-393 548,-399 542,-405 536,-405 536,-405 416,-405 416,-405 410,-405 404,-399 404,-393 404,-393 404,-322 404,-322 404,-316 410,-310 416,-310"/>
<text text-anchor="start" x="423.5" y="-392.2" font-family="Arial Bold" font-size="11.00">PaperTrail::Version</text>
<polyline fill="none" stroke="black" points="404,-385 548,-385 "/>
<text text-anchor="start" x="411" y="-371.5" font-family="Arial" font-size="10.00">event </text>
<text text-anchor="start" x="439" y="-371.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="411" y="-358.5" font-family="Arial" font-size="10.00">item_id </text>
<text text-anchor="start" x="446" y="-358.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text>
<text text-anchor="start" x="411" y="-345.5" font-family="Arial" font-size="10.00">item_type </text>
<text text-anchor="start" x="457" y="-345.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="411" y="-332.5" font-family="Arial" font-size="10.00">object </text>
<text text-anchor="start" x="441" y="-332.5" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="411" y="-319.5" font-family="Arial" font-size="10.00">whodunnit </text>
<text text-anchor="start" x="459" y="-319.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g>
<!-- m_Balance&#45;&gt;m_PaperTrail::Version -->
<g id="edge1" class="edge">
<title>m_Balance&#45;&gt;m_PaperTrail::Version</title>
<path fill="none" stroke="black" d="M351.08,-559.9C357.13,-555.47 362.89,-550.66 368,-545.5 405.48,-507.62 434.29,-453.96 452.52,-413.67"/>
<polygon fill="black" stroke="black" points="455.47,-414.78 456.25,-405.28 449.71,-412.22 455.47,-414.78"/>
</g>
<!-- m_BuyCryptoOrder --> <!-- m_BuyCryptoOrder -->
<g id="node3" class="node"> <g id="node3" class="node">
<title>m_BuyCryptoOrder</title> <title>m_BuyCryptoOrder</title>
@@ -67,13 +90,13 @@
<text text-anchor="start" x="44" y="-407.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text> <text text-anchor="start" x="44" y="-407.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g> </g>
<!-- m_Currency&#45;&gt;m_Balance --> <!-- m_Currency&#45;&gt;m_Balance -->
<g id="edge9" class="edge"> <g id="edge11" class="edge">
<title>m_Currency&#45;&gt;m_Balance</title> <title>m_Currency&#45;&gt;m_Balance</title>
<path fill="none" stroke="black" d="M142.18,-441.08C149.45,-445.41 156.3,-450.52 162,-456.5 191.43,-487.4 170.07,-513.24 198,-545.5 200.55,-548.44 203.32,-551.25 206.25,-553.93"/> <path fill="none" stroke="black" d="M98.77,-441.41C119.93,-468.12 158.38,-513.63 198,-545.5 201.86,-548.61 205.95,-551.65 210.15,-554.6"/>
<polygon fill="black" stroke="black" points="204.45,-556.54 213.36,-559.94 208.52,-551.73 204.45,-556.54"/> <polygon fill="black" stroke="black" points="208.6,-557.35 217.82,-559.79 212.14,-552.14 208.6,-557.35"/>
</g> </g>
<!-- m_Currency&#45;&gt;m_BuyCryptoOrder --> <!-- m_Currency&#45;&gt;m_BuyCryptoOrder -->
<g id="edge6" class="edge"> <g id="edge8" class="edge">
<title>m_Currency&#45;&gt;m_BuyCryptoOrder</title> <title>m_Currency&#45;&gt;m_BuyCryptoOrder</title>
<path fill="none" stroke="black" d="M150.27,-441C162.68,-444.91 175.82,-449.05 188.81,-453.14"/> <path fill="none" stroke="black" d="M150.27,-441C162.68,-444.91 175.82,-449.05 188.81,-453.14"/>
<polygon fill="black" stroke="black" points="188.23,-456.27 197.76,-455.97 190.13,-450.26 188.23,-456.27"/> <polygon fill="black" stroke="black" points="188.23,-456.27 197.76,-455.97 190.13,-450.26 188.23,-456.27"/>
@@ -96,7 +119,7 @@
<text text-anchor="start" x="245" y="-319.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text> <text text-anchor="start" x="245" y="-319.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text>
</g> </g>
<!-- m_Currency&#45;&gt;m_SellCryptoOrder --> <!-- m_Currency&#45;&gt;m_SellCryptoOrder -->
<g id="edge8" class="edge"> <g id="edge10" class="edge">
<title>m_Currency&#45;&gt;m_SellCryptoOrder</title> <title>m_Currency&#45;&gt;m_SellCryptoOrder</title>
<path fill="none" stroke="black" d="M151.39,-397.99C165.03,-393.76 179.51,-389.27 193.68,-384.88"/> <path fill="none" stroke="black" d="M151.39,-397.99C165.03,-393.76 179.51,-389.27 193.68,-384.88"/>
<polygon fill="black" stroke="black" points="194.78,-387.84 202.45,-382.16 192.92,-381.82 194.78,-387.84"/> <polygon fill="black" stroke="black" points="194.78,-387.84 202.45,-382.16 192.92,-381.82 194.78,-387.84"/>
@@ -119,7 +142,7 @@
<text text-anchor="start" x="253" y="-194.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text> <text text-anchor="start" x="253" y="-194.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text>
</g> </g>
<!-- m_Currency&#45;&gt;m_StakeOrder --> <!-- m_Currency&#45;&gt;m_StakeOrder -->
<g id="edge10" class="edge"> <g id="edge12" class="edge">
<title>m_Currency&#45;&gt;m_StakeOrder</title> <title>m_Currency&#45;&gt;m_StakeOrder</title>
<path fill="none" stroke="black" d="M100.24,-397.8C122.24,-372.15 160.91,-328.76 198,-295.5 201.47,-292.38 205.09,-289.26 208.79,-286.17"/> <path fill="none" stroke="black" d="M100.24,-397.8C122.24,-372.15 160.91,-328.76 198,-295.5 201.47,-292.38 205.09,-289.26 208.79,-286.17"/>
<polygon fill="black" stroke="black" points="211.04,-288.4 215.99,-280.25 207.04,-283.53 211.04,-288.4"/> <polygon fill="black" stroke="black" points="211.04,-288.4 215.99,-280.25 207.04,-283.53 211.04,-288.4"/>
@@ -137,69 +160,60 @@
<text text-anchor="start" x="218" y="-95.5" font-family="Arial" font-size="10.00">user_id </text> <text text-anchor="start" x="218" y="-95.5" font-family="Arial" font-size="10.00">user_id </text>
<text text-anchor="start" x="253" y="-95.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text> <text text-anchor="start" x="253" y="-95.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text>
</g> </g>
<!-- m_PaperTrail::Version --> <!-- m_FiatBalance&#45;&gt;m_PaperTrail::Version -->
<g id="node6" class="node"> <g id="edge2" class="edge">
<title>m_PaperTrail::Version</title> <title>m_FiatBalance&#45;&gt;m_PaperTrail::Version</title>
<path fill="none" stroke="black" d="M21,-471C21,-471 141,-471 141,-471 147,-471 153,-477 153,-483 153,-483 153,-554 153,-554 153,-560 147,-566 141,-566 141,-566 21,-566 21,-566 15,-566 9,-560 9,-554 9,-554 9,-483 9,-483 9,-477 15,-471 21,-471"/> <path fill="none" stroke="black" d="M351.08,-155.1C357.13,-159.53 362.89,-164.34 368,-169.5 405.48,-207.38 434.29,-261.04 452.52,-301.33"/>
<text text-anchor="start" x="28.5" y="-553.2" font-family="Arial Bold" font-size="11.00">PaperTrail::Version</text> <polygon fill="black" stroke="black" points="449.71,-302.78 456.25,-309.72 455.47,-300.22 449.71,-302.78"/>
<polyline fill="none" stroke="black" points="9,-546 153,-546 "/>
<text text-anchor="start" x="16" y="-532.5" font-family="Arial" font-size="10.00">event </text>
<text text-anchor="start" x="44" y="-532.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="16" y="-519.5" font-family="Arial" font-size="10.00">item_id </text>
<text text-anchor="start" x="51" y="-519.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8)</text>
<text text-anchor="start" x="16" y="-506.5" font-family="Arial" font-size="10.00">item_type </text>
<text text-anchor="start" x="62" y="-506.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="16" y="-493.5" font-family="Arial" font-size="10.00">object </text>
<text text-anchor="start" x="46" y="-493.5" font-family="Arial Italic" font-size="10.00" fill="#999999">text</text>
<text text-anchor="start" x="16" y="-480.5" font-family="Arial" font-size="10.00">whodunnit </text>
<text text-anchor="start" x="64" y="-480.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g> </g>
<!-- m_User --> <!-- m_User -->
<g id="node9" class="node"> <g id="node9" class="node">
<title>m_User</title> <title>m_User</title>
<path fill="none" stroke="black" d="M12,-172C12,-172 150,-172 150,-172 156,-172 162,-178 162,-184 162,-184 162,-281 162,-281 162,-287 156,-293 150,-293 150,-293 12,-293 12,-293 6,-293 0,-287 0,-281 0,-281 0,-184 0,-184 0,-178 6,-172 12,-172"/> <path fill="none" stroke="black" d="M12,-165.5C12,-165.5 150,-165.5 150,-165.5 156,-165.5 162,-171.5 162,-177.5 162,-177.5 162,-287.5 162,-287.5 162,-293.5 156,-299.5 150,-299.5 150,-299.5 12,-299.5 12,-299.5 6,-299.5 0,-293.5 0,-287.5 0,-287.5 0,-177.5 0,-177.5 0,-171.5 6,-165.5 12,-165.5"/>
<text text-anchor="start" x="66.5" y="-280.2" font-family="Arial Bold" font-size="11.00">User</text> <text text-anchor="start" x="66.5" y="-286.7" font-family="Arial Bold" font-size="11.00">User</text>
<polyline fill="none" stroke="black" points="0,-273 162,-273 "/> <polyline fill="none" stroke="black" points="0,-279.5 162,-279.5 "/>
<text text-anchor="start" x="7" y="-259.5" font-family="Arial" font-size="10.00">email </text> <text text-anchor="start" x="7" y="-266.5" font-family="Arial" font-size="10.00">email </text>
<text text-anchor="start" x="34" y="-259.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text> <text text-anchor="start" x="34" y="-266.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string U</text>
<text text-anchor="start" x="7" y="-246.5" font-family="Arial" font-size="10.00">encrypted_password </text> <text text-anchor="start" x="7" y="-253.5" font-family="Arial" font-size="10.00">encrypted_password </text>
<text text-anchor="start" x="101" y="-246.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text> <text text-anchor="start" x="101" y="-253.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-233.5" font-family="Arial" font-size="10.00">first_name </text> <text text-anchor="start" x="7" y="-240.5" font-family="Arial" font-size="10.00">first_name </text>
<text text-anchor="start" x="56" y="-233.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text> <text text-anchor="start" x="56" y="-240.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-220.5" font-family="Arial" font-size="10.00">last_name </text> <text text-anchor="start" x="7" y="-227.5" font-family="Arial" font-size="10.00">last_name </text>
<text text-anchor="start" x="56" y="-220.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text> <text text-anchor="start" x="56" y="-227.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-207.5" font-family="Arial" font-size="10.00">remember_created_at </text> <text text-anchor="start" x="7" y="-214.5" font-family="Arial" font-size="10.00">remember_created_at </text>
<text text-anchor="start" x="105" y="-207.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text> <text text-anchor="start" x="105" y="-214.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text>
<text text-anchor="start" x="7" y="-194.5" font-family="Arial" font-size="10.00">reset_password_sent_at </text> <text text-anchor="start" x="7" y="-201.5" font-family="Arial" font-size="10.00">reset_password_sent_at </text>
<text text-anchor="start" x="117" y="-194.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text> <text text-anchor="start" x="117" y="-201.5" font-family="Arial Italic" font-size="10.00" fill="#999999">datetime</text>
<text text-anchor="start" x="7" y="-181.5" font-family="Arial" font-size="10.00">reset_password_token </text> <text text-anchor="start" x="7" y="-188.5" font-family="Arial" font-size="10.00">reset_password_token </text>
<text text-anchor="start" x="109" y="-181.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text> <text text-anchor="start" x="109" y="-188.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
<text text-anchor="start" x="7" y="-175.5" font-family="Arial" font-size="10.00">wallet_address </text>
<text text-anchor="start" x="76" y="-175.5" font-family="Arial Italic" font-size="10.00" fill="#999999">string</text>
</g> </g>
<!-- m_User&#45;&gt;m_Balance --> <!-- m_User&#45;&gt;m_Balance -->
<g id="edge3" class="edge"> <g id="edge5" class="edge">
<title>m_User&#45;&gt;m_Balance</title> <title>m_User&#45;&gt;m_Balance</title>
<path fill="none" stroke="black" d="M118.97,-293.21C134.07,-320.11 150.62,-352.6 162,-383.5 187.49,-452.71 154.51,-485.93 198,-545.5 200.01,-548.25 202.23,-550.88 204.6,-553.37"/> <path fill="none" stroke="black" d="M122.66,-299.86C136.72,-325.37 151.54,-355.1 162,-383.5 187.49,-452.71 154.51,-485.93 198,-545.5 200.01,-548.25 202.23,-550.88 204.6,-553.37"/>
<polygon fill="black" stroke="black" points="202.54,-555.76 211.23,-559.69 206.89,-551.2 202.54,-555.76"/> <polygon fill="black" stroke="black" points="202.54,-555.76 211.23,-559.69 206.89,-551.2 202.54,-555.76"/>
</g> </g>
<!-- m_User&#45;&gt;m_BuyCryptoOrder --> <!-- m_User&#45;&gt;m_BuyCryptoOrder -->
<g id="edge5" class="edge"> <g id="edge7" class="edge">
<title>m_User&#45;&gt;m_BuyCryptoOrder</title> <title>m_User&#45;&gt;m_BuyCryptoOrder</title>
<path fill="none" stroke="black" d="M111.75,-293.26C132.6,-332.2 162.94,-382.4 198,-420.5 200.55,-423.28 203.25,-426.01 206.04,-428.69"/> <path fill="none" stroke="black" d="M115.31,-299.85C135.98,-337.74 164.89,-384.52 198,-420.5 200.55,-423.28 203.25,-426.01 206.04,-428.69"/>
<polygon fill="black" stroke="black" points="203.97,-431.07 212.73,-434.85 208.24,-426.43 203.97,-431.07"/> <polygon fill="black" stroke="black" points="203.97,-431.07 212.73,-434.85 208.24,-426.43 203.97,-431.07"/>
</g> </g>
<!-- m_User&#45;&gt;m_FiatBalance --> <!-- m_User&#45;&gt;m_FiatBalance -->
<g id="edge4" class="edge"> <g id="edge6" class="edge">
<title>m_User&#45;&gt;m_FiatBalance</title> <title>m_User&#45;&gt;m_FiatBalance</title>
<path fill="none" stroke="black" d="M162.2,-187.59C181.54,-176.76 201.91,-165.35 220.26,-155.07"/> <path fill="none" stroke="black" d="M162.2,-187.59C181.54,-176.76 201.91,-165.35 220.26,-155.07"/>
</g> </g>
<!-- m_User&#45;&gt;m_SellCryptoOrder --> <!-- m_User&#45;&gt;m_SellCryptoOrder -->
<g id="edge7" class="edge"> <g id="edge9" class="edge">
<title>m_User&#45;&gt;m_SellCryptoOrder</title> <title>m_User&#45;&gt;m_SellCryptoOrder</title>
<path fill="none" stroke="black" d="M162.2,-282.62C173.96,-289.98 186.11,-297.57 197.95,-304.97"/> <path fill="none" stroke="black" d="M162.2,-282.62C173.96,-289.98 186.11,-297.57 197.95,-304.97"/>
<polygon fill="black" stroke="black" points="196.38,-307.7 205.68,-309.8 199.72,-302.36 196.38,-307.7"/> <polygon fill="black" stroke="black" points="196.38,-307.7 205.68,-309.8 199.72,-302.36 196.38,-307.7"/>
</g> </g>
<!-- m_User&#45;&gt;m_StakeOrder --> <!-- m_User&#45;&gt;m_StakeOrder -->
<g id="edge2" class="edge"> <g id="edge4" class="edge">
<title>m_User&#45;&gt;m_StakeOrder</title> <title>m_User&#45;&gt;m_StakeOrder</title>
<path fill="none" stroke="black" d="M162.2,-232.5C175.14,-232.5 188.54,-232.5 201.49,-232.5"/> <path fill="none" stroke="black" d="M162.2,-232.5C175.14,-232.5 188.54,-232.5 201.49,-232.5"/>
<polygon fill="black" stroke="black" points="201.83,-235.65 210.83,-232.5 201.83,-229.35 201.83,-235.65"/> <polygon fill="black" stroke="black" points="201.83,-235.65 210.83,-232.5 201.83,-229.35 201.83,-235.65"/>
@@ -216,10 +230,10 @@
<text text-anchor="start" x="253" y="-10.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text> <text text-anchor="start" x="253" y="-10.5" font-family="Arial Italic" font-size="10.00" fill="#999999">integer (8) FK</text>
</g> </g>
<!-- m_User&#45;&gt;m_UserDocument --> <!-- m_User&#45;&gt;m_UserDocument -->
<g id="edge1" class="edge"> <g id="edge3" class="edge">
<title>m_User&#45;&gt;m_UserDocument</title> <title>m_User&#45;&gt;m_UserDocument</title>
<path fill="none" stroke="black" d="M150.96,-171.77C154.91,-167.12 158.63,-162.35 162,-157.5 185.64,-123.47 169.85,-101.9 198,-71.5 201.12,-68.13 204.56,-64.98 208.22,-62.05"/> <path fill="none" stroke="black" d="M150.29,-165.23C154.45,-160.06 158.4,-154.8 162,-149.5 183.7,-117.6 171.21,-98.27 198,-70.5 200.88,-67.51 204.02,-64.71 207.33,-62.07"/>
<polygon fill="black" stroke="black" points="210.14,-64.56 215.5,-56.67 206.39,-59.49 210.14,-64.56"/> <polygon fill="black" stroke="black" points="209.43,-64.44 214.84,-56.58 205.71,-59.35 209.43,-64.44"/>
</g> </g>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -12,6 +12,7 @@
# remember_created_at :datetime # remember_created_at :datetime
# reset_password_sent_at :datetime # reset_password_sent_at :datetime
# reset_password_token :string # reset_password_token :string
# wallet_address :string
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# #

View File

@@ -6,9 +6,9 @@ RSpec.describe(Types::UserType) do
describe "arguments" do describe "arguments" do
it { is_expected.to(have_a_field(:id).of_type("ID!")) } it { is_expected.to(have_a_field(:id).of_type("ID!")) }
it { is_expected.to(have_a_field(:email).of_type("String!")) }
it { is_expected.to(have_a_field(:first_name).of_type("String!")) } it { is_expected.to(have_a_field(:first_name).of_type("String!")) }
it { is_expected.to(have_a_field(:last_name).of_type("String!")) } it { is_expected.to(have_a_field(:last_name).of_type("String!")) }
it { is_expected.to(have_a_field(:full_name).of_type("String!")) } it { is_expected.to(have_a_field(:wallet_address).of_type("String")) }
it { is_expected.to(have_a_field(:email).of_type("String!")) }
end end
end end

View File

@@ -12,6 +12,7 @@
# remember_created_at :datetime # remember_created_at :datetime
# reset_password_sent_at :datetime # reset_password_sent_at :datetime
# reset_password_token :string # reset_password_token :string
# wallet_address :string
# created_at :datetime not null # created_at :datetime not null
# updated_at :datetime not null # updated_at :datetime not null
# #

View File

@@ -2,9 +2,9 @@
require "rails_helper" require "rails_helper"
RSpec.describe("Homes", type: :request) do RSpec.describe("Homes", type: :request) do
describe "GET /index" do describe "GET /" do
it "returns http success" do it "returns http success" do
get "/home/index" get "/"
expect(response).to(have_http_status(:success)) expect(response).to(have_http_status(:success))
end end
end end