View Javadoc
1   /*
2    * Copyright (c) 2022 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.Books;
19  
20  import lombok.Builder;
21  import lombok.EqualsAndHashCode;
22  import lombok.Getter;
23  import lombok.ToString;
24  import lombok.extern.jackson.Jacksonized;
25  import org.eclipse.microprofile.openapi.annotations.media.Schema;
26  
27  import jakarta.validation.constraints.NotEmpty;
28  import jakarta.validation.constraints.Size;
29  import java.io.Serializable;
30  
31  /**
32   * PublicationData -- The metadata for a single publication.
33   *
34   * @author klenkes74 {@literal <rlichti@kaiserpfalz-edv.de>}
35   * @since 1.2.0  2021-05-23
36   */
37  @Jacksonized
38  @Builder(toBuilder = true)
39  @Getter
40  @ToString
41  @EqualsAndHashCode
42  @Schema(name = "PublicationData", description = "This is the data for an publication")
43  public class PublicationData implements Serializable {
44      /**
45       * Order Id of this publication at the publishing house.
46       */
47      @Schema(description = "The official SKU for this publication", maxLength = 20)
48      @NotEmpty
49      @Size(max = 20, message = "The order id limited to 20 characters.")
50      private final String orderId;
51  
52      /**
53       * Official title of the module.
54       */
55      @Schema(description = "The official title of the publication", maxLength = 200)
56      @NotEmpty
57      @Size(max = 200, message = "The title is limited to 200 characters.")
58      private final String title;
59  
60      /**
61       * Title to display (max 50 characters)
62       */
63      @Schema(description = "The short title of the publication", maxLength = 50)
64      @NotEmpty
65      @Size(max = 50, message = "The display title is limited to 50 characters.")
66      private final String displayTitle;
67  
68      @Schema(description = "The imprint of the publication", maxLength = 5000, nullable = true)
69      @Size(max = 5000, message = "The imprint must not be longer than 5000 characters.")
70      private final String imprint;
71  
72      @Schema(description = "The editorial of the publication", maxLength = 5000, nullable = true)
73      @Size(max = 5000, message = "The description must not be longer than 5000 characters.")
74      private final String editorial;
75  
76      @Schema(description = "ID of this publication at https://drivethrurpg.com", nullable = true)
77      private final Integer driveThroughId;
78  
79      @Schema(description = "Total number of pages of this publications", nullable = true)
80      private final Integer pages;
81  }