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

Add task to export all prizes #214

Closed
wants to merge 5 commits into from

Conversation

pferreira101
Copy link
Member

This PR adds some functionalities to the existing export redeemable prizes task, including the list of prizes won in the Roulette.
Also adds the possibility to generate a csv file.

Comment on lines 89 to +92
|> Map.fetch!(:redeemables)
|> Enum.map(fn redeemable ->
b = get_keys_buy(attendee.id, redeemable.id)
Map.put(redeemable, :quantity, b.quantity)
Map.put(%{name: redeemable.name}, :quantity, b.quantity)
Copy link
Contributor

Choose a reason for hiding this comment

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

This function get_attendee_redeemables/1, is used in AttendeeController, and its result is passed as an argument to the AttendeeControllerView, and then to RedeemableControllerView. So I don't think you should mess with its functionality. My suggestion would be to create a function for the desired purpose, or a mini function that uses this one and adds the step of changing the Map.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll simply undo this changes. The task should work anyway

@jpcorreia99
Copy link
Member

jpcorreia99 commented Mar 1, 2021

Since this task exports both the items bought and the prizes from the roulette, maybe it should reflect that in the name of the task. Since "buys" is already the name of a table, calling it only "export_buys" makes it look like it's only the content of that table that is exported. export_buys_and_prizes should do the trick.

@miguelbrandao
Copy link
Member

oops

@miguelbrandao miguelbrandao reopened this Oct 14, 2021
@pferreira101
Copy link
Member Author

pferreira101 commented Oct 14, 2021 via email

@miguelbrandao miguelbrandao temporarily deployed to sei-22-pf-exportattende-xzx0ds October 19, 2021 21:37 Inactive
@miguelbrandao miguelbrandao temporarily deployed to sei22-pf-exportattendee-yhtkll October 19, 2021 21:49 Inactive
@miguelbrandao miguelbrandao temporarily deployed to sei22-pf-exportattendee-rrqsnt October 19, 2021 22:01 Inactive
@diogogmatos
Copy link
Member

@ruilopesm ruilopesm closed this Dec 2, 2023
@ruilopesm ruilopesm deleted the pf/exportAttendeePrizes branch February 27, 2024 23:30
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.

6 participants