Summary cards now include the in-progress session's hours and earnings,
rounded up to the nearest 15-min increment (matching clock-out billing
logic). A secondary "+Xh est." line appears below each stat when a timer
is active, updating every second as the elapsed counter ticks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add time_entries_update, time_entries_delete, time_entries_get_summary tools
- Fix textResult to use `data ?? null` so JSON.stringify always returns a
string — procedures returning undefined (e.g. getRunning with no timer,
businesses.getById not found) were dropping the text field from the MCP
content item, causing client SDK validation failures
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
next build with output:standalone does not automatically copy
.next/static or public into .next/standalone/. The standalone
server.js looks for them at __dirname/.next/static and
__dirname/public, so they must be copied there post-build.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Turbopack disallows ssr:false in Server Components. Extracted the three
recharts dynamic imports into charts-client.tsx ("use client"), which
page.tsx now imports from directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dynamically import recharts components with ssr:false to prevent
server-side rendering of DOM-dependent charts, eliminating the
width/height -1 warnings and redacted SSR errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The baseline/bogus-entry logic was a one-time workaround for a db:push
→ migration transition that is long past. It required a per-migration
isMigrationApplied case — missing cases caused today's invoiceId bug.
Now both db:migrate (dev) and Docker startup use the same standard
migrate() call. Drizzle's own tracking table handles idempotency.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Baseline logic was falling through to false for all migrations after
0008, causing incorrect behaviour on fresh deploys. Now correctly
detects api_keys table, time_entry table, invoiceId column, and
verification token value column type.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a banner below the page header when a timer is running: shows
description, client, elapsed time (live), a Stop button that auto-links
to the latest invoice, and a Details link to the time clock page.
Query is prefetched server-side so the widget is instant on load.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Clock out and manual entry creation now auto-add a line item to the
client's latest draft/sent invoice and return invoice info
- Time clock page shows invoice badge on each entry with a link
- Toast after clock-out/create includes "View Invoice" action when linked
- MCP time_clock_in now accepts optional startedAt for backdating
- MCP time_clock_out description updated to document invoice linking
- Migration 0012: widen beenvoice_verification_token.value to text to
fix varchar(255) overflow during Authentik PKCE OAuth flow
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New beenvoice_time_entry DB table with migration (startedAt/endedAt, hours, rate, clientId)
- tRPC router with clockIn, clockOut, getRunning, getAll, getSummary, create, update, delete
- Dashboard page at /dashboard/time-clock with live elapsed timer, entry list, and manual entry form
- 5 MCP tools: time_clock_in, time_clock_out, time_get_running, time_entries_list, time_entries_create
- Sidebar navigation entry
Timer state is stored in PostgreSQL (endedAt IS NULL = running), suitable for serverless/Coolify deployment.
drizzle-kit migrate exits 0 even when migrations fail, so the server
would start on a broken schema. The custom migrate.ts uses drizzle-orm's
programmatic migrator and calls process.exit(1) on failure, which
prevents the server from starting and makes failures visible in Coolify.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Migration now runs at container start (when DB is available) rather than
during the build stage (when no DB is reachable). The release image now
includes node_modules, drizzle.config.ts, and the drizzle/ folder so
drizzle-kit can apply pending migrations on each deploy.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NEXT_PUBLIC_ vars are baked in at build time, so NEXT_PUBLIC_APP_URL=localhost
was being embedded in the bundle. Removing baseURL lets better-auth use
window.location.origin automatically, which works correctly on any domain.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PostgreSQL does not support IF NOT EXISTS for ADD CONSTRAINT. Use PL/pgSQL
DO blocks to guard constraint creation idempotently instead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds invoice_payment, recurring_invoice, recurring_invoice_item tables and
publicToken/lastReminderSentAt/invoicePrefix columns to invoice. Uses
IF NOT EXISTS guards since invoicePrefix may have been applied via db:push.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Recurring invoices: schedule-based auto-generation with CRUD UI at /dashboard/invoices/recurring and POST /api/cron/generate-recurring cron endpoint
- Public invoice link: generate/revoke shareable /i/[token] page for unauthenticated clients with PDF download
- Live time tracker: localStorage-persisted timer widget in invoice editor that appends a line item on stop (rounds to nearest 0.25h)
- Partial payment tracking: record payments per invoice, auto-mark paid when fully covered, balance due display
- Send reminder: email reminder via Resend with custom message dialog and last-sent indicator
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CardContent defaults to px-5 pb-4. Tailwind's CSS cascade means pb-4
always wins over the py-0 override, leaving 16px of phantom bottom
padding on all thin toolbar cards. Replaced CardContent with plain divs
carrying the intended py-2 px-3 directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Description field now shows a fuzzy-matched dropdown of past line items
(description, hours, rate) as you type via Fuse.js — zero server cost
- Selecting a suggestion pre-fills description, hours, and rate in one click
- NL quick-add bar lets you type e.g. "3hrs web design @120" + Enter to
append a fully-parsed line item without clicking through fields
- New tRPC query `getLineItemHistory` returns deduplicated past line items
for the current user, ordered by recency
- New `parseLineItem` utility handles hours/rate extraction via regex
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove two-column hero layout. Page is now a compact centered card:
logo, "Welcome back" heading, email/password form, and footer links.
Eliminates the left panel background mismatch issue.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Auto-derive trusted origin from AUTHENTIK_ISSUER URL so OAuth callbacks
are accepted without requiring a separate AUTHENTIK_ORIGIN env var
- Remove leftover ssoProvider schema mapping (no longer used with genericOAuth)
- Remove dead @better-auth/sso dependency from package.json
- Drop md:shadow-2xl/md:shadow-lg from auth cards — the downward box-shadow
was rendering as a U-shaped border (bottom+sides, no top); border +
backdrop-blur-xl provides sufficient visual separation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Implemented `AdministrationContent` component for managing account roles.
- Created `AdministrationPage` to serve as the main entry point for administration tasks.
- Added PDF preview functionality with `PdfPreviewFrame` component for invoice generation.
- Introduced `InputColor` component for advanced color selection with various formats.
- Established color conversion utilities in `color-converter.ts` for handling color formats.
- Defined appearance-related schemas and types in `appearance.ts` for consistent theme management.
- Cleaned up imports and formatted code for better readability in invoices-data-table.tsx.
- Enhanced invoice interface definitions for clarity.
- Improved toast messages for bulk delete and update actions.
- Refactored date formatting and status type retrieval for better readability.
- Simplified template management in templates page, extracting TemplateList component.
- Added registration toggle based on environment variable DISABLE_SIGNUPS.
- Updated navbar to conditionally render registration link based on allowRegistration prop.
- Enhanced error handling and validation in expenses and settings routers.
- Improved PDF export footer handling.
- Updated TRPC react integration for cleaner type imports.
- Deleted the InvoiceView component to streamline the codebase.
- Updated EmailPreview and SendEmailDialog components to include currency and notes fields.
- Enhanced invoice-form to handle default hourly rates and improved item mapping.
- Refactored email template generation to include notes and currency formatting.
- Adjusted API routers for invoices to calculate totals and handle notes and currency correctly.
- Deleted the start.sh script for container management.
- Added AGENTS.md for project guidelines and development principles.
- Introduced new SQL migration files for user appearance preferences and platform settings.
- Implemented appearance provider to manage user interface themes and preferences.
- Created branding utility to define and manage branding-related constants and types.
Co-authored-by: Copilot <copilot@github.com>
- Add taxDeductible boolean to expenses schema + migration 0002
- Update expenses router, form, and list to support tax-deductible flag
- Fix invoice-view tax calculation (was hardcoded $0.00; now uses taxRate)
- New Tax Summary tab in Reports: year selector, income/deductions breakdown,
SE tax + federal income estimates, quarterly bar chart
- CSV export for accountant with income + expense rows and tax summary
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
The previous baseline blindly recorded all migrations as applied.
Now on startup the script validates every recorded migration against
the actual schema; any entry whose schema changes don't exist is
deleted so migrate() will re-run that migration.
This unblocks the existing deployment where 0001 was recorded as done
but beenvoice_client.currency was never actually added.
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
Previously the baseline marked ALL migrations as done, causing 0001 to
be skipped even on databases that didn't have the currency column yet.
Now each migration is checked against a sentinel column/table before
being seeded into the tracking table. Migrations whose changes don't
exist yet are left out so migrate() runs them normally.
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
When switching from db:push to db:migrate on an existing database,
the migration table is empty so Drizzle tries to re-run all migrations,
failing with "relation already exists".
Detect this case (tables exist but no migration history) and seed the
__drizzle_migrations tracking table with all current migrations so
Drizzle treats them as already applied. Future migrations run normally.
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi
- Remove drizzle/*.sql and drizzle/*-journal from .dockerignore so
migration files are included in the Docker build context
- Restore next/font/google imports (removed prematurely due to local
IP being 403'd by Google Fonts; production builds should work fine)
- Update CSS font fallbacks to use proper system font stacks
https://claude.ai/code/session_012sqEgNQpx676isepeoX4Mi