Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ model Transaction {
description String?
notes String?
date DateTime
scheduledDate DateTime?
isRecurring Boolean @default(false)
recurringRuleId String? @map("recurring_rule_id")
receipt_url String?
Expand All @@ -315,6 +316,7 @@ model Transaction {
recurringRule RecurringRule? @relation(fields: [recurringRuleId], references: [id], onDelete: SetNull)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)

@@unique([recurringRuleId, scheduledDate])
@@index([userId])
@@index([accountId])
@@index([categoryId])
Expand All @@ -340,7 +342,11 @@ model RecurringRule {
frequency RecurringFrequency
interval Int @default(1)
dayOfMonth Int?
semiMonthlyDay Int?
dayOfWeek Int?
weekOfMonth Int?
lastDayOfMonth Boolean @default(false)
overrides Json?
nextRunAt DateTime
lastRunAt DateTime?
status RecurringStatus @default(ACTIVE)
Expand Down Expand Up @@ -642,6 +648,7 @@ enum TransactionType {
enum RecurringFrequency {
DAILY
WEEKLY
SEMI_MONTHLY
MONTHLY
YEARLY
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(public)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Page() {
publishedDate: recent.date ?? "",
content: recent.excerpt ? [recent.excerpt] : [],
coverImage: recent.image,
} as BlogPost;
};
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/(public)/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function BlogPage() {
imageAlt: p.imageAlt,
title: p.title,
excerpt: postExcerpts[p.title] ?? "",
href: p.href as string | undefined,
href: p.href,
date: postDates[i] ?? "",
category: postCategories[i] ?? "Product",
})),
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/accounts/account-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function AccountForm({
typeof values.balance === "number"
? String(values.balance)
: values.balance,
} as UpdateAccountInput;
};
await updateAccount(payload);
toast.success("Account updated");
if (onSubmit) onSubmit(payload);
Expand Down
17 changes: 8 additions & 9 deletions src/components/forms/categories/subcategory-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@ export function SubcategoryForm({
type FormValues = CreateSubcategoryInput;

const normalize = React.useCallback(
(vals?: SubcategoryFormProps["initialValues"]) =>
({
name: vals?.name ?? "",
parentId: vals?.parentId ?? undefined,
icon: vals?.icon ?? undefined,
color: vals?.color ?? undefined,
sortOrder: vals?.sortOrder ?? undefined,
}) as Partial<FormValues>,
(vals?: SubcategoryFormProps["initialValues"]) => ({
name: vals?.name ?? "",
parentId: vals?.parentId ?? undefined,
icon: vals?.icon ?? undefined,
color: vals?.color ?? undefined,
sortOrder: vals?.sortOrder ?? undefined,
}),
[],
);

Expand All @@ -111,7 +110,7 @@ export function SubcategoryForm({
const payload: UpdateSubcategoryInput = {
id: initialValues.id,
...values,
} as UpdateSubcategoryInput;
};
await updateSubcategory.mutateAsync(payload);
toast.success("Subcategory updated successfully");
if (onSubmit) onSubmit(payload);
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/transaction/steps/category-step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const CategoryStep = React.memo(function CategoryStep({
<FormControl>
<Select
onValueChange={field.onChange}
value={(field.value as string | undefined) ?? undefined}
value={field.value ?? undefined}
>
<SelectTrigger className="bg-card h-11 w-full border px-4 font-medium shadow-sm transition-shadow hover:shadow">
<SelectValue placeholder="Select method" />
Expand Down
Loading
Loading