Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sergei / 88771 / Australian VRTC accounts are not able to create real account #7633

Merged
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,12 @@ const AccountSwitcher = props => {
const mt5_demo_total = getTotalBalanceCfd(props.mt5_login_list, true, exchanged_rate_cfd_demo);
const dxtrade_demo_total = getTotalBalanceCfd(props.dxtrade_accounts_list, true, exchanged_rate_cfd_demo);

const total =
(vrtc_currency !== account_total_balance_currency ? vrtc_balance * exchanged_rate_demo : vrtc_balance) +
mt5_demo_total.balance +
dxtrade_demo_total.balance;
const exchanged_balance =
vrtc_currency !== account_total_balance_currency ? vrtc_balance * exchanged_rate_demo : vrtc_balance;

return props.is_pre_appstore ? vrtc_balance : total;
const total = exchanged_balance + mt5_demo_total.balance + dxtrade_demo_total.balance;

return props.is_pre_appstore ? exchanged_balance : total;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you excluding mt5 and deriv X balance for trader's hub? isn't this wrong.
can you explain this code

cc: @mahdiyeh-deriv

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matin-deriv we are just excluding that for the old_UI( !is_pre_appstore)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matin-deriv I didn't exclude mt5 and derivX, I've just created a new constant const exchanged_balance = vrtc_currency !== account_total_balance_currency ? vrtc_balance * exchanged_rate_demo : vrtc_balance, and after this just change (vrtc_currency !== account_total_balance_currency ? vrtc_balance * exchanged_rate_demo : vrtc_balance) to the exchanged_balance for the total. I did it because we need exchanged_balance when return balance instead of vrtc_balance

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergei-deriv why do we need code change in balance calculation in this PR scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amina-deriv QA team member created a note with some issues in my card and moved back it to 'in progress'. You can find it here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification @sergei-deriv

};

const getTotalRealAssets = () => {
Expand Down Expand Up @@ -863,14 +863,17 @@ const AccountSwitcher = props => {
</Button>
</div>
))}
{can_manage_account && (
{(can_manage_account || !props.has_active_real_account) && (
<Button
className='acc-switcher__btn'
secondary
onClick={
props.has_any_real_account && !hasSetCurrency()
? setAccountCurrency
: () => props.openRealAccountSignup('manage')
: () =>
props.has_active_real_account
? props.openRealAccountSignup('manage')
: props.openRealAccountSignup()
}
>
{props.has_fiat && props.available_crypto_currencies?.length === 0
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2505,8 +2505,12 @@ export default class ClientStore extends BaseStore {
get is_high_risk() {
if (isEmptyObject(this.account_status)) return false;
const { gaming_company, financial_company } = this.landing_companies;

// This is a conditional check for countries like Australia/Norway which fulfil one of these following conditions.
const restricted_countries = financial_company?.shortcode === 'svg' || gaming_company?.shortcode === 'svg';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first and second line should be removed

Suggested change
const restricted_countries = financial_company?.shortcode === 'svg' || gaming_company?.shortcode === 'svg';
const restricted_countries = financial_company?.shortcode === 'svg' || (gaming_company?.shortcode === 'svg' && financial_company?.shortcode !== 'maltainvest')`;

financial_company?.shortcode === 'svg' || (gaming_company?.shortcode === 'svg' && financial_company?.shortcode !== 'maltainvest')`
const high_risk_landing_company = financial_company?.shortcode === 'svg' && gaming_company?.shortcode === 'svg';
return high_risk_landing_company || this.account_status.risk_classification === 'high';
return high_risk_landing_company || this.account_status.risk_classification === 'high' || restricted_countries;
}

get is_low_risk() {
Expand Down