Skip to content

Redesign Sheets export to normalized row format#4

Merged
bradydibble merged 4 commits intomainfrom
claude/fix-sheets-export-error-PPxTw
Apr 7, 2026
Merged

Redesign Sheets export to normalized row format#4
bradydibble merged 4 commits intomainfrom
claude/fix-sheets-export-error-PPxTw

Conversation

@bradydibble
Copy link
Copy Markdown
Owner

Summary

  • Replaces the old "one row per calculation with staff as columns" format with a stable normalized schema
  • Each export writes one summary row + one staff row per employee — fixed 20-column schema that never changes regardless of staffing
  • Header row written only once when the sheet is empty; subsequent exports append data only

Schema

Date | Shift | Type | Calc ID |
Gross Tips | CC Fee Rate | CC Fees | Net Tips |
Kitchen % | Kitchen Pool | Liquor Sales | Bar Liquor % | Bar Pool | FOH Pool |
Name | Role | FOH Share | Bar Share | Kitchen Share | Total

Type is summary or staff. Calc ID ties rows together and traces back to the app DB — the future-proofing anchor if new fields are added later.

Test plan

  • Clear existing sheet rows, then export a calculation — confirm header + summary + staff rows appear
  • Export again — confirm no duplicate header, only new rows appended
  • Export a calculation with different staff than the first — confirm rows align correctly under the fixed headers

https://claude.ai/code/session_011LY1ZZDXKuvy13nZQpySZU

claude added 4 commits April 7, 2026 17:15
The Sheets API requires a full A1 notation range (e.g. 'Tip History'!A:A),
not just a quoted sheet name. Appending !A:A satisfies the parser for all
sheet names including those with spaces.

https://claude.ai/code/session_011LY1ZZDXKuvy13nZQpySZU
!A1 is the idiomatic anchor for values.append — it identifies the sheet
and starting cell without implying any column constraint.

https://claude.ai/code/session_011LY1ZZDXKuvy13nZQpySZU
Check if the sheet already has data before appending; include the
header row only when the sheet is empty. Subsequent exports append
the data row only.

https://claude.ai/code/session_011LY1ZZDXKuvy13nZQpySZU
Each export now writes one summary row + one row per staff member,
all sharing a fixed 20-column schema:
  Date, Shift, Type, Calc ID,
  Gross Tips, CC Fee Rate, CC Fees, Net Tips,
  Kitchen %, Kitchen Pool, Liquor Sales, Bar Liquor %, Bar Pool, FOH Pool,
  Name, Role, FOH Share, Bar Share, Kitchen Share, Total

Type column is 'summary' or 'staff'. Calc ID ties rows together and
traces back to the app DB. Header written once on empty sheet only.

https://claude.ai/code/session_011LY1ZZDXKuvy13nZQpySZU
@bradydibble bradydibble merged commit 08ba00a into main Apr 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants