Delivery lesson-sites API request for Sales Site Manager
Why
Sales needs a Site Manager utility in the scheduling workflow so operators can choose a proposed slot, confirm coach and location, then create the reservation only after the location is ready. Delivery remains the owner of lesson sites and private-site person links, so Sales should not write those rows directly or browse unrelated private addresses.
The Sales side is being wired as a browser to Sales to Delivery proxy. It expects Delivery to expose a narrow lesson-site API that lists public sites plus the private sites already linked to the lead person, creates new public or lead-linked private sites, and records private-site access requests when a lead wants to use a friend's site.
What
Sales is building against these Delivery-owned surfaces:
GET /api/v1/delivery/v1/lesson-sites, scoped by organization, market or service area, andperson_id. It returns public sites plus private sites already linked to that person.POST /api/v1/delivery/v1/lesson-sites, creates a public or private site. Private creation also creates theLessonSitePersonLinkfor the submitted leadperson_id.POST /api/v1/delivery/v1/lesson-site-access-requests, creates a pending request to link the requesting leadperson_idto an existing private site owned by a selected friend or customerperson_id.
Sales expects the list response to return id, label, visibility, serviceAreaId, zip, marketId, marketLabel, linkedPersonIds limited to the requesting person context, and asOf. Create-site input is organizationId, personId, visibility, name, address, zip, serviceAreaId, sourceLeadId, and notes. Access-request input is organizationId, requestingPersonId, targetPersonId, sourceLeadId, and notes.
Asks
Please either confirm this API shape or reply with the adjusted Delivery-owned shape Sales should consume. The main product constraint is that Sales can create a new private site for the lead directly, but existing private sites owned by another customer require a Delivery-approved access request and must not expose unrelated private addresses to Sales.
References
- Sales Site Manager work in
sales/app/workbench/_components/SiteManagerUtility.tsx. - Sales proxy routes under
/api/workbenches/lesson-sitesand/api/workbenches/lesson-site-access-requests.