Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
568e856
feat: add sales capture workflows and import safeguards
dkast Jun 21, 2026
7a65355
feat: enhance QuickSaleScreen with improved cart handling and UI updates
dkast Jun 21, 2026
3afdbbc
feat: update navigation titles and enhance QuickSaleScreen with impro…
dkast Jun 21, 2026
b771770
feat: add new number input component and integrate into quick sale sc…
dkast Jun 21, 2026
d4daa68
feat: update styles and refactor number input component for improved …
dkast Jun 22, 2026
7f7d6fe
feat(charts): implement chart interaction hooks and utilities
dkast Jun 22, 2026
c889f7d
refactor: skeleton and better mobile layout
dkast Jun 22, 2026
9c25020
feat: enhance sales closing functionality with date filtering and imp…
dkast Jun 23, 2026
85f89b0
feat: add pie chart component with interactive slices and context man…
dkast Jun 26, 2026
c6a631b
feat: enhance sales best sellers pie chart with ranking logic and UI …
dkast Jun 26, 2026
5332806
style: update sales dashboard layout and improve UI elements for bett…
dkast Jun 27, 2026
6b701ba
refactor: simplify SalesClosingDateFilter component by removing inlin…
dkast Jun 27, 2026
e8f2055
feat: enhance sales closing report with detailed hourly sales data an…
dkast Jul 3, 2026
2a51be7
style: update sales components with improved styling and chart config…
dkast Jul 4, 2026
0507537
style: update import options UI with improved icon sizes and button s…
dkast Jul 4, 2026
d156c3f
feat: add SalesProBanner component and integrate it into sales pages;…
dkast Jul 5, 2026
1f3ed0b
style: update BasicPlanView and ProPlanView components for improved s…
dkast Jul 8, 2026
9acb631
feat: add lifecycle fields to Subscription model and update billing l…
dkast Jul 9, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ yarn-error.log*

# prisma generated client
generated

# playwright
.playwright-mcp
269 changes: 264 additions & 5 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
"hooks": "@/hooks"
},
"registries": {
"@bklit": "https://ui.bklit.com/r/{name}.json",
"@magicui": "https://magicui.design/r/{name}.json",
"@kibo-ui": "https://www.kibo-ui.com/r/{name}.json",
"@diceui": "https://diceui.com/r/{name}.json",
"@ncdai": "https://chanhdai.com/r/{name}.json"
"@ncdai": "https://chanhdai.com/r/{name}.json",
"@shark": "https://shark.vini.one/r/{name}.json"
}
}
15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"stripe:listen": "stripe listen --forward-to localhost:3000/api/auth/stripe/webhook"
},
"dependencies": {
"@ark-ui/react": "^5.37.2",
"@aws-sdk/client-s3": "^3.1071.0",
"@aws-sdk/s3-request-presigner": "^3.1071.0",
"@better-auth/stripe": "1.6.9",
Expand All @@ -34,6 +35,7 @@
"@hookform/resolvers": "^5.4.0",
"@internationalized/date": "^3.12.2",
"@next/bundle-analyzer": "16.2.9",
"@number-flow/react": "^0.6.0",
"@prisma/adapter-libsql": "7.8.0",
"@prisma/client": "7.8.0",
"@radix-ui/react-aspect-ratio": "^1.1.10",
Expand Down Expand Up @@ -71,6 +73,14 @@
"@uppy/progress-bar": "^4.3.2",
"@uppy/react": "^4.5.2",
"@vercel/toolbar": "^0.2.6",
"@visx/event": "4.0.1-alpha.0",
"@visx/gradient": "4.0.1-alpha.0",
"@visx/grid": "4.0.1-alpha.0",
"@visx/group": "4.0.1-alpha.0",
"@visx/pattern": "4.0.1-alpha.0",
"@visx/responsive": "4.0.1-alpha.0",
"@visx/scale": "4.0.1-alpha.0",
"@visx/shape": "4.0.1-alpha.0",
"ai": "^6.0.208",
"better-auth": "1.6.9",
"bloom-menu": "^0.1.0",
Expand All @@ -79,6 +89,8 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"d3-array": "^3.2.4",
"d3-shape": "^3.2.0",
"date-fns": "^4.4.0",
"embla-carousel-autoplay": "^8.6.0",
"embla-carousel-react": "^8.6.0",
Expand All @@ -93,7 +105,7 @@
"lodash.isequal": "^4.5.0",
"lodash.isobject": "^3.0.2",
"lodash.transform": "^4.6.0",
"lucide-react": "^1.20.0",
"lucide-react": "^1.21.0",
"lzutf8": "^0.6.3",
"motion": "^12.40.0",
"nanoid": "^5.1.11",
Expand Down Expand Up @@ -129,6 +141,7 @@
"stripe": "^22.1.0",
"styled-components": "^6.4.2",
"tailwind-merge": "^3.6.0",
"tailwind-variants": "^3.2.2",
"tailwindcss-animate": "^1.0.7",
"torph": "^0.0.9",
"vaul": "^1.1.2",
Expand Down
48 changes: 48 additions & 0 deletions prisma/migrations/20260620000000_add_sales_capture/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-- CreateTable
CREATE TABLE "Sale" (
"id" TEXT NOT NULL PRIMARY KEY,
"orderType" TEXT NOT NULL DEFAULT 'DINE_IN',
"currency" TEXT NOT NULL DEFAULT 'MXN',
"subtotal" REAL NOT NULL,
"total" REAL NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"organizationId" TEXT NOT NULL,
CONSTRAINT "Sale_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);

-- CreateTable
CREATE TABLE "SaleItem" (
"id" TEXT NOT NULL PRIMARY KEY,
"saleId" TEXT NOT NULL,
"menuItemId" TEXT,
"variantId" TEXT,
"productName" TEXT NOT NULL,
"variantName" TEXT,
"unitPrice" REAL NOT NULL,
"quantity" INTEGER NOT NULL,
"lineTotal" REAL NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
CONSTRAINT "SaleItem_saleId_fkey" FOREIGN KEY ("saleId") REFERENCES "Sale" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "SaleItem_menuItemId_fkey" FOREIGN KEY ("menuItemId") REFERENCES "MenuItem" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT "SaleItem_variantId_fkey" FOREIGN KEY ("variantId") REFERENCES "Variant" ("id") ON DELETE SET NULL ON UPDATE CASCADE
);

-- CreateIndex
CREATE INDEX "Sale_organizationId_createdAt_idx" ON "Sale"("organizationId", "createdAt");

-- CreateIndex
CREATE INDEX "Sale_organizationId_orderType_createdAt_idx" ON "Sale"("organizationId", "orderType", "createdAt");

-- CreateIndex
CREATE INDEX "SaleItem_saleId_idx" ON "SaleItem"("saleId");

-- CreateIndex
CREATE INDEX "SaleItem_menuItemId_idx" ON "SaleItem"("menuItemId");

-- CreateIndex
CREATE INDEX "SaleItem_variantId_idx" ON "SaleItem"("variantId");

-- CreateIndex
CREATE INDEX "SaleItem_productName_idx" ON "SaleItem"("productName");
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- AlterTable
ALTER TABLE "Subscription" ADD COLUMN "billingInterval" TEXT;
ALTER TABLE "Subscription" ADD COLUMN "cancelAt" DATETIME;
ALTER TABLE "Subscription" ADD COLUMN "canceledAt" DATETIME;
ALTER TABLE "Subscription" ADD COLUMN "endedAt" DATETIME;
ALTER TABLE "Subscription" ADD COLUMN "stripeScheduleId" TEXT;

-- CreateIndex
CREATE INDEX "Verification_identifier_idx" ON "Verification"("identifier");
6 changes: 6 additions & 0 deletions prisma/models/auth.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ model Organization {
location Location[]
menus Menu[]
menuItems MenuItem[]
sales Sale[]
themes Theme[]
mediaAssets MediaAsset[]

Expand Down Expand Up @@ -139,5 +140,10 @@ model Subscription {
trialStart DateTime?
trialEnd DateTime?
cancelAtPeriodEnd Boolean? @default(false)
cancelAt DateTime?
canceledAt DateTime?
endedAt DateTime?
billingInterval String?
stripeScheduleId String?
seats Int?
}
46 changes: 46 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ enum Currency {
USD
}

enum OrderType {
DINE_IN
TAKEOUT
DELIVERY
}

enum MediaAssetType {
IMAGE
VIDEO
Expand Down Expand Up @@ -128,6 +134,7 @@ model MenuItem {
allergens String?
currency Currency @default(MXN)
translations MenuItemTranslation[]
saleItems SaleItem[]

@@unique([organizationId, name])
}
Expand All @@ -153,6 +160,7 @@ model Variant {
menuItemId String
menuItem MenuItem @relation(fields: [menuItemId], references: [id], onDelete: Cascade)
translations VariantTranslation[]
saleItems SaleItem[]
}

model MenuItemTranslation {
Expand Down Expand Up @@ -199,6 +207,44 @@ model CategoryTranslation {
@@index([locale])
}

model Sale {
id String @id @default(cuid())
orderType OrderType @default(DINE_IN)
currency Currency @default(MXN)
subtotal Float
total Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
organizationId String
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
items SaleItem[]

@@index([organizationId, createdAt])
@@index([organizationId, orderType, createdAt])
}

model SaleItem {
id String @id @default(cuid())
saleId String
sale Sale @relation(fields: [saleId], references: [id], onDelete: Cascade)
menuItemId String?
menuItem MenuItem? @relation(fields: [menuItemId], references: [id], onDelete: SetNull)
variantId String?
variant Variant? @relation(fields: [variantId], references: [id], onDelete: SetNull)
productName String
variantName String?
unitPrice Float
quantity Int
lineTotal Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@index([saleId])
@@index([menuItemId])
@@index([variantId])
@@index([productName])
}

// Media asset management models for tracking R2 storage

model MediaAsset {
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function DashboardError({
<div className="flex min-h-[60vh] items-center justify-center px-6">
<div className="flex max-w-lg flex-col items-center gap-4 text-center">
<h1 className="text-3xl font-semibold text-gray-900 dark:text-gray-100">
Ocurrió un error en el dashboard
Ocurrió un error en la aplicación
</h1>
<p className="text-sm text-gray-500">
Intenta nuevamente o vuelve al inicio. Si el problema persiste,
Expand Down
4 changes: 2 additions & 2 deletions src/app/dashboard/menu-items/[action]/[id]/variant-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type UseFormReturn
} from "react-hook-form"
import { Trash } from "lucide-react"
import { z } from "zod/v4"
import { type z } from "zod/v4"

import { Button } from "@/components/ui/button"
import { Field, FieldError, FieldLabel } from "@/components/ui/field"
Expand All @@ -22,7 +22,7 @@ import {
TableRow
} from "@/components/ui/table"
import VariantDelete from "@/app/dashboard/menu-items/[action]/[id]/variant-delete"
import { menuItemFormSchema } from "@/lib/types/menu-item"
import { type menuItemFormSchema } from "@/lib/types/menu-item"

type VariantFormValues = z.infer<typeof menuItemFormSchema>

Expand Down
Loading