Skip to content

Commit a3bcfc9

Browse files
author
Joan Reyero
authored
Tenants created after the 18th of December only had trial for 14 days. It should be until the 15th of January. (#363)
1 parent cb3489f commit a3bcfc9

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

backend/src/database/repositories/tenantRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TenantRepository {
5050
]),
5151
plan: 'Growth',
5252
isTrialPlan: true,
53-
trialEndsAt: moment().add(14, 'days').isAfter('2023-01-01')
53+
trialEndsAt: moment().add(14, 'days').isAfter('2023-01-15')
5454
? moment().add(14, 'days').toISOString()
5555
: '2023-01-15',
5656
createdById: currentUser.id,

backend/src/services/__tests__/tenantService.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import moment from 'moment'
12
import SequelizeTestUtils from '../../database/utils/sequelizeTestUtils'
23
import TenantService from '../tenantService'
34
import MemberService from '../memberService'
@@ -152,7 +153,9 @@ describe('TenantService tests', () => {
152153
url: 'testUrl',
153154
plan: Plans.values.growth,
154155
isTrialPlan: true,
155-
trialEndsAt: new Date('2023-01-15T00:00:00.000Z'),
156+
trialEndsAt: moment().add(14, 'days').isAfter('2023-01-15')
157+
? moment().add(14, 'days').toISOString()
158+
: new Date('2023-01-15T00:00:00.000Z'),
156159
planStatus: 'active',
157160
planStripeCustomerId: null,
158161
planUserId: null,

0 commit comments

Comments
 (0)