Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a73691e
feat: pathwayShop, shopItem, and transactionLedger schemas
thesleepyniko May 5, 2026
613992d
feat: add shopOrder table and address validation schema
thesleepyniko May 5, 2026
a909366
feat: relations + one more table
thesleepyniko May 5, 2026
b04f913
misc: migrations for a73691e, 613992d, a909366
thesleepyniko May 5, 2026
cd9fcc5
chore: scaffold pathway shop page route
thesleepyniko May 5, 2026
562f3d1
feat: add load function + template
thesleepyniko May 5, 2026
a451758
feat: move checking stuff to dedicated function
thesleepyniko May 5, 2026
b11361c
feat: purchase function
thesleepyniko May 6, 2026
0c3f7d6
feat: cancel function
thesleepyniko May 6, 2026
183e4d7
fix: use totalAmount instead of itemPriceSnapshot
thesleepyniko May 6, 2026
4dfe99e
fix: only allow cancellation while pending
thesleepyniko May 6, 2026
8fb5ca7
feat: remove fufillers
May 12, 2026
64c51af
feat: schema changes (accompanying the last thing)
May 12, 2026
da6d6c3
dev: shop seeding for dev
May 12, 2026
5db4546
feat: templating stuff
May 12, 2026
ebbf321
feat: shop frontend (sorta)
May 12, 2026
1698d76
dev: todos
May 12, 2026
58ef148
fix: minor naming change
May 12, 2026
bff2897
feat(accessibility): make it a button! (thanks amp)
May 12, 2026
379789e
feat: only show show-more when more than 3 items
May 12, 2026
4d6ab5c
fix: ignore error because data is basically a one time load
May 12, 2026
0ecb99f
fix: missing line-clamp
May 12, 2026
a88d851
feat: pathwayShop, shopItem, and transactionLedger schemas
thesleepyniko May 5, 2026
23fe62b
feat: add shopOrder table and address validation schema
thesleepyniko May 5, 2026
367127e
feat: relations + one more table
thesleepyniko May 5, 2026
496aeaa
misc: migrations for a73691e, 613992d, a909366
thesleepyniko May 5, 2026
0525821
chore: scaffold pathway shop page route
thesleepyniko May 5, 2026
9203c92
feat: add load function + template
thesleepyniko May 5, 2026
c8ee59a
feat: move checking stuff to dedicated function
thesleepyniko May 5, 2026
2e7611a
feat: purchase function
thesleepyniko May 6, 2026
d704689
feat: cancel function
thesleepyniko May 6, 2026
dcded5c
fix: use totalAmount instead of itemPriceSnapshot
thesleepyniko May 6, 2026
347d76a
fix: only allow cancellation while pending
thesleepyniko May 6, 2026
db9ba6a
feat: remove fufillers
May 12, 2026
c9552a7
feat: schema changes (accompanying the last thing)
May 12, 2026
4f832c8
dev: shop seeding for dev
May 12, 2026
15f5b0c
feat: templating stuff
May 12, 2026
a2d527e
feat: shop frontend (sorta)
May 12, 2026
8425dd5
dev: todos
May 12, 2026
cfbdeaa
fix: minor naming change
May 12, 2026
e095330
feat(accessibility): make it a button! (thanks amp)
May 12, 2026
f8f0090
feat: only show show-more when more than 3 items
May 12, 2026
5b804c8
fix: ignore error because data is basically a one time load
May 12, 2026
1033258
fix: missing line-clamp
May 12, 2026
fdc9ac2
Merge branch 'feat/shop' of https://github.com/hackclub/resolution in…
May 13, 2026
69a39a9
fix: stop migrations from being cooked
thesleepyniko May 13, 2026
cc676e8
feat: a lot of work but in short:
thesleepyniko May 16, 2026
1245545
feat(db): regen baseline db migration
thesleepyniko May 16, 2026
7da318c
feat: add some TODOs and template some pgaes
thesleepyniko May 16, 2026
0946c22
feat: fufillment backend + some migrations
thesleepyniko May 16, 2026
42e2ad7
formatting: oops remove extra space
thesleepyniko May 16, 2026
9f4b09c
feat: frontend for ambassadors + some odd bits and ends
thesleepyniko May 16, 2026
1455232
fix: test failing
thesleepyniko May 16, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE "fufiller_pathway" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "shop_orders" ADD COLUMN "phone" text;
84 changes: 84 additions & 0 deletions resolution-frontend/drizzle.backup/0011_nosy_bloodstrike.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
CREATE TYPE "public"."currency_txn_reason" AS ENUM('GRANT', 'PURCHASE', 'REFUND', 'ADJUSTMENT', 'OTHER');--> statement-breakpoint
CREATE TYPE "public"."shop_item_type" AS ENUM('PHYSICAL', 'DIGITAL');--> statement-breakpoint
CREATE TYPE "public"."shop_order_status" AS ENUM('PENDING', 'PROCESSING', 'FULFILLED', 'CANCELED');--> statement-breakpoint
CREATE TABLE "fufiller_pathway" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"pathway" "pathway" NOT NULL,
"assigned_at" timestamp DEFAULT now() NOT NULL,
"assigned_by" text NOT NULL
);
--> statement-breakpoint
CREATE TABLE "pathway_shop" (
"id" text PRIMARY KEY NOT NULL,
"pathway" "pathway" NOT NULL,
"is_enabled" boolean DEFAULT false NOT NULL,
"currency_name" text DEFAULT 'wish' NOT NULL,
"currency_name_plural" text DEFAULT 'wishes' NOT NULL,
"last_edited_by" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "pathway_shop_pathway_unique" UNIQUE("pathway")
);
--> statement-breakpoint
CREATE TABLE "shop_item" (
"id" text PRIMARY KEY NOT NULL,
"pathway" "pathway" NOT NULL,
"name" text NOT NULL,
"description" text NOT NULL,
"item_url" text,
"item_price" integer NOT NULL,
"item_stock" integer,
"item_type" "shop_item_type" NOT NULL,
"is_active" boolean DEFAULT false NOT NULL,
"last_edited_by" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "shop_orders" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text,
"pathway" "pathway" NOT NULL,
"order_stauts" "shop_order_status" DEFAULT 'PENDING' NOT NULL,
"amount" integer NOT NULL,
"shop_item_id" text,
"item_price_snapshot" integer NOT NULL,
"item_type_enum" "shop_item_type",
"item_name_snapshot" text NOT NULL,
"shipping_address" jsonb,
"user_notes" text,
"fufiller_notes" text,
"fufilled_by" text,
"fufilled_at" timestamp,
"cancelled_reason" text,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "currency_transactions" (
"id" text PRIMARY KEY NOT NULL,
"tx_user_id" text,
"tx_pathway" "pathway" NOT NULL,
"tx_amount" integer NOT NULL,
"tx_reason" "currency_txn_reason" NOT NULL,
"tx_note" text,
"tx_granted_by" text,
"tx_ref_type" text,
"tx_ref_id" text,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "fufiller_pathway" ADD CONSTRAINT "fufiller_pathway_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "fufiller_pathway" ADD CONSTRAINT "fufiller_pathway_assigned_by_user_id_fk" FOREIGN KEY ("assigned_by") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "pathway_shop" ADD CONSTRAINT "pathway_shop_last_edited_by_user_id_fk" FOREIGN KEY ("last_edited_by") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "shop_item" ADD CONSTRAINT "shop_item_pathway_pathway_shop_pathway_fk" FOREIGN KEY ("pathway") REFERENCES "public"."pathway_shop"("pathway") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "shop_item" ADD CONSTRAINT "shop_item_last_edited_by_user_id_fk" FOREIGN KEY ("last_edited_by") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "shop_orders" ADD CONSTRAINT "shop_orders_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "shop_orders" ADD CONSTRAINT "shop_orders_pathway_pathway_shop_pathway_fk" FOREIGN KEY ("pathway") REFERENCES "public"."pathway_shop"("pathway") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "shop_orders" ADD CONSTRAINT "shop_orders_shop_item_id_shop_item_id_fk" FOREIGN KEY ("shop_item_id") REFERENCES "public"."shop_item"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "shop_orders" ADD CONSTRAINT "shop_orders_fufilled_by_user_id_fk" FOREIGN KEY ("fufilled_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "currency_transactions" ADD CONSTRAINT "currency_transactions_tx_user_id_user_id_fk" FOREIGN KEY ("tx_user_id") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "currency_transactions" ADD CONSTRAINT "currency_transactions_tx_pathway_pathway_shop_pathway_fk" FOREIGN KEY ("tx_pathway") REFERENCES "public"."pathway_shop"("pathway") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "currency_transactions" ADD CONSTRAINT "currency_transactions_tx_granted_by_user_id_fk" FOREIGN KEY ("tx_granted_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "fufiller_pathway_unique_idx" ON "fufiller_pathway" USING btree ("user_id","pathway");
Loading