Revert "feat: badge for tax 2025 bug (#5230)"
This reverts commit 6d1b0eef15.
This commit is contained in:
@@ -159,7 +159,6 @@ interface UserBalanceResponse {
|
|||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
balance: UserBalanceResponse | null
|
balance: UserBalanceResponse | null
|
||||||
preloadedPaymentData?: { country: string; methods: PayoutMethod[] } | null
|
preloadedPaymentData?: { country: string; methods: PayoutMethod[] } | null
|
||||||
userBadges?: number
|
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -195,7 +194,6 @@ const { addNotification } = injectNotificationManager()
|
|||||||
const withdrawContext = createWithdrawContext(
|
const withdrawContext = createWithdrawContext(
|
||||||
props.balance,
|
props.balance,
|
||||||
props.preloadedPaymentData || undefined,
|
props.preloadedPaymentData || undefined,
|
||||||
props.userBadges,
|
|
||||||
)
|
)
|
||||||
provideWithdrawContext(withdrawContext)
|
provideWithdrawContext(withdrawContext)
|
||||||
|
|
||||||
|
|||||||
@@ -761,19 +761,13 @@ const { data: payoutBalance } = await useAsyncData('payout/balance', () => {
|
|||||||
|
|
||||||
const showTaxComplianceBanner = computed(() => {
|
const showTaxComplianceBanner = computed(() => {
|
||||||
if (flags.value.testTaxForm && auth.value.user) return true
|
if (flags.value.testTaxForm && auth.value.user) return true
|
||||||
const user = auth.value.user
|
|
||||||
if (!user) return false
|
|
||||||
const bal = payoutBalance.value
|
const bal = payoutBalance.value
|
||||||
const status = bal?.form_completion_status ?? 'unknown'
|
|
||||||
const isComplete = status === 'complete'
|
|
||||||
const isTinMismatch = status === 'tin-mismatch'
|
|
||||||
if (isComplete || isTinMismatch) return false
|
|
||||||
// Show banner if user has the 2025 tax form badge override
|
|
||||||
if (user.badges & UserBadge.TAX_FORM_2025_REQUIRED) return true
|
|
||||||
// Otherwise, show if threshold met
|
|
||||||
if (!bal) return false
|
if (!bal) return false
|
||||||
const thresholdMet = (bal.withdrawn_ytd ?? 0) >= 600
|
const thresholdMet = (bal.withdrawn_ytd ?? 0) >= 600
|
||||||
return thresholdMet
|
const status = bal.form_completion_status ?? 'unknown'
|
||||||
|
const isComplete = status === 'complete'
|
||||||
|
const isTinMismatch = status === 'tin-mismatch'
|
||||||
|
return !!auth.value.user && thresholdMet && !isComplete && !isTinMismatch
|
||||||
})
|
})
|
||||||
|
|
||||||
const showTinMismatchBanner = computed(() => {
|
const showTinMismatchBanner = computed(() => {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
ref="withdrawModal"
|
ref="withdrawModal"
|
||||||
:balance="userBalance"
|
:balance="userBalance"
|
||||||
:preloaded-payment-data="preloadedPaymentMethods"
|
:preloaded-payment-data="preloadedPaymentMethods"
|
||||||
:user-badges="auth.user?.badges"
|
|
||||||
@refresh-data="refreshData"
|
@refresh-data="refreshData"
|
||||||
/>
|
/>
|
||||||
<div class="mb-20 flex flex-col gap-6 lg:pl-8">
|
<div class="mb-20 flex flex-col gap-6 lg:pl-8">
|
||||||
@@ -273,7 +272,7 @@ import RevenueTransaction from '~/components/ui/dashboard/RevenueTransaction.vue
|
|||||||
|
|
||||||
const { formatMessage } = useVIntl()
|
const { formatMessage } = useVIntl()
|
||||||
|
|
||||||
const auth = await useAuth()
|
await useAuth()
|
||||||
|
|
||||||
// TODO: Deduplicate these types & interfaces in @modrinth/api-client PR.
|
// TODO: Deduplicate these types & interfaces in @modrinth/api-client PR.
|
||||||
type FormCompletionStatus = 'unknown' | 'unrequested' | 'unsigned' | 'tin-mismatch' | 'complete'
|
type FormCompletionStatus = 'unknown' | 'unrequested' | 'unsigned' | 'tin-mismatch' | 'complete'
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
} from '@modrinth/assets'
|
} from '@modrinth/assets'
|
||||||
import type { MessageDescriptor } from '@modrinth/ui'
|
import type { MessageDescriptor } from '@modrinth/ui'
|
||||||
import { createContext, getCurrencyIcon, paymentMethodMessages, useDebugLogger } from '@modrinth/ui'
|
import { createContext, getCurrencyIcon, paymentMethodMessages, useDebugLogger } from '@modrinth/ui'
|
||||||
import { UserBadge } from '@modrinth/utils'
|
|
||||||
import { type Component, computed, type ComputedRef, type Ref, ref } from 'vue'
|
import { type Component, computed, type ComputedRef, type Ref, ref } from 'vue'
|
||||||
|
|
||||||
import { getRailConfig } from '@/utils/muralpay-rails'
|
import { getRailConfig } from '@/utils/muralpay-rails'
|
||||||
@@ -380,7 +379,6 @@ const STATE_EXPIRY_MS = 15 * 60 * 1000 // 15 minutes
|
|||||||
export function createWithdrawContext(
|
export function createWithdrawContext(
|
||||||
balance: any,
|
balance: any,
|
||||||
preloadedPaymentData?: { country: string; methods: PayoutMethod[] },
|
preloadedPaymentData?: { country: string; methods: PayoutMethod[] },
|
||||||
userBadges?: number,
|
|
||||||
): WithdrawContextValue {
|
): WithdrawContextValue {
|
||||||
const debug = useDebugLogger('CreatorWithdraw')
|
const debug = useDebugLogger('CreatorWithdraw')
|
||||||
const currentStage = ref<WithdrawStage | undefined>()
|
const currentStage = ref<WithdrawStage | undefined>()
|
||||||
@@ -422,18 +420,15 @@ export function createWithdrawContext(
|
|||||||
|
|
||||||
const usedLimit = balance?.withdrawn_ytd ?? 0
|
const usedLimit = balance?.withdrawn_ytd ?? 0
|
||||||
const available = balance?.available ?? 0
|
const available = balance?.available ?? 0
|
||||||
const hasBadgeOverride = !!(userBadges && userBadges & UserBadge.TAX_FORM_2025_REQUIRED)
|
|
||||||
|
|
||||||
const needsTaxForm =
|
const needsTaxForm =
|
||||||
balance?.form_completion_status !== 'complete' &&
|
balance?.form_completion_status !== 'complete' && usedLimit + available >= 600
|
||||||
(usedLimit + available >= 600 || hasBadgeOverride)
|
|
||||||
|
|
||||||
debug('Tax form check:', {
|
debug('Tax form check:', {
|
||||||
usedLimit,
|
usedLimit,
|
||||||
available,
|
available,
|
||||||
total: usedLimit + available,
|
total: usedLimit + available,
|
||||||
status: balance?.form_completion_status,
|
status: balance?.form_completion_status,
|
||||||
hasBadgeOverride,
|
|
||||||
needsTaxForm,
|
needsTaxForm,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -822,7 +817,6 @@ export function createWithdrawContext(
|
|||||||
calculation: {
|
calculation: {
|
||||||
amount: 0,
|
amount: 0,
|
||||||
fee: null,
|
fee: null,
|
||||||
netUsd: null,
|
|
||||||
exchangeRate: null,
|
exchangeRate: null,
|
||||||
},
|
},
|
||||||
providerData: {
|
providerData: {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ bitflags::bitflags! {
|
|||||||
const CONTRIBUTOR = 1 << 5;
|
const CONTRIBUTOR = 1 << 5;
|
||||||
const TRANSLATOR = 1 << 6;
|
const TRANSLATOR = 1 << 6;
|
||||||
const AFFILIATE = 1 << 7;
|
const AFFILIATE = 1 << 7;
|
||||||
const TAX_FORM_2025_REQUIRED = 1 << 8;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -342,7 +342,6 @@ export enum UserBadge {
|
|||||||
CONTRIBUTOR = 1 << 5,
|
CONTRIBUTOR = 1 << 5,
|
||||||
TRANSLATOR = 1 << 6,
|
TRANSLATOR = 1 << 6,
|
||||||
AFFILIATE = 1 << 7,
|
AFFILIATE = 1 << 7,
|
||||||
TAX_FORM_2025_REQUIRED = 1 << 8,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UserBadges = number
|
export type UserBadges = number
|
||||||
|
|||||||
Reference in New Issue
Block a user