diff --git a/apps/dashboard/jobs/tasks/bank/accounts/update-reference.ts b/apps/dashboard/jobs/tasks/bank/accounts/update-reference.ts
new file mode 100644
index 0000000000..01641ab973
--- /dev/null
+++ b/apps/dashboard/jobs/tasks/bank/accounts/update-reference.ts
@@ -0,0 +1,35 @@
+import { client } from "@midday/engine/client";
+import { createClient } from "@midday/supabase/job";
+import { schemaTask } from "@trigger.dev/sdk/v3";
+import { z } from "zod";
+
+export const updateReference = schemaTask({
+ id: "update-reference",
+ maxDuration: 300,
+ schema: z.object({
+ connectionId: z.string(),
+ }),
+ run: async ({ connectionId }) => {
+ const supabase = createClient();
+
+ const accountsResponse = await client.accounts.$get({
+ query: {
+ id: connectionId,
+ provider: "gocardless",
+ },
+ });
+
+ const { data: accountsData } = await accountsResponse.json();
+
+ await Promise.all(
+ accountsData.map(async (account) => {
+ return supabase
+ .from("bank_accounts")
+ .update({
+ account_reference: account.resource_id,
+ })
+ .eq("account_id", account.id);
+ }),
+ );
+ },
+});
diff --git a/apps/dashboard/jobs/tasks/bank/sync/connection.ts b/apps/dashboard/jobs/tasks/bank/sync/connection.ts
index ae27d35b4d..92b59e04e1 100644
--- a/apps/dashboard/jobs/tasks/bank/sync/connection.ts
+++ b/apps/dashboard/jobs/tasks/bank/sync/connection.ts
@@ -4,6 +4,7 @@ import { logger, schemaTask } from "@trigger.dev/sdk/v3";
import { revalidateCache } from "jobs/utils/revalidate-cache";
import { triggerSequenceAndWait } from "jobs/utils/trigger-sequence";
import { z } from "zod";
+import { updateReference } from "../accounts/update-reference";
import { transactionNotifications } from "../notifications/transactions";
import { syncAccount } from "./account";
@@ -140,6 +141,12 @@ export const syncConnection = schemaTask({
.update({ status: "disconnected" })
.eq("id", connectionId);
}
+
+ if (data.provider === "gocardless") {
+ await updateReference.trigger({
+ connectionId,
+ });
+ }
} catch (error) {
logger.error("Failed to check connection status by accounts", {
error,
diff --git a/apps/dashboard/src/actions/schema.ts b/apps/dashboard/src/actions/schema.ts
index 9c01bce69b..97f11e4b45 100644
--- a/apps/dashboard/src/actions/schema.ts
+++ b/apps/dashboard/src/actions/schema.ts
@@ -180,6 +180,7 @@ export const connectBankAccountSchema = z.object({
currency: z.string(),
name: z.string(),
institution_id: z.string(),
+ account_reference: z.string().nullable().optional(),
enabled: z.boolean(),
logo_url: z.string().nullable().optional(),
type: z.enum([
diff --git a/apps/dashboard/src/components/modals/select-bank-accounts.tsx b/apps/dashboard/src/components/modals/select-bank-accounts.tsx
index 5683569609..766dd01058 100644
--- a/apps/dashboard/src/components/modals/select-bank-accounts.tsx
+++ b/apps/dashboard/src/components/modals/select-bank-accounts.tsx
@@ -8,7 +8,6 @@ import { useConnectParams } from "@/hooks/use-connect-params";
import { useI18n } from "@/locales/client";
import { getInitials } from "@/utils/format";
import { zodResolver } from "@hookform/resolvers/zod";
-import type { Accounts } from "@midday-ai/engine/resources/accounts.mjs";
import { Avatar, AvatarFallback } from "@midday/ui/avatar";
import { Button } from "@midday/ui/button";
import {
@@ -39,6 +38,20 @@ import z from "zod";
import { FormatAmount } from "../format-amount";
import { LoadingTransactionsEvent } from "../loading-transactions-event";
+type Account = {
+ id: string;
+ name: string;
+ balance: number;
+ currency: string;
+ type: string;
+ subtype: string;
+ mask: string;
+ institution: {
+ id: string;
+ name: string;
+ };
+};
+
function RowsSkeleton() {
return (
@@ -140,7 +153,7 @@ export function SelectBankAccountsModal() {
const { toast } = useToast();
const t = useI18n();
- const [accounts, setAccounts] = useState
([]);
+ const [accounts, setAccounts] = useState([]);
const [loading, setLoading] = useState(true);
const [runId, setRunId] = useState();
const [accessToken, setAccessToken] = useState();
@@ -235,6 +248,7 @@ export function SelectBankAccountsModal() {
institution_id: account.institution.id,
logo_url: account.institution?.logo,
account_id: account.id,
+ account_reference: account.resource_id,
bank_name: account.institution.name,
// TODO: Remove once we have a fix and return currency from engine
currency: account.currency ?? account.balance.currency,
diff --git a/apps/engine/src/providers/gocardless/__snapshots__/transform.test.ts.snap b/apps/engine/src/providers/gocardless/__snapshots__/transform.test.ts.snap
index 8d6414794e..eb7c61b801 100644
--- a/apps/engine/src/providers/gocardless/__snapshots__/transform.test.ts.snap
+++ b/apps/engine/src/providers/gocardless/__snapshots__/transform.test.ts.snap
@@ -33,6 +33,7 @@ exports[`Transform accounts 1`] = `
"provider": "gocardless",
},
"name": "Pleo Account",
+ "resource_id": "3133",
"type": "depository",
}
`;
diff --git a/apps/engine/src/providers/gocardless/transform.ts b/apps/engine/src/providers/gocardless/transform.ts
index 0c806b6996..956237ff8e 100644
--- a/apps/engine/src/providers/gocardless/transform.ts
+++ b/apps/engine/src/providers/gocardless/transform.ts
@@ -199,6 +199,7 @@ export const transformAccount = ({
enrollment_id: null,
balance: transformAccountBalance(balance),
institution: transformInstitution(institution),
+ resource_id: account.resourceId,
};
};
diff --git a/apps/engine/src/providers/gocardless/types.ts b/apps/engine/src/providers/gocardless/types.ts
index 8e70cbf85c..ee1642d07a 100644
--- a/apps/engine/src/providers/gocardless/types.ts
+++ b/apps/engine/src/providers/gocardless/types.ts
@@ -169,6 +169,7 @@ export type GetAccountsResponse = {
account: Account;
balance?: GetBalanceRequest;
institution: Institution;
+ resourceId?: string;
}[];
export type GetTransactionsRequest = {
diff --git a/apps/engine/src/providers/plaid/__snapshots__/transform.test.ts.snap b/apps/engine/src/providers/plaid/__snapshots__/transform.test.ts.snap
index 2e07939435..9b5fd645d2 100644
--- a/apps/engine/src/providers/plaid/__snapshots__/transform.test.ts.snap
+++ b/apps/engine/src/providers/plaid/__snapshots__/transform.test.ts.snap
@@ -67,6 +67,7 @@ exports[`Transform accounts 1`] = `
"provider": "plaid",
},
"name": "Plaid Mortgage",
+ "resource_id": null,
"type": "other_asset",
}
`;
diff --git a/apps/engine/src/providers/plaid/transform.ts b/apps/engine/src/providers/plaid/transform.ts
index 77bdbd83ec..9683bc4f51 100644
--- a/apps/engine/src/providers/plaid/transform.ts
+++ b/apps/engine/src/providers/plaid/transform.ts
@@ -196,6 +196,7 @@ export const transformAccount = ({
logo: getLogoURL(institution.id),
provider: Providers.Enum.plaid,
},
+ resource_id: null,
};
};
diff --git a/apps/engine/src/providers/teller/__snapshots__/transform.test.ts.snap b/apps/engine/src/providers/teller/__snapshots__/transform.test.ts.snap
index d1fd554caa..1e4592e9c4 100644
--- a/apps/engine/src/providers/teller/__snapshots__/transform.test.ts.snap
+++ b/apps/engine/src/providers/teller/__snapshots__/transform.test.ts.snap
@@ -101,6 +101,7 @@ exports[`Transform accounts 1`] = `
"provider": "teller",
},
"name": "Platinum Card",
+ "resource_id": null,
"type": "credit",
}
`;
diff --git a/apps/engine/src/providers/teller/transform.ts b/apps/engine/src/providers/teller/transform.ts
index dd5b931b62..c158d716c3 100644
--- a/apps/engine/src/providers/teller/transform.ts
+++ b/apps/engine/src/providers/teller/transform.ts
@@ -156,6 +156,7 @@ export const transformAccount = ({
institution: transformInstitution(institution),
type: getType(type),
balance: transformAccountBalance(balance),
+ resource_id: null,
};
};
diff --git a/apps/engine/src/providers/types.ts b/apps/engine/src/providers/types.ts
index b964c36a65..3b22e250bf 100644
--- a/apps/engine/src/providers/types.ts
+++ b/apps/engine/src/providers/types.ts
@@ -45,6 +45,7 @@ export type Account = {
institution: Institution;
balance: Balance;
enrollment_id: string | null; // Teller
+ resource_id: string | null; // GoCardLess
};
export type ConnectionStatus = {
diff --git a/apps/engine/src/routes/accounts/schema.ts b/apps/engine/src/routes/accounts/schema.ts
index 706ff6e920..f59b47e853 100644
--- a/apps/engine/src/routes/accounts/schema.ts
+++ b/apps/engine/src/routes/accounts/schema.ts
@@ -69,9 +69,17 @@ export const AccountSchema = z
enrollment_id: z
.string()
.openapi({
+ description: "Teller/Plaid enrollment id",
example: "add29d44-1b36-4bcc-b317-b2cbc73ab8e7",
})
.nullable(),
+ resource_id: z
+ .string()
+ .openapi({
+ description: "GoCardLess reference id",
+ example: "GBRGZX62Y8",
+ })
+ .nullable(),
})
.openapi("AccountSchema");
diff --git a/packages/supabase/src/mutations/index.ts b/packages/supabase/src/mutations/index.ts
index 78a769eae9..a52200626e 100644
--- a/packages/supabase/src/mutations/index.ts
+++ b/packages/supabase/src/mutations/index.ts
@@ -14,6 +14,7 @@ type CreateBankConnectionPayload = {
enabled: boolean;
balance: number;
type: "depository" | "credit" | "other_asset" | "loan" | "other_liability";
+ account_reference: string | null;
}[];
balance: number;
accessToken?: string;
@@ -84,6 +85,7 @@ export async function createBankConnection(
currency: account.currency,
enabled: account.enabled,
type: account.type,
+ account_reference: account.account_reference,
balance: account.balance ?? 0,
}),
{
diff --git a/packages/supabase/src/types/db.ts b/packages/supabase/src/types/db.ts
index 687871d7de..c66ec6d949 100644
--- a/packages/supabase/src/types/db.ts
+++ b/packages/supabase/src/types/db.ts
@@ -4,2373 +4,2368 @@ export type Json =
| boolean
| null
| { [key: string]: Json | undefined }
- | Json[];
+ | Json[]
export type Database = {
public: {
Tables: {
apps: {
Row: {
- app_id: string;
- config: Json | null;
- created_at: string | null;
- created_by: string | null;
- id: string;
- settings: Json | null;
- team_id: string | null;
- };
+ app_id: string
+ config: Json | null
+ created_at: string | null
+ created_by: string | null
+ id: string
+ settings: Json | null
+ team_id: string | null
+ }
Insert: {
- app_id: string;
- config?: Json | null;
- created_at?: string | null;
- created_by?: string | null;
- id?: string;
- settings?: Json | null;
- team_id?: string | null;
- };
+ app_id: string
+ config?: Json | null
+ created_at?: string | null
+ created_by?: string | null
+ id?: string
+ settings?: Json | null
+ team_id?: string | null
+ }
Update: {
- app_id?: string;
- config?: Json | null;
- created_at?: string | null;
- created_by?: string | null;
- id?: string;
- settings?: Json | null;
- team_id?: string | null;
- };
+ app_id?: string
+ config?: Json | null
+ created_at?: string | null
+ created_by?: string | null
+ id?: string
+ settings?: Json | null
+ team_id?: string | null
+ }
Relationships: [
{
- foreignKeyName: "apps_created_by_fkey";
- columns: ["created_by"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "apps_created_by_fkey"
+ columns: ["created_by"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "integrations_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "integrations_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
bank_accounts: {
Row: {
- account_id: string;
- balance: number | null;
- bank_connection_id: string | null;
- base_balance: number | null;
- base_currency: string | null;
- created_at: string;
- created_by: string;
- currency: string | null;
- enabled: boolean;
- error_details: string | null;
- error_retries: number | null;
- id: string;
- manual: boolean | null;
- name: string | null;
- team_id: string;
- type: Database["public"]["Enums"]["account_type"] | null;
- };
+ account_id: string
+ account_reference: string | null
+ balance: number | null
+ bank_connection_id: string | null
+ base_balance: number | null
+ base_currency: string | null
+ created_at: string
+ created_by: string
+ currency: string | null
+ enabled: boolean
+ error_details: string | null
+ error_retries: number | null
+ id: string
+ manual: boolean | null
+ name: string | null
+ team_id: string
+ type: Database["public"]["Enums"]["account_type"] | null
+ }
Insert: {
- account_id: string;
- balance?: number | null;
- bank_connection_id?: string | null;
- base_balance?: number | null;
- base_currency?: string | null;
- created_at?: string;
- created_by: string;
- currency?: string | null;
- enabled?: boolean;
- error_details?: string | null;
- error_retries?: number | null;
- id?: string;
- manual?: boolean | null;
- name?: string | null;
- team_id: string;
- type?: Database["public"]["Enums"]["account_type"] | null;
- };
+ account_id: string
+ account_reference?: string | null
+ balance?: number | null
+ bank_connection_id?: string | null
+ base_balance?: number | null
+ base_currency?: string | null
+ created_at?: string
+ created_by: string
+ currency?: string | null
+ enabled?: boolean
+ error_details?: string | null
+ error_retries?: number | null
+ id?: string
+ manual?: boolean | null
+ name?: string | null
+ team_id: string
+ type?: Database["public"]["Enums"]["account_type"] | null
+ }
Update: {
- account_id?: string;
- balance?: number | null;
- bank_connection_id?: string | null;
- base_balance?: number | null;
- base_currency?: string | null;
- created_at?: string;
- created_by?: string;
- currency?: string | null;
- enabled?: boolean;
- error_details?: string | null;
- error_retries?: number | null;
- id?: string;
- manual?: boolean | null;
- name?: string | null;
- team_id?: string;
- type?: Database["public"]["Enums"]["account_type"] | null;
- };
+ account_id?: string
+ account_reference?: string | null
+ balance?: number | null
+ bank_connection_id?: string | null
+ base_balance?: number | null
+ base_currency?: string | null
+ created_at?: string
+ created_by?: string
+ currency?: string | null
+ enabled?: boolean
+ error_details?: string | null
+ error_retries?: number | null
+ id?: string
+ manual?: boolean | null
+ name?: string | null
+ team_id?: string
+ type?: Database["public"]["Enums"]["account_type"] | null
+ }
Relationships: [
{
- foreignKeyName: "bank_accounts_bank_connection_id_fkey";
- columns: ["bank_connection_id"];
- isOneToOne: false;
- referencedRelation: "bank_connections";
- referencedColumns: ["id"];
+ foreignKeyName: "bank_accounts_bank_connection_id_fkey"
+ columns: ["bank_connection_id"]
+ isOneToOne: false
+ referencedRelation: "bank_connections"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "bank_accounts_created_by_fkey";
- columns: ["created_by"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "bank_accounts_created_by_fkey"
+ columns: ["created_by"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "public_bank_accounts_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "public_bank_accounts_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
bank_connections: {
Row: {
- access_token: string | null;
- created_at: string;
- enrollment_id: string | null;
- error_details: string | null;
- error_retries: number | null;
- expires_at: string | null;
- id: string;
- institution_id: string;
- last_accessed: string | null;
- logo_url: string | null;
- name: string;
- provider: Database["public"]["Enums"]["bank_providers"] | null;
- reference_id: string | null;
- status: Database["public"]["Enums"]["connection_status"] | null;
- team_id: string;
- };
+ access_token: string | null
+ created_at: string
+ enrollment_id: string | null
+ error_details: string | null
+ error_retries: number | null
+ expires_at: string | null
+ id: string
+ institution_id: string
+ last_accessed: string | null
+ logo_url: string | null
+ name: string
+ provider: Database["public"]["Enums"]["bank_providers"] | null
+ reference_id: string | null
+ status: Database["public"]["Enums"]["connection_status"] | null
+ team_id: string
+ }
Insert: {
- access_token?: string | null;
- created_at?: string;
- enrollment_id?: string | null;
- error_details?: string | null;
- error_retries?: number | null;
- expires_at?: string | null;
- id?: string;
- institution_id: string;
- last_accessed?: string | null;
- logo_url?: string | null;
- name: string;
- provider?: Database["public"]["Enums"]["bank_providers"] | null;
- reference_id?: string | null;
- status?: Database["public"]["Enums"]["connection_status"] | null;
- team_id: string;
- };
+ access_token?: string | null
+ created_at?: string
+ enrollment_id?: string | null
+ error_details?: string | null
+ error_retries?: number | null
+ expires_at?: string | null
+ id?: string
+ institution_id: string
+ last_accessed?: string | null
+ logo_url?: string | null
+ name: string
+ provider?: Database["public"]["Enums"]["bank_providers"] | null
+ reference_id?: string | null
+ status?: Database["public"]["Enums"]["connection_status"] | null
+ team_id: string
+ }
Update: {
- access_token?: string | null;
- created_at?: string;
- enrollment_id?: string | null;
- error_details?: string | null;
- error_retries?: number | null;
- expires_at?: string | null;
- id?: string;
- institution_id?: string;
- last_accessed?: string | null;
- logo_url?: string | null;
- name?: string;
- provider?: Database["public"]["Enums"]["bank_providers"] | null;
- reference_id?: string | null;
- status?: Database["public"]["Enums"]["connection_status"] | null;
- team_id?: string;
- };
+ access_token?: string | null
+ created_at?: string
+ enrollment_id?: string | null
+ error_details?: string | null
+ error_retries?: number | null
+ expires_at?: string | null
+ id?: string
+ institution_id?: string
+ last_accessed?: string | null
+ logo_url?: string | null
+ name?: string
+ provider?: Database["public"]["Enums"]["bank_providers"] | null
+ reference_id?: string | null
+ status?: Database["public"]["Enums"]["connection_status"] | null
+ team_id?: string
+ }
Relationships: [
{
- foreignKeyName: "bank_connections_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "bank_connections_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
customer_tags: {
Row: {
- created_at: string;
- customer_id: string;
- id: string;
- tag_id: string;
- team_id: string;
- };
+ created_at: string
+ customer_id: string
+ id: string
+ tag_id: string
+ team_id: string
+ }
Insert: {
- created_at?: string;
- customer_id: string;
- id?: string;
- tag_id: string;
- team_id: string;
- };
+ created_at?: string
+ customer_id: string
+ id?: string
+ tag_id: string
+ team_id: string
+ }
Update: {
- created_at?: string;
- customer_id?: string;
- id?: string;
- tag_id?: string;
- team_id?: string;
- };
+ created_at?: string
+ customer_id?: string
+ id?: string
+ tag_id?: string
+ team_id?: string
+ }
Relationships: [
{
- foreignKeyName: "customer_tags_customer_id_fkey";
- columns: ["customer_id"];
- isOneToOne: false;
- referencedRelation: "customers";
- referencedColumns: ["id"];
+ foreignKeyName: "customer_tags_customer_id_fkey"
+ columns: ["customer_id"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "customer_tags_tag_id_fkey";
- columns: ["tag_id"];
- isOneToOne: false;
- referencedRelation: "tags";
- referencedColumns: ["id"];
+ foreignKeyName: "customer_tags_tag_id_fkey"
+ columns: ["tag_id"]
+ isOneToOne: false
+ referencedRelation: "tags"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "customer_tags_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "customer_tags_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
customers: {
Row: {
- address_line_1: string | null;
- address_line_2: string | null;
- city: string | null;
- contact: string | null;
- country: string | null;
- country_code: string | null;
- created_at: string;
- email: string;
- id: string;
- name: string;
- note: string | null;
- phone: string | null;
- state: string | null;
- team_id: string;
- token: string;
- vat_number: string | null;
- website: string | null;
- zip: string | null;
- };
+ address_line_1: string | null
+ address_line_2: string | null
+ city: string | null
+ contact: string | null
+ country: string | null
+ country_code: string | null
+ created_at: string
+ email: string
+ id: string
+ name: string
+ note: string | null
+ phone: string | null
+ state: string | null
+ team_id: string
+ token: string
+ vat_number: string | null
+ website: string | null
+ zip: string | null
+ }
Insert: {
- address_line_1?: string | null;
- address_line_2?: string | null;
- city?: string | null;
- contact?: string | null;
- country?: string | null;
- country_code?: string | null;
- created_at?: string;
- email: string;
- id?: string;
- name: string;
- note?: string | null;
- phone?: string | null;
- state?: string | null;
- team_id?: string;
- token?: string;
- vat_number?: string | null;
- website?: string | null;
- zip?: string | null;
- };
+ address_line_1?: string | null
+ address_line_2?: string | null
+ city?: string | null
+ contact?: string | null
+ country?: string | null
+ country_code?: string | null
+ created_at?: string
+ email: string
+ id?: string
+ name: string
+ note?: string | null
+ phone?: string | null
+ state?: string | null
+ team_id?: string
+ token?: string
+ vat_number?: string | null
+ website?: string | null
+ zip?: string | null
+ }
Update: {
- address_line_1?: string | null;
- address_line_2?: string | null;
- city?: string | null;
- contact?: string | null;
- country?: string | null;
- country_code?: string | null;
- created_at?: string;
- email?: string;
- id?: string;
- name?: string;
- note?: string | null;
- phone?: string | null;
- state?: string | null;
- team_id?: string;
- token?: string;
- vat_number?: string | null;
- website?: string | null;
- zip?: string | null;
- };
+ address_line_1?: string | null
+ address_line_2?: string | null
+ city?: string | null
+ contact?: string | null
+ country?: string | null
+ country_code?: string | null
+ created_at?: string
+ email?: string
+ id?: string
+ name?: string
+ note?: string | null
+ phone?: string | null
+ state?: string | null
+ team_id?: string
+ token?: string
+ vat_number?: string | null
+ website?: string | null
+ zip?: string | null
+ }
Relationships: [
{
- foreignKeyName: "customers_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "customers_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
documents: {
Row: {
- body: string | null;
- created_at: string | null;
- fts: unknown | null;
- id: string;
- metadata: Json | null;
- name: string | null;
- object_id: string | null;
- owner_id: string | null;
- parent_id: string | null;
- path_tokens: string[] | null;
- tag: string | null;
- team_id: string | null;
- title: string | null;
- };
+ body: string | null
+ created_at: string | null
+ fts: unknown | null
+ id: string
+ metadata: Json | null
+ name: string | null
+ object_id: string | null
+ owner_id: string | null
+ parent_id: string | null
+ path_tokens: string[] | null
+ tag: string | null
+ team_id: string | null
+ title: string | null
+ }
Insert: {
- body?: string | null;
- created_at?: string | null;
- fts?: unknown | null;
- id?: string;
- metadata?: Json | null;
- name?: string | null;
- object_id?: string | null;
- owner_id?: string | null;
- parent_id?: string | null;
- path_tokens?: string[] | null;
- tag?: string | null;
- team_id?: string | null;
- title?: string | null;
- };
+ body?: string | null
+ created_at?: string | null
+ fts?: unknown | null
+ id?: string
+ metadata?: Json | null
+ name?: string | null
+ object_id?: string | null
+ owner_id?: string | null
+ parent_id?: string | null
+ path_tokens?: string[] | null
+ tag?: string | null
+ team_id?: string | null
+ title?: string | null
+ }
Update: {
- body?: string | null;
- created_at?: string | null;
- fts?: unknown | null;
- id?: string;
- metadata?: Json | null;
- name?: string | null;
- object_id?: string | null;
- owner_id?: string | null;
- parent_id?: string | null;
- path_tokens?: string[] | null;
- tag?: string | null;
- team_id?: string | null;
- title?: string | null;
- };
+ body?: string | null
+ created_at?: string | null
+ fts?: unknown | null
+ id?: string
+ metadata?: Json | null
+ name?: string | null
+ object_id?: string | null
+ owner_id?: string | null
+ parent_id?: string | null
+ path_tokens?: string[] | null
+ tag?: string | null
+ team_id?: string | null
+ title?: string | null
+ }
Relationships: [
{
- foreignKeyName: "documents_created_by_fkey";
- columns: ["owner_id"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "documents_created_by_fkey"
+ columns: ["owner_id"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "storage_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "storage_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
exchange_rates: {
Row: {
- base: string | null;
- id: string;
- rate: number | null;
- target: string | null;
- updated_at: string | null;
- };
+ base: string | null
+ id: string
+ rate: number | null
+ target: string | null
+ updated_at: string | null
+ }
Insert: {
- base?: string | null;
- id?: string;
- rate?: number | null;
- target?: string | null;
- updated_at?: string | null;
- };
+ base?: string | null
+ id?: string
+ rate?: number | null
+ target?: string | null
+ updated_at?: string | null
+ }
Update: {
- base?: string | null;
- id?: string;
- rate?: number | null;
- target?: string | null;
- updated_at?: string | null;
- };
- Relationships: [];
- };
+ base?: string | null
+ id?: string
+ rate?: number | null
+ target?: string | null
+ updated_at?: string | null
+ }
+ Relationships: []
+ }
inbox: {
Row: {
- amount: number | null;
- attachment_id: string | null;
- base_amount: number | null;
- base_currency: string | null;
- content_type: string | null;
- created_at: string;
- currency: string | null;
- date: string | null;
- description: string | null;
- display_name: string | null;
- file_name: string | null;
- file_path: string[] | null;
- forwarded_to: string | null;
- fts: unknown | null;
- id: string;
- meta: Json | null;
- reference_id: string | null;
- size: number | null;
- status: Database["public"]["Enums"]["inbox_status"] | null;
- team_id: string | null;
- transaction_id: string | null;
- type: Database["public"]["Enums"]["inbox_type"] | null;
- website: string | null;
- inbox_amount_text: string | null;
- };
+ amount: number | null
+ attachment_id: string | null
+ base_amount: number | null
+ base_currency: string | null
+ content_type: string | null
+ created_at: string
+ currency: string | null
+ date: string | null
+ description: string | null
+ display_name: string | null
+ file_name: string | null
+ file_path: string[] | null
+ forwarded_to: string | null
+ fts: unknown | null
+ id: string
+ meta: Json | null
+ reference_id: string | null
+ size: number | null
+ status: Database["public"]["Enums"]["inbox_status"] | null
+ team_id: string | null
+ transaction_id: string | null
+ type: Database["public"]["Enums"]["inbox_type"] | null
+ website: string | null
+ inbox_amount_text: string | null
+ }
Insert: {
- amount?: number | null;
- attachment_id?: string | null;
- base_amount?: number | null;
- base_currency?: string | null;
- content_type?: string | null;
- created_at?: string;
- currency?: string | null;
- date?: string | null;
- description?: string | null;
- display_name?: string | null;
- file_name?: string | null;
- file_path?: string[] | null;
- forwarded_to?: string | null;
- fts?: unknown | null;
- id?: string;
- meta?: Json | null;
- reference_id?: string | null;
- size?: number | null;
- status?: Database["public"]["Enums"]["inbox_status"] | null;
- team_id?: string | null;
- transaction_id?: string | null;
- type?: Database["public"]["Enums"]["inbox_type"] | null;
- website?: string | null;
- };
+ amount?: number | null
+ attachment_id?: string | null
+ base_amount?: number | null
+ base_currency?: string | null
+ content_type?: string | null
+ created_at?: string
+ currency?: string | null
+ date?: string | null
+ description?: string | null
+ display_name?: string | null
+ file_name?: string | null
+ file_path?: string[] | null
+ forwarded_to?: string | null
+ fts?: unknown | null
+ id?: string
+ meta?: Json | null
+ reference_id?: string | null
+ size?: number | null
+ status?: Database["public"]["Enums"]["inbox_status"] | null
+ team_id?: string | null
+ transaction_id?: string | null
+ type?: Database["public"]["Enums"]["inbox_type"] | null
+ website?: string | null
+ }
Update: {
- amount?: number | null;
- attachment_id?: string | null;
- base_amount?: number | null;
- base_currency?: string | null;
- content_type?: string | null;
- created_at?: string;
- currency?: string | null;
- date?: string | null;
- description?: string | null;
- display_name?: string | null;
- file_name?: string | null;
- file_path?: string[] | null;
- forwarded_to?: string | null;
- fts?: unknown | null;
- id?: string;
- meta?: Json | null;
- reference_id?: string | null;
- size?: number | null;
- status?: Database["public"]["Enums"]["inbox_status"] | null;
- team_id?: string | null;
- transaction_id?: string | null;
- type?: Database["public"]["Enums"]["inbox_type"] | null;
- website?: string | null;
- };
+ amount?: number | null
+ attachment_id?: string | null
+ base_amount?: number | null
+ base_currency?: string | null
+ content_type?: string | null
+ created_at?: string
+ currency?: string | null
+ date?: string | null
+ description?: string | null
+ display_name?: string | null
+ file_name?: string | null
+ file_path?: string[] | null
+ forwarded_to?: string | null
+ fts?: unknown | null
+ id?: string
+ meta?: Json | null
+ reference_id?: string | null
+ size?: number | null
+ status?: Database["public"]["Enums"]["inbox_status"] | null
+ team_id?: string | null
+ transaction_id?: string | null
+ type?: Database["public"]["Enums"]["inbox_type"] | null
+ website?: string | null
+ }
Relationships: [
{
- foreignKeyName: "inbox_attachment_id_fkey";
- columns: ["attachment_id"];
- isOneToOne: false;
- referencedRelation: "transaction_attachments";
- referencedColumns: ["id"];
+ foreignKeyName: "inbox_attachment_id_fkey"
+ columns: ["attachment_id"]
+ isOneToOne: false
+ referencedRelation: "transaction_attachments"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "public_inbox_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "public_inbox_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "public_inbox_transaction_id_fkey";
- columns: ["transaction_id"];
- isOneToOne: false;
- referencedRelation: "transactions";
- referencedColumns: ["id"];
+ foreignKeyName: "public_inbox_transaction_id_fkey"
+ columns: ["transaction_id"]
+ isOneToOne: false
+ referencedRelation: "transactions"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
invoice_comments: {
Row: {
- created_at: string;
- id: string;
- };
+ created_at: string
+ id: string
+ }
Insert: {
- created_at?: string;
- id?: string;
- };
+ created_at?: string
+ id?: string
+ }
Update: {
- created_at?: string;
- id?: string;
- };
- Relationships: [];
- };
+ created_at?: string
+ id?: string
+ }
+ Relationships: []
+ }
invoice_templates: {
Row: {
- created_at: string;
- currency: string | null;
- customer_label: string | null;
- date_format: string | null;
- delivery_type: Database["public"]["Enums"]["invoice_delivery_type"];
- description_label: string | null;
- discount_label: string | null;
- due_date_label: string | null;
- from_details: Json | null;
- from_label: string | null;
- id: string;
- include_decimals: boolean | null;
- include_discount: boolean | null;
- include_qr: boolean | null;
- include_tax: boolean | null;
- include_units: boolean | null;
- include_vat: boolean | null;
- invoice_no_label: string | null;
- issue_date_label: string | null;
- logo_url: string | null;
- note_label: string | null;
- payment_details: Json | null;
- payment_label: string | null;
- price_label: string | null;
- quantity_label: string | null;
- size: Database["public"]["Enums"]["invoice_size"] | null;
- tax_label: string | null;
- tax_rate: number | null;
- team_id: string;
- title: string | null;
- total_label: string | null;
- total_summary_label: string | null;
- vat_label: string | null;
- vat_rate: number | null;
- };
+ created_at: string
+ currency: string | null
+ customer_label: string | null
+ date_format: string | null
+ delivery_type: Database["public"]["Enums"]["invoice_delivery_type"]
+ description_label: string | null
+ discount_label: string | null
+ due_date_label: string | null
+ from_details: Json | null
+ from_label: string | null
+ id: string
+ include_decimals: boolean | null
+ include_discount: boolean | null
+ include_qr: boolean | null
+ include_tax: boolean | null
+ include_units: boolean | null
+ include_vat: boolean | null
+ invoice_no_label: string | null
+ issue_date_label: string | null
+ logo_url: string | null
+ note_label: string | null
+ payment_details: Json | null
+ payment_label: string | null
+ price_label: string | null
+ quantity_label: string | null
+ size: Database["public"]["Enums"]["invoice_size"] | null
+ tax_label: string | null
+ tax_rate: number | null
+ team_id: string
+ title: string | null
+ total_label: string | null
+ total_summary_label: string | null
+ vat_label: string | null
+ vat_rate: number | null
+ }
Insert: {
- created_at?: string;
- currency?: string | null;
- customer_label?: string | null;
- date_format?: string | null;
- delivery_type?: Database["public"]["Enums"]["invoice_delivery_type"];
- description_label?: string | null;
- discount_label?: string | null;
- due_date_label?: string | null;
- from_details?: Json | null;
- from_label?: string | null;
- id?: string;
- include_decimals?: boolean | null;
- include_discount?: boolean | null;
- include_qr?: boolean | null;
- include_tax?: boolean | null;
- include_units?: boolean | null;
- include_vat?: boolean | null;
- invoice_no_label?: string | null;
- issue_date_label?: string | null;
- logo_url?: string | null;
- note_label?: string | null;
- payment_details?: Json | null;
- payment_label?: string | null;
- price_label?: string | null;
- quantity_label?: string | null;
- size?: Database["public"]["Enums"]["invoice_size"] | null;
- tax_label?: string | null;
- tax_rate?: number | null;
- team_id: string;
- title?: string | null;
- total_label?: string | null;
- total_summary_label?: string | null;
- vat_label?: string | null;
- vat_rate?: number | null;
- };
+ created_at?: string
+ currency?: string | null
+ customer_label?: string | null
+ date_format?: string | null
+ delivery_type?: Database["public"]["Enums"]["invoice_delivery_type"]
+ description_label?: string | null
+ discount_label?: string | null
+ due_date_label?: string | null
+ from_details?: Json | null
+ from_label?: string | null
+ id?: string
+ include_decimals?: boolean | null
+ include_discount?: boolean | null
+ include_qr?: boolean | null
+ include_tax?: boolean | null
+ include_units?: boolean | null
+ include_vat?: boolean | null
+ invoice_no_label?: string | null
+ issue_date_label?: string | null
+ logo_url?: string | null
+ note_label?: string | null
+ payment_details?: Json | null
+ payment_label?: string | null
+ price_label?: string | null
+ quantity_label?: string | null
+ size?: Database["public"]["Enums"]["invoice_size"] | null
+ tax_label?: string | null
+ tax_rate?: number | null
+ team_id: string
+ title?: string | null
+ total_label?: string | null
+ total_summary_label?: string | null
+ vat_label?: string | null
+ vat_rate?: number | null
+ }
Update: {
- created_at?: string;
- currency?: string | null;
- customer_label?: string | null;
- date_format?: string | null;
- delivery_type?: Database["public"]["Enums"]["invoice_delivery_type"];
- description_label?: string | null;
- discount_label?: string | null;
- due_date_label?: string | null;
- from_details?: Json | null;
- from_label?: string | null;
- id?: string;
- include_decimals?: boolean | null;
- include_discount?: boolean | null;
- include_qr?: boolean | null;
- include_tax?: boolean | null;
- include_units?: boolean | null;
- include_vat?: boolean | null;
- invoice_no_label?: string | null;
- issue_date_label?: string | null;
- logo_url?: string | null;
- note_label?: string | null;
- payment_details?: Json | null;
- payment_label?: string | null;
- price_label?: string | null;
- quantity_label?: string | null;
- size?: Database["public"]["Enums"]["invoice_size"] | null;
- tax_label?: string | null;
- tax_rate?: number | null;
- team_id?: string;
- title?: string | null;
- total_label?: string | null;
- total_summary_label?: string | null;
- vat_label?: string | null;
- vat_rate?: number | null;
- };
+ created_at?: string
+ currency?: string | null
+ customer_label?: string | null
+ date_format?: string | null
+ delivery_type?: Database["public"]["Enums"]["invoice_delivery_type"]
+ description_label?: string | null
+ discount_label?: string | null
+ due_date_label?: string | null
+ from_details?: Json | null
+ from_label?: string | null
+ id?: string
+ include_decimals?: boolean | null
+ include_discount?: boolean | null
+ include_qr?: boolean | null
+ include_tax?: boolean | null
+ include_units?: boolean | null
+ include_vat?: boolean | null
+ invoice_no_label?: string | null
+ issue_date_label?: string | null
+ logo_url?: string | null
+ note_label?: string | null
+ payment_details?: Json | null
+ payment_label?: string | null
+ price_label?: string | null
+ quantity_label?: string | null
+ size?: Database["public"]["Enums"]["invoice_size"] | null
+ tax_label?: string | null
+ tax_rate?: number | null
+ team_id?: string
+ title?: string | null
+ total_label?: string | null
+ total_summary_label?: string | null
+ vat_label?: string | null
+ vat_rate?: number | null
+ }
Relationships: [
{
- foreignKeyName: "invoice_settings_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: true;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "invoice_settings_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: true
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
invoices: {
Row: {
- amount: number | null;
- bottom_block: Json | null;
- company_datails: Json | null;
- created_at: string;
- currency: string | null;
- customer_details: Json | null;
- customer_id: string | null;
- customer_name: string | null;
- discount: number | null;
- due_date: string | null;
- file_path: string[] | null;
- file_size: number | null;
- from_details: Json | null;
- fts: unknown | null;
- id: string;
- internal_note: string | null;
- invoice_number: string | null;
- issue_date: string | null;
- line_items: Json | null;
- note: string | null;
- note_details: Json | null;
- paid_at: string | null;
- payment_details: Json | null;
- reminder_sent_at: string | null;
- sent_to: string | null;
- status: Database["public"]["Enums"]["invoice_status"];
- subtotal: number | null;
- tax: number | null;
- team_id: string;
- template: Json | null;
- token: string;
- top_block: Json | null;
- updated_at: string | null;
- url: string | null;
- user_id: string | null;
- vat: number | null;
- viewed_at: string | null;
- };
+ amount: number | null
+ bottom_block: Json | null
+ company_datails: Json | null
+ created_at: string
+ currency: string | null
+ customer_details: Json | null
+ customer_id: string | null
+ customer_name: string | null
+ discount: number | null
+ due_date: string | null
+ file_path: string[] | null
+ file_size: number | null
+ from_details: Json | null
+ fts: unknown | null
+ id: string
+ internal_note: string | null
+ invoice_number: string | null
+ issue_date: string | null
+ line_items: Json | null
+ note: string | null
+ note_details: Json | null
+ paid_at: string | null
+ payment_details: Json | null
+ reminder_sent_at: string | null
+ sent_to: string | null
+ status: Database["public"]["Enums"]["invoice_status"]
+ subtotal: number | null
+ tax: number | null
+ team_id: string
+ template: Json | null
+ token: string
+ top_block: Json | null
+ updated_at: string | null
+ url: string | null
+ user_id: string | null
+ vat: number | null
+ viewed_at: string | null
+ }
Insert: {
- amount?: number | null;
- bottom_block?: Json | null;
- company_datails?: Json | null;
- created_at?: string;
- currency?: string | null;
- customer_details?: Json | null;
- customer_id?: string | null;
- customer_name?: string | null;
- discount?: number | null;
- due_date?: string | null;
- file_path?: string[] | null;
- file_size?: number | null;
- from_details?: Json | null;
- fts?: unknown | null;
- id?: string;
- internal_note?: string | null;
- invoice_number?: string | null;
- issue_date?: string | null;
- line_items?: Json | null;
- note?: string | null;
- note_details?: Json | null;
- paid_at?: string | null;
- payment_details?: Json | null;
- reminder_sent_at?: string | null;
- sent_to?: string | null;
- status?: Database["public"]["Enums"]["invoice_status"];
- subtotal?: number | null;
- tax?: number | null;
- team_id: string;
- template?: Json | null;
- token?: string;
- top_block?: Json | null;
- updated_at?: string | null;
- url?: string | null;
- user_id?: string | null;
- vat?: number | null;
- viewed_at?: string | null;
- };
+ amount?: number | null
+ bottom_block?: Json | null
+ company_datails?: Json | null
+ created_at?: string
+ currency?: string | null
+ customer_details?: Json | null
+ customer_id?: string | null
+ customer_name?: string | null
+ discount?: number | null
+ due_date?: string | null
+ file_path?: string[] | null
+ file_size?: number | null
+ from_details?: Json | null
+ fts?: unknown | null
+ id?: string
+ internal_note?: string | null
+ invoice_number?: string | null
+ issue_date?: string | null
+ line_items?: Json | null
+ note?: string | null
+ note_details?: Json | null
+ paid_at?: string | null
+ payment_details?: Json | null
+ reminder_sent_at?: string | null
+ sent_to?: string | null
+ status?: Database["public"]["Enums"]["invoice_status"]
+ subtotal?: number | null
+ tax?: number | null
+ team_id: string
+ template?: Json | null
+ token?: string
+ top_block?: Json | null
+ updated_at?: string | null
+ url?: string | null
+ user_id?: string | null
+ vat?: number | null
+ viewed_at?: string | null
+ }
Update: {
- amount?: number | null;
- bottom_block?: Json | null;
- company_datails?: Json | null;
- created_at?: string;
- currency?: string | null;
- customer_details?: Json | null;
- customer_id?: string | null;
- customer_name?: string | null;
- discount?: number | null;
- due_date?: string | null;
- file_path?: string[] | null;
- file_size?: number | null;
- from_details?: Json | null;
- fts?: unknown | null;
- id?: string;
- internal_note?: string | null;
- invoice_number?: string | null;
- issue_date?: string | null;
- line_items?: Json | null;
- note?: string | null;
- note_details?: Json | null;
- paid_at?: string | null;
- payment_details?: Json | null;
- reminder_sent_at?: string | null;
- sent_to?: string | null;
- status?: Database["public"]["Enums"]["invoice_status"];
- subtotal?: number | null;
- tax?: number | null;
- team_id?: string;
- template?: Json | null;
- token?: string;
- top_block?: Json | null;
- updated_at?: string | null;
- url?: string | null;
- user_id?: string | null;
- vat?: number | null;
- viewed_at?: string | null;
- };
+ amount?: number | null
+ bottom_block?: Json | null
+ company_datails?: Json | null
+ created_at?: string
+ currency?: string | null
+ customer_details?: Json | null
+ customer_id?: string | null
+ customer_name?: string | null
+ discount?: number | null
+ due_date?: string | null
+ file_path?: string[] | null
+ file_size?: number | null
+ from_details?: Json | null
+ fts?: unknown | null
+ id?: string
+ internal_note?: string | null
+ invoice_number?: string | null
+ issue_date?: string | null
+ line_items?: Json | null
+ note?: string | null
+ note_details?: Json | null
+ paid_at?: string | null
+ payment_details?: Json | null
+ reminder_sent_at?: string | null
+ sent_to?: string | null
+ status?: Database["public"]["Enums"]["invoice_status"]
+ subtotal?: number | null
+ tax?: number | null
+ team_id?: string
+ template?: Json | null
+ token?: string
+ top_block?: Json | null
+ updated_at?: string | null
+ url?: string | null
+ user_id?: string | null
+ vat?: number | null
+ viewed_at?: string | null
+ }
Relationships: [
{
- foreignKeyName: "invoices_created_by_fkey";
- columns: ["user_id"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "invoices_created_by_fkey"
+ columns: ["user_id"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "invoices_customer_id_fkey";
- columns: ["customer_id"];
- isOneToOne: false;
- referencedRelation: "customers";
- referencedColumns: ["id"];
+ foreignKeyName: "invoices_customer_id_fkey"
+ columns: ["customer_id"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "invoices_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "invoices_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
reports: {
Row: {
- created_at: string;
- created_by: string | null;
- currency: string | null;
- expire_at: string | null;
- from: string | null;
- id: string;
- link_id: string | null;
- short_link: string | null;
- team_id: string | null;
- to: string | null;
- type: Database["public"]["Enums"]["reportTypes"] | null;
- };
+ created_at: string
+ created_by: string | null
+ currency: string | null
+ expire_at: string | null
+ from: string | null
+ id: string
+ link_id: string | null
+ short_link: string | null
+ team_id: string | null
+ to: string | null
+ type: Database["public"]["Enums"]["reportTypes"] | null
+ }
Insert: {
- created_at?: string;
- created_by?: string | null;
- currency?: string | null;
- expire_at?: string | null;
- from?: string | null;
- id?: string;
- link_id?: string | null;
- short_link?: string | null;
- team_id?: string | null;
- to?: string | null;
- type?: Database["public"]["Enums"]["reportTypes"] | null;
- };
+ created_at?: string
+ created_by?: string | null
+ currency?: string | null
+ expire_at?: string | null
+ from?: string | null
+ id?: string
+ link_id?: string | null
+ short_link?: string | null
+ team_id?: string | null
+ to?: string | null
+ type?: Database["public"]["Enums"]["reportTypes"] | null
+ }
Update: {
- created_at?: string;
- created_by?: string | null;
- currency?: string | null;
- expire_at?: string | null;
- from?: string | null;
- id?: string;
- link_id?: string | null;
- short_link?: string | null;
- team_id?: string | null;
- to?: string | null;
- type?: Database["public"]["Enums"]["reportTypes"] | null;
- };
+ created_at?: string
+ created_by?: string | null
+ currency?: string | null
+ expire_at?: string | null
+ from?: string | null
+ id?: string
+ link_id?: string | null
+ short_link?: string | null
+ team_id?: string | null
+ to?: string | null
+ type?: Database["public"]["Enums"]["reportTypes"] | null
+ }
Relationships: [
{
- foreignKeyName: "public_reports_created_by_fkey";
- columns: ["created_by"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "public_reports_created_by_fkey"
+ columns: ["created_by"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "reports_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "reports_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
tags: {
Row: {
- created_at: string;
- id: string;
- name: string;
- team_id: string;
- };
+ created_at: string
+ id: string
+ name: string
+ team_id: string
+ }
Insert: {
- created_at?: string;
- id?: string;
- name: string;
- team_id: string;
- };
+ created_at?: string
+ id?: string
+ name: string
+ team_id: string
+ }
Update: {
- created_at?: string;
- id?: string;
- name?: string;
- team_id?: string;
- };
+ created_at?: string
+ id?: string
+ name?: string
+ team_id?: string
+ }
Relationships: [
{
- foreignKeyName: "tags_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "tags_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
teams: {
Row: {
- base_currency: string | null;
- created_at: string;
- document_classification: boolean | null;
- email: string | null;
- flags: string[] | null;
- id: string;
- inbox_email: string | null;
- inbox_forwarding: boolean | null;
- inbox_id: string | null;
- logo_url: string | null;
- name: string | null;
- };
+ base_currency: string | null
+ created_at: string
+ document_classification: boolean | null
+ email: string | null
+ flags: string[] | null
+ id: string
+ inbox_email: string | null
+ inbox_forwarding: boolean | null
+ inbox_id: string | null
+ logo_url: string | null
+ name: string | null
+ }
Insert: {
- base_currency?: string | null;
- created_at?: string;
- document_classification?: boolean | null;
- email?: string | null;
- flags?: string[] | null;
- id?: string;
- inbox_email?: string | null;
- inbox_forwarding?: boolean | null;
- inbox_id?: string | null;
- logo_url?: string | null;
- name?: string | null;
- };
+ base_currency?: string | null
+ created_at?: string
+ document_classification?: boolean | null
+ email?: string | null
+ flags?: string[] | null
+ id?: string
+ inbox_email?: string | null
+ inbox_forwarding?: boolean | null
+ inbox_id?: string | null
+ logo_url?: string | null
+ name?: string | null
+ }
Update: {
- base_currency?: string | null;
- created_at?: string;
- document_classification?: boolean | null;
- email?: string | null;
- flags?: string[] | null;
- id?: string;
- inbox_email?: string | null;
- inbox_forwarding?: boolean | null;
- inbox_id?: string | null;
- logo_url?: string | null;
- name?: string | null;
- };
- Relationships: [];
- };
+ base_currency?: string | null
+ created_at?: string
+ document_classification?: boolean | null
+ email?: string | null
+ flags?: string[] | null
+ id?: string
+ inbox_email?: string | null
+ inbox_forwarding?: boolean | null
+ inbox_id?: string | null
+ logo_url?: string | null
+ name?: string | null
+ }
+ Relationships: []
+ }
tracker_entries: {
Row: {
- assigned_id: string | null;
- billed: boolean | null;
- created_at: string;
- currency: string | null;
- date: string | null;
- description: string | null;
- duration: number | null;
- id: string;
- project_id: string | null;
- rate: number | null;
- start: string | null;
- stop: string | null;
- team_id: string | null;
- project_members: Record | null;
- };
+ assigned_id: string | null
+ billed: boolean | null
+ created_at: string
+ currency: string | null
+ date: string | null
+ description: string | null
+ duration: number | null
+ id: string
+ project_id: string | null
+ rate: number | null
+ start: string | null
+ stop: string | null
+ team_id: string | null
+ project_members: Record | null
+ }
Insert: {
- assigned_id?: string | null;
- billed?: boolean | null;
- created_at?: string;
- currency?: string | null;
- date?: string | null;
- description?: string | null;
- duration?: number | null;
- id?: string;
- project_id?: string | null;
- rate?: number | null;
- start?: string | null;
- stop?: string | null;
- team_id?: string | null;
- };
+ assigned_id?: string | null
+ billed?: boolean | null
+ created_at?: string
+ currency?: string | null
+ date?: string | null
+ description?: string | null
+ duration?: number | null
+ id?: string
+ project_id?: string | null
+ rate?: number | null
+ start?: string | null
+ stop?: string | null
+ team_id?: string | null
+ }
Update: {
- assigned_id?: string | null;
- billed?: boolean | null;
- created_at?: string;
- currency?: string | null;
- date?: string | null;
- description?: string | null;
- duration?: number | null;
- id?: string;
- project_id?: string | null;
- rate?: number | null;
- start?: string | null;
- stop?: string | null;
- team_id?: string | null;
- };
+ assigned_id?: string | null
+ billed?: boolean | null
+ created_at?: string
+ currency?: string | null
+ date?: string | null
+ description?: string | null
+ duration?: number | null
+ id?: string
+ project_id?: string | null
+ rate?: number | null
+ start?: string | null
+ stop?: string | null
+ team_id?: string | null
+ }
Relationships: [
{
- foreignKeyName: "tracker_entries_assigned_id_fkey";
- columns: ["assigned_id"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "tracker_entries_assigned_id_fkey"
+ columns: ["assigned_id"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "tracker_entries_project_id_fkey";
- columns: ["project_id"];
- isOneToOne: false;
- referencedRelation: "tracker_projects";
- referencedColumns: ["id"];
+ foreignKeyName: "tracker_entries_project_id_fkey"
+ columns: ["project_id"]
+ isOneToOne: false
+ referencedRelation: "tracker_projects"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "tracker_entries_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "tracker_entries_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
tracker_project_tags: {
Row: {
- created_at: string;
- id: string;
- tag_id: string;
- team_id: string;
- tracker_project_id: string;
- };
+ created_at: string
+ id: string
+ tag_id: string
+ team_id: string
+ tracker_project_id: string
+ }
Insert: {
- created_at?: string;
- id?: string;
- tag_id: string;
- team_id: string;
- tracker_project_id: string;
- };
+ created_at?: string
+ id?: string
+ tag_id: string
+ team_id: string
+ tracker_project_id: string
+ }
Update: {
- created_at?: string;
- id?: string;
- tag_id?: string;
- team_id?: string;
- tracker_project_id?: string;
- };
+ created_at?: string
+ id?: string
+ tag_id?: string
+ team_id?: string
+ tracker_project_id?: string
+ }
Relationships: [
{
- foreignKeyName: "project_tags_tag_id_fkey";
- columns: ["tag_id"];
- isOneToOne: false;
- referencedRelation: "tags";
- referencedColumns: ["id"];
+ foreignKeyName: "project_tags_tag_id_fkey"
+ columns: ["tag_id"]
+ isOneToOne: false
+ referencedRelation: "tags"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "project_tags_tracker_project_id_fkey";
- columns: ["tracker_project_id"];
- isOneToOne: false;
- referencedRelation: "tracker_projects";
- referencedColumns: ["id"];
+ foreignKeyName: "project_tags_tracker_project_id_fkey"
+ columns: ["tracker_project_id"]
+ isOneToOne: false
+ referencedRelation: "tracker_projects"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "tracker_project_tags_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "tracker_project_tags_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
tracker_projects: {
Row: {
- billable: boolean | null;
- created_at: string;
- currency: string | null;
- customer_id: string | null;
- description: string | null;
- estimate: number | null;
- id: string;
- name: string;
- rate: number | null;
- status: Database["public"]["Enums"]["trackerStatus"];
- team_id: string | null;
- get_assigned_users_for_project: Json | null;
- get_project_total_amount: number | null;
- project_members: Record | null;
- total_duration: number | null;
- };
+ billable: boolean | null
+ created_at: string
+ currency: string | null
+ customer_id: string | null
+ description: string | null
+ estimate: number | null
+ id: string
+ name: string
+ rate: number | null
+ status: Database["public"]["Enums"]["trackerStatus"]
+ team_id: string | null
+ get_assigned_users_for_project: Json | null
+ get_project_total_amount: number | null
+ project_members: Record | null
+ total_duration: number | null
+ }
Insert: {
- billable?: boolean | null;
- created_at?: string;
- currency?: string | null;
- customer_id?: string | null;
- description?: string | null;
- estimate?: number | null;
- id?: string;
- name: string;
- rate?: number | null;
- status?: Database["public"]["Enums"]["trackerStatus"];
- team_id?: string | null;
- };
+ billable?: boolean | null
+ created_at?: string
+ currency?: string | null
+ customer_id?: string | null
+ description?: string | null
+ estimate?: number | null
+ id?: string
+ name: string
+ rate?: number | null
+ status?: Database["public"]["Enums"]["trackerStatus"]
+ team_id?: string | null
+ }
Update: {
- billable?: boolean | null;
- created_at?: string;
- currency?: string | null;
- customer_id?: string | null;
- description?: string | null;
- estimate?: number | null;
- id?: string;
- name?: string;
- rate?: number | null;
- status?: Database["public"]["Enums"]["trackerStatus"];
- team_id?: string | null;
- };
+ billable?: boolean | null
+ created_at?: string
+ currency?: string | null
+ customer_id?: string | null
+ description?: string | null
+ estimate?: number | null
+ id?: string
+ name?: string
+ rate?: number | null
+ status?: Database["public"]["Enums"]["trackerStatus"]
+ team_id?: string | null
+ }
Relationships: [
{
- foreignKeyName: "tracker_projects_customer_id_fkey";
- columns: ["customer_id"];
- isOneToOne: false;
- referencedRelation: "customers";
- referencedColumns: ["id"];
+ foreignKeyName: "tracker_projects_customer_id_fkey"
+ columns: ["customer_id"]
+ isOneToOne: false
+ referencedRelation: "customers"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "tracker_projects_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "tracker_projects_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
tracker_reports: {
Row: {
- created_at: string;
- created_by: string | null;
- id: string;
- link_id: string | null;
- project_id: string | null;
- short_link: string | null;
- team_id: string | null;
- };
+ created_at: string
+ created_by: string | null
+ id: string
+ link_id: string | null
+ project_id: string | null
+ short_link: string | null
+ team_id: string | null
+ }
Insert: {
- created_at?: string;
- created_by?: string | null;
- id?: string;
- link_id?: string | null;
- project_id?: string | null;
- short_link?: string | null;
- team_id?: string | null;
- };
+ created_at?: string
+ created_by?: string | null
+ id?: string
+ link_id?: string | null
+ project_id?: string | null
+ short_link?: string | null
+ team_id?: string | null
+ }
Update: {
- created_at?: string;
- created_by?: string | null;
- id?: string;
- link_id?: string | null;
- project_id?: string | null;
- short_link?: string | null;
- team_id?: string | null;
- };
+ created_at?: string
+ created_by?: string | null
+ id?: string
+ link_id?: string | null
+ project_id?: string | null
+ short_link?: string | null
+ team_id?: string | null
+ }
Relationships: [
{
- foreignKeyName: "public_tracker_reports_created_by_fkey";
- columns: ["created_by"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "public_tracker_reports_created_by_fkey"
+ columns: ["created_by"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "public_tracker_reports_project_id_fkey";
- columns: ["project_id"];
- isOneToOne: false;
- referencedRelation: "tracker_projects";
- referencedColumns: ["id"];
+ foreignKeyName: "public_tracker_reports_project_id_fkey"
+ columns: ["project_id"]
+ isOneToOne: false
+ referencedRelation: "tracker_projects"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "tracker_reports_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "tracker_reports_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
transaction_attachments: {
Row: {
- created_at: string;
- id: string;
- name: string | null;
- path: string[] | null;
- size: number | null;
- team_id: string | null;
- transaction_id: string | null;
- type: string | null;
- };
+ created_at: string
+ id: string
+ name: string | null
+ path: string[] | null
+ size: number | null
+ team_id: string | null
+ transaction_id: string | null
+ type: string | null
+ }
Insert: {
- created_at?: string;
- id?: string;
- name?: string | null;
- path?: string[] | null;
- size?: number | null;
- team_id?: string | null;
- transaction_id?: string | null;
- type?: string | null;
- };
+ created_at?: string
+ id?: string
+ name?: string | null
+ path?: string[] | null
+ size?: number | null
+ team_id?: string | null
+ transaction_id?: string | null
+ type?: string | null
+ }
Update: {
- created_at?: string;
- id?: string;
- name?: string | null;
- path?: string[] | null;
- size?: number | null;
- team_id?: string | null;
- transaction_id?: string | null;
- type?: string | null;
- };
+ created_at?: string
+ id?: string
+ name?: string | null
+ path?: string[] | null
+ size?: number | null
+ team_id?: string | null
+ transaction_id?: string | null
+ type?: string | null
+ }
Relationships: [
{
- foreignKeyName: "public_transaction_attachments_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "public_transaction_attachments_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "public_transaction_attachments_transaction_id_fkey";
- columns: ["transaction_id"];
- isOneToOne: false;
- referencedRelation: "transactions";
- referencedColumns: ["id"];
+ foreignKeyName: "public_transaction_attachments_transaction_id_fkey"
+ columns: ["transaction_id"]
+ isOneToOne: false
+ referencedRelation: "transactions"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
transaction_categories: {
Row: {
- color: string | null;
- created_at: string | null;
- description: string | null;
- embedding: string | null;
- id: string;
- name: string;
- slug: string;
- system: boolean | null;
- team_id: string;
- vat: number | null;
- };
+ color: string | null
+ created_at: string | null
+ description: string | null
+ embedding: string | null
+ id: string
+ name: string
+ slug: string
+ system: boolean | null
+ team_id: string
+ vat: number | null
+ }
Insert: {
- color?: string | null;
- created_at?: string | null;
- description?: string | null;
- embedding?: string | null;
- id?: string;
- name: string;
- slug: string;
- system?: boolean | null;
- team_id?: string;
- vat?: number | null;
- };
+ color?: string | null
+ created_at?: string | null
+ description?: string | null
+ embedding?: string | null
+ id?: string
+ name: string
+ slug: string
+ system?: boolean | null
+ team_id?: string
+ vat?: number | null
+ }
Update: {
- color?: string | null;
- created_at?: string | null;
- description?: string | null;
- embedding?: string | null;
- id?: string;
- name?: string;
- slug?: string;
- system?: boolean | null;
- team_id?: string;
- vat?: number | null;
- };
+ color?: string | null
+ created_at?: string | null
+ description?: string | null
+ embedding?: string | null
+ id?: string
+ name?: string
+ slug?: string
+ system?: boolean | null
+ team_id?: string
+ vat?: number | null
+ }
Relationships: [
{
- foreignKeyName: "transaction_categories_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "transaction_categories_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
transaction_enrichments: {
Row: {
- category_slug: string | null;
- created_at: string;
- id: string;
- name: string | null;
- system: boolean | null;
- team_id: string | null;
- };
+ category_slug: string | null
+ created_at: string
+ id: string
+ name: string | null
+ system: boolean | null
+ team_id: string | null
+ }
Insert: {
- category_slug?: string | null;
- created_at?: string;
- id?: string;
- name?: string | null;
- system?: boolean | null;
- team_id?: string | null;
- };
+ category_slug?: string | null
+ created_at?: string
+ id?: string
+ name?: string | null
+ system?: boolean | null
+ team_id?: string | null
+ }
Update: {
- category_slug?: string | null;
- created_at?: string;
- id?: string;
- name?: string | null;
- system?: boolean | null;
- team_id?: string | null;
- };
+ category_slug?: string | null
+ created_at?: string
+ id?: string
+ name?: string | null
+ system?: boolean | null
+ team_id?: string | null
+ }
Relationships: [
{
- foreignKeyName: "transaction_enrichments_category_slug_team_id_fkey";
- columns: ["category_slug", "team_id"];
- isOneToOne: false;
- referencedRelation: "transaction_categories";
- referencedColumns: ["slug", "team_id"];
+ foreignKeyName: "transaction_enrichments_category_slug_team_id_fkey"
+ columns: ["category_slug", "team_id"]
+ isOneToOne: false
+ referencedRelation: "transaction_categories"
+ referencedColumns: ["slug", "team_id"]
},
{
- foreignKeyName: "transaction_enrichments_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "transaction_enrichments_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
transaction_tags: {
Row: {
- created_at: string;
- id: string;
- tag_id: string;
- team_id: string;
- transaction_id: string;
- };
+ created_at: string
+ id: string
+ tag_id: string
+ team_id: string
+ transaction_id: string
+ }
Insert: {
- created_at?: string;
- id?: string;
- tag_id: string;
- team_id: string;
- transaction_id: string;
- };
+ created_at?: string
+ id?: string
+ tag_id: string
+ team_id: string
+ transaction_id: string
+ }
Update: {
- created_at?: string;
- id?: string;
- tag_id?: string;
- team_id?: string;
- transaction_id?: string;
- };
+ created_at?: string
+ id?: string
+ tag_id?: string
+ team_id?: string
+ transaction_id?: string
+ }
Relationships: [
{
- foreignKeyName: "transaction_tags_tag_id_fkey";
- columns: ["tag_id"];
- isOneToOne: false;
- referencedRelation: "tags";
- referencedColumns: ["id"];
+ foreignKeyName: "transaction_tags_tag_id_fkey"
+ columns: ["tag_id"]
+ isOneToOne: false
+ referencedRelation: "tags"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "transaction_tags_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "transaction_tags_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "transaction_tags_transaction_id_fkey";
- columns: ["transaction_id"];
- isOneToOne: false;
- referencedRelation: "transactions";
- referencedColumns: ["id"];
+ foreignKeyName: "transaction_tags_transaction_id_fkey"
+ columns: ["transaction_id"]
+ isOneToOne: false
+ referencedRelation: "transactions"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
transactions: {
Row: {
- amount: number;
- assigned_id: string | null;
- balance: number | null;
- bank_account_id: string | null;
- base_amount: number | null;
- base_currency: string | null;
- category: Database["public"]["Enums"]["transactionCategories"] | null;
- category_slug: string | null;
- created_at: string;
- currency: string;
- date: string;
- description: string | null;
- frequency:
- | Database["public"]["Enums"]["transaction_frequency"]
- | null;
- fts_vector: unknown | null;
- id: string;
- internal_id: string;
- manual: boolean | null;
- method: Database["public"]["Enums"]["transactionMethods"];
- name: string;
- note: string | null;
- notified: boolean | null;
- recurring: boolean | null;
- status: Database["public"]["Enums"]["transactionStatus"] | null;
- team_id: string;
- amount_text: string | null;
- calculated_vat: number | null;
- is_fulfilled: boolean | null;
- };
+ amount: number
+ assigned_id: string | null
+ balance: number | null
+ bank_account_id: string | null
+ base_amount: number | null
+ base_currency: string | null
+ category: Database["public"]["Enums"]["transactionCategories"] | null
+ category_slug: string | null
+ created_at: string
+ currency: string
+ date: string
+ description: string | null
+ frequency: Database["public"]["Enums"]["transaction_frequency"] | null
+ fts_vector: unknown | null
+ id: string
+ internal_id: string
+ manual: boolean | null
+ method: Database["public"]["Enums"]["transactionMethods"]
+ name: string
+ note: string | null
+ notified: boolean | null
+ recurring: boolean | null
+ status: Database["public"]["Enums"]["transactionStatus"] | null
+ team_id: string
+ amount_text: string | null
+ calculated_vat: number | null
+ is_fulfilled: boolean | null
+ }
Insert: {
- amount: number;
- assigned_id?: string | null;
- balance?: number | null;
- bank_account_id?: string | null;
- base_amount?: number | null;
- base_currency?: string | null;
- category?:
- | Database["public"]["Enums"]["transactionCategories"]
- | null;
- category_slug?: string | null;
- created_at?: string;
- currency: string;
- date: string;
- description?: string | null;
+ amount: number
+ assigned_id?: string | null
+ balance?: number | null
+ bank_account_id?: string | null
+ base_amount?: number | null
+ base_currency?: string | null
+ category?: Database["public"]["Enums"]["transactionCategories"] | null
+ category_slug?: string | null
+ created_at?: string
+ currency: string
+ date: string
+ description?: string | null
frequency?:
| Database["public"]["Enums"]["transaction_frequency"]
- | null;
- fts_vector?: unknown | null;
- id?: string;
- internal_id: string;
- manual?: boolean | null;
- method: Database["public"]["Enums"]["transactionMethods"];
- name: string;
- note?: string | null;
- notified?: boolean | null;
- recurring?: boolean | null;
- status?: Database["public"]["Enums"]["transactionStatus"] | null;
- team_id: string;
- };
+ | null
+ fts_vector?: unknown | null
+ id?: string
+ internal_id: string
+ manual?: boolean | null
+ method: Database["public"]["Enums"]["transactionMethods"]
+ name: string
+ note?: string | null
+ notified?: boolean | null
+ recurring?: boolean | null
+ status?: Database["public"]["Enums"]["transactionStatus"] | null
+ team_id: string
+ }
Update: {
- amount?: number;
- assigned_id?: string | null;
- balance?: number | null;
- bank_account_id?: string | null;
- base_amount?: number | null;
- base_currency?: string | null;
- category?:
- | Database["public"]["Enums"]["transactionCategories"]
- | null;
- category_slug?: string | null;
- created_at?: string;
- currency?: string;
- date?: string;
- description?: string | null;
+ amount?: number
+ assigned_id?: string | null
+ balance?: number | null
+ bank_account_id?: string | null
+ base_amount?: number | null
+ base_currency?: string | null
+ category?: Database["public"]["Enums"]["transactionCategories"] | null
+ category_slug?: string | null
+ created_at?: string
+ currency?: string
+ date?: string
+ description?: string | null
frequency?:
| Database["public"]["Enums"]["transaction_frequency"]
- | null;
- fts_vector?: unknown | null;
- id?: string;
- internal_id?: string;
- manual?: boolean | null;
- method?: Database["public"]["Enums"]["transactionMethods"];
- name?: string;
- note?: string | null;
- notified?: boolean | null;
- recurring?: boolean | null;
- status?: Database["public"]["Enums"]["transactionStatus"] | null;
- team_id?: string;
- };
+ | null
+ fts_vector?: unknown | null
+ id?: string
+ internal_id?: string
+ manual?: boolean | null
+ method?: Database["public"]["Enums"]["transactionMethods"]
+ name?: string
+ note?: string | null
+ notified?: boolean | null
+ recurring?: boolean | null
+ status?: Database["public"]["Enums"]["transactionStatus"] | null
+ team_id?: string
+ }
Relationships: [
{
- foreignKeyName: "public_transactions_assigned_id_fkey";
- columns: ["assigned_id"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "public_transactions_assigned_id_fkey"
+ columns: ["assigned_id"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "public_transactions_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "public_transactions_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "transactions_bank_account_id_fkey";
- columns: ["bank_account_id"];
- isOneToOne: false;
- referencedRelation: "bank_accounts";
- referencedColumns: ["id"];
+ foreignKeyName: "transactions_bank_account_id_fkey"
+ columns: ["bank_account_id"]
+ isOneToOne: false
+ referencedRelation: "bank_accounts"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "transactions_category_slug_team_id_fkey";
- columns: ["category_slug", "team_id"];
- isOneToOne: false;
- referencedRelation: "transaction_categories";
- referencedColumns: ["slug", "team_id"];
+ foreignKeyName: "transactions_category_slug_team_id_fkey"
+ columns: ["category_slug", "team_id"]
+ isOneToOne: false
+ referencedRelation: "transaction_categories"
+ referencedColumns: ["slug", "team_id"]
},
- ];
- };
+ ]
+ }
user_invites: {
Row: {
- code: string | null;
- created_at: string;
- email: string | null;
- id: string;
- invited_by: string | null;
- role: Database["public"]["Enums"]["teamRoles"] | null;
- team_id: string | null;
- };
+ code: string | null
+ created_at: string
+ email: string | null
+ id: string
+ invited_by: string | null
+ role: Database["public"]["Enums"]["teamRoles"] | null
+ team_id: string | null
+ }
Insert: {
- code?: string | null;
- created_at?: string;
- email?: string | null;
- id?: string;
- invited_by?: string | null;
- role?: Database["public"]["Enums"]["teamRoles"] | null;
- team_id?: string | null;
- };
+ code?: string | null
+ created_at?: string
+ email?: string | null
+ id?: string
+ invited_by?: string | null
+ role?: Database["public"]["Enums"]["teamRoles"] | null
+ team_id?: string | null
+ }
Update: {
- code?: string | null;
- created_at?: string;
- email?: string | null;
- id?: string;
- invited_by?: string | null;
- role?: Database["public"]["Enums"]["teamRoles"] | null;
- team_id?: string | null;
- };
+ code?: string | null
+ created_at?: string
+ email?: string | null
+ id?: string
+ invited_by?: string | null
+ role?: Database["public"]["Enums"]["teamRoles"] | null
+ team_id?: string | null
+ }
Relationships: [
{
- foreignKeyName: "public_user_invites_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "public_user_invites_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "user_invites_invited_by_fkey";
- columns: ["invited_by"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "user_invites_invited_by_fkey"
+ columns: ["invited_by"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
users: {
Row: {
- avatar_url: string | null;
- created_at: string | null;
- date_format: string | null;
- email: string | null;
- full_name: string | null;
- id: string;
- locale: string | null;
- team_id: string | null;
- time_format: number | null;
- timezone: string | null;
- week_starts_on_monday: boolean | null;
- };
+ avatar_url: string | null
+ created_at: string | null
+ date_format: string | null
+ email: string | null
+ full_name: string | null
+ id: string
+ locale: string | null
+ team_id: string | null
+ time_format: number | null
+ timezone: string | null
+ week_starts_on_monday: boolean | null
+ }
Insert: {
- avatar_url?: string | null;
- created_at?: string | null;
- date_format?: string | null;
- email?: string | null;
- full_name?: string | null;
- id: string;
- locale?: string | null;
- team_id?: string | null;
- time_format?: number | null;
- timezone?: string | null;
- week_starts_on_monday?: boolean | null;
- };
+ avatar_url?: string | null
+ created_at?: string | null
+ date_format?: string | null
+ email?: string | null
+ full_name?: string | null
+ id: string
+ locale?: string | null
+ team_id?: string | null
+ time_format?: number | null
+ timezone?: string | null
+ week_starts_on_monday?: boolean | null
+ }
Update: {
- avatar_url?: string | null;
- created_at?: string | null;
- date_format?: string | null;
- email?: string | null;
- full_name?: string | null;
- id?: string;
- locale?: string | null;
- team_id?: string | null;
- time_format?: number | null;
- timezone?: string | null;
- week_starts_on_monday?: boolean | null;
- };
+ avatar_url?: string | null
+ created_at?: string | null
+ date_format?: string | null
+ email?: string | null
+ full_name?: string | null
+ id?: string
+ locale?: string | null
+ team_id?: string | null
+ time_format?: number | null
+ timezone?: string | null
+ week_starts_on_monday?: boolean | null
+ }
Relationships: [
{
- foreignKeyName: "users_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "users_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
- ];
- };
+ ]
+ }
users_on_team: {
Row: {
- created_at: string | null;
- id: string;
- role: Database["public"]["Enums"]["teamRoles"] | null;
- team_id: string;
- user_id: string;
- };
+ created_at: string | null
+ id: string
+ role: Database["public"]["Enums"]["teamRoles"] | null
+ team_id: string
+ user_id: string
+ }
Insert: {
- created_at?: string | null;
- id?: string;
- role?: Database["public"]["Enums"]["teamRoles"] | null;
- team_id: string;
- user_id: string;
- };
+ created_at?: string | null
+ id?: string
+ role?: Database["public"]["Enums"]["teamRoles"] | null
+ team_id: string
+ user_id: string
+ }
Update: {
- created_at?: string | null;
- id?: string;
- role?: Database["public"]["Enums"]["teamRoles"] | null;
- team_id?: string;
- user_id?: string;
- };
+ created_at?: string | null
+ id?: string
+ role?: Database["public"]["Enums"]["teamRoles"] | null
+ team_id?: string
+ user_id?: string
+ }
Relationships: [
{
- foreignKeyName: "users_on_team_team_id_fkey";
- columns: ["team_id"];
- isOneToOne: false;
- referencedRelation: "teams";
- referencedColumns: ["id"];
+ foreignKeyName: "users_on_team_team_id_fkey"
+ columns: ["team_id"]
+ isOneToOne: false
+ referencedRelation: "teams"
+ referencedColumns: ["id"]
},
{
- foreignKeyName: "users_on_team_user_id_fkey";
- columns: ["user_id"];
- isOneToOne: false;
- referencedRelation: "users";
- referencedColumns: ["id"];
+ foreignKeyName: "users_on_team_user_id_fkey"
+ columns: ["user_id"]
+ isOneToOne: false
+ referencedRelation: "users"
+ referencedColumns: ["id"]
},
- ];
- };
- };
+ ]
+ }
+ }
Views: {
- [_ in never]: never;
- };
+ [_ in never]: never
+ }
Functions: {
amount_text: {
Args: {
- "": unknown;
- };
- Returns: string;
- };
+ "": unknown
+ }
+ Returns: string
+ }
calculate_amount_similarity: {
Args: {
- transaction_currency: string;
- inbox_currency: string;
- transaction_amount: number;
- inbox_amount: number;
- };
- Returns: number;
- };
+ transaction_currency: string
+ inbox_currency: string
+ transaction_amount: number
+ inbox_amount: number
+ }
+ Returns: number
+ }
calculate_base_amount_score: {
Args: {
- transaction_base_currency: string;
- inbox_base_currency: string;
- transaction_base_amount: number;
- inbox_base_amount: number;
- };
- Returns: number;
- };
+ transaction_base_currency: string
+ inbox_base_currency: string
+ transaction_base_amount: number
+ inbox_base_amount: number
+ }
+ Returns: number
+ }
calculate_date_proximity_score: {
Args: {
- t_date: string;
- i_date: string;
- };
- Returns: number;
- };
+ t_date: string
+ i_date: string
+ }
+ Returns: number
+ }
calculate_date_similarity: {
Args: {
- transaction_date: string;
- inbox_date: string;
- };
- Returns: number;
- };
+ transaction_date: string
+ inbox_date: string
+ }
+ Returns: number
+ }
calculate_match_score: {
Args: {
- t_record: Record;
- i_record: Record;
- };
- Returns: number;
- };
+ t_record: Record
+ i_record: Record
+ }
+ Returns: number
+ }
calculate_name_similarity_score: {
Args: {
- transaction_name: string;
- inbox_name: string;
- };
- Returns: number;
- };
+ transaction_name: string
+ inbox_name: string
+ }
+ Returns: number
+ }
calculate_overall_similarity: {
Args: {
- transaction_record: Record;
- inbox_record: Record;
- };
- Returns: number;
- };
+ transaction_record: Record
+ inbox_record: Record
+ }
+ Returns: number
+ }
calculate_total_sum: {
Args: {
- target_currency: string;
- };
- Returns: number;
- };
+ target_currency: string
+ }
+ Returns: number
+ }
calculate_total_sum2: {
Args: {
- target_currency: string;
- };
- Returns: number;
- };
+ target_currency: string
+ }
+ Returns: number
+ }
calculate_transaction_differences_v2: {
Args: {
- p_team_id: string;
- };
+ p_team_id: string
+ }
Returns: {
- transaction_group: string;
- date: string;
- team_id: string;
- recurring: boolean;
- frequency: Database["public"]["Enums"]["transaction_frequency"];
- days_diff: number;
- }[];
- };
+ transaction_group: string
+ date: string
+ team_id: string
+ recurring: boolean
+ frequency: Database["public"]["Enums"]["transaction_frequency"]
+ days_diff: number
+ }[]
+ }
calculate_transaction_frequency: {
Args: {
- p_transaction_group: string;
- p_team_id: string;
- p_new_date: string;
- };
+ p_transaction_group: string
+ p_team_id: string
+ p_new_date: string
+ }
Returns: {
- avg_days_between: number;
- transaction_count: number;
- is_recurring: boolean;
- latest_frequency: string;
- }[];
- };
+ avg_days_between: number
+ transaction_count: number
+ is_recurring: boolean
+ latest_frequency: string
+ }[]
+ }
calculated_vat: {
Args: {
- "": unknown;
- };
- Returns: number;
- };
+ "": unknown
+ }
+ Returns: number
+ }
classify_frequency_v2: {
Args: {
- p_team_id: string;
- };
+ p_team_id: string
+ }
Returns: {
- transaction_group: string;
- team_id: string;
- transaction_count: number;
- avg_days_between: number;
- stddev_days_between: number;
- frequency: Database["public"]["Enums"]["transaction_frequency"];
- }[];
- };
+ transaction_group: string
+ team_id: string
+ transaction_count: number
+ avg_days_between: number
+ stddev_days_between: number
+ frequency: Database["public"]["Enums"]["transaction_frequency"]
+ }[]
+ }
create_team: {
Args: {
- name: string;
- };
- Returns: string;
- };
+ name: string
+ }
+ Returns: string
+ }
create_team_v2: {
Args: {
- name: string;
- currency?: string;
- };
- Returns: string;
- };
+ name: string
+ currency?: string
+ }
+ Returns: string
+ }
determine_transaction_frequency:
| {
Args: {
- p_avg_days_between: number;
- p_transaction_count: number;
- };
- Returns: string;
+ p_avg_days_between: number
+ p_transaction_count: number
+ }
+ Returns: string
}
| {
Args: {
- p_avg_days_between: number;
- p_transaction_count: number;
- p_is_recurring: boolean;
- p_latest_frequency: string;
- };
- Returns: string;
- };
+ p_avg_days_between: number
+ p_transaction_count: number
+ p_is_recurring: boolean
+ p_latest_frequency: string
+ }
+ Returns: string
+ }
extract_product_names: {
Args: {
- products_json: Json;
- };
- Returns: string;
- };
+ products_json: Json
+ }
+ Returns: string
+ }
find_matching_inbox_item: {
Args: {
- input_transaction_id: string;
- specific_inbox_id?: string;
- };
+ input_transaction_id: string
+ specific_inbox_id?: string
+ }
Returns: {
- inbox_id: string;
- transaction_id: string;
- transaction_name: string;
- similarity_score: number;
- file_name: string;
- }[];
- };
+ inbox_id: string
+ transaction_id: string
+ transaction_name: string
+ similarity_score: number
+ file_name: string
+ }[]
+ }
generate_hmac: {
Args: {
- secret_key: string;
- message: string;
- };
- Returns: string;
- };
+ secret_key: string
+ message: string
+ }
+ Returns: string
+ }
generate_id: {
Args: {
- size: number;
- };
- Returns: string;
- };
+ size: number
+ }
+ Returns: string
+ }
generate_inbox: {
Args: {
- size: number;
- };
- Returns: string;
- };
+ size: number
+ }
+ Returns: string
+ }
generate_inbox_fts:
| {
Args: {
- display_name: string;
- products_json: Json;
- };
- Returns: unknown;
+ display_name: string
+ products_json: Json
+ }
+ Returns: unknown
}
| {
Args: {
- display_name_text: string;
- product_names: string;
- };
- Returns: unknown;
+ display_name_text: string
+ product_names: string
+ }
+ Returns: unknown
}
| {
Args: {
- display_name_text: string;
- product_names: string;
- amount: number;
- due_date: string;
- };
- Returns: unknown;
- };
+ display_name_text: string
+ product_names: string
+ amount: number
+ due_date: string
+ }
+ Returns: unknown
+ }
get_all_transactions_by_account: {
Args: {
- account_id: string;
- };
+ account_id: string
+ }
Returns: {
- amount: number;
- assigned_id: string | null;
- balance: number | null;
- bank_account_id: string | null;
- base_amount: number | null;
- base_currency: string | null;
- category: Database["public"]["Enums"]["transactionCategories"] | null;
- category_slug: string | null;
- created_at: string;
- currency: string;
- date: string;
- description: string | null;
- frequency:
- | Database["public"]["Enums"]["transaction_frequency"]
- | null;
- fts_vector: unknown | null;
- id: string;
- internal_id: string;
- manual: boolean | null;
- method: Database["public"]["Enums"]["transactionMethods"];
- name: string;
- note: string | null;
- notified: boolean | null;
- recurring: boolean | null;
- status: Database["public"]["Enums"]["transactionStatus"] | null;
- team_id: string;
- }[];
- };
+ amount: number
+ assigned_id: string | null
+ balance: number | null
+ bank_account_id: string | null
+ base_amount: number | null
+ base_currency: string | null
+ category: Database["public"]["Enums"]["transactionCategories"] | null
+ category_slug: string | null
+ created_at: string
+ currency: string
+ date: string
+ description: string | null
+ frequency: Database["public"]["Enums"]["transaction_frequency"] | null
+ fts_vector: unknown | null
+ id: string
+ internal_id: string
+ manual: boolean | null
+ method: Database["public"]["Enums"]["transactionMethods"]
+ name: string
+ note: string | null
+ notified: boolean | null
+ recurring: boolean | null
+ status: Database["public"]["Enums"]["transactionStatus"] | null
+ team_id: string
+ }[]
+ }
get_assigned_users_for_project: {
Args: {
- "": unknown;
- };
- Returns: Json;
- };
+ "": unknown
+ }
+ Returns: Json
+ }
get_bank_account_currencies: {
Args: {
- team_id: string;
- };
+ team_id: string
+ }
Returns: {
- currency: string;
- }[];
- };
+ currency: string
+ }[]
+ }
get_burn_rate: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- currency: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ currency: string
+ }
Returns: {
- date: string;
- value: number;
- }[];
- };
+ date: string
+ value: number
+ }[]
+ }
get_burn_rate_v2: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_burn_rate_v3: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_burn_rate_v4: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_current_burn_rate: {
Args: {
- team_id: string;
- currency: string;
- };
- Returns: number;
- };
+ team_id: string
+ currency: string
+ }
+ Returns: number
+ }
get_current_burn_rate_v2: {
Args: {
- team_id: string;
- base_currency?: string;
- };
+ team_id: string
+ base_currency?: string
+ }
Returns: {
- currency: string;
- value: number;
- }[];
- };
+ currency: string
+ value: number
+ }[]
+ }
get_current_burn_rate_v3: {
Args: {
- team_id: string;
- base_currency?: string;
- };
+ team_id: string
+ base_currency?: string
+ }
Returns: {
- currency: string;
- value: number;
- }[];
- };
+ currency: string
+ value: number
+ }[]
+ }
get_current_user_team_id: {
- Args: Record;
- Returns: string;
- };
+ Args: Record
+ Returns: string
+ }
get_expenses: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- recurring_value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ recurring_value: number
+ currency: string
+ }[]
+ }
get_invoice_summary: {
Args: {
- team_id: string;
- status?: Database["public"]["Enums"]["invoice_status"];
- };
+ team_id: string
+ status?: Database["public"]["Enums"]["invoice_status"]
+ }
Returns: {
- currency: string;
- total_amount: number;
- invoice_count: number;
- }[];
- };
+ currency: string
+ total_amount: number
+ invoice_count: number
+ }[]
+ }
get_next_invoice_number: {
Args: {
- team_id: string;
- };
- Returns: string;
- };
+ team_id: string
+ }
+ Returns: string
+ }
get_payment_score: {
Args: {
- team_id: string;
- };
+ team_id: string
+ }
Returns: {
- score: number;
- payment_status: string;
- }[];
- };
+ score: number
+ payment_status: string
+ }[]
+ }
get_profit: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- currency: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ currency: string
+ }
Returns: {
- date: string;
- value: number;
- }[];
- };
+ date: string
+ value: number
+ }[]
+ }
get_profit_v2: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_profit_v3: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_profit_v4: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_project_total_amount: {
Args: {
- "": unknown;
- };
- Returns: number;
- };
+ "": unknown
+ }
+ Returns: number
+ }
get_revenue: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- currency: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ currency: string
+ }
Returns: {
- date: string;
- value: number;
- }[];
- };
+ date: string
+ value: number
+ }[]
+ }
get_revenue_v2: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_revenue_v3: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- date: string;
- value: number;
- currency: string;
- }[];
- };
+ date: string
+ value: number
+ currency: string
+ }[]
+ }
get_runway: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- currency: string;
- };
- Returns: number;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ currency: string
+ }
+ Returns: number
+ }
get_runway_v2: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
- Returns: number;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
+ Returns: number
+ }
get_runway_v3: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
- Returns: number;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
+ Returns: number
+ }
get_runway_v4: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
- Returns: number;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
+ Returns: number
+ }
get_spending: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- currency_target: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ currency_target: string
+ }
Returns: {
- name: string;
- slug: string;
- amount: number;
- currency: string;
- color: string;
- percentage: number;
- }[];
- };
+ name: string
+ slug: string
+ amount: number
+ currency: string
+ color: string
+ percentage: number
+ }[]
+ }
get_spending_v2: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- name: string;
- slug: string;
- amount: number;
- currency: string;
- color: string;
- percentage: number;
- }[];
- };
+ name: string
+ slug: string
+ amount: number
+ currency: string
+ color: string
+ percentage: number
+ }[]
+ }
get_spending_v3: {
Args: {
- team_id: string;
- date_from: string;
- date_to: string;
- base_currency?: string;
- };
+ team_id: string
+ date_from: string
+ date_to: string
+ base_currency?: string
+ }
Returns: {
- name: string;
- slug: string;
- amount: number;
- currency: string;
- color: string;
- percentage: number;
- }[];
- };
+ name: string
+ slug: string
+ amount: number
+ currency: string
+ color: string
+ percentage: number
+ }[]
+ }
get_team_bank_accounts_balances: {
Args: {
- team_id: string;
- };
+ team_id: string
+ }
Returns: {
- id: string;
- currency: string;
- balance: number;
- name: string;
- logo_url: string;
- }[];
- };
+ id: string
+ currency: string
+ balance: number
+ name: string
+ logo_url: string
+ }[]
+ }
get_total_balance: {
Args: {
- team_id: string;
- currency: string;
- };
- Returns: number;
- };
+ team_id: string
+ currency: string
+ }
+ Returns: number
+ }
get_total_balance_v2: {
Args: {
- team_id: string;
- currency: string;
- };
- Returns: number;
- };
+ team_id: string
+ currency: string
+ }
+ Returns: number
+ }
get_total_balance_v3: {
Args: {
- team_id: string;
- currency: string;
- };
- Returns: number;
- };
+ team_id: string
+ currency: string
+ }
+ Returns: number
+ }
get_transactions_amount_range_data: {
Args: {
- team_id: string;
- amount_type?: string;
- };
+ team_id: string
+ amount_type?: string
+ }
Returns: {
- id: string;
- amount: number;
- }[];
- };
+ id: string
+ amount: number
+ }[]
+ }
group_transactions_v2: {
Args: {
- p_team_id: string;
- };
+ p_team_id: string
+ }
Returns: {
- transaction_group: string;
- date: string;
- team_id: string;
- recurring: boolean;
- frequency: Database["public"]["Enums"]["transaction_frequency"];
- }[];
- };
+ transaction_group: string
+ date: string
+ team_id: string
+ recurring: boolean
+ frequency: Database["public"]["Enums"]["transaction_frequency"]
+ }[]
+ }
gtrgm_compress: {
Args: {
- "": unknown;
- };
- Returns: unknown;
- };
+ "": unknown
+ }
+ Returns: unknown
+ }
gtrgm_decompress: {
Args: {
- "": unknown;
- };
- Returns: unknown;
- };
+ "": unknown
+ }
+ Returns: unknown
+ }
gtrgm_in: {
Args: {
- "": unknown;
- };
- Returns: unknown;
- };
+ "": unknown
+ }
+ Returns: unknown
+ }
gtrgm_options: {
Args: {
- "": unknown;
- };
- Returns: undefined;
- };
+ "": unknown
+ }
+ Returns: undefined
+ }
gtrgm_out: {
Args: {
- "": unknown;
- };
- Returns: unknown;
- };
+ "": unknown
+ }
+ Returns: unknown
+ }
identify_similar_transactions_v2: {
Args: {
- p_team_id: string;
- };
+ p_team_id: string
+ }
Returns: {
- original_transaction_name: string;
- similar_transaction_name: string;
- team_id: string;
- }[];
- };
+ original_transaction_name: string
+ similar_transaction_name: string
+ team_id: string
+ }[]
+ }
identify_transaction_group: {
Args: {
- p_name: string;
- p_team_id: string;
- };
- Returns: string;
- };
+ p_name: string
+ p_team_id: string
+ }
+ Returns: string
+ }
inbox_amount_text: {
Args: {
- "": unknown;
- };
- Returns: string;
- };
+ "": unknown
+ }
+ Returns: string
+ }
is_fulfilled: {
Args: {
- "": unknown;
- };
- Returns: boolean;
- };
+ "": unknown
+ }
+ Returns: boolean
+ }
is_project_tagged: {
Args: {
- project: unknown;
- };
- Returns: boolean;
- };
+ project: unknown
+ }
+ Returns: boolean
+ }
is_transaction_tagged: {
Args: {
- transaction: unknown;
- };
- Returns: boolean;
- };
+ transaction: unknown
+ }
+ Returns: boolean
+ }
match_transaction_with_inbox: {
Args: {
- p_transaction_id: string;
- p_inbox_id?: string;
- };
+ p_transaction_id: string
+ p_inbox_id?: string
+ }
Returns: {
- inbox_id: string;
- transaction_id: string;
- transaction_name: string;
- score: number;
- file_name: string;
- }[];
- };
+ inbox_id: string
+ transaction_id: string
+ transaction_name: string
+ score: number
+ file_name: string
+ }[]
+ }
nanoid: {
Args: {
- size?: number;
- alphabet?: string;
- additionalbytesfactor?: number;
- };
- Returns: string;
- };
+ size?: number
+ alphabet?: string
+ additionalbytesfactor?: number
+ }
+ Returns: string
+ }
nanoid_optimized: {
Args: {
- size: number;
- alphabet: string;
- mask: number;
- step: number;
- };
- Returns: string;
- };
+ size: number
+ alphabet: string
+ mask: number
+ step: number
+ }
+ Returns: string
+ }
project_members:
| {
Args: {
- "": unknown;
- };
+ "": unknown
+ }
Returns: {
- id: string;
- avatar_url: string;
- full_name: string;
- }[];
+ id: string
+ avatar_url: string
+ full_name: string
+ }[]
}
| {
Args: {
- "": unknown;
- };
+ "": unknown
+ }
Returns: {
- id: string;
- avatar_url: string;
- full_name: string;
- }[];
- };
+ id: string
+ avatar_url: string
+ full_name: string
+ }[]
+ }
set_limit: {
Args: {
- "": number;
- };
- Returns: number;
- };
+ "": number
+ }
+ Returns: number
+ }
show_limit: {
- Args: Record;
- Returns: number;
- };
+ Args: Record
+ Returns: number
+ }
show_trgm: {
Args: {
- "": string;
- };
- Returns: string[];
- };
+ "": string
+ }
+ Returns: string[]
+ }
slugify: {
Args: {
- value: string;
- };
- Returns: string;
- };
+ value: string
+ }
+ Returns: string
+ }
total_duration: {
Args: {
- "": unknown;
- };
- Returns: number;
- };
+ "": unknown
+ }
+ Returns: number
+ }
unaccent: {
Args: {
- "": string;
- };
- Returns: string;
- };
+ "": string
+ }
+ Returns: string
+ }
unaccent_init: {
Args: {
- "": unknown;
- };
- Returns: unknown;
- };
- };
+ "": unknown
+ }
+ Returns: unknown
+ }
+ }
Enums: {
account_type:
| "depository"
| "credit"
| "other_asset"
| "loan"
- | "other_liability";
- bank_providers: "gocardless" | "plaid" | "teller";
- bankProviders: "gocardless" | "plaid" | "teller";
- connection_status: "disconnected" | "connected" | "unknown";
- inbox_status: "processing" | "pending" | "archived" | "new" | "deleted";
- inbox_type: "invoice" | "expense";
- invoice_delivery_type: "create" | "create_and_send";
- invoice_size: "a4" | "letter";
- invoice_status: "draft" | "overdue" | "paid" | "unpaid" | "canceled";
- reportTypes: "profit" | "revenue" | "burn_rate" | "expense";
- teamRoles: "owner" | "member";
- trackerStatus: "in_progress" | "completed";
+ | "other_liability"
+ bank_providers: "gocardless" | "plaid" | "teller"
+ bankProviders: "gocardless" | "plaid" | "teller"
+ connection_status: "disconnected" | "connected" | "unknown"
+ inbox_status: "processing" | "pending" | "archived" | "new" | "deleted"
+ inbox_type: "invoice" | "expense"
+ invoice_delivery_type: "create" | "create_and_send"
+ invoice_size: "a4" | "letter"
+ invoice_status: "draft" | "overdue" | "paid" | "unpaid" | "canceled"
+ reportTypes: "profit" | "revenue" | "burn_rate" | "expense"
+ teamRoles: "owner" | "member"
+ trackerStatus: "in_progress" | "completed"
transaction_frequency:
| "weekly"
| "biweekly"
@@ -2378,7 +2373,7 @@ export type Database = {
| "semi_monthly"
| "annually"
| "irregular"
- | "unknown";
+ | "unknown"
transactionCategories:
| "travel"
| "office_supplies"
@@ -2395,7 +2390,7 @@ export type Database = {
| "taxes"
| "other"
| "salary"
- | "fees";
+ | "fees"
transactionMethods:
| "payment"
| "card_purchase"
@@ -2407,19 +2402,19 @@ export type Database = {
| "interest"
| "deposit"
| "wire"
- | "fee";
- transactionStatus: "posted" | "pending" | "excluded" | "completed";
- };
+ | "fee"
+ transactionStatus: "posted" | "pending" | "excluded" | "completed"
+ }
CompositeTypes: {
metrics_record: {
- date: string | null;
- value: number | null;
- };
- };
- };
-};
+ date: string | null
+ value: number | null
+ }
+ }
+ }
+}
-type PublicSchema = Database[Extract];
+type PublicSchema = Database[Extract]
export type Tables<
PublicTableNameOrOptions extends
@@ -2432,7 +2427,7 @@ export type Tables<
> = PublicTableNameOrOptions extends { schema: keyof Database }
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
- Row: infer R;
+ Row: infer R
}
? R
: never
@@ -2440,11 +2435,11 @@ export type Tables<
PublicSchema["Views"])
? (PublicSchema["Tables"] &
PublicSchema["Views"])[PublicTableNameOrOptions] extends {
- Row: infer R;
+ Row: infer R
}
? R
: never
- : never;
+ : never
export type TablesInsert<
PublicTableNameOrOptions extends
@@ -2455,17 +2450,17 @@ export type TablesInsert<
: never = never,
> = PublicTableNameOrOptions extends { schema: keyof Database }
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
- Insert: infer I;
+ Insert: infer I
}
? I
: never
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
- Insert: infer I;
+ Insert: infer I
}
? I
: never
- : never;
+ : never
export type TablesUpdate<
PublicTableNameOrOptions extends
@@ -2476,17 +2471,17 @@ export type TablesUpdate<
: never = never,
> = PublicTableNameOrOptions extends { schema: keyof Database }
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
- Update: infer U;
+ Update: infer U
}
? U
: never
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
- Update: infer U;
+ Update: infer U
}
? U
: never
- : never;
+ : never
export type Enums<
PublicEnumNameOrOptions extends
@@ -2499,14 +2494,14 @@ export type Enums<
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
? PublicSchema["Enums"][PublicEnumNameOrOptions]
- : never;
+ : never
export type CompositeTypes<
PublicCompositeTypeNameOrOptions extends
| keyof PublicSchema["CompositeTypes"]
| { schema: keyof Database },
CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
- schema: keyof Database;
+ schema: keyof Database
}
? keyof Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
: never = never,
@@ -2514,4 +2509,4 @@ export type CompositeTypes<
? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
: PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"]
? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
- : never;
+ : never