# acc-tax-reighteen/spreadsheets-order-next architecture

> Architecture diagram of the GitHub repository acc-tax-reighteen/spreadsheets-order-next, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/acc-tax-reighteen/spreadsheets-order-next
- Repository: https://github.com/acc-tax-reighteen/spreadsheets-order-next

## Overview

This Google Apps Script web app collects sales orders: a salesperson opens the form, the server validates their Google-account email and loads reference data, and the browser submits the completed order for storage. The README also documents live customer search, multi-select, NOO entry, dynamic fields, and optional photo upload. Only the README was available as evidence, so relationships below reflect documented behavior; implementation details are not independently verified.

Main entry points: [`Index.html`](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html) (Order Form UI), [`Code.gs`](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Code.gs) (Initial Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_form["Order Form"]
  node_browser_form["Order Form UI<br/>[Index.html]"]
  node_customer_search["Customer Search<br/>[Index.html]"]
  node_multi_customer["Customer Selection<br/>[Index.html]"]
  node_noo_entry["New Outlet Entry<br/>[Index.html]"]
  node_dynamic_fields["Dynamic Fields<br/>[Index.html]"]
  node_photo_encode["Photo Encoding<br/>[Index.html]"]
end

subgraph group_server["Server Workflow"]
  node_initial_data["Initial Data<br/>[Code.gs]"]
  node_email_validation["Email Validation<br/>[Code.gs]"]
  node_order_submit["Order Submission<br/>[Code.gs]"]
end

subgraph group_services["Google Services"]
  node_sales_sheet[("Sales Spreadsheet")]
  node_customer_sheet[("Customer Spreadsheet")]
  node_category_city_sheets[("Category and City Sheets")]
  node_target_sheet[("Order Spreadsheet")]
  node_drive_folder[("Photo Drive Folder")]
end

node_salesperson(("Salesperson"))

node_salesperson -->|"opens"| node_browser_form
node_browser_form -->|"requests data"| node_initial_data
node_initial_data -->|"validates email"| node_email_validation
node_email_validation -->|"checks roster"| node_sales_sheet
node_initial_data -->|"reads customers"| node_customer_sheet
node_initial_data -->|"reads options"| node_category_city_sheets
node_initial_data -->|"returns form data"| node_browser_form
node_browser_form -->|"offers search"| node_customer_search
node_customer_search -->|"selects results"| node_multi_customer
node_multi_customer -->|"supports new outlet"| node_noo_entry
node_browser_form -->|"shows configured fields"| node_dynamic_fields
node_browser_form -->|"encodes optional photo"| node_photo_encode
node_browser_form -->|"submits order"| node_order_submit
node_order_submit -->|"uploads photo"| node_drive_folder
node_order_submit -->|"appends order"| node_target_sheet

click node_browser_form "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html"
click node_customer_search "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html"
click node_multi_customer "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html"
click node_noo_entry "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html"
click node_dynamic_fields "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html"
click node_photo_encode "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html"
click node_initial_data "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Code.gs"
click node_email_validation "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Code.gs"
click node_order_submit "https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Code.gs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browser_form,node_customer_search,node_multi_customer,node_noo_entry,node_dynamic_fields,node_photo_encode toneBlue
class node_initial_data,node_email_validation,node_order_submit toneAmber
class node_sales_sheet,node_customer_sheet,node_category_city_sheets,node_target_sheet,node_drive_folder toneMint
class node_salesperson toneIndigo
```

## Components

### Order Form

- [Order Form UI](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html): `Index.html`
- [Customer Search](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html): `Index.html`
- [Customer Selection](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html): `Index.html`
- [New Outlet Entry](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html): `Index.html`
- [Dynamic Fields](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html): `Index.html`
- [Photo Encoding](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Index.html): `Index.html`

### Server Workflow

- [Initial Data](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Code.gs): `Code.gs`
- [Email Validation](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Code.gs): `Code.gs`
- [Order Submission](https://github.com/acc-tax-reighteen/spreadsheets-order-next/blob/main/Code.gs): `Code.gs`

### Google Services

- **Sales Spreadsheet**
- **Customer Spreadsheet**
- **Category and City Sheets**
- **Order Spreadsheet**
- **Photo Drive Folder**

### Other components

- **Salesperson**

## Connections

- Salesperson → Order Form UI: opens (evidence: `README.md`)
- Order Form UI → Initial Data: requests data (evidence: `README.md`)
- Initial Data → Email Validation: validates email (evidence: `README.md`)
- Email Validation → Sales Spreadsheet: checks roster (evidence: `README.md`)
- Initial Data → Customer Spreadsheet: reads customers (evidence: `README.md`)
- Initial Data → Category and City Sheets: reads options (evidence: `README.md`)
- Initial Data → Order Form UI: returns form data (evidence: `README.md`)
- Order Form UI → Customer Search: offers search (evidence: `README.md`)
- Customer Search → Customer Selection: selects results (evidence: `README.md`)
- Customer Selection → New Outlet Entry: supports new outlet (evidence: `README.md`)
- Order Form UI → Dynamic Fields: shows configured fields (evidence: `README.md`)
- Order Form UI → Photo Encoding: encodes optional photo (evidence: `README.md`)
- Order Form UI → Order Submission: submits order (evidence: `README.md`)
- Order Submission → Photo Drive Folder: uploads photo (evidence: `README.md`)
- Order Submission → Order Spreadsheet: appends order (evidence: `README.md`)
