Commit graph

14 commits

Author SHA1 Message Date
e60e07c9a5 feat: add shipment request (C-013) and allocation request (C-014) cart workflows
Some checks failed
Build and Deploy / build (push) Successful in 4m39s
Build and Deploy / deploy (push) Failing after 1s
Multi-step cart workflows for both shipment and allocation requests:
- Ship-to address selection from Epicor portal_CustomerShipToAddresses
- Inventory browser dialog (shipment) / coil browser dialog (allocation)
- Cart persistence in DB with duplicate detection
- Details form (order#, PO#, pickup date, instructions, email recipients)
- Review & submit with confirmation dialog
- Cancel with permission gate and confirmation
- Shared components: stepper, ship-to selector, cart table, header form, review
- 16 API routes, 4 services, 13 components, 6 pages
- Phase 2 complete: 16/16 tasks done

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:37:38 -05:00
b32553668d feat: add invoice viewing (C-015) and notifications display (C-016)
Some checks failed
Build and Deploy / build (push) Successful in 5m4s
Build and Deploy / deploy (push) Failing after 3s
- Invoice page with table, search, sort, CSV export, PDF download
- Company-level access control (can_access_invoices + view_invoices permission)
- Notifications page with unread alerts section and mark-as-read
- Fix unread notification count in layout (was counting read markers)
- Fix dashboard notification count to use per-user unread alerts
- Configurable INVOICE_STORAGE_PATH for invoice PDF file serving

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:04:01 -05:00
1198aaa373 feat: add coil-by-coil report, job status by plant, job traveler + PDFs
Some checks failed
Build and Deploy / build (push) Successful in 3m43s
Build and Deploy / deploy (push) Failing after 2s
Implements C-010 (Coil-by-Coil), C-011 (Job Status by Plant), and
C-012 (Job Traveler + PDF) completing 12/16 Phase 2 core features.

C-010: Job number search → detailed coil-level breakdown showing
materials used and produced with independent search/sort/CSV export.
Embeds full 782-line CoilByCoil.sql query in service layer.

C-011: Auto-loading job status view grouped by plant using
OpenOrdersQueryV3 stored procedure. Includes web table with
search/sort/CSV export and landscape PDF download.

C-012: Multi-section job traveler with header info, shipping schedule,
raw materials, operations, and Part_UD paint specifications. Includes
job number search page, detail page, and PDF export with Vorteq
branding. Deduplicates flat SQL results into structured data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:42:39 -05:00
53c35cc273 feat: add order ack detail/PDF, BOL detail/PDF, coil activity usage & receipts
Some checks failed
Build and Deploy / build (push) Successful in 10m53s
Build and Deploy / deploy (push) Failing after 2s
C-005: Order Acknowledgement Detail + PDF
- Order detail page with full line items, releases, addresses, paint codes
- PDF export via Puppeteer matching legacy format
- Clickable order # links and PDF icons in orders table

C-007: BOL Detail + PDF
- BOL detail page with ship-from/to, line items, weights
- PDF export matching legacy BOL format
- PDF icon column in shipments table

C-008: Coil Activity - Usage Report
- Date range picker (max 31 days, default last 10 days)
- Reusable UI: Popover, Calendar (react-day-picker v9), DateRangePicker
- SQL from legacy portal_CoilActivityUsage.sql with OnHandQty dedup
- 11-column sortable table with search and CSV export

C-009: Coil Activity - Receipts Report
- VGL customer exception (special SQL vs portal view)
- 10-column sortable table with search and CSV export
- Shared date range picker component

Also: dashboard API route, shipments API route, HDC→HDM mapping,
Puppeteer PDF infrastructure, improved error handling.

Progress: 9/16 Phase 2 tasks complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 09:14:52 -05:00
239f0e1227 docs: mark C-004 as complete in TASKS.md
Some checks failed
Build and Deploy / build (push) Successful in 3m34s
Build and Deploy / deploy (push) Failing after 3s
2026-02-16 12:38:05 +00:00
d924db88a3 docs: mark C-002 and C-003 as complete in TASKS.md 2026-02-16 12:35:35 +00:00
7774af03a5 feat(C-001,C-002): implement dashboard and begin inventory views
Some checks failed
Build and Deploy / build (push) Failing after 10m59s
Build and Deploy / deploy (push) Has been skipped
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>
2026-02-16 11:41:56 +00:00
a67558de23 feat(F-008,F-009,F-010): complete Phase 1 foundation with middleware, navigation, and migrations
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>
2026-02-16 11:07:44 +00:00
bbcee034cb feat(F-007): implement Better Auth with login and account request
Some checks failed
Build and Deploy / build (push) Failing after 3m6s
Build and Deploy / deploy (push) Has been skipped
Better Auth Configuration:
- Database adapter for PostgreSQL with custom schema mapping
- Email/password authentication enabled
- 7-day session expiration with 24-hour update frequency
- Custom field mappings for auth_user, auth_session, auth_account tables
- Server-side auth helpers: getSession(), requireAuth()
- Client-side React hooks: signIn, signOut, signUp, useSession

Authentication Pages:
- /login: Email/password login with error handling
- /forgot-password: Password reset request flow
- /account-request: New user registration form
  - Captures: name, email, phone, company, Epicor ID, message
  - Creates quest_account_request record for admin approval
  - Success confirmation with next steps

API Routes:
- /api/auth/[...all]: Better Auth handler for all auth operations
- /api/account-request: Account request submission endpoint

UI Components:
- Added Textarea component from shadcn/ui
- Form validation and loading states
- Toast notifications for user feedback
- Responsive card-based layouts

Session management and enhanced context (company, permissions) will be
added in F-008 middleware implementation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 02:25:52 +00:00
10028bcd47 feat(F-006): enhance Epicor MSSQL connection service
Some checks failed
Build and Deploy / build (push) Failing after 7m11s
Build and Deploy / deploy (push) Has been skipped
Enhanced Connection Management:
- Custom error classes: EpicorConnectionError, EpicorQueryError, EpicorTimeoutError
- Connection pool reuse with state tracking
- Configuration validation on startup
- Configurable timeouts (connect: 30s, request: 60s)

Query Execution:
- execStoredProc: execute stored procedures with typed parameters
- execQuery: execute raw SQL queries with parameterization
- execPortalStoredProc: helper for standard portal SP params (CustID, DBNAME, sub)
- Comprehensive error handling with timeout detection

Health & Utilities:
- checkConnection: validates connection with actual query test
- closeConnection: graceful pool shutdown
- getPortalDbName: helper for cross-database query parameters
- Graceful shutdown handlers (SIGINT, SIGTERM)

Type Definitions (src/types/epicor.ts):
- Inventory: summary, detail, with paint codes and dimensions
- Orders: list, acknowledgement with lines
- Shipments: list, BOL detail with lines
- Coil Activity: usage, receipts, coil-by-coil
- Jobs: status, traveler with operations and materials
- Customers: ship-to addresses
- Invoices: customer/job matching
- Shipping Reports: monthly and YTD

Ready for service layer implementation in Phase 2.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 02:18:00 +00:00
d8af580d93 feat(F-004,F-005): complete Quest and remaining domain schemas
Some checks failed
Build and Deploy / deploy (push) Blocked by required conditions
Build and Deploy / build (push) Has been cancelled
Quest Domain Complete (F-004):
- quest_account_request: new user registration requests
- quest_notification + alert reads: notification/alert system
- quest_email_event + subscriptions: email event management
- quest_email_log: email tracking
- quest_plant + inventory_type + inventory_plant: plant/inventory configuration
- quest_processed_order_acknowledgement_email: duplicate prevention

Remaining Domains Complete (F-005):

Shipment Requests:
- ship_request + ship_request_detail: shipment request cart workflow

Allocation Requests:
- alloc_request + alloc_request_detail + alloc_plant: coil allocation workflow

Invoice Management:
- inv_upload + inv_upload_entry + inv_upload_status: invoice upload/processing

Finance/AP:
- finance_ap_check_processing_batch + status: AP check processing

Paint Schedule:
- paint_plant + paint_line + paint_line_type + paint_plant_line + paint_schedule

Documentation:
- doc_category + doc_article + doc_article_permission_group: knowledge base

Wave/EDI:
- wave_process + wave_process_history: EDI processing

Task Scheduler:
- lts_task + lts_task_type + lts_task_schedule + lts_task_execution

Total: 60+ tables, 600+ columns across all domains. All migrations applied successfully.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 02:16:28 +00:00
e643af1fe6 feat(F-003): implement auth domain Prisma schema and migration
Some checks failed
Build and Deploy / build (push) Failing after 5m18s
Build and Deploy / deploy (push) Has been skipped
Auth Domain (Complete):
- auth_user: Better Auth compatible with password, 2FA, SSO support
- auth_session: session management with IP and user agent tracking
- auth_account: OAuth provider accounts
- auth_oauth_client + tokens: OAuth client configuration and token management
- auth_user_type: role definitions (admin, customer, internal)
- auth_domain: multi-tenant domain grouping
- auth_password_history + reset: password security and recovery
- auth_permission_group + rule + category: RBAC system with granular permissions
- auth_security_question + answer: account recovery mechanism

Quest Domain (Partial - Core User/Company):
- quest_user: portal-specific user data (sub-user flag, API tokens)
- quest_company: customer/company info (Epicor integration, invoicing flags)
- quest_user_company: many-to-many with active company tracking

Migration applied successfully to PostgreSQL 16 database.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-16 02:08:09 +00:00
7cd434aa82 feat(F-001): scaffold Next.js 15 project with TypeScript and Tailwind
Some checks failed
Build and Deploy / build (push) Failing after 18m25s
Build and Deploy / deploy (push) Has been skipped
- 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>
2026-02-16 00:04:44 +00:00
fbe79c0773 Update CLAUDE.md and TASKS.md to match infrastructure
Some checks failed
Build and Deploy / build (push) Failing after 9s
Build and Deploy / deploy (push) Has been skipped
2026-02-15 23:25:24 +00:00