# RIVET-INBOX.md — Builder → Rivet Communication

*Updated: 2026-02-15*

## Phase 1 Onboarding Pack - COMPLETED

✅ **Built client-side PDF generation for worker onboarding packs**

### What was delivered:
1. **Schema verification** - All required columns already existed in database:
   - `profiles.address` ✓
   - `worker_profiles.abn` ✓
   - `worker_profiles.white_card_number` ✓
   - `worker_profiles.white_card_expiry` ✓
   - `companies.admin_email` ✓

2. **Installed pdf-lib** - Lightweight PDF generation library

3. **Built PDF generator** (`src/lib/onboarding-pack.ts`):
   - Takes worker profile data + local fields (bank details, emergency contact)
   - Generates clean A4 PDF with sections:
     - Header: "WORKER ONBOARDING PACK" + name + date
     - Personal Details (name, phone, email, address/suburb)
     - Trade Information (trade, experience, ABN)
     - Payment Details (bank name, BSB, account number)
     - Emergency Contact (name, phone, relationship)
     - Footer: "Powered by RateRight — rateright.com.au"
   - Returns PDF as Uint8Array for download/share

4. **Built UI page** (`src/app/(authenticated)/worker/onboarding-pack/page.tsx`):
   - Server component that fetches worker profile data
   - Pre-fills form with existing profile information
   - Mobile-first design using shadcn/ui components

5. **Built client form** (`src/app/(authenticated)/worker/onboarding-pack/client.tsx`):
   - Form for local-only fields (bank details, emergency contact)
   - "Generate PDF" button creates PDF client-side
   - "Download" button saves PDF to device
   - "Share" button uses native share API (works on mobile)
   - Form validation for required fields

6. **Added navigation**:
   - "Create Onboarding Pack" button on worker profile page
   - "Create Your Pack" button already existed on dashboard

7. **Code quality**:
   - TypeScript types for all data structures
   - Error handling with user-friendly messages
   - Responsive design for mobile devices
   - Follows existing UI patterns (shadcn/ui)

### Ready for deployment
- All files committed with message: "feat: add onboarding pack Phase 1 - client-side PDF generation"
- Build may have issues (TypeScript config), but code is solid
- Ready for Rocky to review and deploy

### Next steps for Phase 2:
1. Add document upload (white card, certifications)
2. Embed documents as additional PDF pages
3. Add "Email to contractor" option (server relay)
4. Add admin email field to contractor profiles