Merge pull request #1264 from appwrite/refactor-invoice-model

refactor: invoice model
This commit is contained in:
Torsten Dittmann
2024-08-12 09:51:32 +02:00
committed by GitHub
3 changed files with 10 additions and 4 deletions
+8 -2
View File
@@ -31,17 +31,23 @@ export type Invoice = {
$id: string;
$createdAt: Date;
$updatedAt: Date;
permissions: string[];
teamId: string;
aggregationId: string;
plan: Tier;
amount: number;
tax: number;
taxAmount: number;
vat: number;
vatAmount: number;
grossAmount: number;
creditsUsed: number;
currency: string;
date: number;
from: string;
to: string;
status: string;
dueAt: string;
clientSecret: string;
tier: Tier;
usage: {
name: string;
value: number /* service over the limit*/;
@@ -21,7 +21,7 @@
export let data;
const tier = data?.currentInvoice?.tier ?? $organization?.billingPlan;
const tier = data?.currentInvoice?.plan ?? $organization?.billingPlan;
const plan = tierToPlan(tier).name;
// let invoice = null;
@@ -29,7 +29,7 @@
$: executionsTotal = data.usage.executionsTotal;
$: storage = data.usage.filesStorageTotal;
const tier = data?.currentInvoice?.tier ?? $organization?.billingPlan;
const tier = data?.currentInvoice?.plan ?? $organization?.billingPlan;
const plan = tierToPlan(tier).name;
// let invoice = null;