From 4104fb2f8f08ee7f74237b7e22a7bb3700123a6d Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sat, 26 Oct 2024 10:29:04 +0200
Subject: [PATCH 1/3] Feature/Improve subscription service (#3989)
* Various improvements
---
apps/api/src/app/subscription/subscription.controller.ts | 2 +-
apps/api/src/app/subscription/subscription.service.ts | 4 +++-
apps/client/src/app/components/header/header.component.html | 3 ++-
.../user-account-membership/user-account-membership.html | 3 ++-
apps/client/src/app/pages/pricing/pricing-page.html | 3 ++-
libs/common/src/lib/types/subscription-offer.type.ts | 6 +++++-
6 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/apps/api/src/app/subscription/subscription.controller.ts b/apps/api/src/app/subscription/subscription.controller.ts
index f4ca6d427..a042b2ea2 100644
--- a/apps/api/src/app/subscription/subscription.controller.ts
+++ b/apps/api/src/app/subscription/subscription.controller.ts
@@ -113,7 +113,7 @@ export class SubscriptionController {
@Post('stripe/checkout-session')
@UseGuards(AuthGuard('jwt'), HasPermissionGuard)
public async createCheckoutSession(
- @Body() { couponId, priceId }: { couponId: string; priceId: string }
+ @Body() { couponId, priceId }: { couponId?: string; priceId: string }
) {
try {
return this.subscriptionService.createCheckoutSession({
diff --git a/apps/api/src/app/subscription/subscription.service.ts b/apps/api/src/app/subscription/subscription.service.ts
index 545450669..7c1df023c 100644
--- a/apps/api/src/app/subscription/subscription.service.ts
+++ b/apps/api/src/app/subscription/subscription.service.ts
@@ -124,7 +124,9 @@ export class SubscriptionService {
let offer: SubscriptionOffer = price ? 'renewal' : 'default';
if (isBefore(createdAt, parseDate('2023-01-01'))) {
- offer = 'renewal-early-bird';
+ offer = 'renewal-early-bird-2023';
+ } else if (isBefore(createdAt, parseDate('2024-01-01'))) {
+ offer = 'renewal-early-bird-2024';
}
return {
diff --git a/apps/client/src/app/components/header/header.component.html b/apps/client/src/app/components/header/header.component.html
index 2e9c03122..ff36c2ebe 100644
--- a/apps/client/src/app/components/header/header.component.html
+++ b/apps/client/src/app/components/header/header.component.html
@@ -180,7 +180,8 @@
Upgrade Plan
} @else if (
user.subscription.offer === 'renewal' ||
- user.subscription.offer === 'renewal-early-bird'
+ user.subscription.offer === 'renewal-early-bird-2023' ||
+ user.subscription.offer === 'renewal-early-bird-2024'
) {
Renew Plan
}
diff --git a/apps/client/src/app/components/user-account-membership/user-account-membership.html b/apps/client/src/app/components/user-account-membership/user-account-membership.html
index 644ec0605..d30ce7bdd 100644
--- a/apps/client/src/app/components/user-account-membership/user-account-membership.html
+++ b/apps/client/src/app/components/user-account-membership/user-account-membership.html
@@ -16,7 +16,8 @@
Upgrade Plan
} @else if (
user.subscription.offer === 'renewal' ||
- user.subscription.offer === 'renewal-early-bird'
+ user.subscription.offer === 'renewal-early-bird-2023' ||
+ user.subscription.offer === 'renewal-early-bird-2024'
) {
Renew Plan
}
diff --git a/apps/client/src/app/pages/pricing/pricing-page.html b/apps/client/src/app/pages/pricing/pricing-page.html
index 1caa4e8a0..fe805ef62 100644
--- a/apps/client/src/app/pages/pricing/pricing-page.html
+++ b/apps/client/src/app/pages/pricing/pricing-page.html
@@ -278,7 +278,8 @@
Upgrade Plan
} @else if (
user.subscription.offer === 'renewal' ||
- user.subscription.offer === 'renewal-early-bird'
+ user.subscription.offer === 'renewal-early-bird-2023' ||
+ user.subscription.offer === 'renewal-early-bird-2024'
) {
Renew Plan
}
diff --git a/libs/common/src/lib/types/subscription-offer.type.ts b/libs/common/src/lib/types/subscription-offer.type.ts
index 180088b1e..98977da45 100644
--- a/libs/common/src/lib/types/subscription-offer.type.ts
+++ b/libs/common/src/lib/types/subscription-offer.type.ts
@@ -1 +1,5 @@
-export type SubscriptionOffer = 'default' | 'renewal' | 'renewal-early-bird';
+export type SubscriptionOffer =
+ | 'default'
+ | 'renewal'
+ | 'renewal-early-bird-2023'
+ | 'renewal-early-bird-2024';
From ed97029e1b4255ca8e19da47b85f903bb467127d Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sat, 26 Oct 2024 10:29:24 +0200
Subject: [PATCH 2/3] Feature/upgrade prisma to version 5.21.1 (#3987)
* Upgrade prisma to version 5.21.1
* Update changelog
---
CHANGELOG.md | 1 +
package-lock.json | 68 +++++++++++++++++++++++------------------------
package.json | 4 +--
3 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c4953202b..fb814fba2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Switched the `consistent-type-definitions` rule from `warn` to `error` in the `eslint` configuration
- Switched the `no-empty-function` rule from `warn` to `error` in the `eslint` configuration
- Switched the `prefer-function-type` rule from `warn` to `error` in the `eslint` configuration
+- Upgraded `prisma` from version `5.20.0` to `5.21.1`
### Fixed
diff --git a/package-lock.json b/package-lock.json
index 3c450b4e3..492600202 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "ghostfolio",
- "version": "2.117.0",
+ "version": "2.118.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ghostfolio",
- "version": "2.117.0",
+ "version": "2.118.0",
"hasInstallScript": true,
"license": "AGPL-3.0",
"dependencies": {
@@ -40,7 +40,7 @@
"@nestjs/platform-express": "10.1.3",
"@nestjs/schedule": "3.0.2",
"@nestjs/serve-static": "4.0.0",
- "@prisma/client": "5.20.0",
+ "@prisma/client": "5.21.1",
"@simplewebauthn/browser": "9.0.1",
"@simplewebauthn/server": "9.0.3",
"@stripe/stripe-js": "3.5.0",
@@ -150,7 +150,7 @@
"nx": "20.0.3",
"prettier": "3.3.3",
"prettier-plugin-organize-attributes": "1.0.0",
- "prisma": "5.20.0",
+ "prisma": "5.21.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"replace-in-file": "7.0.1",
@@ -8753,9 +8753,9 @@
"license": "MIT"
},
"node_modules/@prisma/client": {
- "version": "5.20.0",
- "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.20.0.tgz",
- "integrity": "sha512-CLv55ZuMuUawMsxoqxGtLT3bEZoa2W8L3Qnp6rDIFWy+ZBrUcOFKdoeGPSnbBqxc3SkdxJrF+D1veN/WNynZYA==",
+ "version": "5.21.1",
+ "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.21.1.tgz",
+ "integrity": "sha512-3n+GgbAZYjaS/k0M03yQsQfR1APbr411r74foknnsGpmhNKBG49VuUkxIU6jORgvJPChoD4WC4PqoHImN1FP0w==",
"hasInstallScript": true,
"license": "Apache-2.0",
"engines": {
@@ -8771,53 +8771,53 @@
}
},
"node_modules/@prisma/debug": {
- "version": "5.20.0",
- "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.20.0.tgz",
- "integrity": "sha512-oCx79MJ4HSujokA8S1g0xgZUGybD4SyIOydoHMngFYiwEwYDQ5tBQkK5XoEHuwOYDKUOKRn/J0MEymckc4IgsQ==",
+ "version": "5.21.1",
+ "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.21.1.tgz",
+ "integrity": "sha512-uY8SAhcnORhvgtOrNdvWS98Aq/nkQ9QDUxrWAgW8XrCZaI3j2X7zb7Xe6GQSh6xSesKffFbFlkw0c2luHQviZA==",
"devOptional": true,
"license": "Apache-2.0"
},
"node_modules/@prisma/engines": {
- "version": "5.20.0",
- "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.20.0.tgz",
- "integrity": "sha512-DtqkP+hcZvPEbj8t8dK5df2b7d3B8GNauKqaddRRqQBBlgkbdhJkxhoJTrOowlS3vaRt2iMCkU0+CSNn0KhqAQ==",
+ "version": "5.21.1",
+ "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.21.1.tgz",
+ "integrity": "sha512-hGVTldUkIkTwoV8//hmnAAiAchi4oMEKD3aW5H2RrnI50tTdwza7VQbTTAyN3OIHWlK5DVg6xV7X8N/9dtOydA==",
"devOptional": true,
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
- "@prisma/debug": "5.20.0",
- "@prisma/engines-version": "5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284",
- "@prisma/fetch-engine": "5.20.0",
- "@prisma/get-platform": "5.20.0"
+ "@prisma/debug": "5.21.1",
+ "@prisma/engines-version": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ "@prisma/fetch-engine": "5.21.1",
+ "@prisma/get-platform": "5.21.1"
}
},
"node_modules/@prisma/engines-version": {
- "version": "5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284",
- "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284.tgz",
- "integrity": "sha512-Lg8AS5lpi0auZe2Mn4gjuCg081UZf88k3cn0RCwHgR+6cyHHpttPZBElJTHf83ZGsRNAmVCZCfUGA57WB4u4JA==",
+ "version": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36.tgz",
+ "integrity": "sha512-qvnEflL0//lh44S/T9NcvTMxfyowNeUxTunPcDfKPjyJNrCNf2F1zQLcUv5UHAruECpX+zz21CzsC7V2xAeM7Q==",
"devOptional": true,
"license": "Apache-2.0"
},
"node_modules/@prisma/fetch-engine": {
- "version": "5.20.0",
- "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.20.0.tgz",
- "integrity": "sha512-JVcaPXC940wOGpCOwuqQRTz6I9SaBK0c1BAyC1pcz9xBi+dzFgUu3G/p9GV1FhFs9OKpfSpIhQfUJE9y00zhqw==",
+ "version": "5.21.1",
+ "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.21.1.tgz",
+ "integrity": "sha512-70S31vgpCGcp9J+mh/wHtLCkVezLUqe/fGWk3J3JWZIN7prdYSlr1C0niaWUyNK2VflLXYi8kMjAmSxUVq6WGQ==",
"devOptional": true,
"license": "Apache-2.0",
"dependencies": {
- "@prisma/debug": "5.20.0",
- "@prisma/engines-version": "5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284",
- "@prisma/get-platform": "5.20.0"
+ "@prisma/debug": "5.21.1",
+ "@prisma/engines-version": "5.21.1-1.bf0e5e8a04cada8225617067eaa03d041e2bba36",
+ "@prisma/get-platform": "5.21.1"
}
},
"node_modules/@prisma/get-platform": {
- "version": "5.20.0",
- "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.20.0.tgz",
- "integrity": "sha512-8/+CehTZZNzJlvuryRgc77hZCWrUDYd/PmlZ7p2yNXtmf2Una4BWnTbak3us6WVdqoz5wmptk6IhsXdG2v5fmA==",
+ "version": "5.21.1",
+ "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.21.1.tgz",
+ "integrity": "sha512-sRxjL3Igst3ct+e8ya/x//cDXmpLbZQ5vfps2N4tWl4VGKQAmym77C/IG/psSMsQKszc8uFC/q1dgmKFLUgXZQ==",
"devOptional": true,
"license": "Apache-2.0",
"dependencies": {
- "@prisma/debug": "5.20.0"
+ "@prisma/debug": "5.21.1"
}
},
"node_modules/@redis/bloom": {
@@ -29794,14 +29794,14 @@
}
},
"node_modules/prisma": {
- "version": "5.20.0",
- "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.20.0.tgz",
- "integrity": "sha512-6obb3ucKgAnsGS9x9gLOe8qa51XxvJ3vLQtmyf52CTey1Qcez3A6W6ROH5HIz5Q5bW+0VpmZb8WBohieMFGpig==",
+ "version": "5.21.1",
+ "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.21.1.tgz",
+ "integrity": "sha512-PB+Iqzld/uQBPaaw2UVIk84kb0ITsLajzsxzsadxxl54eaU5Gyl2/L02ysivHxK89t7YrfQJm+Ggk37uvM70oQ==",
"devOptional": true,
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
- "@prisma/engines": "5.20.0"
+ "@prisma/engines": "5.21.1"
},
"bin": {
"prisma": "build/index.js"
diff --git a/package.json b/package.json
index 46d93209f..88248515d 100644
--- a/package.json
+++ b/package.json
@@ -86,7 +86,7 @@
"@nestjs/platform-express": "10.1.3",
"@nestjs/schedule": "3.0.2",
"@nestjs/serve-static": "4.0.0",
- "@prisma/client": "5.20.0",
+ "@prisma/client": "5.21.1",
"@simplewebauthn/browser": "9.0.1",
"@simplewebauthn/server": "9.0.3",
"@stripe/stripe-js": "3.5.0",
@@ -196,7 +196,7 @@
"nx": "20.0.3",
"prettier": "3.3.3",
"prettier-plugin-organize-attributes": "1.0.0",
- "prisma": "5.20.0",
+ "prisma": "5.21.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"replace-in-file": "7.0.1",
From 906e526cb9fad9c71e2696f7c8e7f2373eb556e1 Mon Sep 17 00:00:00 2001
From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
Date: Sat, 26 Oct 2024 10:31:24 +0200
Subject: [PATCH 3/3] Release 2.119.0 (#3990)
---
CHANGELOG.md | 2 +-
package.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fb814fba2..f42b96b10 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## Unreleased
+## 2.119.0 - 2024-10-26
### Changed
diff --git a/package.json b/package.json
index 88248515d..b83ce5c59 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ghostfolio",
- "version": "2.118.0",
+ "version": "2.119.0",
"homepage": "https://ghostfol.io",
"license": "AGPL-3.0",
"repository": "https://github.com/ghostfolio/ghostfolio",