diff --git a/app/components/affiliate-page/affiliate-referred-user-item.hbs b/app/components/affiliate-page/affiliate-referred-user-item.hbs index b8217f68bd..ef75c0cfeb 100644 --- a/app/components/affiliate-page/affiliate-referred-user-item.hbs +++ b/app/components/affiliate-page/affiliate-referred-user-item.hbs @@ -22,44 +22,44 @@ -
+
{{#if (gt @affiliateReferral.totalEarningsAmountInDollars 0)}} -
- ${{@affiliateReferral.spentAmountInDollars}} spent + + ${{@affiliateReferral.spentAmountInDollars}} + spent + -
+ {{/if}} + {{#if (gt @affiliateReferral.upcomingPaymentAmountInDollars 0)}} -
- ${{@affiliateReferral.upcomingPaymentAmountInDollars}} pending + + ${{@affiliateReferral.upcomingPaymentAmountInDollars}} + pending + -
+ {{/if}} -
- {{#if @affiliateReferral.statusIsTrialing}} - Trialing - - {{else if @affiliateReferral.statusIsPendingTrial}} - Signed up - - {{else if @affiliateReferral.statusIsFirstChargeSuccessful}} - Paid + + {{#if @affiliateReferral.statusIsAwaitingFirstCharge}} + + Signed up + + + + {{else if @affiliateReferral.statusIsFirstChargeSuccessful}} + + Paid + - {{else}} - Inactive - - {{/if}} -
+ + {{else}} + + Inactive + + + + {{/if}}
diff --git a/app/models/affiliate-referral.ts b/app/models/affiliate-referral.ts index 6f98be6385..f1d2120cdb 100644 --- a/app/models/affiliate-referral.ts +++ b/app/models/affiliate-referral.ts @@ -8,20 +8,20 @@ export default class AffiliateReferralModel extends Model { @belongsTo('affiliate-link', { async: false, inverse: 'referrals' }) declare affiliateLink: AffiliateLinkModel; @attr('date') declare activatedAt: Date; - @attr('string') declare status: 'pending_trial' | 'trialing' | 'first_charge_successful' | 'trial_cancelled' | 'inactive'; + @attr('string') declare status: 'awaiting_first_charge' | 'first_charge_successful' | 'inactive'; @attr('number') declare spentAmountInCents: number; @attr('number') declare upcomingPaymentAmountInCents: number; @attr('number') declare withdrawableEarningsAmountInCents: number; @attr('number') declare withheldEarningsAmountInCents: number; - get hasStartedTrial() { - return this.statusIsTrialing || this.statusIsFirstChargeSuccessful || this.statusIsTrialCancelled; - } - get spentAmountInDollars() { return this.spentAmountInCents / 100; } + get statusIsAwaitingFirstCharge() { + return this.status === 'awaiting_first_charge'; + } + get statusIsFirstChargeSuccessful() { return this.status === 'first_charge_successful'; } @@ -30,18 +30,6 @@ export default class AffiliateReferralModel extends Model { return this.status === 'inactive'; } - get statusIsPendingTrial() { - return this.status === 'pending_trial'; - } - - get statusIsTrialCancelled() { - return this.status === 'trial_cancelled'; - } - - get statusIsTrialing() { - return this.status === 'trialing'; - } - get totalEarningsAmountInCents() { return this.withdrawableEarningsAmountInCents + this.withheldEarningsAmountInCents; }