diff --git a/src/api/complaints.spec.js b/src/api/complaints.spec.js new file mode 100644 index 00000000..ed58951b --- /dev/null +++ b/src/api/complaints.spec.js @@ -0,0 +1,168 @@ +import { renderHook } from '@testing-library/react-hooks'; +import { Provider } from 'react-redux'; +import { store } from '../app/store'; +import { + useGetAggregationsQuery, + useGetDocumentQuery, + useGetListQuery, + useGetMapQuery, + useGetTrendsQuery, +} from './complaints'; +import { aggResponse } from '../components/List/ListPanel/fixture'; +import fetchMock from 'jest-fetch-mock'; +import { waitFor } from '@testing-library/react'; +import { aggResponseTransformed, documentResponse } from './fixture'; + +fetchMock.enableMocks(); + +/** + * + * @param root0 + * @param root0.children + */ +// eslint-disable-next-line react/prop-types +function Wrapper({ children }) { + return {children}; +} + +beforeEach(() => { + fetchMock.resetMocks(); +}); + +afterEach(() => { + jest.restoreAllMocks(); +}); + +describe('getAggregations', () => { + it('renders hook and transforms data', async () => { + fetchMock.mockResponseOnce(JSON.stringify(aggResponse)); + const { result } = renderHook( + () => useGetAggregationsQuery({ foo: 'bar' }), + { + wrapper: Wrapper, + }, + ); + expect(result.current).toMatchObject({ + status: 'pending', + endpointName: 'getAggregations', + isLoading: true, + isSuccess: false, + isError: false, + isFetching: true, + }); + + await waitFor(() => expect(result.current.isSuccess).toBe(true)); + + expect(fetchMock).toBeCalledTimes(1); + expect(result.current.data).toEqual(aggResponseTransformed); + }); +}); + +describe('getDocument', () => { + it('renders hook transforms data', async () => { + fetchMock.mockResponseOnce(JSON.stringify(documentResponse)); + const { result } = renderHook(() => useGetDocumentQuery(12334), { + wrapper: Wrapper, + }); + expect(result.current).toMatchObject({ + status: 'pending', + endpointName: 'getDocument', + isLoading: true, + isSuccess: false, + isError: false, + isFetching: true, + }); + + await waitFor(() => expect(result.current.isSuccess).toBe(true)); + + expect(fetchMock).toBeCalledTimes(1); + expect(result.current.data).toEqual({ + company: 'JPMORGAN CHASE & CO.', + company_public_response: 'Company acknowledges the complaint', + company_response: 'Closed with explanation', + complaint_id: '2371744', + complaint_what_happened: 'Lorem ipsum dolor sit amet', + consumer_consent_provided: 'Consent provided', + consumer_disputed: 'Yes', + date_received: '2017-03-04T12:00:00', + date_sent_to_company: '2017-03-04T12:00:00', + has_narrative: true, + issue: 'Account opening, closing, or management', + product: 'Bank account or service', + state: 'KY', + sub_issue: 'Closing', + sub_product: 'Checking account', + submitted_via: 'Web', + tags: 'Older American', + timely: 'Yes', + zip_code: '423XX', + }); + }); +}); + +describe('getList', () => { + it('renders hook', async () => { + fetchMock.mockResponseOnce(JSON.stringify(aggResponse)); + const { result } = renderHook(() => useGetListQuery({ foo: 'bar' }), { + wrapper: Wrapper, + }); + expect(result.current).toMatchObject({ + status: 'pending', + endpointName: 'getList', + isLoading: true, + isSuccess: false, + isError: false, + isFetching: true, + }); + + await waitFor(() => expect(result.current.isSuccess).toBe(true)); + + expect(fetchMock).toBeCalledTimes(1); + expect(result.current.data).toEqual('foobar'); + }); +}); + +describe('getMap', () => { + it('renders hook', async () => { + fetchMock.mockResponseOnce(JSON.stringify(aggResponse)); + const { result } = renderHook(() => useGetMapQuery({ foo: 'bar' }), { + wrapper: Wrapper, + }); + + expect(result.current).toMatchObject({ + status: 'pending', + endpointName: 'getMap', + isLoading: true, + isSuccess: false, + isError: false, + isFetching: true, + }); + + await waitFor(() => expect(result.current.isSuccess).toBe(true)); + + expect(fetchMock).toBeCalledTimes(1); + expect(result.current.data).toEqual('foobar'); + }); +}); + +describe('getTrends', () => { + it('renders hook', async () => { + fetchMock.mockResponseOnce(JSON.stringify(aggResponse)); + const { result } = renderHook(() => useGetTrendsQuery({ foo: 'bar' }), { + wrapper: Wrapper, + }); + expect(result.current).toMatchObject({ + status: 'pending', + endpointName: 'getTrends', + isLoading: true, + isSuccess: false, + isError: false, + isFetching: true, + }); + + await waitFor(() => expect(result.current.isSuccess).toBe(true)); + + expect(fetchMock).toBeCalledTimes(1); + expect(result.current.data).toEqual('foobar'); + }); +}); diff --git a/src/api/fixture.js b/src/api/fixture.js new file mode 100644 index 00000000..bd30fab7 --- /dev/null +++ b/src/api/fixture.js @@ -0,0 +1,40 @@ +export const aggResponse = { took: 3, timed_out: false, _shards: { total: 5, successful: 5, skipped: 0, failed: 0 }, hits: { total: { value: 4291676, relation: 'eq' }, max_score: null, hits: [] }, aggregations: { company: { doc_count: 4291676, company: { doc_count_error_upper_bound: 0, sum_other_doc_count: 0, buckets: [{ key: 'Monocle Popper Inc', doc_count: 9999 }, { key: 'Safe-T Deposits LLC', doc_count: 999 }, { key: 'Securitized Collateral Risk Obligations Credit Co', doc_count: 99 }, { key: 'EZ Credit', doc_count: 9 }] } } }, _meta: { license: 'CC0', last_updated: '2024-11-04T12:00:00-05:00', last_indexed: '2024-11-04T12:00:00-05:00', total_record_count: 6625190, is_data_stale: false, has_data_issue: false, break_points: {} } }; +export const aggResponseTransformed = { 'doc_count': 6638372, 'lastUpdated': '2024-11-05T12:00:00-05:00', 'lastIndexed': '2024-11-06T12:00:00-05:00', 'hasDataIssue': false, 'isDataStale': false, 'total': 4303365, 'has_narrative': [{ 'key': 0, 'key_as_string': 'false', 'doc_count': 2905958 }, { 'key': 1, 'key_as_string': 'true', 'doc_count': 1397407 }], 'product': [{ 'key': 'Credit reporting or other personal consumer reports', 'doc_count': 2243932, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Credit reporting', 'doc_count': 2232927 }, { 'key': 'Other personal consumer report', 'doc_count': 11005 }] } }, { 'key': 'Credit reporting, credit repair services, or other personal consumer reports', 'doc_count': 1300476, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Credit reporting', 'doc_count': 1289886 }, { 'key': 'Other personal consumer report', 'doc_count': 7704 }, { 'key': 'Credit repair services', 'doc_count': 2886 }] } }, { 'key': 'Debt collection', 'doc_count': 257642, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'I do not know', 'doc_count': 86555 }, { 'key': 'Other debt', 'doc_count': 56111 }, { 'key': 'Credit card debt', 'doc_count': 53596 }, { 'key': 'Medical debt', 'doc_count': 23771 }, { 'key': 'Auto debt', 'doc_count': 10392 }, { 'key': 'Telecommunications debt', 'doc_count': 9354 }, { 'key': 'Rental debt', 'doc_count': 8102 }, { 'key': 'Payday loan debt', 'doc_count': 4459 }, { 'key': 'Mortgage debt', 'doc_count': 2576 }, { 'key': 'Private student loan debt', 'doc_count': 1439 }, { 'key': 'Federal student loan debt', 'doc_count': 1287 }] } }, { 'key': 'Checking or savings account', 'doc_count': 133573, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Checking account', 'doc_count': 108623 }, { 'key': 'Savings account', 'doc_count': 11395 }, { 'key': 'Other banking product or service', 'doc_count': 10692 }, { 'key': 'CD (Certificate of Deposit)', 'doc_count': 2839 }, { 'key': 'Credit reporting', 'doc_count': 1 }] } }, { 'key': 'Credit card', 'doc_count': 83482, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'General-purpose credit card or charge card', 'doc_count': 74549 }, { 'key': 'Store credit card', 'doc_count': 8933 }] } }, { 'key': 'Credit card or prepaid card', 'doc_count': 80187, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'General-purpose credit card or charge card', 'doc_count': 64470 }, { 'key': 'Store credit card', 'doc_count': 9137 }, { 'key': 'General-purpose prepaid card', 'doc_count': 3308 }, { 'key': 'Government benefit card', 'doc_count': 2332 }, { 'key': 'Gift card', 'doc_count': 544 }, { 'key': 'Payroll card', 'doc_count': 384 }, { 'key': 'Student prepaid card', 'doc_count': 12 }] } }, { 'key': 'Mortgage', 'doc_count': 67065, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Conventional home mortgage', 'doc_count': 40610 }, { 'key': 'FHA mortgage', 'doc_count': 12101 }, { 'key': 'VA mortgage', 'doc_count': 5677 }, { 'key': 'Home equity loan or line of credit (HELOC)', 'doc_count': 4155 }, { 'key': 'Other type of mortgage', 'doc_count': 2989 }, { 'key': 'Reverse mortgage', 'doc_count': 1110 }, { 'key': 'USDA mortgage', 'doc_count': 228 }, { 'key': 'Manufactured home loan', 'doc_count': 195 }] } }, { 'key': 'Money transfer, virtual currency, or money service', 'doc_count': 42137, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Mobile or digital wallet', 'doc_count': 15388 }, { 'key': 'Domestic (US) money transfer', 'doc_count': 11709 }, { 'key': 'Virtual currency', 'doc_count': 6375 }, { 'key': 'International money transfer', 'doc_count': 5180 }, { 'key': 'Check cashing service', 'doc_count': 830 }, { 'key': 'Money order, traveler\'s check or cashier\'s check', 'doc_count': 751 }, { 'key': 'Foreign currency exchange', 'doc_count': 523 }, { 'key': 'Traveler\'s check or cashier\'s check', 'doc_count': 441 }, { 'key': 'Debt settlement', 'doc_count': 341 }, { 'key': 'Refund anticipation check', 'doc_count': 302 }, { 'key': 'Money order', 'doc_count': 297 }] } }, { 'key': 'Vehicle loan or lease', 'doc_count': 33228, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Loan', 'doc_count': 28800 }, { 'key': 'Lease', 'doc_count': 4406 }, { 'key': 'Title loan', 'doc_count': 22 }] } }, { 'key': 'Student loan', 'doc_count': 31251, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Federal student loan servicing', 'doc_count': 23862 }, { 'key': 'Private student loan', 'doc_count': 7389 }] } }, { 'key': 'Payday loan, title loan, or personal loan', 'doc_count': 11208, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Installment loan', 'doc_count': 5195 }, { 'key': 'Personal line of credit', 'doc_count': 3091 }, { 'key': 'Payday loan', 'doc_count': 1853 }, { 'key': 'Title loan', 'doc_count': 1024 }, { 'key': 'Pawn loan', 'doc_count': 33 }] } }, { 'key': 'Payday loan, title loan, personal loan, or advance loan', 'doc_count': 9746, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Installment loan', 'doc_count': 5027 }, { 'key': 'Personal line of credit', 'doc_count': 2177 }, { 'key': 'Payday loan', 'doc_count': 1492 }, { 'key': 'Title loan', 'doc_count': 759 }, { 'key': 'Other advances of future income', 'doc_count': 176 }, { 'key': 'Earned wage access', 'doc_count': 73 }, { 'key': 'Pawn loan', 'doc_count': 28 }, { 'key': 'Tax refund anticipation loan or check', 'doc_count': 14 }] } }, { 'key': 'Prepaid card', 'doc_count': 7232, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'General-purpose prepaid card', 'doc_count': 4094 }, { 'key': 'Government benefit card', 'doc_count': 1729 }, { 'key': 'Gift card', 'doc_count': 1076 }, { 'key': 'Payroll card', 'doc_count': 324 }, { 'key': 'Student prepaid card', 'doc_count': 9 }] } }, { 'key': 'Debt or credit management', 'doc_count': 2206, 'sub_product.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Debt settlement', 'doc_count': 1345 }, { 'key': 'Credit repair services', 'doc_count': 715 }, { 'key': 'Mortgage modification or foreclosure avoidance', 'doc_count': 115 }, { 'key': 'Student loan debt relief', 'doc_count': 31 }] } }], 'issue': [{ 'key': 'Incorrect information on your report', 'doc_count': 1598970, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Information belongs to someone else', 'doc_count': 1043158 }, { 'key': 'Account information incorrect', 'doc_count': 207947 }, { 'key': 'Account status incorrect', 'doc_count': 183870 }, { 'key': 'Personal information incorrect', 'doc_count': 101747 }, { 'key': 'Public record information inaccurate', 'doc_count': 21282 }, { 'key': 'Old information reappears or never goes away', 'doc_count': 21035 }, { 'key': 'Information is missing that should be on the report', 'doc_count': 17107 }, { 'key': 'Information is incorrect', 'doc_count': 2176 }, { 'key': 'Information that should be on the report is missing', 'doc_count': 648 }] } }, { 'key': 'Improper use of your report', 'doc_count': 1113708, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Reporting company used your report improperly', 'doc_count': 756390 }, { 'key': 'Credit inquiries on your report that you don\'t recognize', 'doc_count': 350994 }, { 'key': 'Report provided to employer without your written authorization', 'doc_count': 4899 }, { 'key': 'Received unsolicited financial product or insurance offers after opting out', 'doc_count': 1425 }] } }, { 'key': 'Problem with a company\'s investigation into an existing problem', 'doc_count': 463162, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Their investigation did not fix an error on your report', 'doc_count': 266763 }, { 'key': 'Investigation took more than 30 days', 'doc_count': 113832 }, { 'key': 'Was not notified of investigation status or results', 'doc_count': 55873 }, { 'key': 'Difficulty submitting a dispute or getting information about a dispute over the phone', 'doc_count': 14515 }, { 'key': 'Problem with personal statement of dispute', 'doc_count': 12179 }] } }, { 'key': 'Problem with a credit reporting company\'s investigation into an existing problem', 'doc_count': 356753, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Their investigation did not fix an error on your report', 'doc_count': 214536 }, { 'key': 'Investigation took more than 30 days', 'doc_count': 77107 }, { 'key': 'Was not notified of investigation status or results', 'doc_count': 51262 }, { 'key': 'Difficulty submitting a dispute or getting information about a dispute over the phone', 'doc_count': 9195 }, { 'key': 'Problem with personal statement of dispute', 'doc_count': 4653 }] } }, { 'key': 'Attempts to collect debt not owed', 'doc_count': 128781, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Debt is not yours', 'doc_count': 70078 }, { 'key': 'Debt was result of identity theft', 'doc_count': 38999 }, { 'key': 'Debt was paid', 'doc_count': 16188 }, { 'key': 'Debt was already discharged in bankruptcy and is no longer owed', 'doc_count': 3516 }] } }, { 'key': 'Managing an account', 'doc_count': 78368, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Deposits and withdrawals', 'doc_count': 28090 }, { 'key': 'Problem using a debit or ATM card', 'doc_count': 15947 }, { 'key': 'Funds not handled or disbursed as instructed', 'doc_count': 9197 }, { 'key': 'Banking errors', 'doc_count': 7923 }, { 'key': 'Problem accessing account', 'doc_count': 6178 }, { 'key': 'Problem making or receiving payments', 'doc_count': 4303 }, { 'key': 'Fee problem', 'doc_count': 3306 }, { 'key': 'Cashing a check', 'doc_count': 2637 }, { 'key': 'Deposits or withdrawals', 'doc_count': 480 }, { 'key': 'Problem with renewal', 'doc_count': 163 }, { 'key': 'Problem with fees or penalties', 'doc_count': 144 }] } }, { 'key': 'Written notification about debt', 'doc_count': 66840, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Didn\'t receive enough information to verify debt', 'doc_count': 28994 }, { 'key': 'Notification didn\'t disclose it was an attempt to collect a debt', 'doc_count': 20095 }, { 'key': 'Didn\'t receive notice of right to dispute', 'doc_count': 17751 }] } }, { 'key': 'Problem with a purchase shown on your statement', 'doc_count': 35963, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Credit card company isn\'t resolving a dispute about a purchase on your statement', 'doc_count': 24656 }, { 'key': 'Card was charged for something you did not purchase with the card', 'doc_count': 10221 }, { 'key': 'Overcharged for something you did purchase with the card', 'doc_count': 1086 }] } }, { 'key': 'Trouble during payment process', 'doc_count': 33886, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Escrow, taxes, or insurance', 'doc_count': 4084 }, { 'key': 'Trying to communicate with the company to fix an issue while managing or servicing your loan', 'doc_count': 3518 }, { 'key': 'Payment process', 'doc_count': 2867 }, { 'key': 'Loan sold or transferred to another company', 'doc_count': 753 }, { 'key': 'Fees charged', 'doc_count': 687 }, { 'key': 'Paying off the loan', 'doc_count': 621 }, { 'key': 'Private mortgage insurance (PMI)', 'doc_count': 597 }, { 'key': 'Lien release', 'doc_count': 189 }, { 'key': 'Interest rate', 'doc_count': 181 }] } }, { 'key': 'Dealing with your lender or servicer', 'doc_count': 23194, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Trouble with how payments are being handled', 'doc_count': 7878 }, { 'key': 'Received bad information about your loan', 'doc_count': 7726 }, { 'key': 'Problem with customer service', 'doc_count': 3619 }, { 'key': 'Need information about your loan balance or loan terms', 'doc_count': 1963 }, { 'key': 'Don\'t agree with the fees charged', 'doc_count': 1479 }, { 'key': 'Keep getting calls about your loan', 'doc_count': 419 }, { 'key': 'Co-signer', 'doc_count': 110 }] } }, { 'key': 'Getting a credit card', 'doc_count': 22713, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Card opened without my consent or knowledge', 'doc_count': 6885 }, { 'key': 'Card opened as result of identity theft or fraud', 'doc_count': 6784 }, { 'key': 'Application denied', 'doc_count': 5963 }, { 'key': 'Sent card you never applied for', 'doc_count': 1588 }, { 'key': 'Delay in processing application', 'doc_count': 805 }, { 'key': 'Problem getting a working replacement card', 'doc_count': 688 }] } }, { 'key': 'Unable to get your credit report or credit score', 'doc_count': 21429, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Other problem getting your report or credit score', 'doc_count': 17470 }, { 'key': 'Problem getting your free annual credit report', 'doc_count': 3959 }] } }, { 'key': 'False statements or representation', 'doc_count': 20696, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Attempted to collect wrong amount', 'doc_count': 17145 }, { 'key': 'Impersonated attorney, law enforcement, or government official', 'doc_count': 2020 }, { 'key': 'Indicated you were committing crime by not paying debt', 'doc_count': 1202 }, { 'key': 'Told you not to respond to a lawsuit they filed against you', 'doc_count': 329 }] } }, { 'key': 'Took or threatened to take negative or legal action', 'doc_count': 20554, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Threatened or suggested your credit would be damaged', 'doc_count': 10799 }, { 'key': 'Threatened to sue you for very old debt', 'doc_count': 3271 }, { 'key': 'Sued you without properly notifying you of lawsuit', 'doc_count': 2299 }, { 'key': 'Seized or attempted to seize your property', 'doc_count': 1941 }, { 'key': 'Collected or attempted to collect exempt funds', 'doc_count': 947 }, { 'key': 'Threatened to arrest you or take you to jail if you do not pay', 'doc_count': 703 }, { 'key': 'Sued you in a state where you do not live or did not sign for the debt', 'doc_count': 506 }, { 'key': 'Threatened to turn you in to immigration or deport you', 'doc_count': 88 }] } }, { 'key': 'Credit monitoring or identity theft protection services', 'doc_count': 18393, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Problem canceling credit monitoring or identify theft protection service', 'doc_count': 9154 }, { 'key': 'Didn\'t receive services that were advertised', 'doc_count': 3985 }, { 'key': 'Billing dispute for services', 'doc_count': 3546 }, { 'key': 'Problem with product or service terms changing', 'doc_count': 1107 }, { 'key': 'Received unwanted marketing or advertising', 'doc_count': 601 }] } }, { 'key': 'Fraud or scam', 'doc_count': 18295, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Closing an account', 'doc_count': 18215, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Company closed your account', 'doc_count': 7650 }, { 'key': 'Funds not received from closed account', 'doc_count': 6289 }, { 'key': 'Can\'t close your account', 'doc_count': 3646 }, { 'key': 'Fees charged for closing account', 'doc_count': 630 }] } }, { 'key': 'Struggling to pay mortgage', 'doc_count': 16977, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Trying to communicate with the company to fix an issue related to modification, forbearance, short sale, deed-in-lieu, bankruptcy, or foreclosure', 'doc_count': 2482 }, { 'key': 'Foreclosure', 'doc_count': 1386 }, { 'key': 'Applying for or obtaining a modification, forbearance plan, short sale, or deed-in-lieu', 'doc_count': 1215 }, { 'key': 'An existing modification, forbearance plan, short sale, or other loss mitigation relief', 'doc_count': 888 }] } }, { 'key': 'Other features, terms, or problems', 'doc_count': 16349, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Other problem', 'doc_count': 8255 }, { 'key': 'Problem with rewards from credit card', 'doc_count': 3327 }, { 'key': 'Problem with customer service', 'doc_count': 1672 }, { 'key': 'Privacy issues', 'doc_count': 1175 }, { 'key': 'Problem with balance transfer', 'doc_count': 1079 }, { 'key': 'Add-on products and services', 'doc_count': 419 }, { 'key': 'Credit card company forcing arbitration', 'doc_count': 173 }, { 'key': 'Problem with cash advances', 'doc_count': 172 }, { 'key': 'Problem with convenience check', 'doc_count': 77 }] } }, { 'key': 'Problem with a lender or other company charging your account', 'doc_count': 15805, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Transaction was not authorized', 'doc_count': 13022 }, { 'key': 'Money was taken from your account on the wrong day or for the wrong amount', 'doc_count': 1745 }, { 'key': 'Can\'t stop withdrawals from your account', 'doc_count': 1038 }] } }, { 'key': 'Communication tactics', 'doc_count': 14936, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Frequent or repeated calls', 'doc_count': 7765 }, { 'key': 'You told them to stop contacting you, but they keep trying', 'doc_count': 4566 }, { 'key': 'Used obscene, profane, or other abusive language', 'doc_count': 1952 }, { 'key': 'Called before 8am or after 9pm', 'doc_count': 646 }, { 'key': 'Frequent or repeated messages', 'doc_count': 4 }, { 'key': 'Contacted before 8am or after 9pm', 'doc_count': 3 }] } }, { 'key': 'Problem when making payments', 'doc_count': 13977, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Problem during payment process', 'doc_count': 9935 }, { 'key': 'You never received your bill or did not know a payment was due', 'doc_count': 1239 }] } }, { 'key': 'Opening an account', 'doc_count': 13342, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Account opened as a result of fraud', 'doc_count': 4239 }, { 'key': 'Unable to open an account', 'doc_count': 3509 }, { 'key': 'Didn\'t receive terms that were advertised', 'doc_count': 2955 }, { 'key': 'Account opened without my consent or knowledge', 'doc_count': 2124 }, { 'key': 'Confusing or missing disclosures', 'doc_count': 515 }] } }, { 'key': 'Fees or interest', 'doc_count': 13269, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Problem with fees', 'doc_count': 8764 }, { 'key': 'Charged too much interest', 'doc_count': 3247 }, { 'key': 'Unexpected increase in interest rate', 'doc_count': 1258 }] } }, { 'key': 'Problem with fraud alerts or security freezes', 'doc_count': 12870, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Managing the loan or lease', 'doc_count': 10555, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Billing problem', 'doc_count': 5010 }, { 'key': 'Problem with fees charged', 'doc_count': 1896 }, { 'key': 'Problem with additional products or services purchased with the loan', 'doc_count': 1583 }, { 'key': 'Problem with the interest rate', 'doc_count': 1240 }, { 'key': 'Loan sold or transferred to another company', 'doc_count': 826 }] } }, { 'key': 'Closing your account', 'doc_count': 9526, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Company closed your account', 'doc_count': 6958 }, { 'key': 'Can\'t close your account', 'doc_count': 2568 }] } }, { 'key': 'Applying for a mortgage or refinancing an existing mortgage', 'doc_count': 8244, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Application denials', 'doc_count': 619 }, { 'key': 'Trying to communicate with the company to fix an issue with the application process', 'doc_count': 526 }, { 'key': 'Delays in the application process', 'doc_count': 382 }, { 'key': 'Confusing or misleading advertising or marketing', 'doc_count': 344 }, { 'key': 'Changes in loan terms during the application process', 'doc_count': 275 }, { 'key': 'Loan estimate or other related disclosures', 'doc_count': 150 }, { 'key': 'Fees or costs during the application process', 'doc_count': 142 }, { 'key': 'Negative impact of inaccurate appraisal', 'doc_count': 80 }] } }, { 'key': 'Problem caused by your funds being low', 'doc_count': 7033, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Overdrafts and overdraft fees', 'doc_count': 4005 }, { 'key': 'Non-sufficient funds and associated fees', 'doc_count': 1720 }, { 'key': 'Bounced checks or returned payments', 'doc_count': 708 }, { 'key': 'Late or other fees', 'doc_count': 600 }] } }, { 'key': 'Other transaction problem', 'doc_count': 6778, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Advertising and marketing, including promotional offers', 'doc_count': 6451, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Didn\'t receive advertised or promotional terms', 'doc_count': 3599 }, { 'key': 'Confusing or misleading advertising about the credit card', 'doc_count': 2852 }] } }, { 'key': 'Struggling to pay your loan', 'doc_count': 6309, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Denied request to lower payments', 'doc_count': 1480 }, { 'key': 'Lender trying to repossess or disable the vehicle', 'doc_count': 1235 }, { 'key': 'Loan balance remaining after the vehicle is repossessed and sold', 'doc_count': 1115 }, { 'key': 'Problem after you declared or threatened to declare bankruptcy', 'doc_count': 163 }] } }, { 'key': 'Getting a loan or lease', 'doc_count': 5649, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Fraudulent loan', 'doc_count': 1659 }, { 'key': 'Credit denial', 'doc_count': 1361 }, { 'key': 'Confusing or misleading advertising or marketing', 'doc_count': 767 }, { 'key': 'Loan opened without my consent or knowledge', 'doc_count': 630 }, { 'key': 'Changes in terms mid-deal or after closing', 'doc_count': 451 }, { 'key': 'High-pressure sales tactics', 'doc_count': 251 }, { 'key': 'Problem with signing the paperwork', 'doc_count': 238 }, { 'key': 'Problem with additional add-on products or services purchased with the loan', 'doc_count': 186 }, { 'key': 'Problem with a trade-in', 'doc_count': 40 }, { 'key': 'Confusing or misleading advertising', 'doc_count': 36 }, { 'key': 'Did not receive car title', 'doc_count': 30 }] } }, { 'key': 'Trouble using the card', 'doc_count': 5623, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Trouble using the card to spend money in a store or online', 'doc_count': 4144 }, { 'key': 'Trouble getting information about the card', 'doc_count': 632 }, { 'key': 'Problem using the card to withdraw money from an ATM', 'doc_count': 294 }, { 'key': 'Problem with direct deposit', 'doc_count': 233 }, { 'key': 'Trouble using the card to pay a bill', 'doc_count': 182 }, { 'key': 'Problem adding money', 'doc_count': 75 }, { 'key': 'Trouble using the card to send money to another person', 'doc_count': 37 }, { 'key': 'Problem with a check written from your prepaid card account', 'doc_count': 26 }] } }, { 'key': 'Trouble using your card', 'doc_count': 5507, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Can\'t use card to make purchases', 'doc_count': 3714 }, { 'key': 'Credit card company won\'t increase or decrease your credit limit', 'doc_count': 1690 }, { 'key': 'Account sold or transferred to another company', 'doc_count': 103 }] } }, { 'key': 'Problems at the end of the loan or lease', 'doc_count': 5295, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Unable to receive car title or other problem after the loan is paid off', 'doc_count': 2568 }, { 'key': 'Problem with paying off the loan', 'doc_count': 1172 }, { 'key': 'Problem while selling or giving up the vehicle', 'doc_count': 471 }, { 'key': 'Problem related to refinancing', 'doc_count': 410 }, { 'key': 'Problem when attempting to purchase vehicle at the end of the lease', 'doc_count': 234 }, { 'key': 'Termination fees or other problem when ending the lease early', 'doc_count': 217 }, { 'key': 'Excess mileage, damage, or wear fees, or other problem after the lease is finished', 'doc_count': 168 }, { 'key': 'Problem extending the lease', 'doc_count': 55 }] } }, { 'key': 'Closing on a mortgage', 'doc_count': 5204, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Trying to communicate with the company to fix an issue with the loan closing', 'doc_count': 453 }, { 'key': 'Closing disclosure or other related disclosures', 'doc_count': 388 }, { 'key': 'Changes in loan terms during or after closing', 'doc_count': 317 }, { 'key': 'Delays with the closing process', 'doc_count': 309 }, { 'key': 'Fees or costs after closing', 'doc_count': 183 }, { 'key': 'Setting up an escrow account for taxes and insurance', 'doc_count': 37 }] } }, { 'key': 'Struggling to repay your loan', 'doc_count': 4844, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Can\'t get other flexible options for repaying your loan', 'doc_count': 1441 }, { 'key': 'Problem with forgiveness, cancellation, or discharge', 'doc_count': 1140 }, { 'key': 'Problem lowering your monthly payments', 'doc_count': 865 }, { 'key': 'Problem with your payment plan', 'doc_count': 680 }, { 'key': 'Can\'t temporarily delay making payments', 'doc_count': 573 }, { 'key': 'Bankruptcy', 'doc_count': 145 }] } }, { 'key': 'Charged fees or interest you didn\'t expect', 'doc_count': 4709, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Unauthorized transactions or other transaction problem', 'doc_count': 4189, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem with a purchase or transfer', 'doc_count': 4159, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Card company isn\'t resolving a dispute about a purchase or transfer', 'doc_count': 2474 }, { 'key': 'Charged for a purchase or transfer you did not make with the card', 'doc_count': 1619 }, { 'key': 'Overcharged for a purchase or transfer you did make with the card', 'doc_count': 66 }] } }, { 'key': 'Threatened to contact someone or share information improperly', 'doc_count': 3724, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Talked to a third-party about your debt', 'doc_count': 2147 }, { 'key': 'Contacted you after you asked them to stop', 'doc_count': 958 }, { 'key': 'Contacted your employer', 'doc_count': 551 }, { 'key': 'Contacted you instead of your attorney', 'doc_count': 68 }] } }, { 'key': 'Money was not available when promised', 'doc_count': 3674, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Managing, opening, or closing your mobile wallet account', 'doc_count': 3421, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Repossession', 'doc_count': 3316, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Loan balance remaining after the vehicle is repossessed and sold', 'doc_count': 938 }, { 'key': 'Lender trying to repossess or disable the vehicle', 'doc_count': 389 }, { 'key': 'Notice to repossess', 'doc_count': 384 }, { 'key': 'Account reinstatement or redemption after repossession', 'doc_count': 378 }, { 'key': 'Voluntary repossession', 'doc_count': 330 }, { 'key': 'Deficiency balance after repossession', 'doc_count': 315 }, { 'key': 'Company explaining amount owed', 'doc_count': 213 }, { 'key': 'Damage caused or loss of personal items in vehicle during the actual repossession', 'doc_count': 198 }, { 'key': 'Company communicating payment assistance or payment extension options', 'doc_count': 171 }] } }, { 'key': 'Unexpected or other fees', 'doc_count': 2974, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem with a company\'s investigation into an existing issue', 'doc_count': 2550, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Their investigation did not fix an error on your report', 'doc_count': 1186 }, { 'key': 'Difficulty submitting a dispute or getting information about a dispute over the phone', 'doc_count': 467 }, { 'key': 'Investigation took more than 30 days', 'doc_count': 352 }, { 'key': 'Problem with personal statement of dispute', 'doc_count': 297 }, { 'key': 'Was not notified of investigation status or results', 'doc_count': 248 }] } }, { 'key': 'Electronic communications', 'doc_count': 2111, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Frequent or repeated messages', 'doc_count': 1193 }, { 'key': 'You told them to stop contacting you, but they keep trying', 'doc_count': 694 }, { 'key': 'Contacted before 8am or after 9pm', 'doc_count': 134 }, { 'key': 'Used obscene, profane, or other abusive language', 'doc_count': 90 }] } }, { 'key': 'Problem getting a card or closing an account', 'doc_count': 1928, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Trouble getting, activating, or registering a card', 'doc_count': 703 }, { 'key': 'Trouble closing card', 'doc_count': 702 }, { 'key': 'Trouble getting a working replacement card', 'doc_count': 418 }, { 'key': 'Don\'t want a card provided by your employer or the government', 'doc_count': 105 }] } }, { 'key': 'Confusing or missing disclosures', 'doc_count': 1918, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Struggling to pay your bill', 'doc_count': 1820, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Credit card company won\'t work with you while you\'re going through financial hardship', 'doc_count': 1597 }, { 'key': 'Problem lowering your monthly payments', 'doc_count': 147 }, { 'key': 'Filed for bankruptcy', 'doc_count': 76 }] } }, { 'key': 'Problem with the payoff process at the end of the loan', 'doc_count': 1816, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Getting the loan', 'doc_count': 1691, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem with customer service', 'doc_count': 1658, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Trouble accessing funds in your mobile or digital wallet', 'doc_count': 1505, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Getting a line of credit', 'doc_count': 1397, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem with additional add-on products or services', 'doc_count': 1259, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Other service problem', 'doc_count': 1129, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Confusing or misleading advertising or marketing', 'doc_count': 961, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Identity theft protection or other monitoring services', 'doc_count': 776, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Problem canceling credit monitoring or identify theft protection service', 'doc_count': 253 }, { 'key': 'Didn\'t receive services that were advertised', 'doc_count': 167 }, { 'key': 'Billing dispute for services', 'doc_count': 128 }, { 'key': 'Problem with product or service terms changing', 'doc_count': 127 }, { 'key': 'Received unwanted marketing or advertising', 'doc_count': 101 }] } }, { 'key': 'Getting a loan', 'doc_count': 726, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Confusing or misleading advertising', 'doc_count': 183 }, { 'key': 'High pressure sales tactics or recruiting', 'doc_count': 165 }, { 'key': 'Fraudulent loan', 'doc_count': 162 }, { 'key': 'Loan opened without my consent or knowledge', 'doc_count': 67 }, { 'key': 'Denied loan', 'doc_count': 61 }, { 'key': 'Problem with the interest rate', 'doc_count': 25 }, { 'key': 'Changes in terms mid-deal or after closing', 'doc_count': 20 }, { 'key': 'Issues with financial aid services', 'doc_count': 18 }, { 'key': 'Qualified for a better loan than the one offered', 'doc_count': 13 }, { 'key': 'Problem with signing the paperwork', 'doc_count': 8 }] } }, { 'key': 'Didn\'t provide services promised', 'doc_count': 642, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Received a loan you didn\'t apply for', 'doc_count': 535, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Wrong amount charged or received', 'doc_count': 467, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Charged upfront or unexpected fees', 'doc_count': 330, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Can\'t contact lender or servicer', 'doc_count': 318, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Lost or stolen money order', 'doc_count': 311, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Can\'t stop withdrawals from your bank account', 'doc_count': 272, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Unauthorized withdrawals or charges', 'doc_count': 258, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Loan payment wasn\'t credited to your account', 'doc_count': 252, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Vehicle was repossessed or sold the vehicle', 'doc_count': 244, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Lost or stolen check', 'doc_count': 221, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem adding money', 'doc_count': 220, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Money was taken from your bank account on the wrong day or for the wrong amount', 'doc_count': 195, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Advertising', 'doc_count': 184, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Confusing or misleading advertising about the card', 'doc_count': 116 }, { 'key': 'Changes in terms from what was offered or advertised', 'doc_count': 68 }] } }, { 'key': 'Was approved for a loan, but didn\'t receive the money', 'doc_count': 161, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Excessive fees', 'doc_count': 99, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem with cash advance', 'doc_count': 98, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Credit limit changed', 'doc_count': 91, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Issues with repayment', 'doc_count': 79, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem with overdraft', 'doc_count': 67, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Overdraft charges', 'doc_count': 63 }, { 'key': 'Was signed up for overdraft on card, but don\'t want to be', 'doc_count': 4 }] } }, { 'key': 'Issue where my lender is my school', 'doc_count': 66, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Cannot graduate, receive diploma, or get transcript due to money owed', 'doc_count': 34 }, { 'key': 'Issues with fees connected to the loan', 'doc_count': 32 }] } }, { 'key': 'Incorrect exchange rate', 'doc_count': 64, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Overdraft, savings, or rewards features', 'doc_count': 64, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Vehicle was damaged or destroyed the vehicle', 'doc_count': 62, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Issue with income share agreement', 'doc_count': 55, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Marketing or disclosure issues', 'doc_count': 18 }, { 'key': 'Payment issues', 'doc_count': 15 }, { 'key': 'Dealing with provider of income share agreement', 'doc_count': 12 }, { 'key': 'Billing or statement issues', 'doc_count': 10 }] } }, { 'key': 'Problems receiving the advance', 'doc_count': 41, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Was approved for a loan, but didn\'t receive money', 'doc_count': 40, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Unexpected fees', 'doc_count': 36, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Lost or stolen refund', 'doc_count': 6, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Problem with an overdraft', 'doc_count': 3, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [{ 'key': 'Overdraft charges', 'doc_count': 3 }] } }, { 'key': 'Property was sold', 'doc_count': 3, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }, { 'key': 'Property was damaged or destroyed property', 'doc_count': 1, 'sub_issue.raw': { 'doc_count_error_upper_bound': 0, 'sum_other_doc_count': 0, 'buckets': [] } }], 'timely': [{ 'key': 'Yes', 'doc_count': 4285677 }, { 'key': 'No', 'doc_count': 17688 }], 'consumer_consent_provided': [{ 'key': 'Consent not provided', 'doc_count': 2116160 }, { 'key': 'Consent provided', 'doc_count': 1398616 }, { 'key': 'Other', 'doc_count': 232494 }, { 'key': 'N/A', 'doc_count': 117854 }, { 'key': 'Consent withdrawn', 'doc_count': 7051 }], 'company_response': [{ 'key': 'Closed with explanation', 'doc_count': 2116902 }, { 'key': 'Closed with non-monetary relief', 'doc_count': 1725357 }, { 'key': 'In progress', 'doc_count': 400152 }, { 'key': 'Closed with monetary relief', 'doc_count': 57173 }, { 'key': 'Untimely response', 'doc_count': 3763 }], 'submitted_via': [{ 'key': 'Web', 'doc_count': 4184271 }, { 'key': 'Phone', 'doc_count': 67222 }, { 'key': 'Referral', 'doc_count': 33479 }, { 'key': 'Postal mail', 'doc_count': 17152 }, { 'key': 'Web Referral', 'doc_count': 1240 }, { 'key': 'Email', 'doc_count': 1 }], 'state': [{ 'key': 'FL', 'doc_count': 582112 }, { 'key': 'TX', 'doc_count': 527475 }, { 'key': 'CA', 'doc_count': 431069 }, { 'key': 'GA', 'doc_count': 328850 }, { 'key': 'NY', 'doc_count': 274442 }, { 'key': 'PA', 'doc_count': 217522 }, { 'key': 'IL', 'doc_count': 194214 }, { 'key': 'NJ', 'doc_count': 147809 }, { 'key': 'NC', 'doc_count': 143345 }, { 'key': 'MD', 'doc_count': 110907 }, { 'key': 'MI', 'doc_count': 102210 }, { 'key': 'OH', 'doc_count': 95473 }, { 'key': 'VA', 'doc_count': 93430 }, { 'key': 'LA', 'doc_count': 87562 }, { 'key': 'AL', 'doc_count': 84930 }, { 'key': 'SC', 'doc_count': 83513 }, { 'key': 'AZ', 'doc_count': 70302 }, { 'key': 'TN', 'doc_count': 69735 }, { 'key': 'NV', 'doc_count': 66103 }, { 'key': 'IN', 'doc_count': 57049 }, { 'key': 'MA', 'doc_count': 52892 }, { 'key': 'MO', 'doc_count': 50645 }, { 'key': 'MS', 'doc_count': 44911 }, { 'key': 'CT', 'doc_count': 33207 }, { 'key': 'WA', 'doc_count': 31763 }, { 'key': 'WI', 'doc_count': 29443 }, { 'key': 'CO', 'doc_count': 28454 }, { 'key': 'MN', 'doc_count': 25045 }, { 'key': 'AR', 'doc_count': 23376 }, { 'key': 'DE', 'doc_count': 22732 }, { 'key': 'OK', 'doc_count': 20105 }, { 'key': 'KY', 'doc_count': 18690 }, { 'key': 'DC', 'doc_count': 16170 }, { 'key': 'OR', 'doc_count': 14352 }, { 'key': 'PR', 'doc_count': 13174 }, { 'key': 'UT', 'doc_count': 12000 }, { 'key': 'KS', 'doc_count': 10465 }, { 'key': 'IA', 'doc_count': 9910 }, { 'key': 'NE', 'doc_count': 9365 }, { 'key': 'NM', 'doc_count': 8669 }, { 'key': 'RI', 'doc_count': 8378 }, { 'key': 'HI', 'doc_count': 6846 }, { 'key': 'WV', 'doc_count': 5497 }, { 'key': 'ID', 'doc_count': 5052 }, { 'key': 'NH', 'doc_count': 4648 }, { 'key': 'ME', 'doc_count': 3532 }, { 'key': 'ND', 'doc_count': 2644 }, { 'key': 'MT', 'doc_count': 2533 }, { 'key': 'AK', 'doc_count': 2426 }, { 'key': 'SD', 'doc_count': 1804 }, { 'key': 'WY', 'doc_count': 1663 }, { 'key': 'VT', 'doc_count': 1374 }, { 'key': 'VI', 'doc_count': 1033 }, { 'key': 'AE', 'doc_count': 774 }, { 'key': 'UNITED STATES MINOR OUTLYING ISLANDS', 'doc_count': 475 }, { 'key': 'AP', 'doc_count': 384 }, { 'key': 'GU', 'doc_count': 160 }, { 'key': 'AS', 'doc_count': 35 }, { 'key': 'MP', 'doc_count': 25 }, { 'key': 'AA', 'doc_count': 13 }, { 'key': 'FM', 'doc_count': 1 }, { 'key': 'MH', 'doc_count': 1 }], 'consumer_disputed': [{ 'key': 'N/A', 'doc_count': 4303365 }], 'company_public_response': [{ 'key': 'Company has responded to the consumer and the CFPB and chooses not to provide a public response', 'doc_count': 2220172 }, { 'key': 'Company believes it acted appropriately as authorized by contract or law', 'doc_count': 60870 }, { 'key': 'Company disputes the facts presented in the complaint', 'doc_count': 4200 }, { 'key': 'Company believes the complaint is the result of a misunderstanding', 'doc_count': 4110 }, { 'key': 'Company believes the complaint provided an opportunity to answer consumer\'s questions', 'doc_count': 3071 }, { 'key': 'Company believes complaint caused principally by actions of third party outside the control or direction of the company', 'doc_count': 2841 }, { 'key': 'Company can\'t verify or dispute the facts in the complaint', 'doc_count': 1427 }, { 'key': 'Company believes complaint represents an opportunity for improvement to better serve consumers', 'doc_count': 1311 }, { 'key': 'Company believes complaint is the result of an isolated error', 'doc_count': 1309 }, { 'key': 'Company believes complaint relates to a discontinued policy or procedure', 'doc_count': 23 }], 'tags': [{ 'key': 'Servicemember', 'doc_count': 169769 }, { 'key': 'Older American', 'doc_count': 62354 }, { 'key': 'Older American, Servicemember', 'doc_count': 19112 }] }; +export const documentResponse = { + took: 1, + timed_out: false, + _shards: { total: 5, successful: 5, skipped: 0, failed: 0 }, + hits: { + total: { value: 1, relation: 'eq' }, + max_score: 1.0, + hits: [ + { + _index: 'complaint-public-v2', + _type: '_doc', + _id: '2371744', + _score: 1.0, + _source: { + company: 'JPMORGAN CHASE & CO.', + company_public_response: 'Company acknowledges the complaint', + company_response: 'Closed with explanation', + complaint_id: '2371744', + complaint_what_happened: 'Lorem ipsum dolor sit amet', + consumer_consent_provided: 'Consent provided', + consumer_disputed: 'Yes', + date_received: '2017-03-04T12:00:00', + date_sent_to_company: '2017-03-04T12:00:00', + has_narrative: true, + issue: 'Account opening, closing, or management', + product: 'Bank account or service', + state: 'KY', + sub_issue: 'Closing', + sub_product: 'Checking account', + submitted_via: 'Web', + tags: 'Older American', + timely: 'Yes', + zip_code: '423XX', + }, + }, + ], + }, +} \ No newline at end of file