This commit is contained in:
2025-04-04 12:33:03 +02:00
commit 0cec39717e
73 changed files with 6825 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export function debounce<T extends (...args: any[]) => void>(
func: T,
delay: number
): (...args: Parameters<T>) => void {
let timeoutId: ReturnType<typeof setTimeout>;
return (...args: Parameters<T>) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => func(...args), delay);
};
}
+17
View File
@@ -0,0 +1,17 @@
import { z } from "zod";
export const expenseSchema = z.object({
amount: z.number().min(0.01),
description: z.string().optional(),
friendId: z.string().optional(),
groupId: z.string().optional(),
});
export const expenseSplitSchema = z.object({
expenseId: z.string(),
groupId: z.string().optional(),
paidById: z.string().min(1),
owedById: z.string().min(1),
amount: z.number().min(1),
status: z.string(),
});
+10
View File
@@ -0,0 +1,10 @@
import { z } from "zod";
export const groupSchema = z.object({
name: z.string().optional(),
});
export const groupMemberSchema = z.object({
groupId: z.string().optional(),
userId: z.string().optional(),
});
+8
View File
@@ -0,0 +1,8 @@
import { z } from "zod";
export const settlementSchema = z.object({
playerId: z.string().optional(),
receiverId: z.string().optional(),
amount: z.number().min(1),
description: z.string().min(1),
});