mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-11 03:31:47 +00:00
fix(lint): corrigir formatação do snapshot de migration e imports
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@/shared/components/ui/tooltip";
|
||||
import { getCurrentPeriod, formatPeriodForUrl } from "@/shared/utils/period";
|
||||
import { formatPeriodForUrl, getCurrentPeriod } from "@/shared/utils/period";
|
||||
import { cn } from "@/shared/utils/ui";
|
||||
|
||||
type BillListItemProps = {
|
||||
|
||||
@@ -114,12 +114,14 @@ export async function fetchDashboardPeriodOverview(
|
||||
.select({
|
||||
period: transactions.period,
|
||||
transactionType: transactions.transactionType,
|
||||
totalAmount: sql<number>`coalesce(sum(case when ${transactions.note} ilike ${refundPattern} then 0 else ${transactions.amount} end), 0)`.as(
|
||||
"total",
|
||||
),
|
||||
refundAmount: sql<number>`coalesce(sum(case when ${transactions.note} ilike ${refundPattern} then ${transactions.amount} else 0 end), 0)`.as(
|
||||
"refund",
|
||||
),
|
||||
totalAmount:
|
||||
sql<number>`coalesce(sum(case when ${transactions.note} ilike ${refundPattern} then 0 else ${transactions.amount} end), 0)`.as(
|
||||
"total",
|
||||
),
|
||||
refundAmount:
|
||||
sql<number>`coalesce(sum(case when ${transactions.note} ilike ${refundPattern} then ${transactions.amount} else 0 end), 0)`.as(
|
||||
"refund",
|
||||
),
|
||||
accountExcludeFromBalance: financialAccounts.excludeFromBalance,
|
||||
})
|
||||
.from(transactions)
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
import { and, eq } from "drizzle-orm";
|
||||
import { z } from "zod";
|
||||
import { cards, categories, transactions } from "@/db/schema";
|
||||
import {
|
||||
buildRefundNote,
|
||||
isRefundNote,
|
||||
} from "@/shared/lib/accounts/constants";
|
||||
import { buildRefundNote, isRefundNote } from "@/shared/lib/accounts/constants";
|
||||
import { getUser } from "@/shared/lib/auth/server";
|
||||
import { db } from "@/shared/lib/db";
|
||||
import { PERIOD_FORMAT_REGEX } from "@/shared/lib/invoices";
|
||||
|
||||
@@ -45,7 +45,8 @@ export const requiredDecimalSchema = (fieldName: string = "valor") =>
|
||||
.transform((value) => value.replace(",", ".")),
|
||||
])
|
||||
.transform((value, ctx) => {
|
||||
const parsed = typeof value === "number" ? value : Number.parseFloat(value);
|
||||
const parsed =
|
||||
typeof value === "number" ? value : Number.parseFloat(value);
|
||||
if (Number.isNaN(parsed)) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
|
||||
Reference in New Issue
Block a user