mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
Refactor ProjectService to update subscription status
This commit is contained in:
parent
956ac101a2
commit
1d85490c55
@ -347,6 +347,17 @@ export class ProjectService extends DatabaseService<Model> {
|
|||||||
" completed.",
|
" completed.",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// refresh subscription status.
|
||||||
|
const subscriptionState: SubscriptionStatus =
|
||||||
|
await BillingService.getSubscriptionStatus(
|
||||||
|
subscription.subscriptionId as string,
|
||||||
|
);
|
||||||
|
|
||||||
|
const meteredSubscriptionState: SubscriptionStatus =
|
||||||
|
await BillingService.getSubscriptionStatus(
|
||||||
|
subscription.meteredSubscriptionId as string,
|
||||||
|
);
|
||||||
|
|
||||||
await this.updateOneById({
|
await this.updateOneById({
|
||||||
id: new ObjectID(updateBy.query._id! as string),
|
id: new ObjectID(updateBy.query._id! as string),
|
||||||
data: {
|
data: {
|
||||||
@ -357,6 +368,9 @@ export class ProjectService extends DatabaseService<Model> {
|
|||||||
planName: SubscriptionPlan.getPlanType(
|
planName: SubscriptionPlan.getPlanType(
|
||||||
updateBy.data.paymentProviderPlanId! as string,
|
updateBy.data.paymentProviderPlanId! as string,
|
||||||
),
|
),
|
||||||
|
paymentProviderMeteredSubscriptionStatus:
|
||||||
|
meteredSubscriptionState,
|
||||||
|
paymentProviderSubscriptionStatus: subscriptionState,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
isRoot: true,
|
isRoot: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user