- Change attendance idx_attendance_user_date from unique to index (allow multiple shifts per day) - Reset migrations to single baseline init migration - Add seed script with admin user (admin/admin) - Update CLAUDE.md with migration workflow documentation - Various frontend fixes (queries, pages, hooks) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
29 lines
697 B
TypeScript
29 lines
697 B
TypeScript
import { queryOptions } from "@tanstack/react-query";
|
|
import { jsonQuery } from "../apiAdapter";
|
|
|
|
export interface BankAccount {
|
|
id: number;
|
|
account_name: string;
|
|
bank_name: string;
|
|
account_number: string;
|
|
iban: string;
|
|
bic: string;
|
|
currency: string;
|
|
is_default: boolean;
|
|
}
|
|
|
|
export const bankAccountsOptions = () =>
|
|
queryOptions({
|
|
queryKey: ["bank-accounts"],
|
|
queryFn: () => jsonQuery<BankAccount[]>("/api/admin/bank-accounts"),
|
|
staleTime: 2 * 60_000,
|
|
});
|
|
|
|
export const supplierListOptions = () =>
|
|
queryOptions({
|
|
queryKey: ["suppliers"],
|
|
queryFn: () =>
|
|
jsonQuery<string[]>("/api/admin/received-invoices/suppliers"),
|
|
staleTime: 2 * 60_000,
|
|
});
|