---
# System prepended metadata

title: Pickups

---

# Pickups

## 1. Pickup button pressed

(DC) ws -> {"event": "ManualScanner" -> "activate": true}
(DC) ws -> {"event": "PICKUP_STARTED"}

## 2. Pickup Code Input Screen on button press

(PC) /kiosk/:kioskId/lockerForCode/:code  

return: LockerInfo.Locker

```scala
case class Locker(
    lockerID: UUID,
    lockerNumber: Int,
    kioskID: UUID,
    height: Double,
    width: Double,
    depth: Double,
    lockerType: String,
    isFunctional: Boolean = true,
    //parcelId: Option[UUID],
    reservationId: Option[UUID],
    lockerDisplayNumber: Int) {
    	def displayNumber: Int = lockerNumber + 1
}
```

### example
(PC) GET /kiosk/50bc95a9-c0b1-4d50-bb02-3ae15d8884d3/lockerForCode/12345A

{
    "lockerID": "2aed39cd-4670-11ec-850a-0242ac110003",
    "lockerNumber": 12,
    "kioskID": "50bc95a9-c0b1-4d50-bb02-3ae15d8884d3",
    "height": 110,
    "width": 350,
    "depth": 550,
    "lockerType": "Small",
    "isFunctional": true,
    "reservationId": "4b372e1c-466f-11ec-850a-0242ac110003",
    "lockerDisplayNumber": 13
}

## 2.1. If barcode reader got success with QRcode

(DC) ws <- {"event": "lockercode", "lockercode": "SOME_CODE"}

So we moving to opening locker automatically

## 3. GET 	/locker/2aed39cd-4670-11ec-850a-0242ac110003/parcels
[{"idParcel":"87544364-4670-11ec-850a-0242ac110003","name":"Parcel1","trackingNumber":"233124354324","receiveDate":"2021-11-15T13:30:14","packageSize":{"length":0,"width":0,"height":0},"deleted":false,"created":"2021-11-16T00:17:05","archived":false,"isMovedToLobby":false,"isMovedToUnit":false}]

## 4. Opening Locker
(DC) ws -> {"event": "openLocker", "lockerIndex":12}

## 5. Locker Opened
(DC) ws <- {"event":"lockerstatus","status":[false,false,false,false,false,false,false,false,false,false,false,false,true]}

## 6. Show screen with "Please close locker after pickup"

## 7. Docker Closed
(DC) ws <- {"event":"lockerstatus","status":[false,false,false,false,false,false,false,false,false,false,false,false,false]}

## 8. POST /parcels/pickUp 
body: ["87544364-4670-11ec-850a-0242ac110003"] 
response: ["87544364-4670-11ec-850a-0242ac110003"]

(as result package removed from the locker)

## 9. return to home