Order snapshot
Each order keeps a snapshot of the customer's details: business name, phone, email, shipping address, billing address and your primary contact. It is taken when the order is created and never changes. The invoice's Ship To and Bill To always print the snapshot. Editing the customer afterwards changes future orders only, never an order or invoice already created. This is what the contact tooltip means by "Updates apply to future orders only and do not change historical records."
Who uses it
- Supplier staff read the customer's details on orders, invoices and deliveries, and re-download invoices months later.
- Restaurants receive the invoice PDF, which shows the same frozen details.
How it works
When the snapshot is taken
The snapshot is taken once, when the order is created (a draft included). It is never refreshed: moving an order back to Packing and marking it Ready for Delivery again issues a new invoice but reuses the same snapshot. If the restaurant has no business name, the order can't be created.
What's in the snapshot
| Snapshot field | Taken from |
|---|---|
| Business name | The restaurant's business name |
| Phone, email | The restaurant's business phone and email |
| Shipping address | The restaurant's shipping address |
| Billing address | The restaurant's billing address. If it has none, a copy of the shipping address |
| Primary contact | Your primary contact for this customer. If you have none, the restaurant's owner. Never a mix of the two |
The snapshot doesn't hold your Customer Ref ID. Each invoice reads it from the customer when the invoice is issued, and keeps it from then on.
Example
Harbor Bistro, 12 Pier St. Order ICE-000042 is created Oct 1 and marked Ready for Delivery Oct 3. The restaurant moves to 80 Dock Rd on Oct 5.
| Shows | |
|---|---|
| Snapshot address | 12 Pier St (taken Oct 1) |
| Invoice re-downloaded Oct 10 | 12 Pier St |
| A new order on Oct 10 | 80 Dock Rd |
| ICE-000042 moved back to Packing and re-dispatched Oct 11 | 12 Pier St (new invoice, same snapshot) |
If the address changed on Oct 2, between creation and dispatch, the invoice still prints 12 Pier St.
All or nothing
Every customer field on the invoice comes from the snapshot, even a blank one. Nothing is filled in from the customer's current details.
A restaurant cart sent to several suppliers
A restaurant ordering from Supplier A and Supplier B at once creates one order per supplier. Each has its own snapshot, its own invoice, and is seen only by its supplier.
| Supplier A's order | Supplier B's order | |
|---|---|---|
| Business name and addresses | The restaurant's own | The restaurant's own (the same) |
| Primary contact | A's primary contact for the restaurant | B's primary contact for the restaurant |
| Invoice | A's header, A's snapshot | B's header, B's snapshot |
Because the name and address come from the restaurant's own record, both snapshots show the same name and address. Only the primary contact differs.
Where it shows up
| Surface | Uses |
|---|---|
| Invoice PDF "Ship To", "Bill To" | Snapshot |
| Order list, order detail | Snapshot |
| Invoice list, invoice preview, invoice page | Snapshot |
| Order and invoice search by customer name, sort by customer | The snapshot name |
| Messages about an order (placed, confirmed, delivered, payment, return, cancel, overdue reminder) | The snapshot name, as it was when the order was created |
| Bookkeeping rows | The snapshot name |
| Driver deliveries pages | Not on this snapshot yet. See Known limitations |
| Customers list, chat, catalogs, sales report, new order dialog | Current details, never the snapshot. See Names across the app |
Permissions
Nobody can edit a snapshot.
Decisions
- Invoices print a snapshot, not live data. An invoice already sent can't change under the restaurant. (#1977)
- Every order has a snapshot, taken at creation. Order screens, search and bookkeeping never need to fall back to current details. (#1978)
Specs
- "Custom name" / "custom records" (DDSL, DDMS-003 – 007, DDOR, DDIN, DDIL, DDDE): there are no supplier custom records. The snapshot holds the restaurant's own data, plus your primary contact.
- DDMS-005: two suppliers' snapshots have the same name and address.
# prefix: DDSL
Feature: Business record snapshot lifecycle for orders
When an order is created, the system captures a snapshot of the supplier's
custom business records (name, taxID, addresses) for the restaurant at that
point in time. This snapshot is immutable and used for all subsequent displays
of that order's restaurant information from the supplier's perspective.
Contacts are not included in the snapshot as they are not used in order flows.
Background:
Given supplier "Miguel Supplier Test" has two restaurants:
| Restaurant | Has Custom Records | Supplier's Custom Name | Custom Address | Custom City | Custom State | Custom Zip | Custom Phone |
| John Pizza III | Yes | Johnny's Pizzeria | 456 Broadway st | Manhattan | NY | 10001 | +12125551234 |
| Pizza Palace | No | | | | | | |
And "John Pizza III" has its own data:
| Business Name | John Pizza III |
| Address | 123 Wall st |
| City | Brooklyn |
| State | NY |
| Zip | 11222 |
| Phone | +19179171917 |
And "Pizza Palace" has its own data:
| Business Name | Pizza Palace |
| Address | 789 Main st |
| City | Queens |
| State | NY |
| Zip | 11101 |
| Phone | +17185559876 |
Rule: A snapshot of the supplier's custom records is captured at order creation
Scenario: DDSL-001 Order captures current custom records at creation time
Given "Miguel Supplier Test" has custom fields for "John Pizza III":
| Custom Name | Johnny's Pizzeria |
| Tax ID | 12-3456789 |
| Shipping Address | 456 Broadway st |
| Shipping City | Manhattan |
| Shipping State | NY |
| Shipping Zip | 10001 |
| Billing Address | 100 Park Ave |
| Billing City | Midtown |
| Billing State | NY |
| Billing Zip | 10019 |
When "Miguel Supplier Test" creates order 1 for "John Pizza III"
Then order 1's business record snapshot contains:
| name | Johnny's Pizzeria |
| taxID | 12-3456789 |
| shipping.address | 456 Broadway st |
| shipping.city | Manhattan |
| shipping.state | NY |
| shipping.zip | 10001 |
| billing.address | 100 Park Ave |
| billing.city | Midtown |
| billing.state | NY |
| billing.zip | 10019 |
Scenario: DDSL-002 Order without custom records snapshots the restaurant's own data
Given "Miguel Supplier Test" has no custom records for "Pizza Palace"
When "Miguel Supplier Test" creates order 1 for "Pizza Palace"
Then order 1's business record snapshot contains:
| name | Pizza Palace |
| address | 789 Main st |
| city | Queens |
| state | NY |
| zip | 11101 |
Scenario: DDSL-003 Shipping address falls back to billing at snapshot time when shipping is null
Given "Miguel Supplier Test" has custom fields for "John Pizza III":
| Custom Name | Johnny's Pizzeria |
| Shipping Address | |
| Billing Address | 100 Park Ave |
| Billing City | Midtown |
| Billing State | NY |
| Billing Zip | 10019 |
When "Miguel Supplier Test" creates order 1 for "John Pizza III"
Then order 1's snapshot shipping address is pre-resolved to billing:
| shipping.address | 100 Park Ave |
| shipping.city | Midtown |
| shipping.state | NY |
| shipping.zip | 10019 |
Rule: Snapshots are immutable after order creation
Scenario: DDSL-004 Changing custom records does not affect existing order snapshots
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
When "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
Then order 1's business record snapshot still contains name "Johnny's Pizzeria"
Scenario: DDSL-005 Removing custom records does not affect existing order snapshots
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
When "Miguel Supplier Test" removes all custom records for "John Pizza III"
Then order 1's business record snapshot still contains name "Johnny's Pizzeria"
Scenario: DDSL-006 Editing the restaurant's own data does not affect existing order snapshots
Given "Miguel Supplier Test" has no custom records for "Pizza Palace"
And "Miguel Supplier Test" creates order 1 for "Pizza Palace"
When "Pizza Palace" changes its own business name to "Pizza Palace II"
Then order 1's business record snapshot still contains name "Pizza Palace"
Rule: Each order gets its own independent snapshot
Scenario: DDSL-007 Multiple orders from different time periods have different snapshots
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
And "Miguel Supplier Test" creates order 2 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "JP3"
And "Miguel Supplier Test" creates order 3 for "John Pizza III"
Then order 1's snapshot contains name "Johnny's Pizzeria"
And order 2's snapshot contains name "John's Place"
And order 3's snapshot contains name "JP3"
Rule: Supplier order snapshots are independent across suppliers within the same order
Scenario: DDSL-008 Multi-supplier order captures separate snapshots per supplier
Given supplier "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And supplier "Sofia Supplier Test" has custom name "John's Gourmet Pizza" for "John Pizza III"
And "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
Then the supplier order for "Miguel Supplier Test" has snapshot name "Johnny's Pizzeria"
And the supplier order for "Sofia Supplier Test" has snapshot name "John's Gourmet Pizza"
Scenario: DDSL-009 Updating one supplier's custom records does not affect the other supplier's supplier order snapshot
Given supplier "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And supplier "Sofia Supplier Test" has custom name "John's Gourmet Pizza" for "John Pizza III"
And "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Miguel Supplier Test" changes the custom name for "John Pizza III" to "JP III Updated"
Then the supplier order for "Miguel Supplier Test" still has snapshot name "Johnny's Pizzeria"
And the supplier order for "Sofia Supplier Test" still has snapshot name "John's Gourmet Pizza"
Scenario: DDSL-010 Two suppliers with no custom records both snapshot the restaurant's own data identically
Given supplier "Miguel Supplier Test" has no custom records for "John Pizza III"
And supplier "Sofia Supplier Test" has no custom records for "John Pizza III"
And "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
Then the supplier order for "Miguel Supplier Test" has snapshot name "John Pizza III"
And the supplier order for "Sofia Supplier Test" has snapshot name "John Pizza III"
# prefix: DDMS
Feature: Dual-data resolution for multi-supplier orders with an order per supplier
When a restaurant places an order containing items from multiple suppliers,
the system splits it into supplier orders — one per supplier. Each supplier order captures
an independent snapshot from that supplier's custom records for the restaurant.
Each supplier only sees their own supplier order with their own snapshot data,
while the restaurant sees the unified order with its own business name.
Background:
Given restaurant "John Pizza III" has its own data:
| Business Name | John Pizza III |
| Address | 123 Wall st |
| City | Brooklyn |
| State | NY |
| Zip | 11222 |
| Phone | +19179171917 |
| Contact Email | eder.chamale+john.pizza.iii@gmail.com |
And supplier A "Miguel Supplier Test" has custom records for "John Pizza III":
| Custom Name | Johnny's Pizzeria |
| Custom Address | 456 Broadway st |
| Custom City | Manhattan |
| Custom State | NY |
| Custom Zip | 10001 |
| Custom Phone | +12125551234 |
And supplier B "Sofia Supplier Test" has custom records for "John Pizza III":
| Custom Name | John's Gourmet Pizza |
| Custom Address | 200 Lexington Ave |
| Custom City | Midtown |
| Custom State | NY |
| Custom Zip | 10016 |
| Custom Phone | +12125559999 |
Rule: A restaurant order with items from multiple suppliers produces independent supplier orders
Scenario: DDMS-001 Restaurant places order with items from two suppliers
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
Then the system creates two supplier orders — one for each supplier
Scenario: DDMS-002 Each supplier order is linked to exactly one supplier
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
Then the supplier order for "Miguel Supplier Test" is linked only to "Miguel Supplier Test"
And the supplier order for "Sofia Supplier Test" is linked only to "Sofia Supplier Test"
Rule: Each supplier order captures a snapshot from its respective supplier's custom records
Scenario: DDMS-003 Supplier order for Supplier A snapshots Supplier A's custom records
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
Then the supplier order for "Miguel Supplier Test" has a snapshot with:
| name | Johnny's Pizzeria |
| address | 456 Broadway st |
| city | Manhattan |
| state | NY |
| zip | 10001 |
Scenario: DDMS-004 Supplier order for Supplier B snapshots Supplier B's custom records
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
Then the supplier order for "Sofia Supplier Test" has a snapshot with:
| name | John's Gourmet Pizza |
| address | 200 Lexington Ave |
| city | Midtown |
| state | NY |
| zip | 10016 |
Scenario: DDMS-005 Supplier orders in the same order have different snapshot names and addresses for the same restaurant
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
Then the supplier order for "Miguel Supplier Test" has snapshot name "Johnny's Pizzeria"
And the supplier order for "Sofia Supplier Test" has snapshot name "John's Gourmet Pizza"
And the supplier order for "Miguel Supplier Test" has snapshot address "456 Broadway st"
And the supplier order for "Sofia Supplier Test" has snapshot address "200 Lexington Ave"
Rule: Changing one supplier's custom records after order does not affect any supplier order snapshots
Scenario: DDMS-006 Supplier A changes custom name — neither supplier order snapshot changes
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Miguel Supplier Test" changes the custom name for "John Pizza III" to "JP III Updated"
Then the supplier order for "Miguel Supplier Test" still has snapshot name "Johnny's Pizzeria"
And the supplier order for "Sofia Supplier Test" still has snapshot name "John's Gourmet Pizza"
Scenario: DDMS-007 Supplier B removes custom records — both supplier order snapshots remain unchanged
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Sofia Supplier Test" removes all custom records for "John Pizza III"
Then the supplier order for "Sofia Supplier Test" still has snapshot name "John's Gourmet Pizza"
And the supplier order for "Miguel Supplier Test" still has snapshot name "Johnny's Pizzeria"
Rule: Restaurant views the multi-supplier order with its own business name
Scenario: DDMS-008 Restaurant sees its own business name on the order, not any supplier's custom name
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "John Pizza III" views the order
Then the order displays "John Pizza III" as the restaurant name
And the order does not display "Johnny's Pizzeria" or "John's Gourmet Pizza"
Scenario: DDMS-009 Restaurant sees supplier orders grouped by supplier, using its own name throughout
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "John Pizza III" views the order details
Then the order header displays "John Pizza III" as the restaurant name
And the supplier order group for "Miguel Supplier Test" displays "John Pizza III" as the restaurant name
And the supplier order group for "Sofia Supplier Test" displays "John Pizza III" as the restaurant name
Rule: Each supplier sees only their own supplier order with their snapshot data
Scenario: DDMS-010 Each supplier's order list shows their own snapshot name
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Miguel Supplier Test" views their orders list
Then the order displays "Johnny's Pizzeria" as the customer name
When "Sofia Supplier Test" views their orders list
Then the order displays "John's Gourmet Pizza" as the customer name
Scenario: DDMS-011 Each supplier's order detail shows their own snapshot address
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Miguel Supplier Test" opens the order details panel
Then the panel displays "456 Broadway st" as the delivery address street
And the panel displays "Manhattan" as the delivery address city
When "Sofia Supplier Test" opens the order details panel
Then the panel displays "200 Lexington Ave" as the delivery address street
And the panel displays "Midtown" as the delivery address city
# prefix: DDOR
Feature: Dual-data resolution in order pages
When viewing orders, returns, and order details, the supplier application
resolves restaurant information using the supplier's custom records
when available, falling back to the restaurant's own data.
Background:
Given supplier "Miguel Supplier Test" has two restaurants:
| Restaurant | Has Custom Records | Supplier's Custom Name | Custom Address | Custom City | Custom State | Custom Zip | Custom Phone | Custom Contact Email |
| John Pizza III | Yes | Johnny's Pizzeria | 456 Broadway st | Manhattan | NY | 10001 | +12125551234 | eder.chamale+johnny.custom@gmail.com |
| Pizza Palace | No | | | | | | | |
And "John Pizza III" has its own data:
| Business Name | John Pizza III |
| Address | 123 Wall st |
| City | Brooklyn |
| State | NY |
| Zip | 11222 |
| Phone | +19179171917 |
| Contact Email | eder.chamale+john.pizza.iii@gmail.com |
And "Pizza Palace" has its own data:
| Business Name | Pizza Palace |
| Address | 789 Main st |
| City | Queens |
| State | NY |
| Zip | 11101 |
| Phone | +17185559876 |
| Contact Email | eder.chamale+pizza.palace@gmail.com |
Rule: Order list displays supplier's custom restaurant name
Scenario Outline: DDOR-001 Order table and compact list show resolved restaurant name
Given orders exist between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the orders list at "/orders"
Then the order table displays "<displayed_name>" as the customer name
And the compact list displays "<displayed_name>" as the customer name
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Rule: Order list and details display the snapshot custom name from order creation time
Scenario: DDOR-002 Orders retain the custom name that was active at order creation time
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
And "Miguel Supplier Test" creates order 2 for "John Pizza III"
When the supplier views the orders list at "/orders"
Then order 1 displays "Johnny's Pizzeria" as the customer name
And order 2 displays "John's Place" as the customer name
Scenario: DDOR-003 Order details panel shows snapshot fields, not current custom data
Given "Miguel Supplier Test" has custom fields for "John Pizza III":
| Custom Name | Custom Address | Custom City | Custom State | Custom Zip | Custom Phone |
| Johnny's Pizzeria | 456 Broadway st | Manhattan | NY | 10001 | +12125551234 |
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" updates custom fields for "John Pizza III":
| Custom Name | Custom Address | Custom City | Custom State | Custom Zip | Custom Phone |
| John's Place | 789 5th Ave | Bronx | NY | 10451 | +12125559999 |
When the supplier opens the order details panel for order 1
Then the panel displays "Johnny's Pizzeria" as the restaurant name
And the panel displays "456 Broadway st" as the delivery address street
And the panel displays "Manhattan" as the delivery address city
And the panel displays "+12125551234" as the restaurant phone
Scenario: DDOR-004 Searching orders finds by the snapshot custom name
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the supplier searches for "Johnny" in the orders list
Then the search results include order 1 with customer name "Johnny's Pizzeria"
Scenario: DDOR-005 Returns table shows the snapshot custom name from the original order
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
And a return is created for order 1
When the supplier views the returns list at "/orders/returns"
Then the Customer column displays "Johnny's Pizzeria" for order 1's return
Rule: Restaurant sees its own business name on orders, not the supplier's custom name
Scenario: DDOR-006 Restaurant views its own orders with its own business name
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
When "John Pizza III" views its orders list
Then the order displays "John Pizza III" as the restaurant name
Rule: Snapshot survives supplier removing custom records
Scenario: DDOR-007 Supplier removes custom records after order creation
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" removes all custom records for "John Pizza III"
When the supplier views the orders list
Then order 1 still displays "Johnny's Pizzeria" as the customer name
When "Miguel Supplier Test" creates order 2 for "John Pizza III"
Then order 2 displays "John Pizza III" as the customer name
Rule: Searching orders by customer name matches against the supplier's custom name
Scenario Outline: DDOR-008 Supplier searches orders by customer name
Given orders exist between "Miguel Supplier Test" and "<restaurant>"
When the supplier searches for "<search_term>" in the orders list
Then the search results include orders for "<displayed_name>"
Examples:
| restaurant | search_term | displayed_name |
| John Pizza III | Johnny | Johnny's Pizzeria |
| Pizza Palace | Pizza Pal | Pizza Palace |
Rule: Order details panel displays all resolved restaurant fields
Scenario Outline: DDOR-009 Order details panel shows resolved restaurant information
Given an order exists between "Miguel Supplier Test" and "<restaurant>"
When the supplier opens the order details panel
Then the panel displays "<name>" as the restaurant name
And the panel displays "<phone>" as the restaurant phone
And the panel displays "<address>" as the delivery address street
And the panel displays "<city>" as the delivery address city
And the panel displays "<state>" as the delivery address state
And the panel displays "<zip>" as the delivery address zip
Examples:
| restaurant | name | phone | address | city | state | zip |
| John Pizza III | Johnny's Pizzeria | +12125551234 | 456 Broadway st | Manhattan | NY | 10001 |
| Pizza Palace | Pizza Palace | +17185559876 | 789 Main st | Queens | NY | 11101 |
Rule: Returns table displays resolved restaurant name in Customer column
Scenario Outline: DDOR-010 Returns table shows resolved restaurant name
Given a return exists for an order between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the returns list at "/orders/returns"
Then the Customer column displays "<displayed_name>"
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Rule: Searching returns by customer name matches against the supplier's custom name
Scenario Outline: DDOR-011 Supplier searches returns by customer name
Given a return exists for an order between "Miguel Supplier Test" and "<restaurant>"
When the supplier searches for "<search_term>" in the returns list
Then the search results include returns for "<displayed_name>"
Examples:
| restaurant | search_term | displayed_name |
| John Pizza III | Johnny | Johnny's Pizzeria |
| Pizza Palace | Pizza Pal | Pizza Palace |
Rule: Eligible returns dialog displays resolved restaurant name
Scenario Outline: DDOR-012 Eligible returns dialog shows resolved restaurant name
Given an eligible return exists for an order between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the eligible returns dialog at "/orders/returns?tab=eligible&orderID=[orderID]"
Then the dialog displays "<displayed_name>" as the restaurant name
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
# prefix: DDIN
Feature: Dual-data resolution in invoice PDF generation and downloads
When generating invoice PDFs — whether attached to emails or downloaded directly —
the system always resolves restaurant information using the supplier's custom records
when available, falling back to the restaurant's own data.
Background:
Given supplier "Miguel Supplier Test" has two restaurants:
| Restaurant | Has Custom Records | Supplier's Custom Name | Custom Address | Custom City | Custom State | Custom Zip | Custom Phone | Custom Contact Email |
| John Pizza III | Yes | Johnny's Pizzeria | 456 Broadway st | Manhattan | NY | 10001 | +12125551234 | eder.chamale+johnny.custom@gmail.com |
| Pizza Palace | No | | | | | | | |
And "John Pizza III" has its own data:
| Business Name | John Pizza III |
| Address | 123 Wall st |
| City | Brooklyn |
| State | NY |
| Zip | 11222 |
| Phone | +19179171917 |
| Contact Email | eder.chamale+john.pizza.iii@gmail.com |
And "Pizza Palace" has its own data:
| Business Name | Pizza Palace |
| Address | 789 Main st |
| City | Queens |
| State | NY |
| Zip | 11101 |
| Phone | +17185559876 |
| Contact Email | eder.chamale+pizza.palace@gmail.com |
Rule: Invoice PDF "Ship To" and "Bill To" sections always use the supplier's custom data when available
Scenario Outline: DDIN-001 Supplier's invoice PDF displays supplier's custom restaurant fields
Given an order exists between "Miguel Supplier Test" and "<restaurant>"
When the invoice PDF is generated for the supplier
Then the PDF "Ship To" section displays "<name>" as the restaurant name
And the PDF "Ship To" section displays "<address>" as the restaurant address
And the PDF "Ship To" section displays "<city_state_zip>" as the restaurant location
And the PDF "Ship To" section displays "<phone>" as the restaurant phone
And the PDF "Bill To" section displays the same restaurant fields
Examples:
| restaurant | name | address | city_state_zip | phone |
| John Pizza III | Johnny's Pizzeria | 456 Broadway st | Manhattan, NY, 10001 | +12125551234 |
| Pizza Palace | Pizza Palace | 789 Main st | Queens, NY, 11101 | +17185559876 |
Scenario Outline: DDIN-002 Restaurant's invoice PDF displays the supplier's custom restaurant fields when available
Given an order exists between "Miguel Supplier Test" and "<restaurant>"
When the invoice PDF is generated for the restaurant
Then the PDF "Ship To" section displays "<name>" as the restaurant name
And the PDF "Ship To" section displays "<address>" as the restaurant address
And the PDF "Ship To" section displays "<city_state_zip>" as the restaurant location
And the PDF "Ship To" section displays "<phone>" as the restaurant phone
And the PDF "Bill To" section displays the same restaurant fields
Examples:
| restaurant | name | address | city_state_zip | phone |
| John Pizza III | Johnny's Pizzeria | 456 Broadway st | Manhattan, NY, 10001 | +12125551234 |
| Pizza Palace | Pizza Palace | 789 Main st | Queens, NY, 11101 | +17185559876 |
Rule: Invoice PDF uses the supplier's snapshot data from order creation time, not current data
Scenario: DDIN-003 Invoice PDF shows snapshot data after supplier changes custom records
Given "Miguel Supplier Test" has custom fields for "John Pizza III":
| Custom Name | Johnny's Pizzeria |
| Shipping Address | 456 Broadway st |
| Shipping City | Manhattan |
| Shipping State | NY |
| Shipping Zip | 10001 |
| Billing Address | 100 Park Ave |
| Billing City | Midtown |
| Billing State | NY |
| Billing Zip | 10019 |
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the invoice PDF is generated for the supplier for order 1
Then the PDF "Ship To" section displays "Johnny's Pizzeria" as the restaurant name
And the PDF "Ship To" section displays "456 Broadway st" as the restaurant address
And the PDF "Ship To" section displays "Manhattan, NY, 10001" as the restaurant location
And the PDF "Bill To" section displays "Johnny's Pizzeria" as the restaurant name
And the PDF "Bill To" section displays "100 Park Ave" as the restaurant address
And the PDF "Bill To" section displays "Midtown, NY, 10019" as the restaurant location
Scenario: DDIN-004 Re-downloading an invoice still uses order creation-time snapshot
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the supplier downloads the invoice PDF for order 1
Then the PDF "Ship To" section displays "Johnny's Pizzeria" as the restaurant name
When the supplier downloads the invoice PDF for order 1 again
Then the PDF "Ship To" section still displays "Johnny's Pizzeria" as the restaurant name
Scenario: DDIN-005 Multiple invoices in bulk show different snapshot names per order
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
And "Miguel Supplier Test" creates order 2 for "John Pizza III"
When the supplier downloads invoices in bulk
Then the invoice for order 1 displays "Johnny's Pizzeria" in the "Ship To" section
And the invoice for order 2 displays "John's Place" in the "Ship To" section
Scenario: DDIN-006 Restaurant's invoice PDF also uses the supplier's snapshot data
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the invoice PDF is generated for the restaurant for order 1
Then the PDF "Ship To" section displays "Johnny's Pizzeria" as the restaurant name
Scenario: DDIN-007 Invoice PDF after supplier removes custom records still shows snapshot
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" removes all custom records for "John Pizza III"
When the invoice PDF is generated for the supplier for order 1
Then the PDF "Ship To" section displays "Johnny's Pizzeria" as the restaurant name
Rule: Invoice PDF header always displays the supplier's own information
Scenario Outline: DDIN-008 Invoice header shows supplier name and contact regardless of recipient
Given an order exists between "Miguel Supplier Test" and "<restaurant>"
When the invoice PDF is generated for the <recipient>
Then the PDF header displays "Miguel Supplier Test" as the supplier name
And the PDF header displays the supplier's own address and contact information
Examples:
| restaurant | recipient |
| John Pizza III | supplier |
| John Pizza III | restaurant |
| Pizza Palace | supplier |
| Pizza Palace | restaurant |
Rule: Restaurant's invoice PDF includes transaction fees, supplier's does not
Scenario Outline: DDIN-009 Transaction fees are shown only on the restaurant's invoice PDF
Given an order exists between "Miguel Supplier Test" and "<restaurant>"
And the order has third-party processing fees
When the invoice PDF is generated for the restaurant
Then the PDF amounts summary includes "Third-Party Processing Fee"
When the invoice PDF is generated for the supplier
Then the PDF amounts summary does not include "Third-Party Processing Fee"
Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |
Rule: Direct invoice download always uses the supplier's custom data when available
Scenario Outline: DDIN-010 Supplier downloads an invoice PDF
Given an order exists between "Miguel Supplier Test" and "<restaurant>"
When the supplier downloads the invoice PDF
Then the PDF "Ship To" section displays "<displayed_name>" as the restaurant name
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Scenario Outline: DDIN-011 Restaurant downloads an invoice PDF
Given an order exists between "Miguel Supplier Test" and "<restaurant>"
When the restaurant downloads the invoice PDF
Then the PDF "Ship To" section displays "<displayed_name>" as the restaurant name
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Scenario Outline: DDIN-012 Supplier downloads invoices in bulk
Given orders exist between "Miguel Supplier Test" and "<restaurant>"
When the supplier downloads invoices in bulk
Then each PDF "Ship To" section displays "<displayed_name>" as the restaurant name
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Rule: Multi-supplier order produces a unified invoice PDF with one page per supplier
Scenario: DDIN-013 Supplier A's invoice page shows Supplier A's header and snapshot
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When the invoice PDF is generated for "Miguel Supplier Test"'s supplier order
Then the PDF header displays "Miguel Supplier Test" as the supplier name
And the PDF "Ship To" section displays "Johnny's Pizzeria" as the restaurant name
And the PDF "Ship To" section displays "456 Broadway st" as the restaurant address
And the PDF "Bill To" section displays "Johnny's Pizzeria" as the restaurant name
Scenario: DDIN-014 Supplier B's invoice page shows Supplier B's header and snapshot
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When the invoice PDF is generated for "Sofia Supplier Test"'s supplier order
Then the PDF header displays "Sofia Supplier Test" as the supplier name
And the PDF "Ship To" section displays "John's Gourmet Pizza" as the restaurant name
And the PDF "Ship To" section displays "200 Lexington Ave" as the restaurant address
And the PDF "Bill To" section displays "John's Gourmet Pizza" as the restaurant name
Scenario: DDIN-015 Restaurant receives a unified PDF with one page per supplier using respective snapshots
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When the unified invoice PDF is generated for the restaurant
Then the PDF contains one page per supplier
And the page for "Miguel Supplier Test" displays "Miguel Supplier Test" in the header
And the page for "Miguel Supplier Test" displays "Johnny's Pizzeria" in the "Ship To" section
And the page for "Sofia Supplier Test" displays "Sofia Supplier Test" in the header
And the page for "Sofia Supplier Test" displays "John's Gourmet Pizza" in the "Ship To" section
Scenario: DDIN-016 Supplier A changes custom name after order — invoice pages still show original snapshots
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "JP III Updated"
When the invoice PDF is generated for "Miguel Supplier Test"'s supplier order
Then the PDF "Ship To" section displays "Johnny's Pizzeria" as the restaurant name
When the invoice PDF is generated for "Sofia Supplier Test"'s supplier order
Then the PDF "Ship To" section displays "John's Gourmet Pizza" as the restaurant name
Scenario: DDIN-017 Bulk download of multi-supplier order invoices includes all supplier pages with correct snapshots
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When the invoices are downloaded in bulk for the multi-supplier order
Then the bulk download includes a page for "Miguel Supplier Test" with "Johnny's Pizzeria" in the "Ship To" section
And the bulk download includes a page for "Sofia Supplier Test" with "John's Gourmet Pizza" in the "Ship To" section
# prefix: DDIL
Feature: Dual-data resolution in invoice list and preview pages
When viewing the invoice list and invoice preview pages, the supplier
application resolves restaurant information using the supplier's custom
records when available, falling back to the restaurant's own data.
Note: Invoice PDF generation and downloads are covered in invoices.feature.
Background:
Given supplier "Miguel Supplier Test" has two restaurants:
| Restaurant | Has Custom Records | Supplier's Custom Name | Custom Address | Custom City | Custom State | Custom Zip | Custom Phone | Custom Contact Email |
| John Pizza III | Yes | Johnny's Pizzeria | 456 Broadway st | Manhattan | NY | 10001 | +12125551234 | eder.chamale+johnny.custom@gmail.com |
| Pizza Palace | No | | | | | | | |
And "John Pizza III" has its own data:
| Business Name | John Pizza III |
| Address | 123 Wall st |
| City | Brooklyn |
| State | NY |
| Zip | 11222 |
| Phone | +19179171917 |
| Contact Email | eder.chamale+john.pizza.iii@gmail.com |
And "Pizza Palace" has its own data:
| Business Name | Pizza Palace |
| Address | 789 Main st |
| City | Queens |
| State | NY |
| Zip | 11101 |
| Phone | +17185559876 |
| Contact Email | eder.chamale+pizza.palace@gmail.com |
Rule: Invoice list displays resolved restaurant name with avatar
Scenario Outline: DDIL-001 Invoice list shows resolved restaurant name and avatar
Given invoices exist for orders between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the invoice list at "/invoices"
Then the list displays "<displayed_name>" as the restaurant name
And the list displays the avatar for "<displayed_name>"
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Rule: Filtering invoices by customer matches against the supplier's custom name
Scenario Outline: DDIL-002 Supplier filters invoices by customer name
Given invoices exist for orders between "Miguel Supplier Test" and "<restaurant>"
When the supplier filters invoices by "<search_term>"
Then the filtered results include invoices for "<displayed_name>"
Examples:
| restaurant | search_term | displayed_name |
| John Pizza III | Johnny | Johnny's Pizzeria |
| Pizza Palace | Pizza Pal | Pizza Palace |
Rule: Invoice preview page displays resolved restaurant name and phone
Scenario Outline: DDIL-003 Invoice preview page shows resolved restaurant information
Given an invoice exists for an order between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the invoice preview at "/invoices/[orderID]"
Then the preview displays "<name>" as the restaurant name
And the preview displays "<phone>" as the restaurant phone
Examples:
| restaurant | name | phone |
| John Pizza III | Johnny's Pizzeria | +12125551234 |
| Pizza Palace | Pizza Palace | +17185559876 |
Rule: Invoice list and preview display the snapshot custom name from order creation time
Scenario: DDIL-004 Invoice list shows snapshot names after supplier changes custom name
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
And "Miguel Supplier Test" creates order 2 for "John Pizza III"
When the supplier views the invoice list at "/invoices"
Then the list displays "Johnny's Pizzeria" for order 1
And the list displays "John's Place" for order 2
Scenario: DDIL-005 Invoice preview shows snapshot data for a specific order
Given "Miguel Supplier Test" has custom fields for "John Pizza III":
| Custom Name | Custom Phone |
| Johnny's Pizzeria | +12125551234 |
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the supplier views the invoice preview at "/invoices/[order1ID]"
Then the preview displays "Johnny's Pizzeria" as the restaurant name
And the preview displays "+12125551234" as the restaurant phone
Scenario: DDIL-006 Filtering invoices finds orders by their snapshot custom name
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "Miguel Supplier Test" creates order 1 for "John Pizza III"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the supplier filters invoices by "Johnny"
Then the filtered results include the invoice for order 1
Rule: Invoice list and preview for multi-supplier orders show per-supplier snapshot data
Scenario: DDIL-007 Supplier A's invoice list shows only Supplier A's invoices with Supplier A's snapshot name
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Miguel Supplier Test" views the invoice list at "/invoices"
Then the list displays "Johnny's Pizzeria" for "Miguel Supplier Test"'s supplier order
And the list does not display "John's Gourmet Pizza"
Scenario: DDIL-008 Supplier B's invoice list shows only Supplier B's invoices with Supplier B's snapshot name
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Sofia Supplier Test" views the invoice list at "/invoices"
Then the list displays "John's Gourmet Pizza" for "Sofia Supplier Test"'s supplier order
And the list does not display "Johnny's Pizzeria"
Scenario: DDIL-009 Filtering invoices by one supplier's custom name returns only that supplier's invoices
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Miguel Supplier Test" filters invoices by "Johnny"
Then the filtered results include invoices for "Johnny's Pizzeria"
And the filtered results do not include invoices for "John's Gourmet Pizza"
Scenario: DDIL-010 Invoice preview for each supplier's order shows that supplier's snapshot
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
When "Miguel Supplier Test" views the invoice preview for their supplier order
Then the preview displays "Johnny's Pizzeria" as the restaurant name
When "Sofia Supplier Test" views the invoice preview for their supplier order
Then the preview displays "John's Gourmet Pizza" as the restaurant name
# prefix: DDDE
Feature: Dual-data resolution in delivery pages
When viewing deliveries, delivery details, and the delivery sign page,
the supplier application resolves restaurant information using the
supplier's custom records when available, falling back to the
restaurant's own data.
Background:
Given supplier "Miguel Supplier Test" has two restaurants:
| Restaurant | Has Custom Records | Supplier's Custom Name | Custom Address | Custom City | Custom State | Custom Zip | Custom Phone | Custom Contact Email |
| John Pizza III | Yes | Johnny's Pizzeria | 456 Broadway st | Manhattan | NY | 10001 | +12125551234 | eder.chamale+johnny.custom@gmail.com |
| Pizza Palace | No | | | | | | | |
And "John Pizza III" has its own data:
| Business Name | John Pizza III |
| Address | 123 Wall st |
| City | Brooklyn |
| State | NY |
| Zip | 11222 |
| Phone | +19179171917 |
| Contact Email | eder.chamale+john.pizza.iii@gmail.com |
And "Pizza Palace" has its own data:
| Business Name | Pizza Palace |
| Address | 789 Main st |
| City | Queens |
| State | NY |
| Zip | 11101 |
| Phone | +17185559876 |
| Contact Email | eder.chamale+pizza.palace@gmail.com |
Rule: Delivery list displays resolved restaurant name
Scenario Outline: DDDE-001 Delivery list shows resolved restaurant name
Given deliveries exist for orders between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the delivery list at "/delivery/my-deliveries"
Then the list displays "<displayed_name>" as the restaurant name
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Rule: Delivery detail displays resolved restaurant name, phone, and address
Scenario Outline: DDDE-002 Delivery detail shows resolved restaurant information
Given a delivery exists for an order between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the delivery detail at "/delivery/[deliveryID]"
Then the detail displays "<name>" as the restaurant name
And the detail displays "<phone>" as the restaurant phone
And the detail displays "<address>" as the delivery address street
And the detail displays "<city>" as the delivery address city
And the detail displays "<state>" as the delivery address state
And the detail displays "<zip>" as the delivery address zip
Examples:
| restaurant | name | phone | address | city | state | zip |
| John Pizza III | Johnny's Pizzeria | +12125551234 | 456 Broadway st | Manhattan | NY | 10001 |
| Pizza Palace | Pizza Palace | +17185559876 | 789 Main st | Queens | NY | 11101 |
Rule: Delivery sign page invoice PDF uses resolved data
Scenario Outline: DDDE-003 Delivery sign page Ship To section shows resolved restaurant name
Given a delivery exists for an order between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the delivery sign page at "/delivery/[deliveryID]/sign"
Then the Ship To section displays "<displayed_name>" as the restaurant name
Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
Rule: Each supplier's delivery for a multi-supplier order shows that supplier's snapshot data
Scenario: DDDE-004 Supplier A's delivery list shows Supplier A's snapshot name and address
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
And deliveries are created for each supplier order
When "Miguel Supplier Test" views the delivery list at "/delivery/my-deliveries"
Then the list displays "Johnny's Pizzeria" as the restaurant name
And the list displays "456 Broadway st" as the delivery address
Scenario: DDDE-005 Supplier B's delivery list shows Supplier B's snapshot name and address
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
And deliveries are created for each supplier order
When "Sofia Supplier Test" views the delivery list at "/delivery/my-deliveries"
Then the list displays "John's Gourmet Pizza" as the restaurant name
And the list displays "200 Lexington Ave" as the delivery address
Scenario: DDDE-006 Supplier A's delivery detail shows Supplier A's snapshot address, not Supplier B's
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
And deliveries are created for each supplier order
When "Miguel Supplier Test" views the delivery detail for their supplier order
Then the detail displays "Johnny's Pizzeria" as the restaurant name
And the detail displays "456 Broadway st" as the delivery address street
And the detail displays "Manhattan" as the delivery address city
And the detail does not display "200 Lexington Ave"
Scenario: DDDE-007 Delivery sign page for Supplier A's order shows Supplier A's snapshot in Ship To
Given "John Pizza III" places an order with items from "Miguel Supplier Test" and "Sofia Supplier Test"
And deliveries are created for each supplier order
When "Miguel Supplier Test" views the delivery sign page for their supplier order
Then the Ship To section displays "Johnny's Pizzeria" as the restaurant name
And the Ship To section displays "456 Broadway st" as the restaurant address
Known limitations
- The snapshot can't be refreshed. If a restaurant's address was wrong at ordering, the order and every invoice issued from it keep the wrong one. Create a new order to use the corrected details.
- The snapshot holds the restaurant's own name and address, not a private supplier version, because private versions don't exist yet. See Customer info.
- A blank field in a snapshot stays blank even if the customer has since filled it in.
- Messages use the snapshot name, so a renamed customer is still named by its old name in messages about an earlier order.
- The driver deliveries pages (
/delivery,/delivery/my-deliveries) still read the older order records, not these orders (verify scope with the driver rollout).
FAQ
I fixed the customer's address. Why does the old invoice still show the old one? Invoices print the details captured on the order. Only new orders use the new address.
I fixed the address but this order, not yet delivered, still shows the old one. Its snapshot was taken when the order was created and isn't refreshed, even if you re-dispatch it. Create a new order.
Why does the invoice show no billing address line of its own? The restaurant has no separate billing address, so billing is a copy of shipping.
Two suppliers' invoices for the same cart show the same restaurant name. Yes. The name comes from the restaurant's own record. Only each supplier's primary contact differs.