class BookingMessageTO {

    public static BookingMessageTO fromJson(String json) {
        try (ByteArrayInputStream bos = new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8))) {
            return new BookingMessageTOReader().readFrom(null, null, null, null, null, bos);
        } catch (IOException e) {
            throw new RuntimeException("Cannot convert " + json, e);
        }


//        JsonReader reader = Json.createReader(new StringReader(json));
//
//        JsonObject jsonObject = reader.readObject();
//        Long guestId = jsonObject.getJsonNumber("guestId").longValue();
//        String roomNumber = jsonObject.getString("roomNumber");
//
//        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
//
//        LocalDate checkin = LocalDate.parse(jsonObject.getString("checkin"), formatter);
//        LocalDate checkout = LocalDate.parse(jsonObject.getString("checkout"), formatter);
//        return new BookingMessageTO(guestId, roomNumber, checkin, checkout);
    }

    public  BookingMessageTO(Long guest, String room, LocalDate checkin, LocalDate checkout);

}