Skip to content

Commit

Permalink
unblock wksp on plan changing (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
talyguryn authored Aug 18, 2021
1 parent 598946c commit 6d63145
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/models/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ export default class WorkspaceModel extends AbstractModel<WorkspaceDBScheme> imp

/**
* Change plan for current workspace
* Reset billing period events count, reset last charge date
* - set tariffPlanId
* - reset billing period events count
* - update last charge date
* - unblock workspace
*
* @param planId - id of plan to be enabled
*/
Expand All @@ -300,6 +303,7 @@ export default class WorkspaceModel extends AbstractModel<WorkspaceDBScheme> imp
$set: {
tariffPlanId: new ObjectId(planId),
billingPeriodEventsCount: 0,
isBlocked: false,
lastChargeDate: new Date(),
},
}
Expand Down

0 comments on commit 6d63145

Please sign in to comment.