Commit Graph

134 Commits

Author SHA1 Message Date
ea7f46ea8a fix(sales): fix parquet SQL generation and cleanup formatting
- Fix double ORDER BY in sales_orders raw-graphql-ids (was passing full
  ORDER BY clause from build-sort-clause into get-sales-orders which
  prepends its own ORDER BY, producing 'ORDER BY ORDER BY ... DESC DESC')
- Fix WHERE clause column names in parquet build-where-clause:
  external_id.client -> client-code, external_id.vendor -> vendor
- Fix parquet-query format string (%%s -> %s with proper format call)
- Fix ex-info call signature in flush! (was passing :error as third arg
  instead of inside the data map)
- Add S3 credentials to DuckDB connect! so httpfs can read from S3
- Fix parquet buffer indentation and alignment across square/core3,
  ezcater/core, ezcater_xls, payments, sales_summaries, migrations
- Fix broken Datomic query syntax in ezcater/core (upsert-used-subscriptions,
  upsert-recent find/where clauses mangled by paren-repair)
- Uncomment accidentally commented code block in square/core3
- Fix paren/indentation issues in ssr/payments, jobs/sales_summaries
2026-04-27 10:33:22 -07:00
26c9563a03 feat(sales): initial Parquet migration infrastructure
- Add DuckDB/S3 parquet storage layer (auto-ap.storage.parquet)
- Add sales_to_parquet migration script for historical data
- Add cleanup_sales for post-migration Datomic cleanup
- Add sales_orders_new.clj with DuckDB read layer for SSR views
- Add test scaffolding for parquet storage
- Add plan document for move-detailed-sales-to-parquet

feat(sales): redirect production and read flows to Parquet/DuckDB

- U3: Square production (upsert) now buffers to parquet via flatten-order-to-parquet!
- U3: EzCater core import-order now buffers to parquet instead of Datomic transact
- U3: EzCater XLS upload-xls now buffers to parquet instead of audit-transact
- U4: Rewrite sales_orders.clj to read from DuckDB via pq/get-sales-orders
- U5: Rewrite sales_summaries to use parquet aggregation functions
  - get-payment-items-parquet, get-discounts-parquet, get-refund-items-parquet
  - get-tax-parquet, get-tip-parquet, get-sales-parquet
- Add sum-* aggregation functions to storage/sales_summaries.clj
  - sum-discounts, sum-refunds-by-type, sum-taxes, sum-tips, sum-sales-by-category
2026-04-27 09:41:25 -07:00
01329bbdf5 Disallows chatgpt for emailed invoices. 2025-03-25 21:26:40 -07:00
cf8b5cd2fa square fixes 2025-02-25 23:30:18 -08:00
ca5d90b17f investigate progress. 2024-10-14 23:21:48 -07:00
41167a24a7 Updates allowed to change more than one entity at a time 2024-09-28 11:46:01 -07:00
4c14e43734 Greatly simplifies keeping bank accounts in check 2024-09-27 15:59:21 -07:00
065e56d621 adds extra logging, allows printing of checks even if solr has issues. 2024-09-15 21:42:33 -07:00
d9bd09a9cc Resets selected on page change, adds account number to drop downs and makes missing emails less noisy 2024-08-22 21:14:43 -07:00
2d6985f5ca adds extra sysco logging 2024-08-14 23:15:20 -07:00
daafe9eaa1 another fix 2024-05-18 10:41:57 -07:00
1e797592bf load historical sales fix 2024-05-18 10:10:36 -07:00
a7428a2d19 fixes sysco import 2024-05-15 21:30:30 -07:00
518bdb7945 fixing sysco rollout bug. 2024-05-07 20:27:51 -07:00
7d9fe59592 build error 2024-05-03 11:12:47 -07:00
d1a06f24f2 reverts behavior if the totals don't match. 2024-05-02 23:14:05 -07:00
52a23209d7 Sysco can now import for a line item 2024-05-02 23:08:18 -07:00
c50b706de9 Script for deleting vendors 2024-05-02 21:35:03 -07:00
002c3d8688 Adds refresh button 2024-05-01 16:02:15 -07:00
e6a8f7dc78 other tweaks 2024-05-01 12:39:48 -07:00
f9900f5f71 changes 2024-05-01 08:29:05 -07:00
e3b17e50e2 Sales nearly ready 2024-04-30 22:38:21 -07:00
f6dba46835 home stretch 2024-04-29 23:05:33 -07:00
f25ddc2ee4 Sales summaries in slightly more detail 2024-04-29 22:44:09 -07:00
04ad2c9b68 minor tweak 2024-04-24 17:06:59 -07:00
7154d0ff21 Creates daily sales summaries 2024-04-24 16:15:30 -07:00
22e92c819b Adds new expense report, with ability to break down by vendor 2024-04-19 21:48:28 -07:00
58217158e3 Adds unknown processor to payments 2024-04-18 12:37:11 -07:00
Bryce
38030637ba should prevent bad error message from uploaded invoices. 2024-04-14 22:35:39 -07:00
72a17486cd Fixes bug with client page 2024-04-01 19:46:37 -07:00
3957286624 Adds gift cards to sales summaries 2024-04-01 16:06:34 -07:00
4c52dbc4d6 minor tweaks 2024-03-31 22:06:18 -07:00
ded5371e77 Makes simple sales summaries 2024-03-31 21:47:40 -07:00
d1a660c5c1 Adds rudimentary version of summarizing sales 2024-03-31 00:22:53 -07:00
a5e6b0549d Should make reloading AND aot work again 2024-02-08 15:20:58 -08:00
8c61d6571a Should fix builds 2024-02-07 22:28:22 -08:00
8063a8fcbd Builds client SSR approach, sunsets old cljs. 2024-02-07 21:22:56 -08:00
3211635dce removing old square 2023-11-01 10:02:57 -07:00
930b900849 Makes logging unified 2023-10-30 12:35:18 -07:00
Bryce
0f74b71cd1 minor error 2023-10-27 20:44:10 -07:00
Bryce
6c3017d1eb include more details when error happens importing 2023-10-27 20:37:42 -07:00
6059e8a4ca fixes historical load 2023-10-18 23:49:04 -07:00
2454695124 fixes glimpse 2023-09-14 12:59:32 -07:00
0d209829e8 reduces the number of duplicates that we try to import. 2023-09-08 07:15:28 -07:00
Bryce
9c472dfc8e productionizing a bit. 2023-08-24 22:31:21 -07:00
Bryce
ecc31f3680 Makes insights actually work 2023-08-19 21:13:49 -07:00
Bryce
e38636a739 oopsies 2023-08-19 14:14:40 -07:00
Bryce
486c428917 Pregenerates recommendatios 2023-08-19 13:52:44 -07:00
Bryce
0fad7cc66f makes ntg general produce logs better. 2023-08-07 12:12:17 -07:00
Bryce
b345051a83 makes ignoring of blank client names. 2023-08-03 10:58:26 -07:00