Commit graph

7 commits

Author SHA1 Message Date
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