From 6c8432cbc855e184bf05e2709a488d26c5e41569 Mon Sep 17 00:00:00 2001 From: Valery Brobbey Date: Mon, 10 Nov 2025 16:26:44 -0800 Subject: [PATCH] feat(billing): use Subscription.orgRetention in customerOverview --- .../customers/customerOverview.spec.tsx | 38 +++++++++++++++++++ .../components/customers/customerOverview.tsx | 4 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/static/gsAdmin/components/customers/customerOverview.spec.tsx b/static/gsAdmin/components/customers/customerOverview.spec.tsx index 71ab58156d6796..35e91cad5fdc87 100644 --- a/static/gsAdmin/components/customers/customerOverview.spec.tsx +++ b/static/gsAdmin/components/customers/customerOverview.spec.tsx @@ -692,4 +692,42 @@ describe('CustomerOverview', () => { expect(screen.getByText('null')).toBeInTheDocument(); expect(screen.queryByText('36925')).not.toBeInTheDocument(); }); + + it('renders org retention', () => { + const organization = OrganizationFixture({}); + const subscription = SubscriptionFixture({ + organization, + plan: 'am3_f', + orgRetention: {standard: 1234567, downsampled: null}, + }); + + render( + + ); + + expect(screen.getByText('1234567d')).toBeInTheDocument(); + }); + + it('renders org retention default', () => { + const organization = OrganizationFixture({}); + const subscription = SubscriptionFixture({ + organization, + plan: 'am3_f', + orgRetention: {standard: null, downsampled: null}, + }); + + render( + + ); + + expect(screen.getByText('90d')).toBeInTheDocument(); + }); }); diff --git a/static/gsAdmin/components/customers/customerOverview.tsx b/static/gsAdmin/components/customers/customerOverview.tsx index a7ea8693073b89..d443e300324cc3 100644 --- a/static/gsAdmin/components/customers/customerOverview.tsx +++ b/static/gsAdmin/components/customers/customerOverview.tsx @@ -638,7 +638,9 @@ function CustomerOverview({customer, onAction, organization}: Props) { {customer.id} {region} - {customer.dataRetention || '90d'} + {customer.orgRetention?.standard + ? `${customer.orgRetention?.standard}d` + : '90d'} {moment(customer.dateJoined).fromNow()}