Compare commits
3 Commits
develop
...
feature/re
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e72ec0c60 | |||
| e9aae7a4c3 | |||
| 6545be498f |
@@ -115,6 +115,7 @@ export interface PurchaseDetailItemResponse {
|
||||
quantity: number;
|
||||
unit_price: string;
|
||||
line_total: string;
|
||||
refunded_amount?: string;
|
||||
source_catalog_item_id: number | null;
|
||||
source_variant_id: number | null;
|
||||
item_details: {
|
||||
|
||||
@@ -143,6 +143,10 @@ export interface Tenant {
|
||||
cart_editing_policy?: CartEditingPolicy;
|
||||
checkout_editing_policy?: CartEditingPolicy;
|
||||
display_cart_item_images?: boolean;
|
||||
allow_ticket_refund?: boolean;
|
||||
allow_ticket_total_refund?: boolean;
|
||||
allow_ticket_partial_refund?: boolean;
|
||||
ticket_partial_refund_percentage?: string;
|
||||
social_media?: SocialMedia[];
|
||||
menues?: Menu[];
|
||||
categories: Category[];
|
||||
|
||||
@@ -15,6 +15,8 @@ export interface TicketResponse {
|
||||
starts_at: string | null;
|
||||
expires_at: string | null;
|
||||
used_at: string | null;
|
||||
status?: 'active' | 'expired' | 'used' | 'disabled' | 'cancelled' | 'refunded';
|
||||
status_label?: string;
|
||||
is_valid: boolean;
|
||||
is_expired: boolean;
|
||||
is_used: boolean;
|
||||
@@ -26,9 +28,7 @@ export class TicketService extends BaseApiService {
|
||||
|
||||
getTickets(): Promise<TicketResponse[]> {
|
||||
return firstValueFrom(
|
||||
this.http.get<{ data: TicketResponse[] }>(
|
||||
`${this.tenantService.getTenantApiUrl()}/tickets`,
|
||||
),
|
||||
this.http.get<{ data: TicketResponse[] }>(`${this.tenantService.getTenantApiUrl()}/tickets`),
|
||||
).then((response) => response.data ?? []);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,11 @@ export class TicketsPage implements OnInit {
|
||||
}
|
||||
|
||||
protected isInactive(ticket: TicketResponse): boolean {
|
||||
return ticket.is_expired || ticket.is_used;
|
||||
return (
|
||||
(ticket.status !== undefined && ticket.status !== 'active') ||
|
||||
ticket.is_expired ||
|
||||
ticket.is_used
|
||||
);
|
||||
}
|
||||
|
||||
protected formatDate(ticket: TicketResponse): string | null {
|
||||
|
||||
Reference in New Issue
Block a user