Commit Graph

55 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
6e3a024f66 adds stuff for dough burger 2026-03-30 22:36:12 -07:00
53625e4583 Makes invoices use the closed_at date. 2026-02-21 22:53:05 -08:00
45012e85cc fixes bugs. 2025-09-23 22:53:29 -07:00
3647934be6 temporarily loading 30 days of data 2025-09-16 09:15:19 -07:00
495d290a46 look for any order that's updated in the time range. 2025-04-10 21:46:35 -07:00
70d03904f7 fi x 2025-02-25 23:45:51 -08:00
d90f44c6c8 fi x 2025-02-25 23:41:25 -08:00
cf8b5cd2fa square fixes 2025-02-25 23:30:18 -08:00
0bb6ed2c6d Fixes rate limiting, adds more logs 2024-07-03 08:54:58 -07:00
bd3432f540 makes signature show up and adds logging for why invoice might be imported wrong. 2024-05-30 20:36:03 -07:00
af8e55803d merged. 2024-05-26 20:22:13 -07:00
002c3d8688 Adds refresh button 2024-05-01 16:02:15 -07:00
7154d0ff21 Creates daily sales summaries 2024-04-24 16:15:30 -07:00
53b7da9512 Imports custom amounts 2024-04-24 11:59:36 -07:00
22e92c819b Adds new expense report, with ability to break down by vendor 2024-04-19 21:48:28 -07:00
76c0ccb4a7 Starts deleting voided orders after they've been imported 2024-04-18 00:33:54 -07:00
263e432a6b working on import page 2024-04-17 22:13:28 -07:00
a9fdf9c340 prepares for fixing square issue 2024-04-15 20:10:59 -07:00
72a17486cd Fixes bug with client page 2024-04-01 19:46:37 -07:00
d1a660c5c1 Adds rudimentary version of summarizing sales 2024-03-31 00:22:53 -07:00
ae5d2a1b32 Updates to squares preferred limit of 1000 2024-03-11 08:21:07 -07:00
3211635dce removing old square 2023-11-01 10:02:57 -07:00
a8cce0377d lots of progress 2023-10-24 11:52:55 -07:00
f8b76b6c2c a variety of bug fixes. 2023-09-29 09:05:17 -07:00
c48f77811f makes logs a little less noisy. 2023-09-12 18:46:10 -07:00
Bryce
d488acc7d1 Fixes issues with limited pagination on payouts 2023-08-07 12:01:07 -07:00
Bryce
a2320cec80 should handle case of no payouts. 2023-07-26 11:39:19 -07:00
Bryce
90014fbfcd replaces settlement loading with payout loading. 2023-07-25 22:02:36 -07:00
Bryce
42ae36d487 disables square import of settlements, because it is currently broken. 2023-07-25 09:27:21 -07:00
Bryce
9366347245 fixes load from historical sales. 2023-05-23 16:36:07 -07:00
Bryce
8cb8a92a2f Does not use timeouts for background processing 2023-05-23 12:40:33 -07:00
4d6211cacb merged. 2023-05-08 20:56:02 -07:00
13b9bec09f fixing minor bugs in general produce import 2023-05-08 20:55:06 -07:00
eacd6b4537 minor tweaks. 2023-05-05 08:25:16 -07:00
71243808d8 minor fix for datomic cloud 2023-05-04 23:09:40 -07:00
f3175004c6 merged 2023-05-04 22:57:01 -07:00
8f14eaa1bf Cash drawer setup 2023-05-04 22:50:41 -07:00
b2ad7790cf Migrates back to datomic on-prem 2023-04-29 07:12:51 -07:00
78519663ac Getting closer to datomic cloud 2023-03-24 10:57:50 -07:00
0ff147a7a0 Should give a bit more clarity if refunds don't load 2023-03-03 10:03:16 -08:00
5c26447d4c Fixes best sales date detection as well 2023-01-21 22:55:26 -08:00
f5ef0e9b64 Really fixes issue with square and deleted categories. 2023-01-21 22:18:45 -08:00
360ed5fc4e removes retry-4 which may obfuscate the error we're encountering 2023-01-21 21:30:36 -08:00
221adb24f8 Set up some debugging features for square jobs. 2023-01-21 21:18:18 -08:00
447ee308b1 Cleaning up core3 file. 2023-01-20 09:31:37 -08:00
d660b3d800 Makes square more resilent when catalog changes 2023-01-20 08:42:33 -08:00
d2189ba460 integrates new page into company section 2023-01-14 13:52:09 -08:00
6077c3119e Progress on the new vendor form 2023-01-13 22:00:52 -08:00