### Auction is acive. Please log in to bid (Oksjon on aktiivne. Pakkumise tegemiseks logi sisse)
If I understand correctly, question is how to determine if user is authorized from request to get auction `/api/public/object/AUCTION_ID.json`?
It is not possible to do so from this request.
Auction call should contain auction data.
Existing UI logic is that, we know if
- user logged or not
- have permission to place bid
- disabling ability to bid on own auctions
How?
https://bitbucket.org/moderasoftware/timber/src/master/web/js/auction-module/controller/publicObjectController.js#lines-397
### Choose amount and make your offer (Vali summa ja tee oma pakkumine)
Question: How to understand if user have bids or not?
`/api/public/object/AUCTION_ID.json`
```
auction: {id: 9, startTime: "2019-12-02T21:03:14+0200", endTime: "2020-06-11T23:45:00+0300", minBid: 60,…}
bidStep: 500
bids: [{id: 11, time: "2020-06-11T23:14:53+0300", uid: "OOPBR8SE", amount: 1560},…]
endTime: "2020-06-11T23:45:00+0300"
id: 9
isWinner: 1560
minBid: 60
pictures: []
product: {...}
startTime: "2019-12-02T21:03:14+0200"
status: "Started"
userbids: [11, 7]
```
in response `userbids` attribute exist. If array is empty, user doesn't have bids.
NOTE! If user not logged, array will be empty too.
### Your offer is highest at the momemnt. (Sinu pakkumine on hetkel kõrgeim)
Question: How to understand if user bid is highest?
If userbids first element id is same as `auction.bids` first element your bid is highest.
`response.userbids[0] == response.auction.bids[0].id`
### Your offer is not highest anymore. Make new offer (Sinu pakkumine pakuti teise pakkuja poolt üle. Tee uus pakkumine.)
Same as in previous question. But
`response.userbids[0] != response.auction.bids[0].id`
### Current automatic messages (automaatpakkuja seadistamise senised teated)
I cannot understand this question. Please explain.
### You have configured automatic bid to sum xxxx€ (Sul on seadistatud automaatpakkuja summani xxxx €.)
Question: How to understand if autobid is configured?
Autobid is different call. User need to be authorized.
`/api/autobid/AUCTION_ID.json`
Responses GET to `/api/autobid/AUCTION_ID.json`
- 400 response. No autobid
- 200 response.
```
auction: {id: 9}
id: 9
changedAt: "2020-06-11T23:21:40+0300"
id: 2
isBitten: false
limit: 2060
```
Pretty self-explanatory, right?
Please note, UI need to update status of autobidder by it own. Like, current UI does.
No sockets/hooks planned during development.
### Auction is ended (Oksjon on lõppenud.)
`/api/public/object/AUCTION_ID.json`
```
auction: {id: 9, startTime: "2019-12-02T21:03:14+0200", endTime: "2020-06-11T23:45:00+0300", minBid: 60,…}
bidStep: 500
bids: [{id: 11, time: "2020-06-11T23:14:53+0300", uid: "OOPBR8SE", amount: 1560},…]
endTime: "2020-06-11T23:45:00+0300"
id: 9
isWinner: 1560
minBid: 60
pictures: []
product: {...}
startTime: "2019-12-02T21:03:14+0200"
status: "Started"
userbids: [11, 7]
```
`auction.status == "Ended"` means that auction ended.