Skip to content
Snippets Groups Projects
Commit 65aa57fb authored by Michal Badin's avatar Michal Badin
Browse files

feat(entity/DTO): Added string size restriction

parent ba3b3e39
No related branches found
No related tags found
2 merge requests!54Merge develop into main,!45M2 feedback - string size restriction, CI/CD and DomainObject
......@@ -39,10 +39,12 @@ components:
type: string
description: Name of the person
example: Max
maxLength: 35
surname:
type: string
description: Surname of the person
example: Verstappen
maxLength: 35
birthday:
type: string
description: Date of birth
......@@ -64,9 +66,11 @@ components:
name:
type: string
description: Name of the person
maxLength: 35
surname:
type: string
description: Name of the person
maxLength: 35
birthday:
type: string
description: Date of birth
......
......@@ -22,9 +22,11 @@ public class Application implements Serializable {
private ApplicationStatusEnum status;
@NotEmpty
@Size(max = 35)
private String name;
@NotEmpty
@Size(max = 35)
private String surname;
@Past
......
......@@ -47,6 +47,7 @@ components:
type: string
description: Specific information about component
example: lightweight front wing v2 (black)
maxLength: 100
CarComponentCreateDto:
type: object
properties:
......@@ -58,6 +59,7 @@ components:
information:
type: string
description: Specific information about component
maxLength: 100
required:
- componentType
- weight
......@@ -73,6 +75,7 @@ components:
information:
type: string
description: Specific information about component
maxLength: 100
CarDto:
type: object
......@@ -130,10 +133,12 @@ components:
type: string
description: Name of the driver
example: Max
maxLength: 35
surname:
type: string
description: Surname of the driver
example: Verstappen
maxLength: 35
height:
type: integer
description: Height in cm
......@@ -147,6 +152,7 @@ components:
type: string
description: Nationality of the driver
example: Dutch
maxLength: 20
characteristics:
type: array
description: Set of driver's characteristics
......@@ -158,12 +164,15 @@ components:
name:
type: string
description: Name of the driver
maxLength: 35
surname:
type: string
description: Name of the driver
maxLength: 35
nationality:
type: string
description: nationality of the driver
maxLength: 20
height:
type: integer
description: Height in cm
......@@ -178,12 +187,15 @@ components:
name:
type: string
description: Name of the driver
maxLength: 35
surname:
type: string
description: Name of the driver
maxLength: 35
nationality:
type: string
description: Nationality of the driver
maxLength: 20
height:
type: integer
description: Height in cm
......@@ -220,10 +232,12 @@ components:
type: string
description: Name of the engineer
example: John
maxLength: 35
surname:
type: string
description: Surname of the engineer
example: Doe
maxLength: 35
EngineerCreateDto:
type: object
title: Engineer
......@@ -236,10 +250,12 @@ components:
type: string
description: Name of the engineer
example: John
maxLength: 35
surname:
type: string
description: Surname of the engineer
example: Doe
maxLength: 35
DepartmentDto:
type: object
......@@ -259,6 +275,7 @@ components:
specialization:
type: string
example: "Aerodynamics"
maxLength: 100
DepartmentUpdateDto:
type: object
properties:
......@@ -266,6 +283,7 @@ components:
type: string
example: "Aerodynamics"
description: New specialization
maxLength: 100
required:
- specialization
DepartmentCreateDto:
......@@ -274,6 +292,7 @@ components:
specialization:
type: string
example: "Aerodynamics"
maxLength: 100
required:
- specialization
Pageable:
......
......@@ -6,6 +6,7 @@ import jakarta.annotation.Nullable;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;
......@@ -24,6 +25,7 @@ public class CarComponent extends DomainObject<Long> implements Serializable {
private Double weight;
@NotEmpty
@Size(max = 100)
private String information;
@ManyToOne(fetch = FetchType.LAZY)
......
......@@ -3,6 +3,7 @@ package cz.muni.pa165.data.model;
import jakarta.annotation.Nullable;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;
......@@ -13,6 +14,7 @@ import java.util.Set;
public class Department extends DomainObject<Long> implements Serializable {
@NotEmpty
@Size(max = 100)
private String specialization;
@OneToMany(fetch = FetchType.LAZY,
......
......@@ -4,10 +4,7 @@ import cz.muni.pa165.data.enums.CharacteristicsEnum;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
import jakarta.persistence.*;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Past;
import jakarta.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;
......@@ -19,9 +16,11 @@ import java.util.Set;
public class Driver extends DomainObject<Long> implements Serializable {
@NotEmpty
@Size(max = 35)
private String name;
@NotEmpty
@Size(max = 35)
private String surname;
@Nullable
......@@ -34,6 +33,7 @@ public class Driver extends DomainObject<Long> implements Serializable {
private LocalDate birthday;
@NotEmpty
@Size(max = 20)
private String nationality;
@ElementCollection(targetClass = CharacteristicsEnum.class)
......
......@@ -3,6 +3,7 @@ package cz.muni.pa165.data.model;
import jakarta.annotation.Nullable;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;
......@@ -12,9 +13,11 @@ import java.util.Objects;
public class Engineer extends DomainObject<Long> implements Serializable {
@NotEmpty
@Size(max = 35)
private String name;
@NotEmpty
@Size(max = 35)
private String surname;
@ManyToOne(fetch = FetchType.LAZY)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment