Added a different message if the account is free tier (#69)

* Added a different upsell message if the account is free tier

* Fixing prettier and unit tests
This commit is contained in:
vchske
2020-07-08 10:02:47 -07:00
committed by GitHub
parent 512f56c28a
commit 955d08e4d0
9 changed files with 132 additions and 18 deletions

View File

@@ -279,12 +279,16 @@ export function getEstimatedSpendAcknowledgeString(
)} - ${currencySign}${calculateEstimateNumber(monthlyPrice)} monthly cost for the throughput above.`;
}
export function getUpsellMessage(serverId: string = "default"): string {
let price: number = Constants.OfferPricing.MonthlyPricing.default.Standard.StartingPrice;
export function getUpsellMessage(serverId: string = "default", isFreeTier: boolean = false): string {
if (isFreeTier) {
return `With free tier discount, you'll get the first 400 RU/s and 5 GB of storage in this account for free. Charges will apply if your resource throughput exceeds 400 RU/s.`;
} else {
let price: number = Constants.OfferPricing.MonthlyPricing.default.Standard.StartingPrice;
if (serverId === "mooncake") {
price = Constants.OfferPricing.MonthlyPricing.mooncake.Standard.StartingPrice;
if (serverId === "mooncake") {
price = Constants.OfferPricing.MonthlyPricing.mooncake.Standard.StartingPrice;
}
return `Start at ${getCurrencySign(serverId)}${price}/mo per database, multiple containers included`;
}
return `Start at ${getCurrencySign(serverId)}${price}/mo per database, multiple containers included`;
}