Issue:
feat(payments_v2): payment intent diesel and domain models changes v2

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Refactoring

## Description
<!-- Describe your changes in detail -->
This PR refactors the codebase to include all the payment related operations under the v1 feature flag. 

This also includes changes to the payment intent diesel and domain models to add new fields that are relevant to the v2 version of application.

### Additional Changes

- [ ] This PR modifies the API contract
- [x] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code


Resolution:
<think>
PR Context:
- Title: refactor(payment_intent_v2): payment intent fields refactoring
- Merged: 2024-09-20T11:46:27Z
- Files changed: 30 files
- Commits: 30 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Refactoring

## Description
<!-- Describe your changes in detail -->
This PR addresses some comments that were left on #5783. Few fields have been mademandatory and renamed
- renamed `statement_descriptor_name` to `statement_descriptor`
- make `currecy`, `client_secret` and `profile_id` as a mandatory field in payment intent
- group amount related fields to a struct to be used in payment intent domain model
```rust

</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** refactor(payment_intent_v2): payment intent fields refactoring (#5880)
Co-authored-by: hrithikesh026
Files to modify:


**crates/api_models/src/payments.rs**
  Remove:
    - function: pub::get_client_secret
    - function: private::deserialize
    - function: private::expecting
    - function: private::visit_str
    - function: private::serialize
    - function: private::test_serialize_client_secret
    - function: private::test_deserialize_client_secret
    - struct: pub::ClientSecret
    - struct: private::ClientSecretVisitor
    - impl: impl ClientSecret
    - impl: impl Deserialize<'de> for ClientSecret
    - impl: impl Visitor<'de> for ClientSecretVisitor
    - impl: impl Serialize for ClientSecret
    - mod: private::client_secret_tests

**crates/common_enums/src/enums.rs**
  Add:
    - enum: pub::External3dsAuthenticationRequest
    - enum: pub::EnablePaymentLinkRequest
    - enum: pub::MitExemptionRequest
    - enum: pub::PresenceOfCustomerDuringPayment

**crates/common_enums/src/transformers.rs**
  Add:
    - function: private::from
    - function: pub::as_bool
    - function: pub::as_bool
    - function: private::from
    - function: private::from
    - function: pub::as_bool
    - function: private::from
    - function: pub::as_bool
    - impl: impl From<Option<bool>> for super::External3dsAuthenticationRequest
    - impl: impl super::External3dsAuthenticationRequest
    - impl: impl super::EnablePaymentLinkRequest
    - impl: impl From<Option<bool>> for super::EnablePaymentLinkRequest
    - impl: impl From<Option<bool>> for super::MitExemptionRequest
    - impl: impl super::MitExemptionRequest
    - impl: impl From<Option<bool>> for super::PresenceOfCustomerDuringPayment
    - impl: impl super::PresenceOfCustomerDuringPayment

**crates/common_utils/src/consts.rs**
  Modify existing code

**crates/common_utils/src/id_type.rs**
  Remove:
    - mod: private::payment_methods

**crates/common_utils/src/id_type/global_id.rs**
  Remove:
    - struct: pub::CellId
  Add:
    - function: pub::get_string_repr
    - struct: pub::CellId
    - mod: pub::payment
    - mod: pub::payment_methods

**crates/common_utils/src/id_type/global_id/payment.rs**
  Add:
    - function: pub::get_string_repr
    - function: private::try_from
    - function: private::to_sql
    - function: private::from_sql
    - struct: pub::GlobalPaymentId
    - impl: impl GlobalPaymentId
    - impl: impl TryFrom<std::borrow::Cow<'static, str>> for GlobalPaymentId
    - impl: impl diesel::serialize::ToSql<diesel::sql_types::Text, DB> for GlobalPaymentId
    - impl: impl diesel::deserialize::FromSql<diesel::sql_types::Text, DB> for GlobalPaymentId

**crates/common_utils/src/id_type/payment.rs**
  Remove:
    - struct: pub::PaymentGlobalId

**crates/common_utils/src/types.rs**
  Remove:
    - struct: pub::Description
  Add:
    - function: private::to_sql
    - function: private::from_sql
    - function: pub::get_string_repr
    - function: private::deserialize
    - function: private::expecting
    - function: private::visit_str
    - function: private::serialize
    - function: private::to_sql
    - function: private::from_sql
    - function: private::build
    - function: private::test_serialize_client_secret
    - function: private::test_deserialize_client_secret
    - function: pub::from
    - function: pub::new_unchecked
    - function: private::deserialize
    - function: private::from_sql
    - function: private::to_sql
    - function: private::build
    - function: private::from_sql
    - struct: pub::Url
    - struct: pub::ClientSecret
    - struct: private::ClientSecretVisitor
    - struct: pub::LengthString
    - struct: pub::Description
    - struct: pub::StatementDescriptor
    - enum: pub::LengthStringError
    - impl: impl ToSql<sql_types::Text, DB> for Url
    - impl: impl FromSql<sql_types::Text, DB> for Url
    - impl: impl ClientSecret
    - impl: impl Deserialize<'de> for ClientSecret
    - impl: impl Visitor<'de> for ClientSecretVisitor
    - impl: impl Serialize for ClientSecret
    - impl: impl ToSql<sql_types::Text, diesel::pg::Pg> for ClientSecret
    - impl: impl FromSql<sql_types::Text, DB> for ClientSecret
    - impl: impl Queryable<sql_types::Text, DB> for ClientSecret
    - impl: impl LengthString<MAX_LENGTH, MIN_LENGTH>
    - impl: impl Deserialize<'de> for LengthString<MAX_LENGTH, MIN_LENGTH>
    - impl: impl FromSql<sql_types::Text, DB> for LengthString<MAX_DESCRIPTION_LENGTH, 1>
    - impl: impl Queryable<sql_types::Text, DB> for StatementDescriptor
    - impl: impl FromSql<sql_types::Text, DB> for StatementDescriptor
    - mod: private::client_secret_type
    - mod: private::client_secret_tests

**crates/diesel_models/src/payment_intent.rs**
  Add:
    - struct: pub::PaymentLinkConfigRequestForPayments
    - struct: pub::PaymentLinkTransactionDetails
    - struct: pub::TransactionDetailsUiConfiguration

**crates/diesel_models/src/query/payment_intent.rs**
  Modify existing code

**crates/diesel_models/src/schema_v2.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/payments.rs**
  Add:
    - function: private::from
    - function: private::from
    - function: private::get_surcharge_action_as_bool
    - function: private::get_external_tax_action_as_bool
    - struct: pub::AmountDetails
    - enum: pub::TaxCalculationOverride
    - enum: pub::SurchargeCalculationOverride
    - impl: impl From<Option<bool>> for TaxCalculationOverride
    - impl: impl From<Option<bool>> for SurchargeCalculationOverride
    - impl: impl AmountDetails

**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
  Remove:
    - struct: pub::PaymentIntentNew
    - struct: pub::PaymentIntentNew

**crates/router/src/core/customers.rs**
  Modify existing code

**crates/router/src/core/fraud_check.rs**
  Add:
    - function: pub::call_frm_service
    - function: pub::make_frm_data_and_fraud_check_operation

**crates/router/src/core/fraud_check/flows/fulfillment_flow.rs**
  Add:
    - function: pub::construct_fulfillment_router_data

**crates/router/src/core/fraud_check/operation/fraud_check_post.rs**
  Add:
    - function: private::get_trackers

**crates/router/src/core/fraud_check/operation/fraud_check_pre.rs**
  Add:
    - function: private::get_trackers

**crates/router/src/core/payment_methods.rs**
  Modify existing code

**crates/router/src/core/payment_methods/cards.rs**
  Modify existing code

**crates/router/src/core/payment_methods/transformers.rs**
  Modify existing code

**crates/router/src/core/payments.rs**
  Add:
    - function: private::populate_surcharge_details
    - function: pub::tokenize_in_router_when_confirm_false_or_external_authentication
    - function: private::get_payment_intent_profile_id

**crates/router/src/core/payments/helpers.rs**
  Add:
    - function: pub::store_payment_method_data_in_vault
    - function: pub::authenticate_client_secret
    - function: pub::verify_payment_intent_time_and_client_secret

**crates/router/src/core/payments/operations/payment_response.rs**
  Add:
    - struct: pub::PaymentResponse

**crates/router/src/core/payments/retry.rs**
  Modify existing code

**crates/router/src/core/payments/routing.rs**
  Modify existing code

**crates/router/src/core/payments/transformers.rs**
  Add:
    - function: private::try_from
    - function: private::try_from
    - function: private::try_from
    - impl: impl TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCaptureData
    - impl: impl TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsCancelData
    - impl: impl TryFrom<PaymentAdditionalData<'_, F>> for types::SdkPaymentsSessionUpdateData

**crates/router/src/core/pm_auth.rs**
  Add:
    - function: pub::retrieve_payment_method_from_auth_service

**crates/router/src/core/utils.rs**
  Add:
    - function: pub::construct_refund_router_data
    - function: pub::construct_payments_dynamic_tax_calculation_router_data
    - function: private::get_profile_id

**crates/router/src/core/verification/utils.rs**
  Add:
    - function: pub::check_if_profile_id_is_present_in_payment_intent

**crates/router/src/db/kafka_store.rs**
  Modify existing code

**crates/router/src/services/kafka/payment_intent.rs**
  Modify existing code

**crates/router/src/services/kafka/payment_intent_event.rs**
  Modify existing code

**crates/router/src/types/storage.rs**
  Modify existing code

**crates/router/src/utils.rs**
  Modify existing code

**crates/storage_impl/src/lib.rs**
  Add:
    - function: private::unique_constraints

**crates/storage_impl/src/mock_db/payment_intent.rs**
  Modify existing code

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