Skip to content

Commit 45ec8e4

Browse files
authored
Merge pull request #2979 from codecrafters-io/refactor-remove-upcoming-payment-logic
refactor: remove upcoming payment logic from affiliate referral
2 parents 1ed03dc + 4cd933e commit 45ec8e4

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

app/components/affiliate-page/affiliate-referred-user-item.hbs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,6 @@
3232
</Pill>
3333
{{/if}}
3434

35-
{{#if (gt @affiliateReferral.upcomingPaymentAmountInDollars 0)}}
36-
<Pill @color="yellow" class="shrink-0">
37-
${{@affiliateReferral.upcomingPaymentAmountInDollars}}
38-
pending
39-
40-
<EmberTooltip @text="This is the value of {{@affiliateReferral.customer.username}}'s upcoming payment." />
41-
</Pill>
42-
{{/if}}
43-
4435
{{#if @affiliateReferral.statusIsAwaitingFirstCharge}}
4536
<Pill @color="gray" class="shrink-0">
4637
Signed up

app/models/affiliate-referral.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export default class AffiliateReferralModel extends Model {
1010
@attr('date') declare activatedAt: Date;
1111
@attr('string') declare status: 'awaiting_first_charge' | 'first_charge_successful' | 'inactive';
1212
@attr('number') declare spentAmountInCents: number;
13-
@attr('number') declare upcomingPaymentAmountInCents: number;
1413
@attr('number') declare withdrawableEarningsAmountInCents: number;
1514
@attr('number') declare withheldEarningsAmountInCents: number;
1615

@@ -37,8 +36,4 @@ export default class AffiliateReferralModel extends Model {
3736
get totalEarningsAmountInDollars() {
3837
return this.totalEarningsAmountInCents / 100;
3938
}
40-
41-
get upcomingPaymentAmountInDollars() {
42-
return this.upcomingPaymentAmountInCents / 100;
43-
}
4439
}

tests/acceptance/affiliate-page/view-affiliate-referrals-test.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,15 @@ module('Acceptance | affiliate-page | view-affiliate-referrals', function (hooks
116116
referrer: this.server.schema.users.first(),
117117
affiliateLink: affiliateLink,
118118
activatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 7), // 7 days ago
119-
status: 'pending_trial',
119+
status: 'awaiting_first_charge',
120120
});
121121

122122
this.server.create('affiliate-referral', {
123123
customer: customer2,
124124
referrer: this.server.schema.users.first(),
125125
affiliateLink: affiliateLink,
126126
activatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 3), // 3 days ago
127-
status: 'trialing',
128-
upcomingPaymentAmountInCents: 59000,
127+
status: 'awaiting_first_charge',
129128
});
130129

131130
this.server.create('affiliate-referral', {
@@ -198,16 +197,15 @@ module('Acceptance | affiliate-page | view-affiliate-referrals', function (hooks
198197
referrer: this.server.schema.users.first(),
199198
affiliateLink: affiliateLink,
200199
activatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 7), // 7 days ago
201-
status: 'pending_trial',
200+
status: 'awaiting_first_charge',
202201
});
203202

204203
this.server.create('affiliate-referral', {
205204
customer: customer2,
206205
referrer: this.server.schema.users.first(),
207206
affiliateLink: affiliateLink,
208207
activatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 3), // 3 days ago
209-
status: 'trialing',
210-
upcomingPaymentAmountInCents: 59000,
208+
status: 'awaiting_first_charge',
211209
});
212210

213211
this.server.create('affiliate-referral', {
@@ -278,16 +276,15 @@ module('Acceptance | affiliate-page | view-affiliate-referrals', function (hooks
278276
referrer: this.server.schema.users.first(),
279277
affiliateLink: affiliateLink,
280278
activatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 7), // 7 days ago
281-
status: 'pending_trial',
279+
status: 'awaiting_first_charge',
282280
});
283281

284282
this.server.create('affiliate-referral', {
285283
customer: customer2,
286284
referrer: this.server.schema.users.first(),
287285
affiliateLink: affiliateLink,
288286
activatedAt: new Date(new Date().getTime() - 1000 * 60 * 60 * 24 * 3), // 3 days ago
289-
status: 'trialing',
290-
upcomingPaymentAmountInCents: 59000,
287+
status: 'awaiting_first_charge',
291288
});
292289

293290
this.server.create('affiliate-referral', {

0 commit comments

Comments
 (0)