feat(events): unify registration checkout and receipts

This commit is contained in:
2026-10-01 12:21:27 +03:30
parent 9f3f3631ac
commit 0f5ec429d0
21 changed files with 1593 additions and 840 deletions

View File

@@ -234,7 +234,9 @@ export type UserUpdateSchema = {
};
export interface UserPaymentSchema {
payment_id: number;
event: {
id: number;
title: string;
slug: string;
image_url?: string | null;
@@ -243,6 +245,7 @@ export interface UserPaymentSchema {
discount_amount: number;
amount: number;
status: "initiated" | "pending" | "paid" | "failed" | "canceled";
refund_status?: "none" | "pending" | "succeeded" | "manual_review";
created_at: string;
paid_at?: string | null;
}
@@ -805,6 +808,8 @@ export interface EventRegistrationSchema {
id: number;
status: 'pending' | 'confirmed' | 'cancelled' | 'attended';
ticket_id: string;
final_price?: number | null;
discount_amount?: number;
registered_at: string;
created_at: string;
updated_at: string;
@@ -819,12 +824,92 @@ export interface EventRegistrationSchema {
export interface RegistrationStatusSchema {
is_registered: boolean;
checkout_state?: "none" | "confirmed" | "active" | "legacy_pending" | "expired" | "unresolved" | "cancelled";
registration_id?: number | null;
registration_status?: "pending" | "confirmed" | "cancelled" | "attended" | null;
ticket_id?: string | null;
checkout_expires_at?: string | null;
payment_id?: number | null;
payment_status?: "initiated" | "pending" | "paid" | "failed" | "canceled" | null;
refund_status?: "none" | "pending" | "succeeded" | "manual_review" | null;
can_resume?: boolean;
can_cancel?: boolean;
}
export type RegistrationHubState =
| "ready"
| "active_checkout"
| "legacy_pending"
| "verification_pending"
| "manual_review"
| "paid_success"
| "free_success"
| "failed"
| "cancelled"
| "expired"
| "refund_pending"
| "refund_manual_review"
| "refund_succeeded";
export interface RegistrationHubSchema {
state: RegistrationHubState;
event: {
id: number;
title: string;
slug: string;
description: string;
event_type: "online" | "on_site" | "hybrid";
address?: string | null;
location?: string | null;
start_time: string;
end_time: string;
registration_start_date?: string | null;
registration_end_date?: string | null;
capacity?: number | null;
price: number;
status: "draft" | "published" | "cancelled" | "completed";
registration_count: number;
image_url?: string | null;
registration_success_markdown?: string | null;
};
registration?: {
ticket_id: string;
status: "pending" | "confirmed" | "cancelled" | "attended";
registered_at: string;
checkout_started_at?: string | null;
checkout_expires_at?: string | null;
cancellation_reason: string;
final_price?: number | null;
discount_amount: number;
} | null;
payment?: {
id: number;
status: "initiated" | "pending" | "paid" | "failed" | "canceled";
verification_state: "awaiting_verification" | "checking" | "retry_scheduled" | "manual_review" | "verified" | "failed" | "canceled";
refund_status: "none" | "pending" | "succeeded" | "manual_review";
base_amount: number;
discount_amount: number;
amount: number;
ref_id?: string | null;
created_at: string;
gateway_paid_at?: string | null;
} | null;
can_register: boolean;
can_resume: boolean;
can_cancel: boolean;
}
export interface MyEventRegistrationSchema {
id: number;
ticket_id: string;
created_at: string;
status: 'pending' | 'confirmed' | 'cancelled' | 'attended';
checkout_state?: "none" | "active" | "legacy_pending" | "expired" | "unresolved" | "cancelled";
checkout_expires_at?: string | null;
payment_id?: number | null;
payment_status?: "initiated" | "pending" | "paid" | "failed" | "canceled" | null;
refund_status?: "none" | "pending" | "succeeded" | "manual_review" | null;
can_resume?: boolean;
event: {
id: number;
title: string;
@@ -1083,6 +1168,18 @@ export interface PaymentDetailSchema {
amount: number;
status: "initiated" | "pending" | "paid" | "failed" | "canceled";
verified_at: string | null;
gateway_paid_at?: string | null;
refund_status?: "none" | "pending" | "succeeded" | "manual_review";
refund_attempts?: number;
refund_last_attempt_at?: string | null;
refund_next_attempt_at?: string | null;
refund_reference?: string | null;
refund_last_error?: string | null;
verification_state: "awaiting_verification" | "checking" | "retry_scheduled" | "manual_review" | "verified" | "failed" | "canceled";
verification_attempts: number;
last_verification_at: string | null;
next_verification_at: string | null;
manual_review_at: string | null;
event: {
id: number;
title: string;