"winners" table is updated when an item is bid on. It's keyed by item id so that we know who's winning what
when the auction is closed (the big red stop button), a function fires off to create a new collection, "payments", from the winners list. Payments is keyed by the user id of the winner and a "paid" boolean value that's initially false. Since we're grouping the items by winner on the frontend, I don't think we'll run into any issues with people winning multiple items.
The winners list grabs all the winners and does some grouping by user ID to play nice with the markup
Winners list also grabs the payments information
When "Mark paid" is clicked, it toggles the user's paid value.
Let me know if that logic makes sense or if there are any holes in it that you can see.
The way this works is:
Let me know if that logic makes sense or if there are any holes in it that you can see.