Skip to content

131383/statementpage monthly#44151

Draft
rweir4 wants to merge 50 commits intomainfrom
131383/statementpage-monthly
Draft

131383/statementpage monthly#44151
rweir4 wants to merge 50 commits intomainfrom
131383/statementpage-monthly

Conversation

@rweir4
Copy link
Copy Markdown
Contributor

@rweir4 rweir4 commented Apr 16, 2026

Summary

Adds a monthly / prior statement experience for medical copays in the combined debt portal, including a dedicated monthly statement route and page, Redux wiring for statement-scoped copay data, and Lighthouse vs VBS handling aligned with existing detail flows. Statement dates, charges, balances, downloads, and navigation (breadcrumbs, previous statements, resolve) are updated so monthly views stay consistent with list/detail behavior.

What’s included:

  • Routing — New route: /copay-balances/:parentCopayId/previous-statements/:id → MonthlyStatementPage.
    Monthly statement UI — New MonthlyStatementPage container: account summary, charges (Lighthouse → StatementTable, VBS → StatementCharges), downloads, addresses, and related layout/copy.

  • State & data — combined actions (copays.js), reducers, and selectors extended for monthly statement flows; helpers and monthlyStatementAttributes.js centralize statement metadata (dates, titles, charges, previous balance, payments, download refs, etc.).

  • Components — Updates to AccountSummary, StatementTable, StatementCharges, DownloadStatement, PreviousStatements, HTMLStatementLink, and related medical-copays surfaces; DetailCopayPage, HTMLStatementPage, and ResolvePage adjusted where monthly/previous-statement behavior touches them.

  • Copy — eng.json entries for new monthly-statement strings.

  • Tests — New/updated specs: monthlyStatementAttributes, actionsCopays, selectors, reducers, combinedHelpers, detailCopayPage, previousStatements, paymentHistory, statement, and others touched by the above.

Technical notes

  • Lighthouse statements use StatementTable and API-shaped attributes where applicable; VBS continues to use StatementCharges and CDW-style fields.
  • Date math and statement IDs (e.g. composite / statement id usage) were iterated in commits; unit tests document expected selector/helper behavior.
  • Branch includes merges from main; recent commits cover table date fixes, PDF download / list behavior, previous balance logic, and test alignment for statement table specs.

How to test

Testing
Run both of derek's branches from his open prs

Manually: copay balances → facility with previous statements → open a previous monthly statement URL and confirm summary, charge table, downloads, and breadcrumbs; repeat with Lighthouse vs VBS toggles as your environment allows.

for vbs, you have to use mockdata from what i created below because there are no "previous statements" popping up with default mockdata

Note that with default mockdata, you'll see the page error out because of a 404. but if you manually comment that flag to false: monthlyStatementFetchError: false you should see most everything render. i have the error render there because with the 404 some of the info is unaccurate. (0 for prev bal for instance).

Screenshot 2026-04-17 at 12 26 12 PM
Mocks for vbs and lighthouse previous statements export const mockCurrentVbsCopay = { id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', accountNumber: '57 0000 0001 97750 IPOAD', pSSeqNum: 1, pSTotSeqNum: 1, pSFacilityNum: '757', pSFacPhoneNum: null, pSTotStatement: 3, pSStatementVal: '0000037953E', pSStatementDate: '12112025', pSStatementDateOutput: '12/11/2025', pSProcessDate: '12102020', pSProcessDateOutput: '12/10/2020', pHPatientLstNme: 'HHUFHYULSEHU', pHPatientFstNme: 'CDAA', pHPatientMidNme: 'A', pHAddress1: '7780 RED MAPLE CT', pHAddress2: null, pHAddress3: null, pHCity: 'HUBER HEIGHTS', pHState: 'OH', pHZipCde: '45424', pHZipCdeOutput: '45424', pHCtryNme: null, pHAmtDue: 105.24, pHAmtDueOutput: '105.24  ', pHPrevBal: 103.21, pHPrevBalOutput: '103.21  ', pHTotCharges: 2.03, pHTotChargesOutput: '2.03  ', pHTotCredits: 0, pHTotCreditsOutput: '.00  ', pHNewBalance: 105.24, pHNewBalanceOutput: '105.24  ', pHSpecialNotes: null, pHroParaCdes: '0125304050556065708085', pHNumOfLines: 2, pHDfnNumber: 197750, pHCernerStatementNumber: 0, pHCernerPatientId: ' ', pHCernerAccountNumber: ' ', pHIcnNumber: ' ', pHAccountNumber: 7570000000197750, pHLargeFontIndcator: 0, details: [ { pDDatePosted: null, pDDatePostedOutput: '', pDTransDesc: 'INTEREST/ADM. CHARGE (Int:0.10 Adm:1.93 Other:0.00', pDTransDescOutput: 'INTEREST/ADM. CHARGE (Int:0.10 Adm:1.93 Other:0.00', pDTransAmt: 2.03, pDTransAmtOutput: '2.03  ', pDRefNo: null, }, { pDDatePosted: null, pDDatePostedOutput: '', pDTransDesc: 'Please refer to previous statement of rights.', pDTransDescOutput: '   Please refer to previous statement of rights.', pDTransAmt: 0, pDTransAmtOutput: '.00  ', pDRefNo: null, }, ], station: { facilitYNum: '757', visNNum: '10', facilitYDesc: 'CHALMERS P WYLIE VA ACC (757)', facilityName: 'CHALMERS P WYLIE VA ACC (757)', cyclENum: '004', remiTToFlag: 'L', maiLInsertFlag: '0', staTAddress1: '420 N JAMES RD', staTAddress2: null, staTAddress3: null, city: 'COLUMBUS', state: 'OH', ziPCde: '432191834', ziPCdeOutput: '43219-1834', baRCde: '*432191834203*', teLNumFlag: 'S', teLNum: '1-866-812-0318', teLNum2: null, contacTInfo: null, dM2TelNum: null, contacTInfo2: null, toPTelNum: null, lbXFedexAddress1: null, lbXFedexAddress2: null, lbXFedexAddress3: null, lbXFedexCity: null, lbXFedexState: null, lbXFedexZipCde: null, lbXFedexBarCde: null, lbXFedexContact: null, lbXFedexContactTelNum: null, }, };

export const mockPreviousVbsCopay1 = {
...mockCurrentVbsCopay,
id: 'copay-757-nov-2025',
pSStatementDate: '11112025',
pSStatementDateOutput: '11/11/2025',
pHPrevBal: 103.21,
pHPrevBalOutput: '103.21  ',
pHTotCharges: 50.0,
pHTotChargesOutput: '50.00  ',
pHTotCredits: 0,
pHTotCreditsOutput: '.00  ',
pHNewBalance: 50.0,
pHNewBalanceOutput: '50.00  ',
pHAmtDue: 50.0,
pHAmtDueOutput: '50.00  ',
details: [
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'INTEREST/ADM. CHARGE (Int:0.10 Adm:1.93 Other:0.00',
pDTransDescOutput: 'INTEREST/ADM. CHARGE (Int:0.10 Adm:1.93 Other:0.00',
pDTransAmt: 50.0,
pDTransAmtOutput: '50.00  ',
pDRefNo: 'REF001',
},
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'Please refer to previous statement of rights.',
pDTransDescOutput: '   Please refer to previous statement of rights.',
pDTransAmt: 0,
pDTransAmtOutput: '.00  ',
pDRefNo: null,
},
],
};

export const mockPreviousVbsCopay2 = {
...mockCurrentVbsCopay,
id: 'copay-757-oct-2025',
pSStatementDate: '10112025',
pSStatementDateOutput: '10/11/2025',
pHAmtDue: 25.0,
pHAmtDueOutput: '25.00  ',
pHTotCharges: 25.0,
pHTotChargesOutput: '25.00  ',
pHNewBalance: 25.0,
pHNewBalanceOutput: '25.00  ',
details: [
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'PHARMACY',
pDTransDescOutput: 'PHARMACY',
pDTransAmt: 25.0,
pDTransAmtOutput: '25.00  ',
pDRefNo: null,
},
],
};

export const mockVbsStatements = [
mockCurrentVbsCopay,
mockPreviousVbsCopay1,
mockPreviousVbsCopay2,
];

export const mockCurrentVbsCopay2 = {
id: '4fa85f65-6718-5563-b3fc-3c963f66afa7',
accountNumber: '60 0000 0001 97750 IPOAD',
pSSeqNum: 506,
pSTotSeqNum: 588,
pSFacilityNum: '534',
pSFacPhoneNum: null,
pSTotStatement: 27,
pSStatementVal: '0000018255H',
pSStatementDate: '12112025',
pSStatementDateOutput: '12/11/2025',
pSProcessDate: '11112019',
pSProcessDateOutput: '11/11/2019',
pHPatientLstNme: 'JONES',
pHPatientFstNme: 'TRAVIS',
pHPatientMidNme: 'D',
pHAddress1: '1885 SHORE DR S APT 327',
pHAddress2: null,
pHAddress3: null,
pHCity: 'SAVANNAH',
pHState: 'FL',
pHZipCde: '314104413',
pHZipCdeOutput: '31410-4413',
pHCtryNme: null,
pHAmtDue: 15.0,
pHAmtDueOutput: '15.00  ',
pHPrevBal: 135.0,
pHPrevBalOutput: '135.00  ',
pHTotCharges: 15.0,
pHTotChargesOutput: '15.00  ',
pHTotCredits: -135,
pHTotCreditsOutput: '135.00- ',
pHNewBalance: 15.0,
pHNewBalanceOutput: '15.00  ',
pHSpecialNotes: 'To pay your statement online, go to www.pay.gov or call 1-888-827-4817.',
pHroParaCdes: '304050556065708085',
pHNumOfLines: 10,
pHDfnNumber: 346310,
pHCernerStatementNumber: 1005154223,
pHCernerPatientId: '1005154223',
pHCernerAccountNumber: '5341001005154223',
pHIcnNumber: '039219581V969512 ',
pHAccountNumber: 0,
pHLargeFontIndcator: 0,
details: [
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'Outpatient-Family Medicine',
pDTransDescOutput: 'Outpatient-Family Medicine',
pDTransAmt: 15.0,
pDTransAmtOutput: '15.00  ',
pDRefNo: '17604638',
},
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'INTEREST/ADM. CHARGE (Int:0.10 Adm:1.93 Other:0.00',
pDTransDescOutput: 'INTEREST/ADM. CHARGE (Int:0.10 Adm:1.93 Other:0.00',
pDTransAmt: 2.03,
pDTransAmtOutput: '2.03  ',
pDRefNo: null,
},
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'Please refer to previous statement of rights.',
pDTransDescOutput: '   Please refer to previous statement of rights.',
pDTransAmt: 0,
pDTransAmtOutput: '.00  ',
pDRefNo: null,
},
],
station: {
facilitYNum: '668',
visNNum: '20',
facilitYDesc: 'VAMC SPOKANE (668)',
facilityName: 'VAMC SPOKANE (668)',
cyclENum: '003',
remiTToFlag: 'L',
maiLInsertFlag: '0',
staTAddress1: '4815 N ASSEMBLY ST',
staTAddress2: null,
staTAddress3: null,
city: 'SPOKANE',
state: 'WA',
ziPCde: '992056185',
ziPCdeOutput: '99205-6185',
baRCde: '992056185159',
teLNumFlag: 'P',
teLNum: '1-866-290-4618',
teLNum2: null,
contacTInfo: null,
dM2TelNum: null,
contacTInfo2: null,
toPTelNum: null,
lbXFedexAddress1: null,
lbXFedexAddress2: null,
lbXFedexAddress3: null,
lbXFedexCity: null,
lbXFedexState: null,
lbXFedexZipCde: null,
lbXFedexBarCde: null,
lbXFedexContact: null,
lbXFedexContactTelNum: null,
},
};

export const mockPreviousVbsCopay3 = {
...mockCurrentVbsCopay2,
id: 'copay-534-nov-2025',
pSStatementDate: '11112025',
pSStatementDateOutput: '11/11/2025',
pHAmtDue: 30.0,
pHAmtDueOutput: '30.00  ',
pHPrevBal: 120.0,
pHPrevBalOutput: '120.00  ',
pHTotCharges: 30.0,
pHTotChargesOutput: '30.00  ',
pHTotCredits: 0,
pHTotCreditsOutput: '.00  ',
pHNewBalance: 30.0,
pHNewBalanceOutput: '30.00  ',
details: [
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'Outpatient-Family Medicine',
pDTransDescOutput: 'Outpatient-Family Medicine',
pDTransAmt: 30.0,
pDTransAmtOutput: '30.00  ',
pDRefNo: '17604639',
},
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'Please refer to previous statement of rights.',
pDTransDescOutput: '   Please refer to previous statement of rights.',
pDTransAmt: 0,
pDTransAmtOutput: '.00  ',
pDRefNo: null,
},
],
};

export const mockPreviousVbsCopay4 = {
...mockCurrentVbsCopay2,
id: 'copay-534-oct-2025',
pSStatementDate: '10112025',
pSStatementDateOutput: '10/11/2025',
pHAmtDue: 15.0,
pHAmtDueOutput: '15.00  ',
pHPrevBal: 90.0,
pHPrevBalOutput: '90.00  ',
pHTotCharges: 15.0,
pHTotChargesOutput: '15.00  ',
pHTotCredits: 0,
pHTotCreditsOutput: '.00  ',
pHNewBalance: 15.0,
pHNewBalanceOutput: '15.00  ',
details: [
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'PHARMACY',
pDTransDescOutput: 'PHARMACY',
pDTransAmt: 15.0,
pDTransAmtOutput: '15.00  ',
pDRefNo: null,
},
{
pDDatePosted: null,
pDDatePostedOutput: '',
pDTransDesc: 'Please refer to previous statement of rights.',
pDTransDescOutput: '   Please refer to previous statement of rights.',
pDTransAmt: 0,
pDTransAmtOutput: '.00  ',
pDRefNo: null,
},
],
};

export const mockVbsStatements2 = [
mockCurrentVbsCopay2,
mockPreviousVbsCopay3,
mockPreviousVbsCopay4,
];

export const mockCurrentLighthouseCopay = {
id: '4-2vKmP9xQr3nTw',
type: 'medicalCopayDetails',
attributes: {
externalId: '4-2vKmP9xQr3nTw',
facility: {
name: 'James A. Haley Veterans Hospital',
address: {
addressLine1: '151 KNOLLCROFT ROAD',
addressLine2: null,
addressLine3: null,
city: 'LYONS',
state: 'NJ',
postalCode: '07939-5001',
},
},
patient: {
firstName: 'Travis',
middleName: null,
lastName: 'Jones',
address: {
addressLine1: '909 Rohan Highlands',
addressLine2: null,
addressLine3: null,
city: 'Mesa',
state: 'AZ',
postalCode: '85120',
},
},
billNumber: '516-K3FD983',
status: 'issued',
statusDescription: 'ACTIVE',
invoiceDate: '2024-11-15T10:30:00Z',
paymentDueDate: '2024-12-15',
accountNumber: '5160000000018698JONES',
originalAmount: 50.0,
principalBalance: 25.0,
interestBalance: 0.0,
administrativeCostBalance: 0.0,
principalPaid: 25.0,
interestPaid: 0.0,
administrativeCostPaid: 0.0,
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CC',
datePosted: '2024-11-15T10:30:00Z',
description: 'OUTPATIENT CARE(NSC)',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Total Charge', amount: 50.0 }],
},
],
payments: [],
associatedStatements: [
{
id: '4-1abZUKu7xIv1t4',
compositeId: 'ORG-VAMC-2-2026',
date: 'February 22, 2026',
billNumber: '516-K3FD983',
lineItems: [
{
billingReference: '4-6c9ZE23XQjkAu53',
datePosted: '2025-05-30T00:00:00Z',
description: 'INTEREST/ADM. CHARGE',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [
{ type: 'interest', code: 'Interest Charge', amount: 0.1 },
{ type: 'administrative', code: 'Administrative Cost', amount: 1.93 },
],
},
],
},
{
id: '4-2vKmP9xQr3nTx',
compositeId: 'ORG-VAMC-1-2026',
date: 'January 22, 2026',
billNumber: '516-K3FD982',
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CD',
datePosted: '2024-10-15T10:30:00Z',
description: 'OUTPATIENT CARE(NSC)',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [
{ type: 'base', code: 'Total Charge', amount: 50.0 },
{ type: 'copay', code: 'Copay Amount', amount: 25.0 },
],
},
{
billingReference: '4-6c9ZE23XjkA9CE',
datePosted: '2024-10-16T10:30:00Z',
description: 'PHARMACY',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Copay Amount', amount: 25.0 }],
medication: {
medicationName: 'Lisinopril 10mg Tablet',
rxNumber: 'RX-123456',
quantity: 30,
daysSupply: 30,
},
},
],
},
{
id: '4-2vKmP9xQr3nTy',
compositeId: 'ORG-VAMC-12-2025',
date: 'December 22, 2025',
billNumber: '516-K3FD981',
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CF',
datePosted: '2024-09-15T10:30:00Z',
description: 'PHARMACY',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Copay Amount', amount: 25.0 }],
medication: {
medicationName: 'Metformin 500mg Tablet',
rxNumber: 'RX-654321',
quantity: 60,
daysSupply: 60,
},
},
],
},
],
},
};

const sharedPatient = {
firstName: 'Travis',
middleName: null,
lastName: 'Jones',
address: {
addressLine1: '909 Rohan Highlands',
addressLine2: null,
addressLine3: null,
city: 'Mesa',
state: 'AZ',
postalCode: '85120',
},
};

const sharedFacility = {
name: 'James A. Haley Veterans Hospital',
address: {
addressLine1: '151 KNOLLCROFT ROAD',
addressLine2: null,
addressLine3: null,
city: 'LYONS',
state: 'NJ',
postalCode: '07939-5001',
},
};

export const mockCurrentLighthouseCopayResponse = {
data: {
id: '4-2vKmP9xQr3nTw',
type: 'medicalCopayDetails',
attributes: {
externalId: '4-2vKmP9xQr3nTw',
facility: sharedFacility,
patient: sharedPatient,
billNumber: '516-K3FD983',
status: 'issued',
statusDescription: 'ACTIVE',
invoiceDate: '2024-11-15T10:30:00Z',
paymentDueDate: '2024-12-15',
accountNumber: '5160000000018698JONES',
originalAmount: 50.0,
principalBalance: 25.0,
interestBalance: 0.0,
administrativeCostBalance: 0.0,
principalPaid: 25.0,
interestPaid: 0.0,
administrativeCostPaid: 0.0,
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CC',
datePosted: '2024-11-15T10:30:00Z',
description: 'OUTPATIENT CARE(NSC)',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Total Charge', amount: 50.0 }],
},
],
payments: [],
associatedStatements: [
{
id: '4-1abZUKu7xIv1t4',
compositeId: 'ORG-VAMC-2-2026',
date: 'February 22, 2026',
billNumber: '516-K3FD983',
lineItems: [
{
billingReference: '4-6c9ZE23XQjkAu53',
datePosted: '2025-05-30T00:00:00Z',
description: 'INTEREST/ADM. CHARGE',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [
{ type: 'interest', code: 'Interest Charge', amount: 0.1 },
{ type: 'administrative', code: 'Administrative Cost', amount: 1.93 },
],
},
],
},
{
id: '4-2vKmP9xQr3nTx',
compositeId: 'ORG-VAMC-1-2026',
date: 'January 22, 2026',
billNumber: '516-K3FD982',
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CD',
datePosted: '2024-10-15T10:30:00Z',
description: 'OUTPATIENT CARE(NSC)',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [
{ type: 'base', code: 'Total Charge', amount: 50.0 },
{ type: 'copay', code: 'Copay Amount', amount: 25.0 },
],
},
{
billingReference: '4-6c9ZE23XjkA9CE',
datePosted: '2024-10-16T10:30:00Z',
description: 'PHARMACY',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Copay Amount', amount: 25.0 }],
medication: {
medicationName: 'Lisinopril 10mg Tablet',
rxNumber: 'RX-123456',
quantity: 30,
daysSupply: 30,
},
},
],
},
{
id: '4-2vKmP9xQr3nTy',
compositeId: 'ORG-VAMC-12-2025',
date: 'December 22, 2025',
billNumber: '516-K3FD981',
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CF',
datePosted: '2024-09-15T10:30:00Z',
description: 'PHARMACY',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Copay Amount', amount: 25.0 }],
medication: {
medicationName: 'Metformin 500mg Tablet',
rxNumber: 'RX-654321',
quantity: 60,
daysSupply: 60,
},
},
],
},
],
},
meta: { lineItemCount: 1, paymentCount: 0 },
},
isCerner: false,
};

export const mockPreviousLighthouseCopayResponse1 = {
...mockCurrentLighthouseCopayResponse,
data: {
...mockCurrentLighthouseCopayResponse.data,
id: '4-2vKmP9xQr3nTx',
attributes: {
...mockCurrentLighthouseCopayResponse.data.attributes,
externalId: '4-2vKmP9xQr3nTx',
billNumber: '516-K3FD982',
invoiceDate: '2026-01-15T10:30:00Z',
paymentDueDate: '2026-02-15',
originalAmount: 75.0,
principalBalance: 75.0,
principalPaid: 10.0,
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CD',
datePosted: '2024-10-15T10:30:00Z',
description: 'OUTPATIENT CARE(NSC)',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [
{ type: 'base', code: 'Total Charge', amount: 50.0 },
{ type: 'copay', code: 'Copay Amount', amount: 25.0 },
],
},
{
billingReference: '4-6c9ZE23XjkA9CE',
datePosted: '2024-10-16T10:30:00Z',
description: 'PHARMACY',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Copay Amount', amount: 25.0 }],
medication: {
medicationName: 'Lisinopril 10mg Tablet',
rxNumber: 'RX-123456',
quantity: 30,
daysSupply: 30,
},
},
],
payments: [],
associatedStatements: [
{
id: '4-2vKmP9xQr3nTy',
compositeId: 'ORG-VAMC-12-2025',
date: 'December 22, 2025',
billNumber: '516-K3FD981',
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CF',
datePosted: '2024-09-15T10:30:00Z',
description: 'PHARMACY',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Copay Amount', amount: 25.0 }],
medication: {
medicationName: 'Metformin 500mg Tablet',
rxNumber: 'RX-654321',
quantity: 60,
daysSupply: 60,
},
},
],
},
],
},
meta: { lineItemCount: 2, paymentCount: 0 },
},
};

export const mockPreviousLighthouseCopayResponse2 = {
...mockCurrentLighthouseCopayResponse,
data: {
...mockCurrentLighthouseCopayResponse.data,
id: '4-2vKmP9xQr3nTy',
attributes: {
...mockCurrentLighthouseCopayResponse.data.attributes,
externalId: '4-2vKmP9xQr3nTy',
billNumber: '516-K3FD981',
status: 'paid',
statusDescription: 'CLOSED',
invoiceDate: '2025-12-15T10:30:00Z',
paymentDueDate: '2026-01-15',
originalAmount: 25.0,
principalBalance: 0.0,
principalPaid: 25.0,
lineItems: [
{
billingReference: '4-6c9ZE23XjkA9CF',
datePosted: '2024-09-15T10:30:00Z',
description: 'PHARMACY',
providerName: 'James A. Haley Veterans Hospital',
priceComponents: [{ type: 'base', code: 'Copay Amount', amount: 25.0 }],
medication: {
medicationName: 'Metformin 500mg Tablet',
rxNumber: 'RX-654321',
quantity: 60,
daysSupply: 60,
},
},
],
payments: [
{
paymentId: 'PMT-001',
paymentDate: '2024-10-01',
paymentAmount: 25.0,
transactionNumber: 'TXN-789',
billNumber: '516-K3FD981',
invoiceReference: '4-2vKmP9xQr3nTy',
disposition: 'Complete',
detail: [{ type: 'Principal', amount: 25.0 }],
},
],
associatedStatements: [],
},
meta: { lineItemCount: 1, paymentCount: 1 },
},
};

export const mockLighthouseStatements = [
mockCurrentLighthouseCopay,
mockPreviousLighthouseCopayResponse1,
mockPreviousLighthouseCopayResponse2,
];

export const mockLighthouseCopaysIndexResponse = [
{
id: '4-2vKmP9xQr3nTw',
type: 'medical_copays',
attributes: {
url: 'https://api.va.gov/v1/medical_copays/4-2vKmP9xQr3nTw',
facility: 'James A. Haley Veterans Hospital',
city: 'Tampa',
invoiceDate: '2024-11-15T10:30:00Z',
facilityId: '516',
externalId: '4-2vKmP9xQr3nTw',
latestBillingRef: '4-6c9ZE23XjkA9CC',
currentBalance: 25.0,
previousBalance: 75.0,
previousUnpaidBalance: 0.0,
lastUpdatedAt: '2024-11-15T10:30:00.000+00:00',
},
},
{
id: '4-2vKmP9xQr3nTx',
type: 'medical_copays',
attributes: {
url: 'https://api.va.gov/v1/medical_copays/4-2vKmP9xQr3nTx',
facility: 'James A. Haley Veterans Hospital',
city: 'Tampa',
invoiceDate: '2026-01-15T10:30:00Z',
facilityId: '516',
externalId: '4-2vKmP9xQr3nTx',
latestBillingRef: '4-6c9ZE23XjkA9CD',
currentBalance: 75.0,
previousBalance: 25.0,
previousUnpaidBalance: 20.0,
lastUpdatedAt: '2026-01-15T10:30:00.000+00:00',
},
},
{
id: '4-2vKmP9xQr3nTy',
type: 'medical_copays',
attributes: {
url: 'https://api.va.gov/v1/medical_copays/4-2vKmP9xQr3nTy',
facility: 'James A. Haley Veterans Hospital',
city: 'Tampa',
invoiceDate: '2025-12-15T10:30:00Z',
facilityId: '516',
externalId: '4-2vKmP9xQr3nTy',
latestBillingRef: '4-6c9ZE23XjkA9CF',
currentBalance: 0.0,
previousBalance: 25.0,
previousUnpaidBalance: 0.0,
lastUpdatedAt: '2025-12-15T10:30:00.000+00:00',
},
},
];

Related issue(s)

Testing done

  • Describe what the old behavior was prior to the change
  • Describe the steps required to verify your changes are working as expected
  • Describe the tests completed and the results
  • _Exclusively stating 'Specs and automated tests passing' is NOT acceptable as appropriate testing
  • Optionally, provide a link to your test plan and test execution records

Screenshots

the reason the lineitems look like they do on the LH ss is mockdata if you use the manual mockdata above, you'll see it's correct, but previous balance wont populate that way. i had some trouble getting that mockdata set up to be used.

Before After
Mobile
Desktop Screenshot 2026-04-17 at 12 08 45 PMScreenshot 2026-04-17 at 11 35 06 AM

What areas of the site does it impact?

(Describe what parts of the site are impacted if code touched other areas)

Acceptance criteria

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

Requested Feedback

(OPTIONAL) What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

Comment on lines +103 to +107
...state,
monthlyStatementCopay: action.response.data,
isMonthlyStatementLoading: false,
monthlyStatementError: null,
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had to create a separate slice of state to be able to track both the parent copaydetail and the v1/medical_copays/id response i needed for the monthlyStatementCopay to be able to access the full set of attributes for certain properties that were needed needed

}

return isValid(date) ? format(new Date(date), 'MMMM d, y') : '';
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the there were some breaking dates, in particular for the pdf download link

Comment on lines +16 to +24
const dateRange = date
? {
initialDate: new Date(date),
finalDate: subMonths(new Date(date), 1),
}
: {
initialDate: new Date(copay.pSStatementDateOutput),
finalDate: subDays(new Date(copay.pSStatementDateOutput), 30),
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chose this approach in this and statement table as a normalized way of handling date now that we needed some by month difference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants