feat(date_time): add created_at and modified_at to merchant related tables (#925)

This commit is contained in:
Nishant Joshi
2023-04-21 02:51:22 +05:30
committed by GitHub
parent 22cee8cdd9
commit 1f151ba15a
9 changed files with 45 additions and 0 deletions

View File

@ -31,6 +31,7 @@ pub struct Customer {
pub description: Option<String>,
pub created_at: PrimitiveDateTime,
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: PrimitiveDateTime,
}
#[derive(Debug)]
@ -54,6 +55,7 @@ pub struct CustomerUpdateInternal {
description: Option<String>,
phone_country_code: Option<String>,
metadata: Option<pii::SecretSerdeValue>,
modified_at: Option<PrimitiveDateTime>,
}
impl From<CustomerUpdate> for CustomerUpdateInternal {
@ -73,6 +75,7 @@ impl From<CustomerUpdate> for CustomerUpdateInternal {
description,
phone_country_code,
metadata,
modified_at: Some(common_utils::date_time::now()),
},
}
}

View File

@ -35,6 +35,8 @@ pub struct MerchantAccount {
pub routing_algorithm: Option<serde_json::Value>,
pub primary_business_details: serde_json::Value,
pub api_key: Option<StrongSecret<String>>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
}
#[derive(Clone, Debug, Default, Insertable, router_derive::DebugAsDisplay)]
@ -99,6 +101,7 @@ pub struct MerchantAccountUpdateInternal {
metadata: Option<pii::SecretSerdeValue>,
routing_algorithm: Option<serde_json::Value>,
primary_business_details: Option<serde_json::Value>,
modified_at: Option<time::PrimitiveDateTime>,
}
impl From<MerchantAccountUpdate> for MerchantAccountUpdateInternal {
@ -134,6 +137,7 @@ impl From<MerchantAccountUpdate> for MerchantAccountUpdateInternal {
locker_id,
metadata,
primary_business_details,
modified_at: Some(common_utils::date_time::now()),
..Default::default()
},
MerchantAccountUpdate::StorageSchemeUpdate { storage_scheme } => Self {

View File

@ -33,6 +33,8 @@ pub struct MerchantConnectorAccount {
pub business_country: storage_enums::CountryCode,
pub business_label: String,
pub business_sub_label: Option<String>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
}
#[derive(Clone, Debug, Default, Insertable, router_derive::DebugAsDisplay)]
@ -80,6 +82,7 @@ pub struct MerchantConnectorAccountUpdateInternal {
payment_methods_enabled: Option<Vec<serde_json::Value>>,
metadata: Option<pii::SecretSerdeValue>,
frm_configs: Option<Secret<serde_json::Value>>,
modified_at: Option<time::PrimitiveDateTime>,
}
impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInternal {
@ -105,6 +108,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte
payment_methods_enabled,
metadata,
frm_configs,
modified_at: Some(common_utils::date_time::now()),
},
}
}

View File

@ -106,6 +106,7 @@ diesel::table! {
description -> Nullable<Varchar>,
created_at -> Timestamp,
metadata -> Nullable<Json>,
modified_at -> Timestamp,
}
}
@ -228,6 +229,8 @@ diesel::table! {
routing_algorithm -> Nullable<Json>,
primary_business_details -> Json,
api_key -> Nullable<Varchar>,
created_at -> Timestamp,
modified_at -> Timestamp,
}
}
@ -251,6 +254,8 @@ diesel::table! {
business_country -> CountryCode,
business_label -> Varchar,
business_sub_label -> Nullable<Varchar>,
created_at -> Timestamp,
modified_at -> Timestamp,
}
}