Skip to content

Commit

Permalink
Feature/1421/user-profile-withdraw (#1479)
Browse files Browse the repository at this point in the history
* feat: #1421; new Withdraw Widget-Main + Modal;

* feat: #1421; new Withdraw assets;

* feat: #1421; new Withdraw Widget ref +page.svelte;

* chore: clean store/user-settings.ts;

* doc: OpenApi adjust for Tx to DB action endpoint;

* feat: #1421; new balance Firebase upd func; clean;

* feat: #1421; endpoint /api/data/profile POST add;

* update: app.css for global form > input; clean;

* feat: #1421; add Withdraw-Widget Profile/Menu-Opt;

* feat: #1421; endpoint /api/data/profile; cont;

* pkg: @scores-lib ➤ 1.4.0;

* issue: #1483;

* pkg: ibantools 4.3.3;

* pkg: @scores-lib ➤ 1.4.1;

* issue: #1483; withdraw-fixes; cont;

* issue: #1486;

* issue: #1485;

* issue: #1486; cont;

* issue: #1488;

* issue: #1491;

* issue: #1497; #1489; #1495;

* issue: #1497; cont;

* issue: #1504;

* issue: #1506;

* issue: #1507; #1502;

* issue: #1508;

* issue: #1497;

* issue: #1497; cont;

* issue: #1497; cont;

* pkg: @scores-lib ➤ 1.4.4;

* issue: #1491;

* pkg: @scores-lib ➤ 1.4.5;

* issue: #1491; adjust show more action text;

* issue: #1498;

* pkg: @scores-lib ➤ 1.4.6;

* issue: #1498; types update;

* chore: firebase secrets;

* chore: firebase secrets;
  • Loading branch information
migbash authored Aug 9, 2023
1 parent 9250f52 commit 175e627
Show file tree
Hide file tree
Showing 26 changed files with 2,730 additions and 124 deletions.
69 changes: 68 additions & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1177,4 +1177,71 @@ paths:
responses:
200:
description:
Target player SEO widget data
Target player SEO widget data
post:
description:
Optional extended description in CommonMark or HTML.
tags:
- User
requestBody:
description:
⚠️❗️ IMPORTANT
Please read carefully
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/USER-WITHDRAW-REQUEST'
summary:
Endpoint dealing with User Updates.
responses:
200:
description:
User Updated!

components:

schemas:

USER-WITHDRAW-REQUEST:
type: object
properties:
asset:
type: string
example: USD
quantity:
type: integer
example: 53
amount:
type: integer
example: 10
type:
type: string
example: Withdraw
status:
type: string
example: Pending
Gateway:
type: string
example: Stripe
first_name:
type: string
example: M
last_name:
type: string
example: B
payment_email:
type: string
example: '@newEmail'
iban:
type: string
example: 12124123asd12
bic_swift:
type: string
example: asdqwe123123
wallet_address_erc20:
type: string
example: 0xqwe123dasd
uid:
type: string
example: 213210412321sad
39 changes: 32 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
"name": "betarena-scores-platform",
"description": "Betarena Official Scores Platform (PWA)",
"version": "1.1.1",
"engines":
{
"engines": {
"npm": "8.19.1",
"node": "16.17.0"
},
"scripts":
{
"scripts": {
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
Expand All @@ -25,7 +23,7 @@
"build": "vite build",
"preview": "vite preview --host --port 4173",
"preview:1-click:spin": "make preview-1-click-spin",
"start": "node build/index.js",
"start": "node build/index.js",
"start:docker": "node server-docker.js",
"start:heroku": "node server-heroku.js",
"@betarena/scores-lib:pull:next": "npm i @betarena/scores-lib@latest",
Expand All @@ -35,8 +33,7 @@
"test:unit": "vitest",
"coverage": "vitest run --coverage"
},
"devDependencies":
{
"devDependencies": {
"@playwright/test": "^1.36.1",
"@sveltejs/adapter-node": "^1.3.1",
"@sveltejs/kit": "^1.22.3",
Expand Down Expand Up @@ -64,9 +61,8 @@
"vitest": "^0.33.0"
},
"type": "module",
"dependencies":
{
"@betarena/scores-lib": "^1.3.4",
"dependencies": {
"@betarena/scores-lib": "^1.4.6",
"@lukeed/uuid": "^2.0.1",
"@metamask/sdk": "^0.1.0",
"@moralisweb3/client-firebase-auth-utils": "^2.18.4",
Expand All @@ -79,11 +75,13 @@
"compression": "^1.7.4",
"cookie": "^0.5.0",
"dotenv": "^16.3.1",
"email-validator": "^2.0.4",
"express": "^4.17.3",
"express-sslify": "^1.2.0",
"firebase": "^9.20.0",
"graphql-request": "^5.0.0",
"heroku-ssl-redirect": "^0.1.1",
"ibantools": "^4.3.3",
"ioredis": "^5.3.2",
"moralis": "^2.18.4",
"request-ip": "^3.3.0",
Expand Down
7 changes: 6 additions & 1 deletion src/lib/components/Platform-Alert.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
);
});
$: if_R_1 =
($sessionStore.livescoreShowCalendar && mobileExclusive)
|| $sessionStore.withdrawModal
;
</script>

<!-- ===================
Expand All @@ -48,7 +53,7 @@
{#if HEADER_TRANSLATION_DATA.scores_top_bar_messages.status && show}
<div
id="platform-alert-container"
class:update-z-index={$sessionStore.livescoreShowCalendar && mobileExclusive}>
class:update-z-index={if_R_1}>
<p
class="
s-12
Expand Down
34 changes: 20 additions & 14 deletions src/lib/components/_main_/header/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COMPONENT JS - BASIC
import sessionStore from '$lib/store/session.js';
import userBetarenaSettings from '$lib/store/user-settings.js';
import { NB_W_STY, NB_W_TAG, NB_W_TOG, dlog, dlogv2 } from '$lib/utils/debug';
import { viewport_change } from '$lib/utils/platform-functions';
import { selectLanguage, spliceBalanceDoubleZero, toDecimalFix, viewport_change } from '$lib/utils/platform-functions';
import { translationObject } from '$lib/utils/translation.js';
import { initUser, logoutUser } from '$lib/utils/user.js';
import { doc, updateDoc } from 'firebase/firestore';
Expand Down Expand Up @@ -79,6 +79,7 @@ COMPONENT JS - BASIC
$: B_NAV_T = $page.data.HEADER_TRANSLATION_DATA;
$: userUid = $userBetarenaSettings?.user?.firebase_user_data?.uid;
$: userLang = $userBetarenaSettings?.lang;
$: dropDownArea =
isLangDropdown
Expand Down Expand Up @@ -187,8 +188,8 @@ COMPONENT JS - BASIC
if (!$userBetarenaSettings?.lang
|| $page.error
|| !$page.route.id
|| $userBetarenaSettings?.user == undefined
|| !setUserLang) {
|| $userBetarenaSettings?.user == undefined)
{
return
}
Expand Down Expand Up @@ -272,10 +273,11 @@ COMPONENT JS - BASIC
NB_W_STY
);
// selectLanguage
// (
// userlang
// )
selectLanguage
(
userlang,
$page
);
}
/**
Expand Down Expand Up @@ -317,20 +319,19 @@ COMPONENT JS - BASIC
* TODO: DOC:
*/
$: if_R_3 =
$userBetarenaSettings?.lang
&& !$page.error
!$page.error
&& $page.route.id
&& $userBetarenaSettings?.user != undefined
;
$: if (if_R_3)
$: if (if_R_3 && userLang != undefined)
{
// [🐞]
console.debug
(
`🚏 checkpoint ➤ NAVBAR if_R_3`,
);
// update_select_lang()
update_select_lang();
}
/**
Expand Down Expand Up @@ -390,6 +391,11 @@ COMPONENT JS - BASIC
calcNavTrianglePos('scores');
}
$: if_R_4 =
($sessionStore.livescoreShowCalendar && isViewMobile)
|| $sessionStore.withdrawModal
;
// [🐞]
$: dlogv2
(
Expand Down Expand Up @@ -506,7 +512,7 @@ NAVBAR MAIN
column-space-center
"
class:user-active={PROFILE_URL == $page.route.id}
class:update-z-index={$sessionStore.livescoreShowCalendar && isViewMobile}
class:update-z-index={if_R_4}
>

<!--
Expand Down Expand Up @@ -1119,12 +1125,12 @@ NAVBAR MAIN
m-r-5
"
>
{$userBetarenaSettings?.user?.scores_user_data?.main_balance ?? '0.00'} BTA
{spliceBalanceDoubleZero(toDecimalFix($userBetarenaSettings?.user?.scores_user_data?.main_balance)) ?? '0.00'} BTA
</span>
{#if isViewMobile}
<br/>
{/if}
(${$userBetarenaSettings?.user?.scores_user_data?.main_balance ?? '0.00'})
(${spliceBalanceDoubleZero(toDecimalFix($userBetarenaSettings?.user?.scores_user_data?.main_balance)) ?? '0.00'})
</p>
</div>

Expand Down
16 changes: 8 additions & 8 deletions src/lib/components/page/profile/Widget-MenuOpt-Row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ VIEW DESIGN - 1
{:else if MENU_OPT == 'Scores'}
{RESPONSE_PROFILE_DATA?.profile?.scores ?? 'Scores'}
{:else if MENU_OPT == 'Withdraw'}
{'Withdraw'}
{RESPONSE_PROFILE_DATA?.profile?.withdraw ?? 'Withdraw'}
{:else if MENU_OPT == 'Deposit'}
{'Deposit'}
{RESPONSE_PROFILE_DATA?.profile?.deposit ?? 'Deposit'}
{:else if MENU_OPT == 'Transaction History'}
{'Transaction History'}
{RESPONSE_PROFILE_DATA?.profile?.transact_history ?? 'Transaction History'}
{:else if MENU_OPT == 'Competitions History'}
{'Competitions History'}
{RESPONSE_PROFILE_DATA?.profile?.competitions_history ?? 'Competitions History'}
{/if}
</p>

Expand Down Expand Up @@ -356,13 +356,13 @@ VIEW DESIGN - 2
{:else if MENU_OPT == 'Scores'}
{RESPONSE_PROFILE_DATA?.profile?.scores ?? 'Scores'}
{:else if MENU_OPT == 'Withdraw'}
{'Withdraw'}
{RESPONSE_PROFILE_DATA?.profile?.withdraw ?? 'Withdraw'}
{:else if MENU_OPT == 'Deposit'}
{'Deposit'}
{RESPONSE_PROFILE_DATA?.profile?.deposit ?? 'Deposit'}
{:else if MENU_OPT == 'Transaction History'}
{'Transaction History'}
{RESPONSE_PROFILE_DATA?.profile?.transact_history ?? 'Transaction History'}
{:else if MENU_OPT == 'Competitions History'}
{'Competitions History'}
{RESPONSE_PROFILE_DATA?.profile?.competitions_history ?? 'Competitions History'}
{/if}
</p>

Expand Down
Loading

0 comments on commit 175e627

Please sign in to comment.