Issue:
feat(payments): show aggregate count of payment status

Show count of aggregate payments status in the given time range:


![Image](https://github.com/user-attachments/assets/7510b765-03e7-4469-872d-f61f6748312c)


This can be part of filter Api.

Resolution:
<think>
PR Context:
- Title: feat(payments): add support for aggregates in payments
- Merged: 2024-08-21T13:01:59Z
- Files changed: 12 files
- Commits: 2 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
![image](https://github.com/user-attachments/assets/9fea2624-b844-4318-8595-d35908d1e993)
- The endpoint `/aggregate` to support views
![image](https://github.com/user-attachments/assets/f3cc252d-6e5d-410b-8a8d-162cb10418aa)

- Add support for aggregates in payments.
- For now it
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(payments): add support for aggregates in payments (#5654)
Files to modify:


**crates/api_models/src/events/payment.rs**
  Add:
    - function: private::get_api_event_type
    - impl: impl ApiEventMetric for PaymentsAggregateResponse

**crates/api_models/src/payments.rs**
  Add:
    - struct: pub::PaymentsAggregateResponse

**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
  Modify existing code

**crates/router/src/core/payments.rs**
  Add:
    - function: pub::get_aggregates_for_payments

**crates/router/src/db/kafka_store.rs**
  Add:
    - function: private::get_intent_status_with_count

**crates/router/src/routes/app.rs**
  Modify existing code

**crates/router/src/routes/lock_utils.rs**
  Modify existing code

**crates/router/src/routes/payments.rs**
  Add:
    - function: pub::get_payments_aggregates

**crates/router/src/types/api/payments.rs**
  Modify existing code

**crates/router_env/src/logger/types.rs**
  Modify existing code

**crates/storage_impl/src/mock_db/payment_intent.rs**
  Add:
    - function: private::get_intent_status_with_count

**crates/storage_impl/src/payments/payment_intent.rs**
  Add:
    - function: private::get_intent_status_with_count
    - function: private::get_intent_status_with_count