Skip to content

Commit

Permalink
Name
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jun 11, 2024
1 parent f0b1207 commit 238349a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apps/dashboard/src/actions/create-bank-account-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ export const createBankAccountAction = action(
const teamId = user?.data?.team_id;

const { data, error } = await supabase
.from("decrypted_bank_accounts")
.from("bank_accounts")
.insert({
name,
original_name: name,
currency,
team_id: teamId,
created_by: user?.data?.id,
enabled: true,
account_id: nanoid(),
manual: true,
})
.select("id, name:decrypted_name")
.select("id, name:original_name")
.single();

if (error) {
Expand Down
44 changes: 41 additions & 3 deletions packages/supabase/src/types/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ export type Database = {
bank_connection_id: string | null;
created_at: string;
created_by: string;
currency: string;
currency: string | null;
enabled: boolean;
id: string;
last_accessed: string | null;
manual: boolean | null;
name: string | null;
original_name: string | null;
team_id: string;
};
Insert: {
Expand All @@ -29,11 +31,13 @@ export type Database = {
bank_connection_id?: string | null;
created_at?: string;
created_by: string;
currency: string;
currency?: string | null;
enabled?: boolean;
id?: string;
last_accessed?: string | null;
manual?: boolean | null;
name?: string | null;
original_name?: string | null;
team_id: string;
};
Update: {
Expand All @@ -42,11 +46,13 @@ export type Database = {
bank_connection_id?: string | null;
created_at?: string;
created_by?: string;
currency?: string;
currency?: string | null;
enabled?: boolean;
id?: string;
last_accessed?: string | null;
manual?: boolean | null;
name?: string | null;
original_name?: string | null;
team_id?: string;
};
Relationships: [
Expand Down Expand Up @@ -90,6 +96,7 @@ export type Database = {
institution_id: string;
logo_url: string | null;
name: string;
original_name: string | null;
provider: Database["public"]["Enums"]["bank_providers"] | null;
team_id: string;
};
Expand All @@ -102,6 +109,7 @@ export type Database = {
institution_id: string;
logo_url?: string | null;
name: string;
original_name?: string | null;
provider?: Database["public"]["Enums"]["bank_providers"] | null;
team_id: string;
};
Expand All @@ -114,6 +122,7 @@ export type Database = {
institution_id?: string;
logo_url?: string | null;
name?: string;
original_name?: string | null;
provider?: Database["public"]["Enums"]["bank_providers"] | null;
team_id?: string;
};
Expand Down Expand Up @@ -548,6 +557,7 @@ export type Database = {
color: string | null;
created_at: string | null;
description: string | null;
embedding: string | null;
id: string;
name: string;
slug: string;
Expand All @@ -559,6 +569,7 @@ export type Database = {
color?: string | null;
created_at?: string | null;
description?: string | null;
embedding?: string | null;
id?: string;
name: string;
slug: string;
Expand All @@ -570,6 +581,7 @@ export type Database = {
color?: string | null;
created_at?: string | null;
description?: string | null;
embedding?: string | null;
id?: string;
name?: string;
slug?: string;
Expand Down Expand Up @@ -884,7 +896,9 @@ export type Database = {
enabled: boolean | null;
id: string | null;
last_accessed: string | null;
manual: boolean | null;
name: string | null;
original_name: string | null;
team_id: string | null;
};
Insert: {
Expand All @@ -898,7 +912,9 @@ export type Database = {
enabled?: boolean | null;
id?: string | null;
last_accessed?: string | null;
manual?: boolean | null;
name?: string | null;
original_name?: string | null;
team_id?: string | null;
};
Update: {
Expand All @@ -912,7 +928,9 @@ export type Database = {
enabled?: boolean | null;
id?: string | null;
last_accessed?: string | null;
manual?: boolean | null;
name?: string | null;
original_name?: string | null;
team_id?: string | null;
};
Relationships: [
Expand Down Expand Up @@ -957,6 +975,7 @@ export type Database = {
institution_id: string | null;
logo_url: string | null;
name: string | null;
original_name: string | null;
provider: Database["public"]["Enums"]["bank_providers"] | null;
team_id: string | null;
};
Expand All @@ -970,6 +989,7 @@ export type Database = {
institution_id?: string | null;
logo_url?: string | null;
name?: string | null;
original_name?: string | null;
provider?: Database["public"]["Enums"]["bank_providers"] | null;
team_id?: string | null;
};
Expand All @@ -983,6 +1003,7 @@ export type Database = {
institution_id?: string | null;
logo_url?: string | null;
name?: string | null;
original_name?: string | null;
provider?: Database["public"]["Enums"]["bank_providers"] | null;
team_id?: string | null;
};
Expand Down Expand Up @@ -1288,6 +1309,22 @@ export type Database = {
percentage: number;
}[];
};
get_spending_v2: {
Args: {
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;
}[];
};
get_total_balance: {
Args: {
team_id: string;
Expand Down Expand Up @@ -1518,6 +1555,7 @@ export type Database = {
institution_id: string;
logo_url: string | null;
name: string;
original_name: string | null;
provider: Database["public"]["Enums"]["bank_providers"] | null;
team_id: string;
};
Expand Down

0 comments on commit 238349a

Please sign in to comment.