Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

added tierCurrency

Blue Mouse32fced6b46c9
diff --git a/apps/production/src/user/entities/user.entity.ts b/apps/production/src/user/entities/user.entity.ts
index 293757442..1741370b1 100644
--- a/apps/production/src/user/entities/user.entity.ts
+++ b/apps/production/src/user/entities/user.entity.ts
@@ -246,6 +246,9 @@ export class User {
@Column({ type: 'date', nullable: true })
cancellationEffectiveDate: Date | null
+ @Column('varchar', { length: 3, nullable: true })
+ tierCurrency: string
+
@Column({
type: 'varchar',
length: 36,
diff --git a/apps/production/src/webhook/webhook.controller.ts b/apps/production/src/webhook/webhook.controller.ts
index b6e630564..fabd365c0 100644
--- a/apps/production/src/webhook/webhook.controller.ts
+++ b/apps/production/src/webhook/webhook.controller.ts
@@ -10,7 +10,7 @@ import {
import { ApiTags } from '@nestjs/swagger'
import * as _find from 'lodash/find'
-import { ProjectService } from 'src/project/project.service'
+import { ProjectService } from '../project/project.service'
import {
PlanCode,
ACCOUNT_PLANS,
@@ -55,6 +55,7 @@ export class WebhookController {
cancel_url: subCancelURL,
update_url: subUpdateURL,
next_bill_date: nextBillDate,
+ currency,
} = body
let uid
@@ -91,6 +92,7 @@ export class WebhookController {
billingFrequency: monthlyBilling
? BillingFrequency.Monthly
: BillingFrequency.Yearly,
+ tierCurrency: currency,
}
if (uid) {
@@ -114,6 +116,7 @@ export class WebhookController {
billingFrequency: BillingFrequency.Monthly,
nextBillDate: null,
cancellationEffectiveDate,
+ tierCurrency: null,
})
break
@@ -126,6 +129,7 @@ export class WebhookController {
// planCode: PlanCode.none,
// billingFrequency: BillingFrequency.Monthly,
// nextBillDate: null,
+ // tierCurrency: null,
// })
// break
@@ -139,6 +143,7 @@ export class WebhookController {
planCode: PlanCode.none,
billingFrequency: BillingFrequency.Monthly,
nextBillDate: null,
+ tierCurrency: null,
})
}
diff --git a/migrations/mysql/2023_05_22.sql b/migrations/mysql/2023_05_22.sql
new file mode 100644
index 000000000..00bf5f4a3
--- /dev/null
+++ b/migrations/mysql/2023_05_22.sql
@@ -0,0 +1 @@
+alter table user add column `tierCurrency` varchar(3) DEFAULT NULL AFTER cancellationEffectiveDate;