feat(routing): add domain type for Routing id (#5733)

Co-authored-by: Sanchith Hegde <sanchith.hegde@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2024-08-29 19:34:29 +05:30
committed by GitHub
parent b66f91034b
commit e939db2fad
14 changed files with 93 additions and 67 deletions

View File

@ -1,3 +1,4 @@
use common_utils::id_type;
use diesel::{Identifiable, Insertable, Queryable, Selectable};
use serde::{Deserialize, Serialize};
@ -6,9 +7,9 @@ use crate::{enums, schema::routing_algorithm};
#[derive(Clone, Debug, Identifiable, Insertable, Queryable, Selectable, Serialize, Deserialize)]
#[diesel(table_name = routing_algorithm, primary_key(algorithm_id), check_for_backend(diesel::pg::Pg))]
pub struct RoutingAlgorithm {
pub algorithm_id: String,
pub profile_id: common_utils::id_type::ProfileId,
pub merchant_id: common_utils::id_type::MerchantId,
pub algorithm_id: id_type::RoutingId,
pub profile_id: id_type::ProfileId,
pub merchant_id: id_type::MerchantId,
pub name: String,
pub description: Option<String>,
pub kind: enums::RoutingAlgorithmKind,
@ -19,7 +20,7 @@ pub struct RoutingAlgorithm {
}
pub struct RoutingAlgorithmMetadata {
pub algorithm_id: String,
pub algorithm_id: id_type::RoutingId,
pub name: String,
pub description: Option<String>,
pub kind: enums::RoutingAlgorithmKind,
@ -29,8 +30,8 @@ pub struct RoutingAlgorithmMetadata {
}
pub struct RoutingProfileMetadata {
pub profile_id: common_utils::id_type::ProfileId,
pub algorithm_id: String,
pub profile_id: id_type::ProfileId,
pub algorithm_id: id_type::RoutingId,
pub name: String,
pub description: Option<String>,
pub kind: enums::RoutingAlgorithmKind,