Customer Listings Integration
Creating Listings with Contact Auto-Copy
Location: `/admin/listings/create`
Workflow
-
Select Customer
- Use CustomerSelector dropdown
- Search by company name or contact name
- Click "➕ Add New Customer" if needed
-
Select Contact
- CustomerContactSelector enabled after customer selected
- Search/select from customer's contacts
- Click "➕ Add Contact" if customer contact doesn't exist
-
Fill Listing Details
- Title, description, salary, location, etc.
-
Submit
- Backend automatically copies selected contact data to ListingContact
- Listing + ListingContact created in single transaction
Backend Automation
Endpoint: `POST /api/v1/admin/listings`
Optional DTO Field: `customerContactId?: string`
Behavior:
- Validates customerContactId exists and belongs to customer
- Creates Listing record
- Creates ListingContact record with copied data (name, email, phone)
- Both created in atomic Prisma transaction
Benefits
- Reusable contacts across multiple listings
- No duplicate data entry
- Contact changes don't affect existing listings (isolation)
- Faster listing creation workflow