mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(analytics): refactor and introduce analytics APIs to accommodate OrgLevel, MerchantLevel and ProfileLevel authentication (#5729)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sampras Lopes <sampras.lopes@juspay.in>
This commit is contained in:
@ -13,7 +13,7 @@ use super::{
|
||||
health_check::HealthCheck,
|
||||
payment_intents::{filters::PaymentIntentFilterRow, metrics::PaymentIntentMetricRow},
|
||||
payments::{
|
||||
distribution::PaymentDistributionRow, filters::FilterRow, metrics::PaymentMetricRow,
|
||||
distribution::PaymentDistributionRow, filters::PaymentFilterRow, metrics::PaymentMetricRow,
|
||||
},
|
||||
query::{Aggregate, ToSql, Window},
|
||||
refunds::{filters::RefundFilterRow, metrics::RefundMetricRow},
|
||||
@ -244,10 +244,10 @@ impl TryInto<PaymentDistributionRow> for serde_json::Value {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryInto<FilterRow> for serde_json::Value {
|
||||
impl TryInto<PaymentFilterRow> for serde_json::Value {
|
||||
type Error = Report<ParsingError>;
|
||||
|
||||
fn try_into(self) -> Result<FilterRow, Self::Error> {
|
||||
fn try_into(self) -> Result<PaymentFilterRow, Self::Error> {
|
||||
serde_json::from_value(self).change_context(ParsingError::StructParseFailure(
|
||||
"Failed to parse FilterRow in clickhouse results",
|
||||
))
|
||||
@ -415,15 +415,7 @@ impl TryInto<ActivePaymentsMetricRow> for serde_json::Value {
|
||||
|
||||
impl ToSql<ClickhouseClient> for PrimitiveDateTime {
|
||||
fn to_sql(&self, _table_engine: &TableEngine) -> error_stack::Result<String, ParsingError> {
|
||||
let format =
|
||||
time::format_description::parse("[year]-[month]-[day] [hour]:[minute]:[second]")
|
||||
.change_context(ParsingError::DateTimeParsingError)
|
||||
.attach_printable("Failed to parse format description")?;
|
||||
self.format(&format)
|
||||
.change_context(ParsingError::EncodeError(
|
||||
"failed to encode to clickhouse date-time format",
|
||||
))
|
||||
.attach_printable("Failed to format date time")
|
||||
Ok(self.assume_utc().unix_timestamp().to_string())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user