1 /*
2 * Copyright (c) 2021 Kaiserpfalz EDV-Service, Roland T. Lichti.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18 package de.kaiserpfalzedv.rpg.core.dice.history;
19
20 import com.fasterxml.jackson.annotation.JsonInclude;
21
22 import de.kaiserpfalzedv.commons.api.resources.Pointer;
23 import de.kaiserpfalzedv.commons.api.user.User;
24 import de.kaiserpfalzedv.rpg.core.dice.mat.RollTotal;
25 import lombok.*;
26 import lombok.extern.jackson.Jacksonized;
27 import org.eclipse.microprofile.openapi.annotations.media.Schema;
28
29 import java.io.Serializable;
30 import java.time.OffsetDateTime;
31
32 /**
33 * RollHistoryEntry -- A stored roll result for getting a list of recent rolls.
34 * <p>
35 * The rolls are stored seperately for users in sessions.
36 * <p>
37 * For example a session could be represented by a special Discord channel.
38 *
39 * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
40 * @since 1.2.0 2021-02-05
41 */
42 @Jacksonized
43 @Builder(toBuilder = true)
44 @AllArgsConstructor
45 @RequiredArgsConstructor
46 @Getter
47 @ToString
48 @EqualsAndHashCode
49 @JsonInclude(JsonInclude.Include.NON_ABSENT)
50 @Schema(name = "RollHistory", description = "A single dice roll.")
51 public class RollHistoryEntry implements Serializable {
52 private Pointer game;
53
54 private User user;
55
56 private String rollId;
57
58 private OffsetDateTime timestamp;
59
60 private RollTotal result;
61 }