chore: remove UsageAlert

This commit is contained in:
Ali BARIN
2023-04-16 14:22:30 +00:00
parent 80ee974973
commit fcf3a480be
7 changed files with 0 additions and 189 deletions

View File

@@ -1,33 +0,0 @@
import appConfig from '../../config/app';
import Context from '../../types/express/context';
// TODO: remove as getBillingAndUsageData query has been introduced
const getUsageData = async (
_parent: unknown,
_params: unknown,
context: Context
) => {
if (!appConfig.isCloud) return;
const usageData = await context.currentUser
.$relatedQuery('currentUsageData')
.throwIfNotFound();
const subscription = await usageData
.$relatedQuery('subscription')
.throwIfNotFound();
const plan = subscription.plan;
const computedUsageData = {
name: plan.name,
allowedTaskCount: plan.quota,
consumedTaskCount: usageData.consumedTaskCount,
remainingTaskCount: plan.quota - usageData.consumedTaskCount,
nextResetAt: usageData.nextResetAt,
};
return computedUsageData;
};
export default getUsageData;

View File

@@ -11,7 +11,6 @@ import getExecutionSteps from './queries/get-execution-steps';
import getDynamicData from './queries/get-dynamic-data';
import getDynamicFields from './queries/get-dynamic-fields';
import getCurrentUser from './queries/get-current-user';
import getUsageData from './queries/get-usage-data.ee';
import getPaymentPlans from './queries/get-payment-plans.ee';
import getPaddleInfo from './queries/get-paddle-info.ee';
import getBillingAndUsage from './queries/get-billing-and-usage.ee';
@@ -35,7 +34,6 @@ const queryResolvers = {
getDynamicData,
getDynamicFields,
getCurrentUser,
getUsageData,
getPaymentPlans,
getPaddleInfo,
getBillingAndUsage,

View File

@@ -34,7 +34,6 @@ type Query {
parameters: JSONObject
): [SubstepArgument]
getCurrentUser: User
getUsageData: GetUsageData
getPaymentPlans: [PaymentPlan]
getPaddleInfo: GetPaddleInfo
getBillingAndUsage: GetBillingAndUsage
@@ -529,14 +528,6 @@ type Usage {
task: Int
}
type GetUsageData {
name: String
allowedTaskCount: Int
consumedTaskCount: Int
remainingTaskCount: Int
nextResetAt: String
}
type GetPaddleInfo {
sandbox: Boolean
vendorId: Int