Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementación de sistema de transferencia de tickets #286

Merged
merged 21 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
23a0e4b
feat: gift tickets in claimUserTicket flow
TextC0de Oct 4, 2024
8147d62
feat: update ticket gift emails copy
TextC0de Oct 4, 2024
4863986
fix: email copy
TextC0de Oct 7, 2024
bdbfb5d
feat: add giftMyTicketToUser mutation, refactor code for better organ…
TextC0de Oct 7, 2024
beffd4e
fix: remove duplicated image in 9punto5 template
TextC0de Oct 7, 2024
319cae3
fix: name or username on gift emails
TextC0de Oct 7, 2024
f389aab
feat: clean emails
TextC0de Oct 7, 2024
49cd842
feat: flexible "myTicketGifts" query with filters
TextC0de Oct 7, 2024
9f82ac2
fix: if/else on syncPurchaseOrderPaymentStatus for tickets with vs wi…
TextC0de Oct 7, 2024
32ee0da
fix: orders without gifts
TextC0de Oct 7, 2024
54fa75d
feat: on fixtures insert users with clean emails
TextC0de Oct 7, 2024
be6b98f
fix: nullable giftInfo
TextC0de Oct 7, 2024
865ce76
chore: remove commentary
TextC0de Oct 7, 2024
0dba4a2
Merge branch 'main' into textcode/feat-ticket-gifts
TextC0de Oct 7, 2024
3c13254
fix: add missing test for giftMyTicketToUser
TextC0de Oct 8, 2024
2a85165
Merge branch 'textcode/feat-ticket-gifts' of github.com:JSConfCL/gql_…
TextC0de Oct 8, 2024
cc41ec1
refactor(tickets): change user ticket gifts to transfers
TextC0de Oct 11, 2024
a6b6aa1
chore: remove unused imports
TextC0de Oct 11, 2024
896752e
feat(tickets): implement transfer-specific approval statuses
TextC0de Oct 11, 2024
85bb893
fix: ensure that user can only see transfers related to a ticket with…
TextC0de Oct 11, 2024
3b98e2c
chore: remove unused import
TextC0de Oct 11, 2024
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
49 changes: 49 additions & 0 deletions drizzle/migrations/0033_thankful_orphan.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
CREATE TABLE IF NOT EXISTS "user_ticket_transfers" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_ticket_id" uuid NOT NULL,
"sender_user_id" uuid NOT NULL,
"recipient_user_id" uuid NOT NULL,
"status" text DEFAULT 'pending' NOT NULL,
"transfer_message" text,
"expiration_date" timestamp NOT NULL,
"is_return" boolean DEFAULT false NOT NULL,
"created_at" timestamp (6) DEFAULT now() NOT NULL,
"updated_at" timestamp (6),
"deleted_at" timestamp (6)
);
--> statement-breakpoint
ALTER TABLE "user_tickets" DROP CONSTRAINT "user_tickets_purchase_order_id_purchase_orders_id_fk";
--> statement-breakpoint
ALTER TABLE "user_tickets" ALTER COLUMN "user_id" SET NOT NULL;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "user_ticket_transfers" ADD CONSTRAINT "user_ticket_transfers_user_ticket_id_user_tickets_id_fk" FOREIGN KEY ("user_ticket_id") REFERENCES "public"."user_tickets"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "user_ticket_transfers" ADD CONSTRAINT "user_ticket_transfers_sender_user_id_users_id_fk" FOREIGN KEY ("sender_user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "user_ticket_transfers" ADD CONSTRAINT "user_ticket_transfers_recipient_user_id_users_id_fk" FOREIGN KEY ("recipient_user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "user_ticket_transfers_user_ticket_id_index" ON "user_ticket_transfers" USING btree ("user_ticket_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "user_ticket_transfers_sender_user_id_index" ON "user_ticket_transfers" USING btree ("sender_user_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "user_ticket_transfers_recipient_user_id_index" ON "user_ticket_transfers" USING btree ("recipient_user_id");--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "user_tickets" ADD CONSTRAINT "user_tickets_purchase_order_id_purchase_orders_id_fk" FOREIGN KEY ("purchase_order_id") REFERENCES "public"."purchase_orders"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "tickets_event_id_index" ON "tickets" USING btree ("event_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "user_tickets_ticket_template_id_index" ON "user_tickets" USING btree ("ticket_template_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "user_tickets_user_id_index" ON "user_tickets" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "user_tickets_approval_status_index" ON "user_tickets" USING btree ("approval_status");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "user_tickets_purchase_order_id_index" ON "user_tickets" USING btree ("purchase_order_id");
Loading
Loading