Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
d934e2d
Add ambassador shipping rate estimation endpoint
jeninh Feb 25, 2026
4ecb222
Add warehouse inventory management page and schema
jeninh Feb 25, 2026
ad4a410
feat: add staging mode to bypass OAuth for local/staging testing
jeninh Feb 25, 2026
b8a4daf
Add drizzle-kit push to container startup for auto-migrations
jeninh Feb 26, 2026
5467636
Install drizzle-kit in production image for runtime schema push
jeninh Feb 27, 2026
718b9ac
feat: add warehouse item photo uploads via Hack Club CDN
jeninh Feb 27, 2026
765bc55
Add edit item feature to warehouse
jeninh Feb 27, 2026
f6266c9
Rename Sizing to Options with dynamic add/remove inputs
jeninh Mar 2, 2026
ccafd91
Add required dimensions (length, width, height) fields to warehouse i…
jeninh Mar 2, 2026
2e7441a
Add image remove button with undo in edit item form
jeninh Mar 2, 2026
9360d21
Add warehouse categories with CRUD and item grouping by category
jeninh Mar 2, 2026
2fb3032
Add Vitest testing framework, 67 unit/integration tests, and GitHub A…
jeninh Mar 2, 2026
543b307
Add warehouse route changes and sub-pages
jeninh Mar 2, 2026
2be2858
Add category rename, reorder, and editCategory server action
jeninh Mar 2, 2026
187ade9
Remove 'steal their prizes' text from hero description
jeninh Mar 2, 2026
43f9f4f
Add flat package type for warehouse items and orders page with shippi…
jeninh Mar 2, 2026
a893d9f
Increase BODY_SIZE_LIMIT to 10M for image uploads
jeninh Mar 3, 2026
f303256
Move .github/workflows to repo root and set working-directory
jeninh Mar 3, 2026
9a930a8
feat: show who ordered on warehouse orders, add tags for filtering
jeninh Mar 3, 2026
2c9ce9a
Snap flat estimation to 4x6 or 6x9 envelopes, treat larger flats as b…
jeninh Mar 3, 2026
b6f6c75
ci: add typecheck, security audit, and dependabot config
jeninh Mar 3, 2026
5194b9c
Split warehouse into read-only view and admin-only warehouse-backend
jeninh Mar 3, 2026
b49601e
Add warehouse backend button to /app dashboard for admins
jeninh Mar 3, 2026
e70d786
Move all tabs to warehouse, strip warehouse-backend to admin placeholder
jeninh Mar 3, 2026
ffbb4d6
Add warehouse backend admin tools for managing categories and items
jeninh Mar 3, 2026
b56a705
Fix table layout - remove flex from table cells
jeninh Mar 3, 2026
ac8dd2e
Add order placement page for ambassadors
jeninh Mar 3, 2026
07fdfc2
feat(warehouse): add search-to-add items and shipping cost estimation
jeninh Mar 4, 2026
63a8964
feat(warehouse): replace country text input with dropdown
jeninh Mar 4, 2026
fac18ba
feat(warehouse): auto-estimate shipping on item add/remove/qty change
jeninh Mar 4, 2026
b9e7210
feat(warehouse): multi-step order wizard with shipping rate selection…
jeninh Mar 4, 2026
e3d04f2
feat(warehouse): make postal code required in order wizard
jeninh Mar 4, 2026
706367d
feat(warehouse): rename Place Order to Send to Warehouse
jeninh Mar 4, 2026
f6c8124
feat(warehouse): tag input with chips, Enter to add, autocomplete fro…
jeninh Mar 4, 2026
b1d65d5
feat(warehouse): add order templates, batches (CSV upload + field map…
jeninh Mar 4, 2026
2e0029b
feat(warehouse): add red asterisks to required fields in new order form
jeninh Mar 4, 2026
6f0b859
feat(warehouse): link batch CSV template to Google Sheets (Resolution…
jeninh Mar 4, 2026
5ab0e1a
feat(warehouse): scope orders and batches to the logged-in user
jeninh Mar 4, 2026
9b592a9
fix(warehouse): reorder batch field mapping so Address Line 2 appears…
jeninh Mar 4, 2026
8a49ff0
feat(warehouse): step-by-step batch flow (create → auto-map fields → …
jeninh Mar 4, 2026
dab9513
feat: replace PlatformBackground with Hack Club Phantom Sans font and…
jeninh Mar 4, 2026
39baaf1
fix: remove extra closing div in admin page causing build failure
jeninh Mar 4, 2026
0489555
fix: add postalCode to test fixture and install @vitest/coverage-v8
jeninh Mar 4, 2026
0ea3388
ci: trigger CI on warehouse-dev branch pushes
jeninh Mar 4, 2026
1f092a9
fix: resolve npm audit vulnerabilities (rollup, svelte, devalue, lodash)
jeninh Mar 4, 2026
79cb532
Subtract item quantity from warehouse inventory when orders are placed
jeninh Mar 6, 2026
d165d83
Add batch cost calculation with cheapest shipping and inventory alerts
jeninh Mar 6, 2026
a42fa4a
Add shipping cost estimate disclaimer to orders and batch pages
jeninh Mar 6, 2026
9787196
Add fulfillment tab with auto-incrementing order IDs
jeninh Mar 10, 2026
38d8282
Add fulfillment tab to warehouse backend
jeninh Mar 12, 2026
c9aa778
Fix fulfillment page: await parent layout data
jeninh Mar 12, 2026
d3cef6c
Pin drizzle-kit version in Dockerfile, add stderr to push output
jeninh Mar 12, 2026
be3dda4
Add debug logging to entrypoint for drizzle-kit push
jeninh Mar 12, 2026
4f1d0cc
Fix drizzle-kit push: pipe stdin to avoid interactive prompt blocking…
jeninh Mar 12, 2026
4e9c7e9
fix: correct migration journal tag to match actual filename
jeninh Mar 22, 2026
2618c02
Set new warehouse orders to APPROVED status instead of DRAFT
jeninh Mar 22, 2026
00cefa3
Save selected shipping rate and service name when creating orders
jeninh Mar 22, 2026
a43dc36
Add fulfillment label generation with Canada Post, Theseus lettermail…
jeninh Mar 22, 2026
41d0eb7
Mark Theseus letters as printed, remove company from CP sender
jeninh Mar 22, 2026
a7582ed
Add sender address line 2 and restore required company field for Cana…
jeninh Mar 22, 2026
22285f4
Make QZ Tray certificate optional for demo mode
jeninh Mar 22, 2026
659956a
Combine print label and packing slip into single Print button
jeninh Mar 22, 2026
f553cf8
Handle escaped newlines in QZ certificate and private key env vars
jeninh Mar 22, 2026
8c34a2b
Add settlement-info to Canada Post shipment XML, support CreditCard p…
jeninh Mar 22, 2026
499fc56
Fetch Theseus label PDF and convert to base64 for qz-tray printing
jeninh Mar 22, 2026
bc24e25
Add reprint button for orders with existing labels, remove label-alre…
jeninh Mar 22, 2026
3a8c15e
Handle both data URLs and remote URLs in printAll for label printing
jeninh Mar 22, 2026
b0ca5a6
Fix CORS: always proxy label fetch through server, never fetch remote…
jeninh Mar 22, 2026
af2a655
Add reprint path: re-fetch existing label as base64 instead of creati…
jeninh Mar 22, 2026
d024019
Add logging and proper error handling for label re-fetch to debug 502
jeninh Mar 22, 2026
ca8691d
Fix stack overflow: use loop-based arrayBufferToBase64 instead of spr…
jeninh Mar 22, 2026
c94665d
Include packing slip in reprint response, extract buildPackingSlipBas…
jeninh Mar 22, 2026
63e6c95
fix: rename method-of-payment to intended-method-of-payment in Canada…
jeninh Mar 22, 2026
c41519e
fix: add non-delivery handling (RASE) for intl shipments, require pho…
jeninh Mar 22, 2026
f723ec6
fix: remove invalid non-delivery and RASE option from Canada Post cus…
jeninh Mar 22, 2026
ed6511b
refactor: consolidate Canada Post integration into shared module
jeninh Mar 22, 2026
8bea788
fix: guard against empty sku-list in customs XML, add default to hsCo…
jeninh Mar 22, 2026
759a9f9
fix: add non-delivery, fallback customs item, and required phone for …
jeninh Mar 22, 2026
13ea14b
fix: add retry with backoff for Canada Post 500 errors
jeninh Mar 23, 2026
4a1e2e8
fix: remove non-delivery from customs XML
jeninh Mar 23, 2026
0630cc6
fix: move non-delivery RASE to options block for US/intl shipments
jeninh Mar 23, 2026
8234a40
debug: log shipment XML to diagnose non-delivery handling error
jeninh Mar 23, 2026
c0deb14
fix: use ABAN non-delivery for small packet services, RASE for others
jeninh Mar 23, 2026
2c835a1
fix: try RTS non-delivery option for US shipments
jeninh Mar 23, 2026
1330fc7
feat: add download buttons for label PDF and packing slip
jeninh Mar 23, 2026
815bd54
feat: add Zonos integration for US-bound Canada Post shipments
jeninh Mar 23, 2026
0278e6a
fix: resolve country names to ISO codes for Canada Post API
jeninh Mar 23, 2026
991eb34
fix: set batch orders to APPROVED so they appear in fulfillment
jeninh Mar 23, 2026
bee633b
fix: use non-contract shipment endpoint when CP_CONTRACT_ID is not set
jeninh Mar 23, 2026
68adf69
fix: use non-contract shipment XML schema (ncshipment-v4) when no con…
jeninh Mar 23, 2026
54b7f2b
fix: omit country-code from sender address for non-contract shipments
jeninh Mar 23, 2026
49d2116
fix: omit print-preferences for non-contract shipments
jeninh Mar 23, 2026
8762e2e
debug: log service code and country when creating shipment
jeninh Mar 23, 2026
2b1b7ac
fix: use country-appropriate service code fallback when estimatedServ…
jeninh Mar 23, 2026
12ca422
fix: use RASE non-delivery option for non-contract international ship…
jeninh Mar 23, 2026
62ee884
fix: use ABAN non-delivery option for non-contract shipments
jeninh Mar 23, 2026
e98cdc4
fix: skip options element for non-contract shipments
jeninh Mar 23, 2026
453f61c
fix: restore ABAN non-delivery handling option for non-contract intl …
jeninh Mar 23, 2026
29cd831
debug: try RASE option and log full shipment XML
jeninh Mar 23, 2026
f535ba1
debug: try RTS option code for non-delivery handling
jeninh Mar 23, 2026
c1f2f7b
debug: remove options block for non-contract to test if small packet …
jeninh Mar 24, 2026
4bc4925
revert: restore RTS options block for non-contract intl shipments
jeninh Mar 24, 2026
5137b3f
fix: use Tracked Packet instead of Small Packet for non-contract ship…
jeninh Mar 24, 2026
27eb90c
feat: crop non-contract 8.5x11 labels to 4x6 using pdf-lib
jeninh Mar 24, 2026
46289c1
fix: crop full right half of 8.5x11 label (label spans full height)
jeninh Mar 24, 2026
a128a02
fix: crop label to 4x6 centered on actual label content in right half
jeninh Mar 24, 2026
d6be639
fix: crop right half dynamically using actual PDF page dimensions
jeninh Mar 24, 2026
409b580
fix: trim top/bottom whitespace from cropped label
jeninh Mar 24, 2026
16f696b
fix: tighten label crop to 0.9in from top, 7.1in content height
jeninh Mar 24, 2026
7c57970
fix: modify source PDF page boxes directly instead of copying to new doc
jeninh Mar 24, 2026
fcfc1c2
fix: correct label crop coordinates for landscape PDF, output exactly…
jeninh Mar 24, 2026
33c8f01
Add Chit Chats as third shipping option alongside Theseus and Canada …
jeninh Mar 24, 2026
4cada62
Fix Chit Chats API: send body fields at top level, not wrapped in shi…
jeninh Mar 24, 2026
f9d0130
Fix Chit Chats: add required line_items to rate fetch request
jeninh Mar 24, 2026
c3e937b
Fix Chit Chats: add required hs_tariff_code for CA origin line items
jeninh Mar 24, 2026
8b87354
Add required manufacturer details and weight to Chit Chats line_items…
jeninh Mar 24, 2026
b0cf8b9
Fix Chit Chats: use valid 10-digit HTS codes, strip dots and pad item…
jeninh Mar 24, 2026
2692a59
Fix Chit Chats: use 9505100000 as fallback HTS code (your actual item…
jeninh Mar 24, 2026
89e7623
Use Chit Chats example HTS code 7117199000 as fallback for rate quotes
jeninh Mar 24, 2026
f2c5b61
Remove carrier dropdown from fulfillment panel; use customer-selected…
jeninh Mar 24, 2026
b0948ce
fix: add U.S./international fallback patterns to getServiceCode
jeninh Mar 24, 2026
0cbc817
Use customer-selected shipping carrier (Chit Chats/lettermail/Canada …
jeninh Mar 24, 2026
8f3be64
Switch Chit Chats labels from PDF (8.5x11) to PNG (4x6)
jeninh Mar 24, 2026
6a03f38
Prevent warehouse inventory from going negative
jeninh Mar 24, 2026
e7d69b4
Add HCB billing for warehouse orders
jeninh Mar 24, 2026
2eb4f9f
Add removeAdmin script for toggling admin status via CLI
jeninh Mar 24, 2026
6d9e4bd
Add Chit Chats rates to fetchCheapestRate batch shipping selection
jeninh Mar 24, 2026
6c3a7a0
Fix HS tariff code format and pass province to Chit Chats rates
jeninh Mar 24, 2026
fbf157b
Fix HS tariff code format: Canada Post requires ####.##.##.## with dots
jeninh Mar 24, 2026
708a2be
Truncate Canada Post XML fields to API max lengths
jeninh Mar 24, 2026
52c89f4
Pass email and phone to Chit Chats shipment (required for some countr…
jeninh Mar 24, 2026
6ab0c5e
Fall back to INT.XP when INT.TP is unavailable for a country (and vic…
jeninh Mar 24, 2026
360d3f9
Resolve full state/province names to 2-letter codes for Canada Post
jeninh Mar 24, 2026
51692a8
Fix state code resolution at shipment time + fix INT.XP fallback
jeninh Mar 24, 2026
5913749
Auto-fallback to Chit Chats when Canada Post fails for international …
jeninh Mar 24, 2026
12d347d
Fix international shipping fallbacks for unsupported destinations
jeninh Mar 25, 2026
004a52b
Warehouse: admin-only fulfillment, show all orders for admins, sort s…
jeninh Mar 25, 2026
4ee5f2a
fix: resolve npm audit vulnerabilities (devalue, undici, dompurify)
jeninh Mar 25, 2026
9f3cf8e
Merge branch 'main' into warehouse-dev
jeninh Mar 25, 2026
0afd0de
fix: add auth to QZ endpoints and authorization to fulfillment
jeninh Mar 25, 2026
079abc6
Add non-delivery-handling to customs XML for INT.IP services
jeninh Mar 27, 2026
93362e1
Revert "Add non-delivery-handling to customs XML for INT.IP services"
jeninh Mar 29, 2026
594b41e
fix: display server-side form errors on warehouse order creation page
jeninh Mar 29, 2026
b0cd3aa
fix: IDOR on get-label — verify ambassador owns the order
jeninh Apr 1, 2026
bfa769c
fix: IDOR on batch actions — verify batch ownership before mapFields,…
jeninh Apr 1, 2026
684a14b
fix: race condition on inventory — use atomic WHERE guard on stock de…
jeninh Apr 1, 2026
8d60366
fix: add auth + admin check to all warehouse-backend form actions
jeninh Apr 1, 2026
f920794
fix: remove removeAdmin.mjs — privilege escalation risk if run agains…
jeninh Apr 1, 2026
b4219ec
fix: remove DATABASE_URL presence disclosure from entrypoint logs
jeninh Apr 1, 2026
c753180
fix: remove --force from drizzle-kit push to prevent silent destructi…
jeninh Apr 1, 2026
22ee85d
fix: remove committed coverage files and add coverage/ to .gitignore
jeninh Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: [main]
branches: [main, warehouse-dev]
pull_request:

defaults:
Expand Down
Empty file added dev-stderr.log
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we not put this in prod please

Empty file.
Empty file added dev-stdout.log
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this one, can we also not put this in prod

Empty file.
23 changes: 23 additions & 0 deletions resolution-frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@ AIRTABLE_BASE_ID=your_base_id
AIRTABLE_TABLE_ID=your_table_id
AIRTABLE_YSWS_TABLE_ID=your_ysws_project_submission_table_id

# Canada Post API (for shipping rate estimates)
CP_API_USERNAME=your_cp_api_username
CP_API_PASSWORD=your_cp_api_password
CP_CUSTOMER_NUMBER=your_cp_customer_number
CP_CONTRACT_ID= # optional
CP_ORIGIN_POSTAL_CODE=A1A1A1
CP_ENVIRONMENT=development # or "production"
ZONOS_ACCOUNT_KEY= # Zonos Verified Account key for US duty prepayment
ZONOS_CREDENTIAL_TOKEN= # Zonos API credential token for landed cost calculations

# Chit Chats API (alternative shipping provider)
CHITCHATS_CLIENT_ID=your_chitchats_client_id
CHITCHATS_ACCESS_TOKEN=your_chitchats_access_token

# Hack Club CDN (for warehouse image uploads)
HACK_CLUB_CDN_API_KEY=sk_cdn_your_key_here

# HCB OAuth (for warehouse order billing — auto-refreshes every 30 min)
HCB_CLIENT_ID=your_hcb_oauth_client_id
HCB_CLIENT_SECRET=your_hcb_oauth_client_secret
HCB_ACCESS_TOKEN=your_hcb_access_token
HCB_REFRESH_TOKEN=your_hcb_refresh_token

# Season Configuration
# Only SEASON_STARTS is required - everything else is auto-calculated
SEASON_STARTS="2026-01-01"
Expand Down
4 changes: 4 additions & 0 deletions resolution-frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ vite.config.ts.timestamp-*

/docs

# Coverage
/coverage

# Prisma
*.db
*.db-journal

18 changes: 16 additions & 2 deletions resolution-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,25 @@ COPY --from=builder /app/tsconfig.json ./tsconfig.json
# Install drizzle-kit locally so we don't rely on npx fetching it at runtime
RUN npm install --no-save drizzle-kit

# Copy drizzle files needed for push
COPY --from=builder /app/drizzle ./drizzle
COPY --from=builder /app/drizzle.config.ts ./drizzle.config.ts
COPY --from=builder /app/src/lib/server/db/schema.ts ./src/lib/server/db/schema.ts

# Install drizzle-kit for runtime schema push (pruned as devDependency)
RUN npm install drizzle-kit@0.31.8

# Copy entrypoint script
COPY entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh

# Expose the port the app runs on (SvelteKit node adapter starts on 3000 by default)
EXPOSE 3000

# Set Node environment to production
ENV NODE_ENV=production
# Increase body size limit for image uploads (default 512K is too small)
ENV BODY_SIZE_LIMIT=10M

# Push DB schema and start the application
CMD ["sh", "-c", "npx drizzle-kit push && node build"]
# Start the application with migrations
CMD ["./entrypoint.sh"]
43 changes: 43 additions & 0 deletions resolution-frontend/drizzle/0002_add_package_type_and_orders.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
ALTER TABLE "warehouse_item" ADD COLUMN "package_type" text DEFAULT 'box' NOT NULL;
--> statement-breakpoint
CREATE TYPE "warehouse_order_status" AS ENUM ('DRAFT', 'ESTIMATED', 'APPROVED', 'SHIPPED', 'CANCELED');
--> statement-breakpoint
CREATE TABLE "warehouse_order" (
"id" text PRIMARY KEY NOT NULL,
"created_by_id" text NOT NULL,
"status" "warehouse_order_status" DEFAULT 'DRAFT' NOT NULL,
"first_name" text NOT NULL,
"last_name" text NOT NULL,
"email" text NOT NULL,
"phone" text,
"address_line_1" text NOT NULL,
"address_line_2" text,
"city" text NOT NULL,
"state_province" text NOT NULL,
"postal_code" text,
"country" text NOT NULL,
"estimated_shipping_cents" integer,
"estimated_service_name" text,
"estimated_package_type" text,
"estimated_total_length_in" real,
"estimated_total_width_in" real,
"estimated_total_height_in" real,
"estimated_total_weight_grams" real,
"notes" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "warehouse_order_item" (
"id" text PRIMARY KEY NOT NULL,
"order_id" text NOT NULL,
"warehouse_item_id" text NOT NULL,
"quantity" integer DEFAULT 1 NOT NULL,
"sizing_choice" text
);
--> statement-breakpoint
ALTER TABLE "warehouse_order" ADD CONSTRAINT "warehouse_order_created_by_id_user_id_fk" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
ALTER TABLE "warehouse_order_item" ADD CONSTRAINT "warehouse_order_item_order_id_warehouse_order_id_fk" FOREIGN KEY ("order_id") REFERENCES "public"."warehouse_order"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
ALTER TABLE "warehouse_order_item" ADD CONSTRAINT "warehouse_order_item_warehouse_item_id_warehouse_item_id_fk" FOREIGN KEY ("warehouse_item_id") REFERENCES "public"."warehouse_item"("id") ON DELETE restrict ON UPDATE no action;
55 changes: 55 additions & 0 deletions resolution-frontend/drizzle/0003_add_templates_and_batches.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
-- Order Templates
CREATE TABLE "warehouse_order_template" (
"id" text PRIMARY KEY NOT NULL,
"created_by_id" text NOT NULL,
"name" text NOT NULL,
"is_public" boolean DEFAULT false NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "warehouse_order_template_item" (
"id" text PRIMARY KEY NOT NULL,
"template_id" text NOT NULL,
"warehouse_item_id" text NOT NULL,
"quantity" integer DEFAULT 1 NOT NULL
);
--> statement-breakpoint
ALTER TABLE "warehouse_order_template" ADD CONSTRAINT "warehouse_order_template_created_by_id_user_id_fk" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
ALTER TABLE "warehouse_order_template_item" ADD CONSTRAINT "warehouse_order_template_item_template_id_warehouse_order_template_id_fk" FOREIGN KEY ("template_id") REFERENCES "public"."warehouse_order_template"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
ALTER TABLE "warehouse_order_template_item" ADD CONSTRAINT "warehouse_order_template_item_warehouse_item_id_warehouse_item_id_fk" FOREIGN KEY ("warehouse_item_id") REFERENCES "public"."warehouse_item"("id") ON DELETE restrict ON UPDATE no action;
--> statement-breakpoint
-- Batches
CREATE TYPE "warehouse_batch_status" AS ENUM ('AWAITING_MAPPING', 'MAPPED', 'PROCESSED');
--> statement-breakpoint
CREATE TABLE "warehouse_batch" (
"id" text PRIMARY KEY NOT NULL,
"created_by_id" text NOT NULL,
"template_id" text NOT NULL,
"title" text,
"status" "warehouse_batch_status" DEFAULT 'AWAITING_MAPPING' NOT NULL,
"csv_data" text NOT NULL,
"field_mapping" text,
"address_count" integer DEFAULT 0 NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "warehouse_batch_tag" (
"id" text PRIMARY KEY NOT NULL,
"batch_id" text NOT NULL,
"tag" text NOT NULL
);
--> statement-breakpoint
ALTER TABLE "warehouse_batch" ADD CONSTRAINT "warehouse_batch_created_by_id_user_id_fk" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
ALTER TABLE "warehouse_batch" ADD CONSTRAINT "warehouse_batch_template_id_warehouse_order_template_id_fk" FOREIGN KEY ("template_id") REFERENCES "public"."warehouse_order_template"("id") ON DELETE restrict ON UPDATE no action;
--> statement-breakpoint
ALTER TABLE "warehouse_batch_tag" ADD CONSTRAINT "warehouse_batch_tag_batch_id_warehouse_batch_id_fk" FOREIGN KEY ("batch_id") REFERENCES "public"."warehouse_batch"("id") ON DELETE cascade ON UPDATE no action;
--> statement-breakpoint
CREATE UNIQUE INDEX "warehouse_batch_tag_unique_idx" ON "warehouse_batch_tag" USING btree ("batch_id","tag");
--> statement-breakpoint
-- Add batch_id to warehouse_order
ALTER TABLE "warehouse_order" ADD COLUMN "batch_id" text;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "warehouse_order" ADD COLUMN "tracking_number" text;
ALTER TABLE "warehouse_order" ADD COLUMN "label_url" text;
ALTER TABLE "warehouse_order" ADD COLUMN "shipping_method" text;
1 change: 1 addition & 0 deletions resolution-frontend/drizzle/0005_add_hs_code.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "warehouse_item" ADD COLUMN "hs_code" text NOT NULL DEFAULT '';
87 changes: 86 additions & 1 deletion resolution-frontend/drizzle/meta/0002_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "35dc54d2-783c-4816-8106-c7e56ffd8939",
"id": "0fa6b235-2de1-4477-8997-b6da9895316e",
"prevId": "becd34cd-7692-4ef3-a912-458e58e190ad",
"version": "7",
"dialect": "postgresql",
Expand Down Expand Up @@ -1058,6 +1058,90 @@
"checkConstraints": {},
"isRLSEnabled": false
},
"public.warehouse_item": {
"name": "warehouse_item",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"sku": {
"name": "sku",
"type": "text",
"primaryKey": false,
"notNull": true
},
"sizing": {
"name": "sizing",
"type": "text",
"primaryKey": false,
"notNull": false
},
"weight_grams": {
"name": "weight_grams",
"type": "real",
"primaryKey": false,
"notNull": true
},
"cost_cents": {
"name": "cost_cents",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"image_filename": {
"name": "image_filename",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"warehouse_item_sku_unique": {
"name": "warehouse_item_sku_unique",
"nullsNotDistinct": false,
"columns": [
"sku"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.weekly_ship": {
"name": "weekly_ship",
"schema": "",
Expand Down Expand Up @@ -1564,6 +1648,7 @@
"schema": "public",
"values": [
"PYTHON",
"WEB_DEV",
"RUST",
"GAME_DEV",
"HARDWARE",
Expand Down
11 changes: 9 additions & 2 deletions resolution-frontend/drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@
{
"idx": 2,
"version": "7",
"when": 1772636037511,
"tag": "0002_luxuriant_maria_hill",
"when": 1772206185519,
"tag": "0002_add_package_type_and_orders",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1772790000000,
"tag": "0003_add_templates_and_batches",
"breakpoints": true
}
]
Expand Down
8 changes: 8 additions & 0 deletions resolution-frontend/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -e

echo "Running database schema push..."
echo "" | npx drizzle-kit push --verbose 2>&1 || echo "WARNING: drizzle-kit push failed with exit code $?"
echo "Schema push complete."

exec node build
Loading
Loading