Skip to main content
Version: MarketPulse

Records

Author(s)

  • Pritam Dutta

Last Updated Date

2026-03-27


SRS References

  • SRS Document: MarketPulse-SRS-v1.0
  • Section: Records and Details
  • Document Link: Records

Version History

VersionDateAuthorChanges
1.02026-03-27Pritam DuttaRecords and details

Feature Overview

The Records feature provides a centralized view of all data fetched from multiple sources within the MarketPulse platform. It enables users to explore, filter, manage, and export records efficiently.

This module ensures that users can access detailed information for each record, including its source and listing URL, while also offering advanced filtering and export capabilities for better data handling and reporting.

Additionally, users can take actions on records such as returning them in case of issues, ensuring data accuracy and workflow integrity.

Key Features

  • Records Listing: Displays all fetched records in a structured and paginated format
  • Detailed Record View: Each record includes complete details along with its associated listing URL
  • Advanced Filtering: Users can filter records based on multiple criteria for precise data retrieval
  • Filter-Based Exporting: Export data based on applied filters to generate customized datasets
  • Export Functionality: Initiate data export for full or filtered records
  • Record Return Option: Users can return a record if any issue or inconsistency is identified
  • Data Source Integration: Aggregates records from multiple sources into a single view

User Types

  1. Admin: Platform administrators with full system access
  2. Reseller: Organization-level users managing multiple dealers
  3. Dealer: Individual dealer users with location-specific access

Functional Requirements

IDRequirementPriority
FR-1Fetch and display records from multiple data sourcesHigh
FR-2Display records in a paginated and structured formatHigh
FR-3View detailed information for each recordHigh
FR-4Show listing URL associated with each recordHigh
FR-5Apply filters based on multiple criteriaHigh
FR-6Support dynamic filtering with real-time updatesHigh
FR-7Export all recordsHigh
FR-8Export filtered records based on applied filtersHigh
FR-9Initiate export jobs with unique export identifiersHigh
FR-10Track export status using export codeMedium
FR-11Allow users to return a record with a selected reasonHigh
FR-12Maintain audit log for record actions (view, export, return)Medium
FR-13Handle empty and error states gracefullyMedium
FR-14Support search functionality within recordsMedium
FR-15Enable sorting of records based on fields (e.g., date, source)Low

Non-Functional Requirements

IDRequirementPriority
NFR-1System must handle large volumes of records efficientlyHigh
NFR-2Record fetching and filtering response time < 1 secondHigh
NFR-3Export processing should be asynchronous and non-blockingHigh
NFR-4Ensure data consistency across fetched sourcesHigh
NFR-5Maintain 99.9% uptime for records serviceHigh
NFR-6Secure data handling during export and record operationsMedium
NFR-7Scalable architecture to support increasing data sourcesMedium
NFR-8Proper error handling and logging for debugging and monitoringMedium

Here need to include the Schema , Models , Enums

API Interfaces

EndpointMethodPurposeParametersRequest ModelResponse ModelStatus Codes
/recordsGETFetch all records with pagination and filteringQuery params (filters, pagination)-ServerPaginatedData<Record>200, 400, 401, 403, 404, 500
/records/exportPOSTInitiate exporting with or withput filteringJWT in header-CommonResponse & ExportResponse200, 400, 401, 403, 404, 500

API Examples

1. Get Records API

Endpoint: GET /records

Request Headers:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type: application/json

Request Headers:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Request Body (Get Records):

{
"dealerId": "string (optional)",
"sourceId": "string (optional)",
"searchKeyword": "string (optional)",
"rowsPerPage": 10,
"pageNumber": 1,
"postedDateFrom": "YYYY-MM-DD (optional)",
"postedDateTo": "YYYY-MM-DD (optional)",
"createdAtFrom": "YYYY-MM-DD (optional)",
"createdAtTo": "YYYY-MM-DD (optional)"
}

Success Response (200):

  "data": {
"data": [
{
"refinedListingId": "uuid",
"postedDate": "2026-03-20",
"sourceName": "string",
"make": "string",
"model": "string",
"year": 2022,
"mileage": 15000,
"location": "string",
"price": 25000,
"dealerName": "string",
"dealerCode": "string",
"rawListingId": "uuid",
"enrichmentJobId": "uuid",
"listingTitle": "string",
"sellerType": "Dealer",
"confidenceScore": 0.85,
"classificationReasons": [
"string"
],
"dealerIndicators": [
"string"
],
"isQualified": true,
"attributes": {},
"description": "string",
"images": [
"string"
],
"createdAt": "2026-03-21T10:00:00Z",
"updatedAt": "2026-03-21T12:00:00Z"
}
],
"totalNumber": 1,
"hasPreviousPage": true,
"hasNextPage": true,
"totalPages": 1,
"pageNumber": 1,
"rowsPerPage": 1
}

Error Response (400 Bad Request):

{
"status": -20000,
"message": "Validation failed."
}

2 . Export Records API

Endpoint: POST /api/management/records/export

Request Headers:

Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json

Request Headers:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Request Body (Export):

{
"dealerId": "",
"sourceId": null,
"searchKeyword": null,
"rowsPerPage": 1,
"pageNumber": 1,
"postedDateFrom": null,
"postedDateTo": null,
"createdAtFrom": null,
"createdAtTo": null
}

Success Response (200):

{
"status": 200,
"message": "string",
"exportCode": "string",
"exportId": "string"
}

Error Response (400 Bad Request):

{
"status": -20000,
"message": "Validation failed."
}

Workflow

1. User Views and Manages Records

  1. User logs into the Management Portal
  2. User navigates to Records page
  3. System loads and displays all records in a paginated table
  4. User selects a dealer from the dealer dropdown/filter
  5. User searches records using keyword (SearchKeyword)
  6. User applies filters:
    • Dealer
    • Source
    • Posted Date range
    • Created Date range
  7. User sorts records:
    • By Created Date
    • By Posted Date
  8. Frontend prepares filter payload
  9. GET /records is triggered with query parameters
  10. System validates filter parameters
  11. System fetches records from database/services
  12. System returns paginated response
  13. Frontend displays updated records list

2. Export Records (Filtered Data)

  1. User selects a dealer (mandatory for export)
  2. User optionally applies filters (date range, source, keyword)
  3. User clicks on "Export" button
  4. Frontend validates:
    • Dealer must be selected
  5. Frontend prepares ExportRequest payload
  6. POST /api/management/records/export is triggered
  7. System validates request:
    • DealerId is present
    • Filter parameters are valid
  8. System initiates export job asynchronously
  9. System generates unique exportCode
  10. System stores export job details
  11. System returns success response with exportCode
  12. User is notified that export has started

Development Tasks & Estimates

NoTask NameEstimate (Hours)DependenciesNotes
1Database Schema Setup & Index Optimization4 hoursNoneEnsure records and export tables exist with proper indexing (dealerId, dates, sourceId)
2Feature Documentation4 hoursTask 1Document filter models, response DTOs, and export flow
3Feature Planning & Technical Design5 hoursNoneDefine architecture, filtering logic, export workflow, and validation rules
4C# Contract Models (ContractLibrary)3 hoursTask 1Create Record DTOs, filter models, pagination wrapper, and export models
5API: Get Records - Paginated List (GET /records)7 hoursTask 4Implement filtering, pagination, sorting, search, and unit tests
6API: Export Records (POST /records/export)6 hoursTask 5Implement export job creation, validation, async processing, and exportCode generation
7API: Export History (GET /records/export-history)4 hoursTask 6Fetch export jobs with pagination and status handling
8Background Job for Export Processing6 hoursTask 6Handle large dataset export asynchronously, file generation, and storage
9Frontend Integration (Filters, Sorting, Export Trigger)5 hoursTask 5Integrate APIs, manage UI state, validation for dealer selection
10Testing (Unit + Integration + Edge Cases)5 hoursAll aboveCover filtering, pagination, export scenarios, and error handling
Grand Total49 hours

Testing & Quality Assurance

Integration Test Scenarios:

  • Fetch records API with valid and invalid filter combinations
  • Authorization checks (users can only access permitted dealer data)
  • Pagination edge cases (first page, last page, empty results, single page)
  • Sorting validation (Created Date, Posted Date ascending/descending)
  • Filter validation (dealer, source, date ranges, keyword search)
  • Export API with valid and invalid payloads
  • Export without dealer selection (should fail)
  • Export job creation and exportCode generation
  • Export history retrieval with different statuses
  • Large dataset handling during fetch and export
  • Data consistency between filtered results and exported data
  • Handling null/empty fields in records response

Testing Tools

  • xUnit - Unit and integration testing framework
  • FluentAssertions - Readable test assertions
  • Moq - Mocking framework for unit tests
  • WebApplicationFactory - Integration testing for APIs
  • Testcontainers - PostgreSQL container for integration tests
  • Bogus - Fake data generation for records
  • Postman/Swagger - Manual API testing
  • SonarQube - Code quality and coverage analysis

Acceptance Criteria

Feature Complete When:

  1. ✅ Records are fetched successfully with pagination
  2. ✅ All filters (dealer, source, date range, keyword) work correctly
  3. ✅ Sorting works correctly for Created Date and Posted Date
  4. ✅ Records display complete and accurate data from sources
  5. ✅ Listing URL and record details are correctly shown
  6. ✅ Export works only when dealer is selected
  7. ✅ Filter-based export generates correct dataset
  8. ✅ Export API returns a valid exportCode
  9. ✅ Export jobs are processed asynchronously without blocking UI
  10. ✅ Export history shows correct status (Pending, Processing, Completed, Failed)
  11. ✅ User can download exported file when status is "Completed"
  12. ✅ Proper error messages are shown for invalid inputs
  13. ✅ Authorization ensures access to permitted records only
  14. ✅ APIs respond within acceptable performance limits
  15. ✅ Unit test coverage > 85%
  16. ✅ All integration tests pass

Deployment Considerations

Configuration Changes

Database Migration:

  • Ensure records-related tables are created and up to date
  • Verify indexes on frequently queried fields (dealerId, sourceId, postedDate, createdAt)
  • Verify foreign key constraints between records, dealers, and sources
  • Ensure export job table is created for tracking export history
  • Seed source master data if required for filtering

Risks & Mitigations

RiskImpactLikelihoodMitigation Strategy
Large dataset fetching impacting performanceHighMediumImplement pagination, indexing, and query optimization
Slow filtering on multiple parametersMediumMediumAdd composite indexes; optimize queries; use caching for frequent filters
Exporting large data causing system loadHighMediumUse asynchronous background jobs; limit export size; implement queue-based processing
Export job failures or incomplete filesMediumLowAdd retry mechanism; maintain export status tracking; log failures for debugging
Missing dealer selection during exportLowHighEnforce frontend and backend validation
Inconsistent data between UI and exportMediumMediumUse same filtering logic for UI and export APIs
High memory usage during exportMediumMediumStream data instead of loading into memory; generate files in chunks
API latency under heavy loadHighMediumImplement caching, rate limiting, and horizontal scaling

Review & Approval

(Include a section for review and approval by stakeholders.)

  • Reviewer:
    (pending)

  • Approval Date:
    (pending)


Notes

Future Enhancements

  1. Advanced filtering options (multi-select, saved filters)
  2. Bulk record actions (bulk return, bulk export)
  3. Real-time record updates and live data refresh
  4. Export scheduling (daily/weekly automated exports)
  5. Download history with expiry and re-download support
  6. Record detail page with enriched insights
  7. Integration with analytics dashboard
  8. Notification system for export completion

Technical Debt to Address

  • Filter logic duplication between frontend and backend — centralize filtering contract
  • Response structure (data.data) is redundant — refactor to a cleaner structure
  • Lack of standardized error responses — implement consistent error handling model
  • No sorting parameters in API — add sortBy and sortDirection support
  • Export API shares filter model — consider separate ExportRequest model