Skip to content
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: display refunds in spent table when backed by transactions API #1091

Merged
merged 4 commits into from
Nov 17, 2023

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Nov 15, 2023

Description

Ticket: ENT-7644 | Figma

Summary:

  • Handles the conditional display of refunds (reversals) on individual transaction rows per the Figma spec. Only relevant when the table is backed by the transactions API via enterprise-subsidy.
    • Note: Handling refunds/reversals for offers (backed by analytics API) is not supported.
  • Resolves bug in the "Spent" table display where the enrollment date was always today's date when backed by the transactions API.
  • Resolves bug in the "Spent" table where the search query parameter was not correctly using ?search_all when viewing a enterprise offer backed by the analytics API (it was passing ?search as it was were communicating to transactions API instead).
  • Resolves bug where useBudgetDetailActivityOverview was calling the analytics API for spent transactions whereas the "Spent" table was pulling from the transactions (enterprise-subsidy) API. These should always rely on the same data source.
  • Ensures the "Amount" column shows non-refunded transaction prices with a - to indicate that balance was drawn down (as seen in Figma spec and consistent with "Assigned" table).
image

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (68a3045) 84.66% compared to head (5c689f8) 84.60%.

❗ Current head 5c689f8 differs from pull request most recent head c266ec2. Consider uploading reports for the commit c266ec2 to get more accurate results

Files Patch % Lines
...redit-management/data/hooks/useOfferRedemptions.js 83.33% 1 Missing ⚠️
...components/learner-credit-management/data/utils.js 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1091      +/-   ##
==========================================
- Coverage   84.66%   84.60%   -0.07%     
==========================================
  Files         475      475              
  Lines        9934     9924      -10     
  Branches     2070     2076       +6     
==========================================
- Hits         8411     8396      -15     
- Misses       1482     1486       +4     
- Partials       41       42       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

courseListPrice: PropTypes.number.isRequired,
enrollmentDate: PropTypes.string.isRequired,
courseProductLine: PropTypes.string.isRequired,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[inform] "Product" column is no longer included in this table.

@adamstankiewicz adamstankiewicz force-pushed the ags/ent-7644 branch 2 times, most recently from f1ca9c7 to 8786422 Compare November 15, 2023 22:46
Copy link
Contributor

@pwnage101 pwnage101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

practicing my rejections :). Couple comments, otherwise LGTM!

@@ -83,7 +86,7 @@ const useOfferRedemptions = (
}
let data;
let transformedTableResults;
if (budgetId && shouldFetchSubsidyTransactions) {
if (budgetId && isTopDownAssignmentEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just this?

Suggested change
if (budgetId && isTopDownAssignmentEnabled) {
if (shouldFetchSubsidyTransactions) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

if (budgetId !== null) {
options.budgetId = budgetId;
options[isTopDownAssignmentEnabled ? 'subsidyAccessPolicyUuid' : 'budgetId'] = budgetId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this key off shouldFetchSubsidyTransactions instead?

Suggested change
options[isTopDownAssignmentEnabled ? 'subsidyAccessPolicyUuid' : 'budgetId'] = budgetId;
options[shouldFetchSubsidyTransactions ? 'subsidyAccessPolicyUuid' : 'budgetId'] = budgetId;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could; I will update.

@adamstankiewicz adamstankiewicz merged commit 5cc1b8d into master Nov 17, 2023
4 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/ent-7644 branch November 17, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants