You've already forked AstralRinth
forked from didirus/AstralRinth
Clearer error on TIN mismatch (#4579)
* Clearer error on TIN mismatch * Remove ctoken code (how did that end up there) * polish: frontend for TIN/SSN mismatch * fix: lint * polish: only banner + change text * fix: logic * fix: lint --------- Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
This commit is contained in:
committed by
GitHub
parent
752f68124c
commit
7796273529
@@ -82,6 +82,23 @@
|
|||||||
</ButtonStyled>
|
</ButtonStyled>
|
||||||
</template>
|
</template>
|
||||||
</PagewideBanner>
|
</PagewideBanner>
|
||||||
|
<PagewideBanner v-if="showTinMismatchBanner" variant="error">
|
||||||
|
<template #title>
|
||||||
|
<span>{{ formatMessage(tinMismatchBannerMessages.title) }}</span>
|
||||||
|
</template>
|
||||||
|
<template #description>
|
||||||
|
<span>{{ formatMessage(tinMismatchBannerMessages.description) }}</span>
|
||||||
|
</template>
|
||||||
|
<template #actions>
|
||||||
|
<div class="flex w-fit flex-row">
|
||||||
|
<ButtonStyled color="red">
|
||||||
|
<nuxt-link to="https://support.modrinth.com" target="_blank" rel="noopener">
|
||||||
|
<MessageIcon /> {{ formatMessage(tinMismatchBannerMessages.action) }}
|
||||||
|
</nuxt-link>
|
||||||
|
</ButtonStyled>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</PagewideBanner>
|
||||||
<PagewideBanner v-if="showTaxComplianceBanner" variant="warning">
|
<PagewideBanner v-if="showTaxComplianceBanner" variant="warning">
|
||||||
<template #title>
|
<template #title>
|
||||||
<span>{{ formatMessage(taxBannerMessages.title) }}</span>
|
<span>{{ formatMessage(taxBannerMessages.title) }}</span>
|
||||||
@@ -851,6 +868,7 @@ import {
|
|||||||
LogInIcon,
|
LogInIcon,
|
||||||
LogOutIcon,
|
LogOutIcon,
|
||||||
MastodonIcon,
|
MastodonIcon,
|
||||||
|
MessageIcon,
|
||||||
ModrinthIcon,
|
ModrinthIcon,
|
||||||
MoonIcon,
|
MoonIcon,
|
||||||
OrganizationIcon,
|
OrganizationIcon,
|
||||||
@@ -918,7 +936,15 @@ const showTaxComplianceBanner = computed(() => {
|
|||||||
const thresholdMet = (bal.withdrawn_ytd ?? 0) >= 600
|
const thresholdMet = (bal.withdrawn_ytd ?? 0) >= 600
|
||||||
const status = bal.form_completion_status ?? 'unknown'
|
const status = bal.form_completion_status ?? 'unknown'
|
||||||
const isComplete = status === 'complete'
|
const isComplete = status === 'complete'
|
||||||
return !!auth.value.user && thresholdMet && !isComplete
|
const isTinMismatch = status === 'tin-mismatch'
|
||||||
|
return !!auth.value.user && thresholdMet && !isComplete && !isTinMismatch
|
||||||
|
})
|
||||||
|
|
||||||
|
const showTinMismatchBanner = computed(() => {
|
||||||
|
const bal = payoutBalance.value
|
||||||
|
if (!bal) return false
|
||||||
|
const status = bal.form_completion_status ?? 'unknown'
|
||||||
|
return !!auth.value.user && status === 'tin-mismatch'
|
||||||
})
|
})
|
||||||
|
|
||||||
const taxBannerMessages = defineMessages({
|
const taxBannerMessages = defineMessages({
|
||||||
@@ -929,7 +955,7 @@ const taxBannerMessages = defineMessages({
|
|||||||
description: {
|
description: {
|
||||||
id: 'layout.banner.tax.description',
|
id: 'layout.banner.tax.description',
|
||||||
defaultMessage:
|
defaultMessage:
|
||||||
'You’ve already withdrawn over $600 from Modrinth this year. To comply with tax regulations, you need to complete a tax form. Your withdrawals are paused until this form is submitted.',
|
"You've already withdrawn over $600 from Modrinth this year. To comply with tax regulations, you need to complete a tax form. Your withdrawals are paused until this form is submitted.",
|
||||||
},
|
},
|
||||||
action: {
|
action: {
|
||||||
id: 'layout.banner.tax.action',
|
id: 'layout.banner.tax.action',
|
||||||
@@ -937,6 +963,22 @@ const taxBannerMessages = defineMessages({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const tinMismatchBannerMessages = defineMessages({
|
||||||
|
title: {
|
||||||
|
id: 'layout.banner.tin-mismatch.title',
|
||||||
|
defaultMessage: 'Tax form failed',
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
id: 'layout.banner.tin-mismatch.description',
|
||||||
|
defaultMessage:
|
||||||
|
"Your withdrawals are temporarily locked because your TIN or SSN didn't match IRS records. Please contact support to reset and resubmit your tax form.",
|
||||||
|
},
|
||||||
|
action: {
|
||||||
|
id: 'layout.banner.tin-mismatch.action',
|
||||||
|
defaultMessage: 'Contact support',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const taxFormModalRef = ref(null)
|
const taxFormModalRef = ref(null)
|
||||||
function openTaxForm(e) {
|
function openTaxForm(e) {
|
||||||
if (taxFormModalRef.value && taxFormModalRef.value.startTaxForm) {
|
if (taxFormModalRef.value && taxFormModalRef.value.startTaxForm) {
|
||||||
@@ -1732,6 +1774,7 @@ const footerLinks = [
|
|||||||
@media screen and (min-width: 354px) {
|
@media screen and (min-width: 354px) {
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 674px) {
|
@media screen and (min-width: 674px) {
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
}
|
}
|
||||||
@@ -1926,10 +1969,12 @@ const footerLinks = [
|
|||||||
width: 25rem;
|
width: 25rem;
|
||||||
height: 25rem;
|
height: 25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.animation-ring-2 {
|
.animation-ring-2 {
|
||||||
width: 50rem;
|
width: 50rem;
|
||||||
height: 50rem;
|
height: 50rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.animation-ring-3 {
|
.animation-ring-3 {
|
||||||
width: 100rem;
|
width: 100rem;
|
||||||
height: 100rem;
|
height: 100rem;
|
||||||
@@ -1958,15 +2003,19 @@ const footerLinks = [
|
|||||||
0% {
|
0% {
|
||||||
rotate: 0deg;
|
rotate: 0deg;
|
||||||
}
|
}
|
||||||
|
|
||||||
25% {
|
25% {
|
||||||
rotate: calc(1deg * (var(--_r-count) - 20));
|
rotate: calc(1deg * (var(--_r-count) - 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
rotate: 0deg;
|
rotate: 0deg;
|
||||||
}
|
}
|
||||||
|
|
||||||
75% {
|
75% {
|
||||||
rotate: calc(-1deg * (var(--_r-count) - 20));
|
rotate: calc(-1deg * (var(--_r-count) - 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
rotate: 0deg;
|
rotate: 0deg;
|
||||||
}
|
}
|
||||||
@@ -1976,15 +2025,19 @@ const footerLinks = [
|
|||||||
0% {
|
0% {
|
||||||
translate: 0;
|
translate: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
25% {
|
25% {
|
||||||
translate: calc(2px * (var(--_r-count) - 20));
|
translate: calc(2px * (var(--_r-count) - 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
translate: 0;
|
translate: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
75% {
|
75% {
|
||||||
translate: calc(-2px * (var(--_r-count) - 20));
|
translate: calc(-2px * (var(--_r-count) - 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
translate: 0;
|
translate: 0;
|
||||||
}
|
}
|
||||||
@@ -1994,15 +2047,19 @@ const footerLinks = [
|
|||||||
0% {
|
0% {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
25% {
|
25% {
|
||||||
transform: translateY(calc(2px * (var(--_r-count) - 20)));
|
transform: translateY(calc(2px * (var(--_r-count) - 20)));
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
75% {
|
75% {
|
||||||
transform: translateY(calc(-2px * (var(--_r-count) - 20)));
|
transform: translateY(calc(-2px * (var(--_r-count) - 20)));
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -924,11 +924,20 @@
|
|||||||
"message": "Complete tax form"
|
"message": "Complete tax form"
|
||||||
},
|
},
|
||||||
"layout.banner.tax.description": {
|
"layout.banner.tax.description": {
|
||||||
"message": "You’ve already withdrawn over $600 from Modrinth this year. To comply with tax regulations, you need to complete a tax form. Your withdrawals are paused until this form is submitted."
|
"message": "You've already withdrawn over $600 from Modrinth this year. To comply with tax regulations, you need to complete a tax form. Your withdrawals are paused until this form is submitted."
|
||||||
},
|
},
|
||||||
"layout.banner.tax.title": {
|
"layout.banner.tax.title": {
|
||||||
"message": "Tax form required"
|
"message": "Tax form required"
|
||||||
},
|
},
|
||||||
|
"layout.banner.tin-mismatch.action": {
|
||||||
|
"message": "Contact support"
|
||||||
|
},
|
||||||
|
"layout.banner.tin-mismatch.description": {
|
||||||
|
"message": "Your withdrawals are temporarily locked because your TIN or SSN didn't match IRS records. Please contact support to reset and resubmit your tax form."
|
||||||
|
},
|
||||||
|
"layout.banner.tin-mismatch.title": {
|
||||||
|
"message": "Tax form failed"
|
||||||
|
},
|
||||||
"layout.banner.verify-email.action": {
|
"layout.banner.verify-email.action": {
|
||||||
"message": "Re-send verification email"
|
"message": "Re-send verification email"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
before proceeding.
|
before proceeding.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p v-if="blockedByTax" class="font-bold text-orange">
|
<p v-else-if="blockedByTax" class="font-bold text-orange">
|
||||||
You have withdrawn over $600 this year. To continue withdrawing, you must complete a tax form.
|
You have withdrawn over $600 this year. To continue withdrawing, you must complete a tax form.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,18 @@ pub async fn post_compliance_form(
|
|||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let mut compliance = match maybe_compliance {
|
let mut compliance = match maybe_compliance {
|
||||||
Some(c) => c,
|
Some(c) => {
|
||||||
|
if c.signed.is_some()
|
||||||
|
&& c.form_type.is_some_and(|f| f.requires_domestic_tin_match())
|
||||||
|
&& !c.tin_matched
|
||||||
|
{
|
||||||
|
return Err(ApiError::InvalidInput(
|
||||||
|
"Your TIN/SSN did not match the IRS records. Please contact support https://support.modrinth.com".to_owned(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
c
|
||||||
|
}
|
||||||
None => users_compliance::UserCompliance {
|
None => users_compliance::UserCompliance {
|
||||||
id: 0,
|
id: 0,
|
||||||
user_id,
|
user_id,
|
||||||
@@ -1110,7 +1121,11 @@ pub async fn get_balance(
|
|||||||
if compliance.compliance_api_check_failed {
|
if compliance.compliance_api_check_failed {
|
||||||
FormCompletionStatus::Unknown
|
FormCompletionStatus::Unknown
|
||||||
} else if compliance.model.signed.is_some() {
|
} else if compliance.model.signed.is_some() {
|
||||||
if compliance.model.tin_matched {
|
if compliance.model.tin_matched
|
||||||
|
|| compliance.model.form_type.is_some_and(|x| {
|
||||||
|
!x.requires_domestic_tin_match()
|
||||||
|
})
|
||||||
|
{
|
||||||
FormCompletionStatus::Complete
|
FormCompletionStatus::Complete
|
||||||
} else {
|
} else {
|
||||||
FormCompletionStatus::TinMismatch
|
FormCompletionStatus::TinMismatch
|
||||||
|
|||||||
Reference in New Issue
Block a user