39 lines
2.4 KiB
Markdown
39 lines
2.4 KiB
Markdown
# Mobile quote contact integration
|
|
|
|
## ADDED Requirements
|
|
|
|
### Requirement: Mobile updates persist the selected contact name
|
|
|
|
The mobile quote update entry SHALL resolve the canonical contact name, phone and email snapshot using the authenticated tenant, the quote's effective customer and the submitted contact ID. It SHALL reuse the existing quote update validation, data scope and single-transaction persistence flow. It SHALL NOT trust a client-submitted contact name or snapshot. Empty canonical phone/email values SHALL replace stale values from the previous contact.
|
|
|
|
#### Scenario: Change the customer and contact on a draft
|
|
|
|
- **WHEN** the mobile form saves an existing draft with another accessible customer and one of that customer's contacts
|
|
- **THEN** the saved contact ID and name belong to that selected contact, and subsequent mobile and Web reads show consistent name and phone data.
|
|
|
|
#### Scenario: Invalid or inaccessible contact
|
|
|
|
- **WHEN** the requested contact is deleted, belongs to a different customer or tenant, or is outside the user's allowed scope
|
|
- **THEN** the update is rejected without persisting the quote changes.
|
|
|
|
#### Scenario: Clear an optional contact on a draft
|
|
|
|
- **WHEN** the mobile draft explicitly clears its contact
|
|
- **THEN** the persisted contact ID, name, phone and email are cleared, subject to the existing draft validation rules.
|
|
|
|
#### Scenario: Omit the optional contact
|
|
|
|
- **WHEN** the mobile update omits the contact field and retains the same customer
|
|
- **THEN** the existing contact is retained and its current canonical snapshot is validated and resolved again.
|
|
- **WHEN** the customer changes and the mobile update omits the contact field
|
|
- **THEN** the previous customer's contact ID and snapshot are cleared.
|
|
|
|
### Requirement: Existing Web behavior remains unchanged
|
|
|
|
The original Web update route, request schema, default CRUD behavior and frontend UI SHALL remain unchanged. A server-internal optional canonical snapshot argument MAY extend the existing CRUD transaction; its default SHALL retain original Web behavior. Only the explicit mobile page variant SHALL call the mobile update entry, both when saving a draft and when saving before approval submission.
|
|
|
|
#### Scenario: Desktop save
|
|
|
|
- **WHEN** the desktop quote form saves a draft or submits it for approval
|
|
- **THEN** it continues to use the original route and original request and validation behavior.
|