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

3528 Scope Customer Totals report also by variant (not just product) and use variant SKU #3646

Merged

Conversation

kristinalim
Copy link
Member

@kristinalim kristinalim commented Mar 23, 2019

Scope Customer Totals report also by variant (not just product) and use variant SKU.

(This includes the work of @mkllnk in his fork. Thank you, @mkllnk!)

What? Why?

Closes #3528

The report groups the line item data by product, among other attributes. We need to display the variant SKU, not the product SKU, so we need to group these by variant instead also.

What should we test?

  1. Create two customers for a hub with an open OC. Make sure they have different names.
  2. Prepare a purchasable Product A with two variants, and a purchasable Product B with one variant.
  3. For Customer A, create an order purchasing all three variants.
  4. For Customer B, create an order purchasing Variant A of Product A.
  5. For Customer B, create another order purchasing Variant B of Product A.
  6. Generate the Customer Totals report. Note the SKU and total for these orders. These should be correct.

Release notes

  • In the Customer Totals report, separate rows for different variants and use the variant SKU.

Changelog Category: Fixed

@kristinalim kristinalim self-assigned this Mar 23, 2019
@kristinalim kristinalim force-pushed the fix/3528-product_sku_in_report branch 2 times, most recently from 68f343e to 34eed18 Compare March 24, 2019 20:34
mkllnk added 6 commits March 25, 2019 04:47
Probably a copy&paste error. The PackingReport had exactly the same
spec.
This conversion is done by Transpec 3.4.0 with the following command:
    transpec spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb

* 8 conversions
    from: == expected
      to: eq(expected)

* 8 conversions
    from: obj.should
      to: expect(obj).to

* 1 conversion
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

For more details: https://github.com/yujinakayama/transpec#supported-conversions
@kristinalim kristinalim force-pushed the fix/3528-product_sku_in_report branch 2 times, most recently from 4c62a3c to a64b078 Compare March 24, 2019 20:56
Copy link
Contributor

@luisramos0 luisramos0 left a comment

Choose a reason for hiding this comment

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

no comments 💯 :-D

@kristinalim kristinalim changed the title 3528 Scope Customer Totals report also by variant (not product) and use variant SKU 3528 Scope Customer Totals report also by variant (not just product) and use variant SKU Mar 24, 2019
This groups the Customer Totals report by variant too (among others,
including by product), and then changes the report to use the variant
SKU not the product SKU.

This adds a spec for customer totals grouping and details, which
replaces the test specific to the SKU column.
Line items belong to a single order.
@kristinalim kristinalim force-pushed the fix/3528-product_sku_in_report branch from a64b078 to 807cdb4 Compare March 24, 2019 23:47
@kristinalim
Copy link
Member Author

kristinalim commented Mar 24, 2019

I updated the description of this commit: 46e7090, and also the title and description of this PR, to reflect that the grouping is by variant in addition to (not "instead of") by product. 🙂 No code changes.

In an earlier version, I just replaced the grouping by product to grouping by variant. The current version uses both because both are important.

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

❤️

@RachL RachL added the pr-staged-uk staging.openfoodnetwork.org.uk label Mar 25, 2019
@RachL RachL self-assigned this Mar 25, 2019
@RachL
Copy link
Contributor

RachL commented Mar 25, 2019

I hate myself. I literally spent 20 minutes on "I don't see SKU in the report, am I on the correct report?" Only to discover that SKU is called "product code" in the export 🤦‍♀️

Anyway this is good to go :)

https://docs.google.com/document/d/1cb3tylYDFc6YJcsTNsHrb14zc4tLbUE0wxjCNjBSkrs/edit#heading=h.hj26umg3kyxb

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.

4 participants