-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(analytics): org level analytics #4530
base: main
Are you sure you want to change the base?
Conversation
let mut matching_values = vec![]; | ||
|
||
for m in org_merchant_ids { | ||
let t = m.clone(); | ||
if payload.contains(&t) { | ||
matching_values.push(t); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let mut matching_values = vec![]; | |
for m in org_merchant_ids { | |
let t = m.clone(); | |
if payload.contains(&t) { | |
matching_values.push(t); | |
} | |
} | |
let matching_values = payload.iter().filter(|i| org_merchant_ids.contains(i)).cloned().collect(); |
let merchant_id: Option<String> = row.try_get("merchant_id").or_else(|e| match e { | ||
ColumnNotFound(_) => Ok(Default::default()), | ||
e => Err(e), | ||
})?; | ||
Ok(Self { | ||
currency, | ||
status, | ||
connector, | ||
authentication_type, | ||
payment_method, | ||
payment_method_type, | ||
merchant_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this deserialization handler for PaymentMetricRow
& PaymentDistributionRow
as well
.map(|org| org.merchant_id.clone()) | ||
.collect(), | ||
), | ||
_ => None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ => None, | |
_ => vec![&merchant.merchant_id.clone()], |
if the user doesn't have org admin access return only a single merchant id that he is belongs to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it need to be none or in the every iteration it will try to push the merchant_id when the permission is not matching
…nto org-level-analytics
…nto org-level-analytics
Type of Change
Description
Have an organisation level analytics view:
Additional Changes
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy