Skip to content

Commit

Permalink
Support plan.monthlyChargeCurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
TatianaFomina committed Nov 10, 2024
1 parent 4aa96a9 commit 35961c2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ type Plan {
"""Monthly charge for plan"""
monthlyCharge: Int!

"""Monthly charge currency for plan"""
monthlyChargeCurrency: String!

"""Events limit for plan"""
eventsLimit: Int!

Expand Down
1 change: 1 addition & 0 deletions src/api/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const WORKSPACE_PLAN = `
id
name
monthlyCharge
monthlyChargeCurrency
eventsLimit
}
}
Expand Down
1 change: 1 addition & 0 deletions src/api/plans/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const QUERY_PLANS = `
id
name
monthlyCharge
monthlyChargeCurrency
eventsLimit
}
}
Expand Down
16 changes: 15 additions & 1 deletion src/components/workspace/settings/BillingOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{{ plan.name || 'Free' }}
</div>
<div class="billing-card__plan-coast">
{{ plan.monthlyCharge || 0 }}$/{{ $t('billing.payPeriod') }}
{{ plan.monthlyCharge || 0 }}{{planCurrencySign}}/{{ $t('billing.payPeriod') }}
</div>
</div>
</div>
Expand Down Expand Up @@ -217,6 +217,20 @@ export default Vue.extend({
plan(): Plan {
return this.workspace.plan;
},
/**
* Return currency sign depending on plan currency
*/
planCurrencySign(): string {
switch (this.plan.monthlyChargeCurrency) {
case 'USD':
return '$';
case 'RUB':
return '';
default:
return '';
}
},
/**
* Total number of errors since the last charge date
*/
Expand Down
5 changes: 5 additions & 0 deletions src/types/plan.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export interface Plan {
*/
monthlyCharge: number;

/**
* Plan monthly charge currency
*/
monthlyChargeCurrency: 'USD' | 'RUB'

/**
* Plan events limit
*/
Expand Down

0 comments on commit 35961c2

Please sign in to comment.