Creating New Customers
Location
`/admin/customers` → Click "➕ New Customer" button
Steps
-
Open Create Customer Modal
- Click "➕ New Customer" button in top right
- Modal opens with CustomerForm
-
Fill in Customer Information
- Email (required): User's login email, must be unique
- Company Name (optional): Organization name
- Primary Contact Name (optional): Main contact person
- Phone (optional): Contact phone number (formatted)
- Website (optional): Company website URL (validated)
-
Submit
- Click "Create Customer" button
- System creates User + Customer in atomic transaction
- Auto-generates temporary password
- Returns to customer list with success notification
Backend Process
- Creates User account with `customer` role
- Creates Customer record linked to User
- Transaction ensures both succeed or both fail (no orphaned records)
Validation
- Email must be unique (returns 409 Conflict if duplicate)
- Email must be valid format
- Website must be valid URL format
- Phone format validation (optional but enforced if provided)