Skip to main content

Names across the app

Which customer name and contact details each screen, document and message uses. In short: screens about the customer show the restaurant's current details; screens about an order show the order's snapshot; messages about an order name the restaurant as it was on the order's snapshot. Since a supplier can't yet keep a private name for a customer, the restaurant's own name is the only name there is.

Who uses it​

Supplier staff and support, answering "why does this screen say X when that one says Y?".

Supplier screens​

ScreenName shownPhone, email, addressSearch matches
Customers listCurrent business nameCurrent business phone, email, address. Hidden address for an invited restaurant that hasn't acceptedBusiness name, business email, business phone, Customer Ref ID. Not your contacts
Customer detail headerCurrent business nameYour primary contact's email and phone first (see Contacts). Address and EIN from the business
Payments page and payment detailCurrent business name (verify)
New order dialog, customer pickerCurrent business nameBusiness name
Orders list and order detailSnapshotSnapshotSnapshot name, order number, reference number
Returns table and returns dialogSnapshot
Invoice list and invoice previewSnapshotSnapshotOrder number, reference number, snapshot customer name
Driver deliveries pages (/delivery)Not on the snapshot: they still read the older order records (verify)
Catalogs: customer preview, customer assignmentCurrent business name and logoBusiness name
Chat: conversation header, new message listCurrent business name and logo
Sales report: Top CustomersCurrent business name
Bookkeeping rowsThe order's snapshot name

Documents​

DocumentCustomer details
Invoice PDF ("Ship To", "Bill To")The order's snapshot. Header: the supplier's own name and contact details
Restaurant's copy of the invoiceThe same snapshot
Bulk download, several ordersEach page uses its own order's snapshot
Packing slipThe same snapshot. "Account #" (your Customer Ref ID) on the detailed layout
StatementSent to your primary contact's email, else the business email

Messages​

MessageRecipientCustomer name used
New order email and push to the supplier ("New Order Received from …")Supplier staffThe snapshot name
Restaurant signed upSupplier staffThe restaurant's current business name
Payment received (to the supplier)Supplier staffThe snapshot name
Confirmed, dispatched, delivered, canceled, returns, payment receipt, Notify to Pay reminder (to the restaurant)The restaurant, plus your contactsThe snapshot name. The supplier is named by its own name as it was on the order
Invoice PDF attached to an emailThe order's snapshot
Invitation email and textThe invited contactThe restaurant name typed or matched when inviting
Editing a customer's detailsNothing is sent

Recipients of the restaurant's messages are listed in Contacts.

Example​

Kulu Desserts is renamed by Supplier A from "Kulu Desserts Lower East Side" to "Kulu Lower Manhattan" on Oct 5. Order ICE-000042 was placed Oct 1 and dispatched Oct 3.

WhereShows
Customers list, chat, catalogs, sales reportKulu Lower Manhattan
ICE-000042 in the orders list and its invoice PDFKulu Desserts Lower East Side (snapshot)
Search orders for "Lower Manhattan"Doesn't find ICE-000042 (its snapshot has the old name)
Search orders for "Lower East Side"Finds ICE-000042
Overdue reminder for ICE-000042 sent Nov 3Names the restaurant "Kulu Desserts Lower East Side" (snapshot); so does the attached invoice
Supplier B's screensAlso Kulu Lower Manhattan (the name is shared)

Permissions​

Display only.

Decisions​

  • Customer screens show current details, order screens show the snapshot. A customer list is about the customer now; an invoice is about the order then. (#1978)
  • Editing customer details never notifies the restaurant. (PRD: Dual Data)

Known limitations​

  • No private supplier name exists, so every screen and message uses the restaurant's own name. The specs on this page assume a supplier "custom name".
  • Order search and messages use the snapshot name, so a renamed customer is found and named by its old name on earlier orders.
  • Customer search doesn't look at your contacts' names, only the business name, phone, email and Customer Ref ID.

FAQ​

I renamed the customer. Why does the old order still say the old name? Order screens show the details captured on the order. See Order snapshot.

Why can't I find an order by the customer's new name? Order search matches the name on the order's snapshot, which is the name the customer had when the order was created. Search by order number instead.

Will the restaurant get an email when I edit their details? No.

Specs​

Where these specs don't match the app

All eight files assume a supplier custom name, address and logo that overrides the restaurant's own. That doesn't exist, so every "custom name" scenario resolves to the restaurant's own name. In particular:

  • DDCU-002, DDND-001, DDCA-003: search matches the business name (and, on Customers, the Customer Ref ID).
  • DDEM-001 – DDEM-018, DDSM-005 – 006, DDPN-001 – 003: messages use the restaurant's own name; order messages use the snapshot name.
  • DDSR-002, DDSR-003: bookkeeping keeps the name at the time of recording, which matches in spirit.
  • DDEM-019, DDSM-007, DDPN-004 (no message on edit) match.
customers.feature
# prefix: DDCU
Feature: Dual-data resolution in customer pages
When viewing the customers list, customer detail, and payments pages,
the supplier application resolves restaurant information using the
supplier's custom records when available, falling back to the
restaurant's own data.
Note: Editing business info is covered in edit-business-info.feature,
editing contacts in edit-restaurant-contacts.feature, and the
newly-connected badge in newly-connected-customer.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: Customers list displays resolved restaurant fields

Scenario Outline: DDCU-001 Customers list shows resolved restaurant information
When the supplier views the customers list at "/customers"
Then the list displays "<name>" as the restaurant name for "<restaurant>"
And the list displays "<phone>" as the restaurant phone
And the list displays "<email>" as the restaurant email
And the list displays "<address>, <city>, <state> <zip>" as the restaurant address

Examples:
| restaurant | name | phone | email | address | city | state | zip |
| John Pizza III | Johnny's Pizzeria | +12125551234 | eder.chamale+johnny.custom@gmail.com | 456 Broadway st | Manhattan | NY | 10001 |
| Pizza Palace | Pizza Palace | +17185559876 | eder.chamale+pizza.palace@gmail.com | 789 Main st | Queens | NY | 11101 |

Rule: Searching customers by name matches against the supplier's custom name

Scenario Outline: DDCU-002 Supplier searches customers by name
When the supplier searches for "<search_term>" in the customers list
Then the search results include "<displayed_name>"

Examples:
| restaurant | search_term | displayed_name |
| John Pizza III | Johnny | Johnny's Pizzeria |
| Pizza Palace | Pizza Pal | Pizza Palace |

Rule: Customer detail header displays resolved restaurant fields

Scenario Outline: DDCU-003 Customer detail header shows resolved restaurant information
When the supplier views the customer detail at "/customers/[customerID]" for "<restaurant>"
Then the header displays "<name>" as the restaurant name
And the header displays the logo for "<name>"
And the header displays "<phone>" as the restaurant phone
And the header displays "<email>" as the restaurant email
And the header displays "<address>, <city>, <state> <zip>" as the restaurant address

Examples:
| restaurant | name | phone | email | address | city | state | zip |
| John Pizza III | Johnny's Pizzeria | +12125551234 | eder.chamale+johnny.custom@gmail.com | 456 Broadway st | Manhattan | NY | 10001 |
| Pizza Palace | Pizza Palace | +17185559876 | eder.chamale+pizza.palace@gmail.com | 789 Main st | Queens | NY | 11101 |

Rule: Customer detail shows resolved contact person name

Scenario Outline: DDCU-004 Customer detail shows resolved contact person
When the supplier views the customer detail at "/customers/[customerID]" for "<restaurant>"
Then the contact section displays the resolved contact person name for "<restaurant>"

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Rule: Payments page displays resolved restaurant name

Scenario Outline: DDCU-005 Payments page shows resolved restaurant name
Given payments exist between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the payments page at "/payments/[customerID]" for "<restaurant>"
Then the page displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Payment detail drawer displays resolved restaurant name

Scenario Outline: DDCU-006 Payment detail drawer shows resolved restaurant name
Given a payment exists between "Miguel Supplier Test" and "<restaurant>"
When the supplier opens the payment detail drawer for "<restaurant>"
Then the drawer displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
new-order-dialog.feature
# prefix: DDND
Feature: Dual-data resolution in new order dialog
When creating a new order, the customer picker and order form resolve
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: Customer picker shows supplier's custom name in search results

Scenario Outline: DDND-001 Supplier searches for a customer in the new order dialog
When the supplier opens the new order dialog
And searches for "<search_term>" in the customer picker
Then the search results display "<displayed_name>"

Examples:
| restaurant | search_term | displayed_name |
| John Pizza III | Johnny | Johnny's Pizzeria |
| Pizza Palace | Pizza Pal | Pizza Palace |

Rule: New order dialog displays resolved restaurant fields after selection

Scenario Outline: DDND-002 New order dialog shows resolved restaurant information after customer selection
When the supplier opens the new order dialog
And selects "<restaurant>" as the customer
Then the dialog displays "<name>" as the restaurant name
And the dialog displays "<phone>" as the restaurant phone
And the dialog displays "<address>" as the delivery address street
And the dialog displays "<city>" as the delivery address city
And the dialog displays "<state>" as the delivery address state
And the dialog 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: New order dialog always uses the current/live custom data, not any snapshot

Scenario: DDND-003 New order dialog shows updated custom name after supplier edit
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 opens the new order dialog
And searches for "John" in the customer picker
Then the search results display "John's Place"
And the search results do not display "Johnny's Pizzeria"
catalogs.feature
# prefix: DDCA
Feature: Dual-data resolution in catalog pages
When managing catalogs and assigning customers, 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: Customer preview dialog displays resolved restaurant name and logo

Scenario Outline: DDCA-001 Customer preview dialog shows resolved restaurant information
Given a catalog exists for "Miguel Supplier Test"
And "<restaurant>" is assigned to the catalog
When the supplier opens the customer preview dialog for "<restaurant>"
Then the dialog displays "<displayed_name>" as the restaurant name
And the dialog displays the logo for "<displayed_name>"

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Customer assignment panel displays resolved restaurant name and logo

Scenario Outline: DDCA-002 Customer assignment panel shows resolved restaurant information
Given a catalog exists for "Miguel Supplier Test"
When the supplier views the customer assignment panel
Then the panel displays "<displayed_name>" as the restaurant name for "<restaurant>"
And the panel displays the logo for "<displayed_name>"

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Searching customers for catalog assignment matches against the supplier's custom name

Scenario Outline: DDCA-003 Supplier searches customers for catalog assignment
Given a catalog exists for "Miguel Supplier Test"
When the supplier searches for "<search_term>" in the customer assignment panel
Then the search results include "<displayed_name>"

Examples:
| restaurant | search_term | displayed_name |
| John Pizza III | Johnny | Johnny's Pizzeria |
| Pizza Palace | Pizza Pal | Pizza Palace |
chat.feature
# prefix: DDCH
Feature: Dual-data resolution in chat
When using the chat feature, 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: Chat displays resolved restaurant name, email, and logo

Scenario Outline: DDCH-001 Chat conversation header shows resolved restaurant information
Given a chat conversation exists between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the chat at "/chat"
Then the chat header displays "<name>" as the restaurant name
And the chat header displays "<email>" as the restaurant email
And the chat header displays the logo for "<name>"

Examples:
| restaurant | name | email |
| John Pizza III | Johnny's Pizzeria | eder.chamale+johnny.custom@gmail.com |
| Pizza Palace | Pizza Palace | eder.chamale+pizza.palace@gmail.com |

Scenario Outline: DDCH-002 Chat preview list shows resolved restaurant information
Given a chat conversation exists between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the chat at "/chat"
Then the conversation preview list displays "<name>" as the restaurant name
And the conversation preview list displays the logo for "<name>"

Examples:
| restaurant | name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
sales-report-and-accounting.feature
# prefix: DDSR
Feature: Dual-data resolution in sales report and bookkeeping pages
When viewing the sales report and bookkeeping pages, the supplier
application resolves restaurant information using the supplier's
custom records when available, falling back to the restaurant's own data.
Historical transactions retain the name from the time of recording.

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: Top Customers section displays resolved restaurant name

Scenario Outline: DDSR-001 Sales report Top Customers shows resolved restaurant name
Given orders exist between "Miguel Supplier Test" and "<restaurant>"
When the supplier views the sales report at "/sales-report"
Then the Top Customers section displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Historical transactions retain the restaurant name from time of recording

Scenario Outline: DDSR-002 Transactions recorded before custom records keep original name
Given a transaction was recorded between "Miguel Supplier Test" and "<restaurant>" before custom records were created
When the supplier views the bookkeeping page at "/bookkeeping"
Then the transaction displays "<original_name>" as the restaurant name

Examples:
| restaurant | original_name |
| John Pizza III | John Pizza III |
| Pizza Palace | Pizza Palace |

Rule: New transactions use current resolved restaurant name

Scenario Outline: DDSR-003 Transactions recorded after custom records use resolved name
Given a transaction is recorded between "Miguel Supplier Test" and "<restaurant>" after custom records exist
When the supplier views the bookkeeping page at "/bookkeeping"
Then the transaction displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
email-notifications.feature
# prefix: DDEM
Feature: Dual-data resolution in email notifications
When sending email notifications, the system always resolves restaurant information
using the supplier's custom records when available, falling back to the
restaurant's own data. This applies regardless of who the recipient is.

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: Emails to the supplier display the supplier's custom restaurant name when available

Scenario Outline: DDEM-001 Order Placed email to supplier shows restaurant name
Given "<restaurant>" places an order with "Miguel Supplier Test"
When the Order Placed email is sent to the supplier
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-002 Restaurant Signed Up email to supplier shows restaurant name
Given "<restaurant>" completes onboarding after being invited by "Miguel Supplier Test"
When the Restaurant Signed Up email is sent to the supplier
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-003 Supplier Payment Received email shows restaurant name
Given "Miguel Supplier Test" receives a payment from "<restaurant>"
When the Payment Received email is sent to the supplier
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-004 Supplier Refund Issued email shows restaurant name
Given "Miguel Supplier Test" issues a refund to "<restaurant>"
When the Refund Issued email is sent to the supplier
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Emails to the restaurant display the supplier's custom restaurant name when available

Scenario Outline: DDEM-005 Order Status Update email to restaurant shows supplier's custom name
Given "Miguel Supplier Test" updates the order status for "<restaurant>"
When the Order Status Update email is sent to the restaurant
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-006 Order Delivered email to restaurant shows supplier's custom name
Given "Miguel Supplier Test" marks an order as delivered for "<restaurant>"
When the Order Delivered email is sent to the restaurant
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-007 Overdue Invoice email to restaurant shows supplier's custom name
Given "<restaurant>" has an overdue invoice from "Miguel Supplier Test"
When the Overdue Invoice email is sent to the restaurant
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-008 Payment Receipt email to restaurant shows supplier's custom name
Given "<restaurant>" makes a payment on an order from "Miguel Supplier Test"
When the Payment Receipt email is sent to the restaurant
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-009 Refund Received email to restaurant shows supplier's custom name
Given "<restaurant>" receives a refund from "Miguel Supplier Test"
When the Refund Received email is sent to the restaurant
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Each email trigger attaches the invoice PDF with supplier's custom data when available

Scenario Outline: DDEM-010 Order Delivered email attaches the invoice PDF with supplier's custom data
Given "Miguel Supplier Test" marks an order as delivered for "<restaurant>"
When the Order Delivered email is sent to the restaurant
Then the attached invoice PDF displays "<displayed_name>" in the "Ship To" section

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-011 Overdue Invoice email attaches the invoice PDF with supplier's custom data
Given "<restaurant>" has an overdue invoice from "Miguel Supplier Test"
When the Overdue Invoice email is sent to the restaurant
Then the attached invoice PDF displays "<displayed_name>" in the "Ship To" section

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-012 Payment Receipt email attaches the invoice PDF with supplier's custom data
Given "<restaurant>" makes a payment on an order from "Miguel Supplier Test"
When the Payment Receipt email is sent to the supplier
Then the attached invoice PDF displays "<displayed_name>" in the "Ship To" section
When the Payment Receipt email is sent to the restaurant
Then the attached invoice PDF displays "<displayed_name>" in the "Ship To" section

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-013 Refund email attaches the invoice PDF with supplier's custom data
Given "<restaurant>" receives a refund from "Miguel Supplier Test"
When the Refund email is sent to the restaurant
Then the attached invoice PDF displays "<displayed_name>" in the "Ship To" section

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-014 Return Alert email attaches the supplier's invoice PDF
Given "<restaurant>" returns items on an order from "Miguel Supplier Test"
When the Return Alert email is sent to the supplier
Then the attached invoice PDF displays "<supplier_name>" in the "Ship To" section

Examples:
| restaurant | supplier_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Order-related email notifications use the snapshot custom data from order creation time

Scenario: DDEM-015 Order Placed email uses the snapshot name, not the current name
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "John Pizza III" places an order (order 1) with "Miguel Supplier Test"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the Order Placed email for order 1 is sent to the supplier
Then the email displays "Johnny's Pizzeria" as the restaurant name

Scenario: DDEM-016 Order Delivered email and attached invoice use the snapshot 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 "Miguel Supplier Test" marks order 1 as delivered
And the Order Delivered email is sent to the restaurant
Then the email displays "Johnny's Pizzeria" as the restaurant name
And the attached invoice PDF displays "Johnny's Pizzeria" in the "Ship To" section

Scenario: DDEM-017 Overdue Invoice email uses the snapshot name from 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" changes the custom name for "John Pizza III" to "John's Place"
And order 1 becomes overdue
When the Overdue Invoice email is sent to the restaurant
Then the email displays "Johnny's Pizzeria" as the restaurant name
And the attached invoice PDF displays "Johnny's Pizzeria" in the "Ship To" section

Scenario: DDEM-018 Payment Receipt email uses the snapshot name from the associated 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 "John Pizza III" makes a payment on order 1
When the Payment Receipt email is sent to the supplier
Then the email displays "Johnny's Pizzeria" as the restaurant name

Rule: Supplier edits to Business Identity do not trigger restaurant email notifications

Scenario Outline: DDEM-019 No email notification when supplier edits Business Identity
Given "Miguel Supplier Test" has a customer record for "<restaurant>"
When "Miguel Supplier Test" edits the Business Identity fields for "<restaurant>"
Then no email notification is sent to "<restaurant>"

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Rule: Invitation emails display the supplier's custom restaurant name

Scenario Outline: DDEM-020 New Restaurant Invitation email shows supplier's custom name
Given "Miguel Supplier Test" invites "<restaurant>" for the first time
When the New Restaurant Invitation email is sent
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDEM-021 Existing Restaurant Invitation email shows supplier's custom name
Given "Miguel Supplier Test" invites an existing restaurant "<restaurant>"
When the Existing Restaurant Invitation email is sent
Then the email displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
sms-notifications.feature
# prefix: DDSM
Feature: Dual-data resolution in SMS notifications
When sending SMS notifications, the system resolves business names
using the supplier's custom records when available, falling back
to the business's own data.

Background:
Given supplier "Miguel Supplier Test" has two restaurants:
| Restaurant | Has Custom Records | Supplier's Custom Name |
| John Pizza III | Yes | Johnny's Pizzeria |
| Pizza Palace | No | |
And "John Pizza III" has its own business name "John Pizza III"
And "Pizza Palace" has its own business name "Pizza Palace"

Rule: SMS to the restaurant display the supplier's own name

Scenario Outline: DDSM-001 Order Confirmed SMS to restaurant shows supplier's name
Given "Miguel Supplier Test" confirms an order for "<restaurant>"
When the Order Confirmed SMS is sent to the restaurant
Then the SMS displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDSM-002 Payment Receipt SMS to restaurant shows supplier's name
Given "<restaurant>" makes a payment on an order from "Miguel Supplier Test"
When the Payment Receipt SMS is sent to the restaurant
Then the SMS displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDSM-003 Refund SMS to restaurant shows supplier's name
Given "<restaurant>" receives a refund from "Miguel Supplier Test"
When the Refund SMS is sent to the restaurant
Then the SMS displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDSM-004 Overdue Invoice SMS to restaurant shows supplier's name
Given "<restaurant>" has an overdue invoice from "Miguel Supplier Test"
When the Overdue Invoice SMS is sent to the restaurant
Then the SMS displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Rule: SMS referencing the restaurant name use the supplier's custom name when available

Scenario Outline: DDSM-005 AI Voice Agent Order Placed SMS shows restaurant name
Given the AI voice agent places an order for "<restaurant>" with "Miguel Supplier Test"
When the AI Voice Agent Order Placed SMS is sent
Then the SMS displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: SMS referencing the restaurant name use the snapshot custom name from order creation time

Scenario: DDSM-006 AI Voice Agent Order Placed SMS uses the snapshot name
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And the AI voice agent places order 1 for "John Pizza III" with "Miguel Supplier Test"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the AI Voice Agent Order Placed SMS is sent for order 1
Then the SMS displays "Johnny's Pizzeria" as the restaurant name

Rule: Supplier edits to Business Identity do not trigger restaurant SMS notifications

Scenario Outline: DDSM-007 No SMS notification when supplier edits Business Identity
Given "Miguel Supplier Test" has a customer record for "<restaurant>"
When "Miguel Supplier Test" edits the Business Identity fields for "<restaurant>"
Then no SMS notification is sent to "<restaurant>"

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Rule: Invitation SMS display the supplier's custom restaurant name when available

Scenario Outline: DDSM-008 Restaurant Invitation SMS shows supplier's custom name
Given "Miguel Supplier Test" invites "<restaurant>"
When the Invitation SMS is sent to the restaurant
Then the SMS displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |
push-notifications.feature
# prefix: DDPN
Feature: Dual-data resolution in push notifications
When sending push notifications, the system resolves business names
using the supplier's custom records when available, falling back
to the business's own data.

Background:
Given supplier "Miguel Supplier Test" has two restaurants:
| Restaurant | Has Custom Records | Supplier's Custom Name |
| John Pizza III | Yes | Johnny's Pizzeria |
| Pizza Palace | No | |
And "John Pizza III" has its own business name "John Pizza III"
And "Pizza Palace" has its own business name "Pizza Palace"

Rule: Push notifications to the supplier display the supplier's custom restaurant name when available

Scenario Outline: DDPN-001 New Order push notification to supplier shows restaurant name
Given "<restaurant>" places an order with "Miguel Supplier Test"
When the New Order push notification is sent to the supplier
Then the notification displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Scenario Outline: DDPN-002 Payment Received push notification to supplier shows restaurant name
Given "Miguel Supplier Test" receives a payment from "<restaurant>"
When the Payment Received push notification is sent to the supplier
Then the notification displays "<displayed_name>" as the restaurant name

Examples:
| restaurant | displayed_name |
| John Pizza III | Johnny's Pizzeria |
| Pizza Palace | Pizza Palace |

Rule: Push notifications to the supplier use the snapshot custom name from order creation time

Scenario: DDPN-003 New Order push notification uses the snapshot name
Given "Miguel Supplier Test" has custom name "Johnny's Pizzeria" for "John Pizza III"
And "John Pizza III" places order 1 with "Miguel Supplier Test"
And "Miguel Supplier Test" changes the custom name for "John Pizza III" to "John's Place"
When the New Order push notification for order 1 is sent to "Miguel Supplier Test"
Then the notification displays "Johnny's Pizzeria" as the restaurant name

Rule: Supplier edits to Business Identity do not trigger restaurant push notifications

Scenario Outline: DDPN-004 No push notification when supplier edits Business Identity
Given "Miguel Supplier Test" has a customer record for "<restaurant>"
When "Miguel Supplier Test" edits the Business Identity fields for "<restaurant>"
Then no push notification is sent to "<restaurant>"

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Rule: Push notifications to the restaurant display the supplier's own name

Scenario Outline: DDPN-005 Order Confirmed push notification to restaurant shows supplier's name
Given "Miguel Supplier Test" confirms an order for "<restaurant>"
When the Order Confirmed push notification is sent to the restaurant
Then the notification displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDPN-006 Order Delivered push notification to restaurant shows supplier's name
Given "Miguel Supplier Test" marks an order as delivered for "<restaurant>"
When the Order Delivered push notification is sent to the restaurant
Then the notification displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDPN-007 Order Cancelled push notification to restaurant shows supplier's name
Given "Miguel Supplier Test" cancels an order for "<restaurant>"
When the Order Cancelled push notification is sent to the restaurant
Then the notification displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDPN-008 Dispatched push notification to restaurant shows supplier's name
Given "Miguel Supplier Test" marks an order as ready for delivery for "<restaurant>"
When the Dispatched push notification is sent to the restaurant
Then the notification displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDPN-009 Payment Receipt push notification to restaurant shows supplier's name
Given "<restaurant>" makes a payment on an order from "Miguel Supplier Test"
When the Payment Receipt push notification is sent to the restaurant
Then the notification displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |

Scenario Outline: DDPN-010 Refund push notification to restaurant shows supplier's name
Given "<restaurant>" receives a refund from "Miguel Supplier Test"
When the Refund push notification is sent to the restaurant
Then the notification displays "Miguel Supplier Test" as the supplier name

Examples:
| restaurant |
| John Pizza III |
| Pizza Palace |