From 7fbdd3844fbee406616643c174bb5c0b1bc339bf Mon Sep 17 00:00:00 2001 From: ncoronel Date: Mon, 24 Aug 2026 12:35:33 -0300 Subject: [PATCH] fix(purchase-detail): add in-review section with WhatsApp contact option --- .../purchase-detail-page.html | 21 +++++++++++++++ .../purchase-detail-page.scss | 26 +++++++++++++++++++ .../purchase-detail-page.ts | 22 +++++++++++++--- 3 files changed, 66 insertions(+), 3 deletions(-) diff --git a/src/app/features/store/pages/account-page/pages/purchase-detail-page/purchase-detail-page.html b/src/app/features/store/pages/account-page/pages/purchase-detail-page/purchase-detail-page.html index 8019b12..4c88ac6 100644 --- a/src/app/features/store/pages/account-page/pages/purchase-detail-page/purchase-detail-page.html +++ b/src/app/features/store/pages/account-page/pages/purchase-detail-page/purchase-detail-page.html @@ -15,6 +15,27 @@ @if (isLoading()) {

Cargando detalle de compra...

} @else if (purchase(); as purchase) { + @if (purchase.isInReview) { +
+

ESPERANDO CONFIRMACIÓN

+

+ Tu compra aún no ha sido confirmada.
+ Si no te contactaste con nosotros, podés hacerlo a través del siguiente WhatsApp +

+ + @if (whatsappUrl()) { + + WhatsApp + + } +
+ } +
(null); + protected readonly whatsappUrl = computed( + () => + this.tenantService + .tenant() + ?.social_media?.find((socialMedia) => socialMedia.code === 'whatsapp')?.url ?? null, + ); async ngOnInit(): Promise { const purchaseId = this.route.snapshot.paramMap.get('id'); @@ -54,6 +61,7 @@ export class PurchaseDetailPage implements OnInit { date: this.formatDate(response.created_at), total: response.total, items: this.mapItems(response), + isInReview: response.status === 'in_review', }); } catch (error) { console.error('Failed to fetch purchase detail:', error); @@ -64,6 +72,14 @@ export class PurchaseDetailPage implements OnInit { } } + protected openWhatsApp(): void { + const url = this.whatsappUrl(); + + if (url) { + window.open(url, '_blank', 'noopener,noreferrer'); + } + } + private formatDate(value: string | null): string { if (!value) { return '-';