laughing-waffles / oneweektickets-app

0 stars 0 forks source link

Only single bid is shown in my-events page #61

Open enginyoyen opened 3 years ago

enginyoyen commented 3 years ago

When there are multiple bids, only one of them shown. The example I have, is 1 bid that is won, 1 canceled and 1 is still active(auction in progress but payment data is collected).

Screenshot 2021-05-20 at 12 40 57

The response I see is only the last on in the JSON payload, here is the server response.

[
  {
    "id": "06b84004-5fe5-4160-995a-9afcb449f9db",
    "name": "Rammstein",
    "userId": "6728af8c-c3d4-4e33-8fa7-3527fc28d17b",
    "eventId": "1",
    "state": "CANCEL",
    "setupIntent": "seti_1Is4OrEwp6z4fR3ERYMcte03",
    "currency": "USD",
    "amount": 200,
    "quantity": 3,
    "bidDay": -368,
    "paymentRequestReference": "9e350676-e267-4fc5-8999-d0de158c984a",
    "timezone": null,
    "bidTime": null
  },
  {
    "id": "ee9e769a-6b54-4855-98fa-3924f9f44535",
    "name": "Rammstein",
    "userId": "6728af8c-c3d4-4e33-8fa7-3527fc28d17b",
    "eventId": "1",
    "state": "PURCHASE_COMPLETE",
    "setupIntent": "seti_1IsQmiEwp6z4fR3EX9yGwZfB",
    "currency": "USD",
    "amount": 1000,
    "quantity": 1,
    "bidDay": 1,
    "paymentRequestReference": "db403ad3-c1fd-4e9f-909c-19704f41b4c8",
    "timezone": "Europe/Berlin",
    "bidTime": "2021-05-20T11:55:47.404306"
  },
  {
    "id": "a985d0e4-f59c-4411-b820-572163a02dcb",
    "name": "Rammstein",
    "userId": "6728af8c-c3d4-4e33-8fa7-3527fc28d17b",
    "eventId": "1",
    "state": "ACTIVE",
    "setupIntent": "seti_1It9EeEwp6z4fR3EWwinYXJz",
    "currency": "USD",
    "amount": 1200,
    "quantity": 3,
    "bidDay": 1,
    "paymentRequestReference": "c7372fc0-aa52-4619-9782-323fd10f6241",
    "timezone": "Europe/Berlin",
    "bidTime": "2021-05-20T12:36:11.714949"
  }
]
edireson commented 3 years ago

This was an intentional decision for MVP. This whole page is going to have to be re-worked once we start talking about multiple events being on this page (both from a UI perspective and from the JS).

As an aside, I suppose we shouldn't allow for a case where the user has both ACTIVE and PURCHASE_COMPLETE. If they've won the auction and we've charged their card, that's the end of the road.

Adding a post-mvp label to this. Our ideal my profile page will have:

Upcoming events

Past events

In the above, I'm using "event" specifically - not "bid". But in some sort of expandy thing, under each event, a listing of all "bids" related to that event - i.e. you placed a bid on date/time and then upped your bid the next day and then withdrew your bid the third day, etc.

Happy to iterate on this as we go along.