Add cmdk-based combobox to portal header for inline company switching
with search by name or Epicor ID. Also update select-company page to
use the same pattern. Fix admin company switching by allowing admins
to switch to any active company without requiring a quest_user_company
link.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Inventory summary table now shows Plant, Cust Part#, Vorteq Part#,
Vorteq Desc, Warehouse, Qty LB, Rows with a blue View button for
drill-down. Admins see all active companies in the company selector.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Inventory service now maps PascalCase SP columns (VorteqPartNum,
OnHandQty, etc.) to snake_case types. Fixed non-V6 SP parameter
from Customer to CUSTID. Orders service now uses the portal_Orders
view instead of raw table queries with nonexistent columns.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update inventory service to use actual PascalCase SP names
(e.g. PortalWorkInProgressInventorySummaryV6) and correct parameter
names (Customer, SUBUSER) matching the Epicor database.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add DEV_MODE env var check to return mock admin session when auth is
unavailable, hostname-based middleware bypass for dev domain, and
window.location.href for login redirect to ensure cookies are sent.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
next build bakes NODE_ENV=production into the bundle, so a custom
DEV_MODE env var is used instead. Middleware bypasses auth by hostname
for the dev domain, and getQuestSession returns a mock admin session
when DEV_MODE=true. Login page now uses window.location.href for
full-page navigation to ensure the session cookie is sent.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change session cookie name from better-auth.session_token to session_token
- Increase rate limit to 100 req/min in development (10 in production)
- Fix DATABASE_URL to use URL-encoded password for special characters
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace client-side useSession hook with server-side prop passing.
Portal layout fetches user email server-side and passes to header.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add custom login API route with bcrypt password verification
- Update auth client to use custom endpoints
- Simplify login page to use new auth client
- Remove Better Auth dependencies that were causing issues
- Add orders service with getTop100Orders and getOrderDetails
- Add special HDC/HDM customer exception handling
- Add OrdersTable component with search, filter, CSV export
- Add orders list page at /orders
- Create public folder for Next.js static assets
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add inventory detail service functions for all 6 categories
- Update stored procedure names to match Epicor database
- Add InventoryDetailTable component with search and CSV export
- Add dynamic detail page at /inventory/[category]/detail
- Update summary table links to point to detail pages
- Fix InventoryDetailRow type to support flexible field names
- Add Dockerfile prisma generate step before build
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements complete dashboard with metrics, recent activity, and quick navigation.
Begins inventory system with service layer and category selector.
Dashboard (C-001) - Complete:
- Server component with parallel data fetching
- Summary cards: WIP, Finished Goods, Total Weight, Recent Orders
- Recent activity tables: top 5 orders and shipments
- Alert banner for important notifications
- Quick navigation cards to all major features
- Loading skeletons with Suspense boundaries
- Reusable components: SummaryCard, QuickNavCard, tables
- Dashboard service with typed Epicor queries
Inventory (C-002) - Core Complete:
- Complete service layer for all 6 inventory categories
- Category selector page with permission-based visibility
- Reusable inventory summary table with search and CSV export
- WIP inventory page as template for other categories
- Sub-user permission enforcement at service layer
- Type-safe stored procedure calls with proper error handling
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements authentication middleware with rate limiting, comprehensive permission
system, full portal navigation with sidebar and header, company selection flow,
and data migration tooling from SQL Server to PostgreSQL.
Key additions:
- Middleware: auth guards, rate limiting, session management
- Permissions: role-based access control with hierarchical permission rules
- Navigation: responsive sidebar with expandable sections, header with notifications
- Company selector: multi-company user support with session-based active company
- Data migration: comprehensive script for migrating auth and quest domain tables
- Schema: added auth_user_type_permission_group junction table
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Initialize Next.js 15 with App Router and TypeScript strict mode
- Configure Tailwind CSS with shadcn/ui theme system
- Install shadcn/ui components (button, card, input, table, etc.)
- Set up ESLint and Prettier with automatic formatting
- Configure path aliases (@/*) in tsconfig.json
- Create full project structure per CLAUDE.md
- Add health check endpoint at /api/health
- Configure next.config.ts with output: 'standalone' for Docker
- Set up Prisma with placeholder schema
- Configure Vitest (unit) and Playwright (E2E) testing
- Add VS Code settings for consistent development experience
Build verification: TypeScript compilation, ESLint, and production build all pass.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>