Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit d9905b7

Browse files
author
ge85riz
committed
🚑 hotfix: fix Gender field of Profiles so that they have to obey Gender enum. Also fix profile field of employees not updating when updated via csv
1 parent e5e56a1 commit d9905b7

10 files changed

Lines changed: 77 additions & 91 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.itestra.eep.configs;
2+
3+
import com.fasterxml.jackson.databind.Module;
4+
import com.fasterxml.jackson.databind.module.SimpleModule;
5+
import com.itestra.eep.enums.Gender;
6+
import com.itestra.eep.serializers.GenderDeserializer;
7+
import org.springframework.context.annotation.Bean;
8+
import org.springframework.context.annotation.Configuration;
9+
10+
@Configuration
11+
public class JacksonModuleConfig {
12+
13+
@Bean
14+
public Module customJacksonModule() {
15+
SimpleModule module = new SimpleModule();
16+
module.addDeserializer(Gender.class, new GenderDeserializer());
17+
return module;
18+
}
19+
}

‎backend/src/main/java/com/itestra/eep/dtos/EmployeeCreateDTO.java‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.itestra.eep.dtos;
22

3-
import com.fasterxml.jackson.annotation.JsonProperty;
3+
44
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
55
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
66
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
77
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
88
import com.itestra.eep.enums.DietaryPreference;
9+
import com.itestra.eep.enums.Gender;
910
import com.itestra.eep.enums.Role;
1011
import com.itestra.eep.serializers.GenderDeserializer;
11-
import com.itestra.eep.validators.ValidGender;
1212
import jakarta.persistence.EnumType;
1313
import jakarta.persistence.Enumerated;
1414
import jakarta.validation.Valid;
@@ -30,6 +30,7 @@
3030
public class EmployeeCreateDTO implements Serializable {
3131

3232
@Valid
33+
@NotNull
3334
ProfileCreateDTO profile;
3435

3536
@NotNull(message = "Employment start date cannot be empty.")
@@ -54,12 +55,9 @@ public static class ProfileCreateDTO implements Serializable {
5455
@NotBlank(message = "Last name cannot be empty.")
5556
String lastName;
5657

57-
@Size(max = 255)
58-
@NotBlank(message = "Gender cannot be empty.")
59-
@ValidGender
60-
@JsonProperty("gender")
58+
@NotNull(message = "Gender cannot be empty.")
6159
@JsonDeserialize(using = GenderDeserializer.class)
62-
String gender;
60+
Gender gender;
6361

6462
@Size(max = 255, message = "GitLab username should be shorter than 255 characters")
6563
String gitlabUsername;

‎backend/src/main/java/com/itestra/eep/dtos/EmployeeUpdateDTO.java‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
66
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
77
import com.itestra.eep.enums.DietaryPreference;
8+
import com.itestra.eep.enums.Gender;
89
import com.itestra.eep.enums.Role;
910
import com.itestra.eep.serializers.GenderDeserializer;
10-
import com.itestra.eep.validators.ValidGender;
1111
import jakarta.persistence.EnumType;
1212
import jakarta.persistence.Enumerated;
1313
import jakarta.validation.Valid;
14-
import jakarta.validation.constraints.Email;
15-
import jakarta.validation.constraints.NotBlank;
16-
import jakarta.validation.constraints.PastOrPresent;
17-
import jakarta.validation.constraints.Size;
14+
import jakarta.validation.constraints.*;
1815
import lombok.Getter;
1916
import lombok.Setter;
2017

@@ -28,7 +25,7 @@
2825
public class EmployeeUpdateDTO implements Serializable {
2926

3027
@Valid
31-
ProfileUpdateDTO profile;
28+
EmployeeUpdateDTO.EmployeeProfileUpdateDTO profile;
3229

3330
@PastOrPresent(message = "Employment start date cannot be in the future.")
3431
@JsonSerialize(using = LocalDateSerializer.class)
@@ -39,7 +36,7 @@ public class EmployeeUpdateDTO implements Serializable {
3936

4037
@Getter
4138
@Setter
42-
public static class ProfileUpdateDTO implements Serializable {
39+
public static class EmployeeProfileUpdateDTO implements Serializable {
4340

4441
@Size(max = 255)
4542
@NotBlank(message = "Name cannot be empty.")
@@ -49,11 +46,9 @@ public static class ProfileUpdateDTO implements Serializable {
4946
@NotBlank(message = "Last name cannot be empty.")
5047
String lastName;
5148

52-
@Size(max = 255)
53-
@NotBlank(message = "Gender cannot be empty.")
54-
@ValidGender
49+
@NotNull(message = "Gender cannot be empty.")
5550
@JsonDeserialize(using = GenderDeserializer.class)
56-
String gender;
51+
Gender gender;
5752

5853
@Size(max = 255, message = "GitLab username should be shorter than 255 characters")
5954
String gitlabUsername;

‎backend/src/main/java/com/itestra/eep/dtos/ProfileUpdateDTO.java‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@
22

33
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
44
import com.itestra.eep.enums.DietaryPreference;
5+
import com.itestra.eep.enums.Gender;
56
import com.itestra.eep.serializers.GenderDeserializer;
6-
import com.itestra.eep.validators.ValidGender;
77
import jakarta.persistence.EnumType;
88
import jakarta.persistence.Enumerated;
99
import jakarta.validation.constraints.Email;
1010
import jakarta.validation.constraints.NotBlank;
11+
import jakarta.validation.constraints.NotNull;
1112
import jakarta.validation.constraints.Size;
12-
import lombok.Value;
13+
import lombok.AllArgsConstructor;
14+
import lombok.Getter;
15+
import lombok.NoArgsConstructor;
16+
import lombok.Setter;
1317

1418
import java.io.Serializable;
1519

1620

17-
@Value
21+
@Getter
22+
@Setter
23+
@NoArgsConstructor
24+
@AllArgsConstructor
1825
public class ProfileUpdateDTO implements Serializable {
1926

2027
@Size(max = 255)
@@ -25,11 +32,9 @@ public class ProfileUpdateDTO implements Serializable {
2532
@NotBlank(message = "Last name cannot be empty.")
2633
String lastName;
2734

28-
@Size(max = 255)
29-
@NotBlank(message = "Gender cannot be empty.")
30-
@ValidGender
35+
@NotNull(message = "Gender cannot be empty.")
3136
@JsonDeserialize(using = GenderDeserializer.class)
32-
String gender;
37+
Gender gender;
3338

3439
@Size(max = 255, message = "GitLab username should be shorter than 255 characters")
3540
String gitlabUsername;

‎backend/src/main/java/com/itestra/eep/serializers/GenderDeserializer.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
import com.fasterxml.jackson.databind.DeserializationContext;
55
import com.fasterxml.jackson.databind.JsonDeserializer;
66
import com.itestra.eep.enums.Gender;
7+
import org.springframework.boot.jackson.JsonComponent;
78

89
import java.io.IOException;
910

10-
public class GenderDeserializer extends JsonDeserializer<String> {
11+
@JsonComponent
12+
public class GenderDeserializer extends JsonDeserializer<Gender> {
1113

1214
@Override
13-
public String deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
15+
public Gender deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
1416
String value = p.getValueAsString();
15-
Gender gender = Gender.fromStringOrNull(value);
16-
return gender != null ? gender.name() : value;
17+
return Gender.fromStringOrNull(value);
1718
}
1819
}

‎backend/src/main/java/com/itestra/eep/services/impl/EmployeeServiceImpl.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ public EmployeeBatchUpsertResultDTO upsertEmployeesBatch(List<EmployeeCreateDTO>
9292
// handle existing employee
9393
EmployeeUpdateDTO employeeUpdateDTO = new EmployeeUpdateDTO();
9494
BeanUtils.copyProperties(dto, employeeUpdateDTO);
95+
// manually copy is needed nested objects
96+
if (dto.getProfile() != null) {
97+
EmployeeUpdateDTO.EmployeeProfileUpdateDTO profileUpdateDTO = new EmployeeUpdateDTO.EmployeeProfileUpdateDTO();
98+
BeanUtils.copyProperties(dto.getProfile(), profileUpdateDTO);
99+
employeeUpdateDTO.setProfile(profileUpdateDTO);
100+
}
101+
95102
validator.validate(employeeUpdateDTO);
96103
employeeMapper.updateEmployeeFromDto(employeeUpdateDTO, employee);
97104
employeesToUpdate.add(employee);

‎backend/src/main/java/com/itestra/eep/sql/postgres-dump.sql‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ INSERT INTO organization.event VALUES ('9f5a4dbf-e15d-4c8b-8d51-fb9a3e07f289', '
55
INSERT INTO organization.event VALUES ('d624cc6d-98ea-4d27-9f04-14d47ef55856', 'Café Münchner Freiheit', 'Small informal meetup to welcome new colleagues and casually chat about project ideas and team topics.', NULL , '2023-12-05 17:00:00', 50, 'WINTER_EVENT', 'Leopoldstraße 82, 80802 München');
66
INSERT INTO organization.event VALUES ('f1c9d9f4-7a5e-4d91-9fcb-2c9d1c3b7bfa', 'Käfer-Schänke', 'Dinner in a small group focused on sharing ideas between project leads and management. Great food, relaxed setting.', NULL , '2023-06-23 18:30:00', 40, 'SUMMER_EVENT', 'Prinzregentenstraße 73, 81675 München');
77

8-
INSERT INTO organization.profile VALUES ('a3f2f969-d8cd-4af1-9391-85eb57b0c6b4', 'itestra.tum.hr', 'itestra.tum.hr@gmail.com', 'itestra', '', 'Male', NULL, NULL, '2025-06-11 20:45:36.046825', '2025-06-11 20:45:36.046855');
9-
INSERT INTO organization.profile VALUES ('f3a2b6de-b3c4-4b5e-9c13-8e46ff2cbb15', 'julia.santos93', 'julia.santos93@example.com', 'Julia', 'Santos', 'Female', '{VEGAN}', NULL, '2025-06-18 10:12:34.123456', '2025-06-23 08:55:12.654321');
10-
INSERT INTO organization.profile VALUES ('e1283fa1-24cf-4af9-bd31-1f94d3b23a77', 'liwei.chen21', 'liwei.chen21@example.com', 'Liwei', 'Chen', 'Female', '{VEGETARIAN}', NULL, '2025-06-20 15:45:00.654321', '2025-06-23 11:20:45.987654');
11-
INSERT INTO organization.profile VALUES ('d9ef7c19-62b5-4b44-84ab-3e77c3e77e5f', 'michael_brooks', 'michael.brooks@example.com', 'Michael', 'Brooks', 'Male', '{FRUCTOSE_FREE,VEGETARIAN}', NULL, '2025-06-21 09:30:22.111222', '2025-06-23 12:44:01.778899');
12-
INSERT INTO organization.profile VALUES ('a6b79f10-3e2a-4632-a29f-d7c041fd90b1', 'fatima.khaled', 'fatima.khaled@example.com', 'Fatima', 'Khaled', 'Female', '{FRUCTOSE_FREE,VEGETARIAN}', NULL, '2025-06-22 18:20:18.999', '2025-06-23 13:37:42.112233');
13-
INSERT INTO organization.profile VALUES ('c4b27480-0f7e-4960-845e-79e8d7b4f4e4', 'tommy.nguyen', 'tommy.nguyen@example.com', 'Tommy', 'Nguyen', 'Male', '{VEGETARIAN}', NULL, '2025-06-17 07:55:44.223344', '2025-06-23 14:22:11.334455');
14-
INSERT INTO organization.profile VALUES ('b7d8e5f2-4a3c-4d6e-8f9a-1b2c3d4e5f6a', 'alexandra.mueller', 'alexandra.mueller@example.com', 'Alexandra', 'Müller', 'Female', '{GLUTEN_FREE}', NULL, '2025-06-15 14:30:15.445566', '2025-06-24 09:12:33.556677');
15-
INSERT INTO organization.profile VALUES ('c8e9f6a3-5b4d-4e7f-9a0b-2c3d4e5f6a7b', 'rajesh.patel', 'rajesh.patel@example.com', 'Rajesh', 'Patel', 'Male', '{VEGETARIAN}', NULL, '2025-06-16 11:45:22.667788', '2025-06-24 10:33:44.778899');
16-
INSERT INTO organization.profile VALUES ('d9fa07b4-6c5e-4f8a-a1b2-3d4e5f6a7b8c', 'sophie.larsson', 'sophie.larsson@example.com', 'Sophie', 'Larsson', 'Female', '{LACTOSE_FREE}', NULL, '2025-06-19 08:22:11.8899', '2025-06-24 11:55:22.990011');
17-
INSERT INTO organization.profile VALUES ('ea0b18c5-7d6f-4a9b-b2c3-4e5f6a7b8c9d', 'carlos.rodriguez', 'carlos.rodriguez@example.com', 'Carlos', 'Rodriguez', 'Male', '{VEGAN}', NULL, '2025-06-14 16:10:33.001122', '2025-06-24 12:17:55.112233');
18-
INSERT INTO organization.profile VALUES ('fb1c29d6-8e7a-4b0c-c3d4-5f6a7b8c9d0e', 'yuki.tanaka', 'yuki.tanaka@example.com', 'Yuki', 'Tanaka', 'Female', NULL, NULL, '2025-06-13 13:55:44.223344', '2025-06-24 13:40:11.334455');
19-
INSERT INTO organization.profile VALUES ('0c2d3ae7-9f8b-4c1d-d4e5-60a7b8c9d0ef', 'david.kim', 'david.kim@example.com', 'David', 'Kim', 'Male', '{FRUCTOSE_FREE}', NULL, '2025-06-12 09:18:55.445566', '2025-06-24 14:25:33.556677');
20-
INSERT INTO organization.profile VALUES ('1d3e4bf8-a09c-4d2e-e5f6-71b8c9d0efa0', 'emma.johnson', 'emma.johnson@example.com', 'Emma', 'Johnson', 'Female', '{VEGAN}', NULL, '2025-06-10 12:33:22.667788', '2025-06-24 15:08:44.778899');
21-
INSERT INTO organization.profile VALUES ('2e4f5ca9-b10d-4e3f-f6a7-82c9d0efa0b1', 'ahmed.hassan', 'ahmed.hassan@example.com', 'Ahmed', 'Hassan', 'Male', '{FRUCTOSE_FREE}', NULL,'2025-06-09 15:47:33.8899', '2025-06-24 16:12:55.990011');
22-
INSERT INTO organization.profile VALUES ('3f5a6db0-c21e-4f4a-a7b8-93d0efa0b1c2', 'nina.kowalski', 'nina.kowalski@example.com', 'Nina', 'Kowalski', 'Female', '{VEGETARIAN,GLUTEN_FREE}', NULL, '2025-06-08 10:25:44.001122', '2025-06-24 17:35:11.112233');
23-
INSERT INTO organization.profile VALUES ('5b7c8fd2-e43a-4b6c-c9d0-b5f1a0b1c2de', 'maria.gonzalez', 'maria.gonzalez@example.com', 'Maria', 'Gonzalez', 'Female', '{LACTOSE_FREE,VEGETARIAN}', NULL, '2025-06-06 14:15:11.445566', '2025-06-24 19:44:33.556677');
24-
INSERT INTO organization.profile VALUES ('6c8d9ae3-f54b-4c7d-d0e1-c6a2b1c2deaf', 'erik.andersson', 'erik.andersson@example.com', 'Erik', 'Andersson', 'Male', NULL, NULL, '2025-06-05 11:38:22.667788', '2025-06-24 20:15:44.778899');
25-
INSERT INTO organization.profile VALUES ('7d9e0bf4-a65c-4d8e-e1f2-d7b3c2d3efb0', 'priya.sharma', 'priya.sharma@example.com', 'Priya', 'Sharma', 'Female', '{VEGETARIAN}', NULL, '2025-06-04 17:52:33.8899', '2025-06-24 21:33:55.990011');
26-
INSERT INTO organization.profile VALUES ('8e0f1ca5-b76d-4e9f-f2a3-e8c4d3e4fac1', 'lucas.weber', 'lucas.weber@example.com', 'Lucas', 'Weber', 'Male', '{VEGAN,LACTOSE_FREE}', NULL, '2025-06-03 08:27:44.001122', '2025-06-24 22:18:11.112233');
27-
INSERT INTO organization.profile VALUES ('4a6b7ec1-d32f-4a5b-b8c9-a4e0fa0b1c2d', 'james.oconnor', 'james.oconnor@example.com', 'James', 'O''Connor', 'Male', '{VEGETARIAN,GLUTEN_FREE}', NULL, '2025-06-07 07:42:55.223344', '2025-06-24 10:39:06.998013');
28-
INSERT INTO organization.profile VALUES ('7136abd9-fac8-415e-806b-add50275fafc', 'kaan.ozgen12', 'kaan.ozgen12@gmail.com', 'Kaan', 'Özgen', 'Male', '{VEGAN}', NULL, '2025-06-24 10:35:45.320503', '2025-06-24 10:39:29.019129');
8+
INSERT INTO organization.profile VALUES ('a3f2f969-d8cd-4af1-9391-85eb57b0c6b4', 'itestra.tum.hr', 'itestra.tum.hr@gmail.com', 'itestra', '', 'MALE', NULL, NULL, '2025-06-11 20:45:36.046825', '2025-06-11 20:45:36.046855');
9+
INSERT INTO organization.profile VALUES ('f3a2b6de-b3c4-4b5e-9c13-8e46ff2cbb15', 'julia.santos93', 'julia.santos93@example.com', 'Julia', 'Santos', 'FEMALE', '{VEGAN}', NULL, '2025-06-18 10:12:34.123456', '2025-06-23 08:55:12.654321');
10+
INSERT INTO organization.profile VALUES ('e1283fa1-24cf-4af9-bd31-1f94d3b23a77', 'liwei.chen21', 'liwei.chen21@example.com', 'Liwei', 'Chen', 'FEMALE', '{VEGETARIAN}', NULL, '2025-06-20 15:45:00.654321', '2025-06-23 11:20:45.987654');
11+
INSERT INTO organization.profile VALUES ('d9ef7c19-62b5-4b44-84ab-3e77c3e77e5f', 'michael_brooks', 'michael.brooks@example.com', 'Michael', 'Brooks', 'MALE', '{FRUCTOSE_FREE,VEGETARIAN}', NULL, '2025-06-21 09:30:22.111222', '2025-06-23 12:44:01.778899');
12+
INSERT INTO organization.profile VALUES ('a6b79f10-3e2a-4632-a29f-d7c041fd90b1', 'fatima.khaled', 'fatima.khaled@example.com', 'Fatima', 'Khaled', 'FEMALE', '{FRUCTOSE_FREE,VEGETARIAN}', NULL, '2025-06-22 18:20:18.999', '2025-06-23 13:37:42.112233');
13+
INSERT INTO organization.profile VALUES ('c4b27480-0f7e-4960-845e-79e8d7b4f4e4', 'tommy.nguyen', 'tommy.nguyen@example.com', 'Tommy', 'Nguyen', 'MALE', '{VEGETARIAN}', NULL, '2025-06-17 07:55:44.223344', '2025-06-23 14:22:11.334455');
14+
INSERT INTO organization.profile VALUES ('b7d8e5f2-4a3c-4d6e-8f9a-1b2c3d4e5f6a', 'alexandra.mueller', 'alexandra.mueller@example.com', 'Alexandra', 'Müller', 'FEMALE', '{GLUTEN_FREE}', NULL, '2025-06-15 14:30:15.445566', '2025-06-24 09:12:33.556677');
15+
INSERT INTO organization.profile VALUES ('c8e9f6a3-5b4d-4e7f-9a0b-2c3d4e5f6a7b', 'rajesh.patel', 'rajesh.patel@example.com', 'Rajesh', 'Patel', 'MALE', '{VEGETARIAN}', NULL, '2025-06-16 11:45:22.667788', '2025-06-24 10:33:44.778899');
16+
INSERT INTO organization.profile VALUES ('d9fa07b4-6c5e-4f8a-a1b2-3d4e5f6a7b8c', 'sophie.larsson', 'sophie.larsson@example.com', 'Sophie', 'Larsson', 'FEMALE', '{LACTOSE_FREE}', NULL, '2025-06-19 08:22:11.8899', '2025-06-24 11:55:22.990011');
17+
INSERT INTO organization.profile VALUES ('ea0b18c5-7d6f-4a9b-b2c3-4e5f6a7b8c9d', 'carlos.rodriguez', 'carlos.rodriguez@example.com', 'Carlos', 'Rodriguez', 'MALE', '{VEGAN}', NULL, '2025-06-14 16:10:33.001122', '2025-06-24 12:17:55.112233');
18+
INSERT INTO organization.profile VALUES ('fb1c29d6-8e7a-4b0c-c3d4-5f6a7b8c9d0e', 'yuki.tanaka', 'yuki.tanaka@example.com', 'Yuki', 'Tanaka', 'FEMALE', NULL, NULL, '2025-06-13 13:55:44.223344', '2025-06-24 13:40:11.334455');
19+
INSERT INTO organization.profile VALUES ('0c2d3ae7-9f8b-4c1d-d4e5-60a7b8c9d0ef', 'david.kim', 'david.kim@example.com', 'David', 'Kim', 'MALE', '{FRUCTOSE_FREE}', NULL, '2025-06-12 09:18:55.445566', '2025-06-24 14:25:33.556677');
20+
INSERT INTO organization.profile VALUES ('1d3e4bf8-a09c-4d2e-e5f6-71b8c9d0efa0', 'emma.johnson', 'emma.johnson@example.com', 'Emma', 'Johnson', 'FEMALE', '{VEGAN}', NULL, '2025-06-10 12:33:22.667788', '2025-06-24 15:08:44.778899');
21+
INSERT INTO organization.profile VALUES ('2e4f5ca9-b10d-4e3f-f6a7-82c9d0efa0b1', 'ahmed.hassan', 'ahmed.hassan@example.com', 'Ahmed', 'Hassan', 'MALE', '{FRUCTOSE_FREE}', NULL,'2025-06-09 15:47:33.8899', '2025-06-24 16:12:55.990011');
22+
INSERT INTO organization.profile VALUES ('3f5a6db0-c21e-4f4a-a7b8-93d0efa0b1c2', 'nina.kowalski', 'nina.kowalski@example.com', 'Nina', 'Kowalski', 'FEMALE', '{VEGETARIAN,GLUTEN_FREE}', NULL, '2025-06-08 10:25:44.001122', '2025-06-24 17:35:11.112233');
23+
INSERT INTO organization.profile VALUES ('5b7c8fd2-e43a-4b6c-c9d0-b5f1a0b1c2de', 'maria.gonzalez', 'maria.gonzalez@example.com', 'Maria', 'Gonzalez', 'FEMALE', '{LACTOSE_FREE,VEGETARIAN}', NULL, '2025-06-06 14:15:11.445566', '2025-06-24 19:44:33.556677');
24+
INSERT INTO organization.profile VALUES ('6c8d9ae3-f54b-4c7d-d0e1-c6a2b1c2deaf', 'erik.andersson', 'erik.andersson@example.com', 'Erik', 'Andersson', 'MALE', NULL, NULL, '2025-06-05 11:38:22.667788', '2025-06-24 20:15:44.778899');
25+
INSERT INTO organization.profile VALUES ('7d9e0bf4-a65c-4d8e-e1f2-d7b3c2d3efb0', 'priya.sharma', 'priya.sharma@example.com', 'Priya', 'Sharma', 'FEMALE', '{VEGETARIAN}', NULL, '2025-06-04 17:52:33.8899', '2025-06-24 21:33:55.990011');
26+
INSERT INTO organization.profile VALUES ('8e0f1ca5-b76d-4e9f-f2a3-e8c4d3e4fac1', 'lucas.weber', 'lucas.weber@example.com', 'Lucas', 'Weber', 'MALE', '{VEGAN,LACTOSE_FREE}', NULL, '2025-06-03 08:27:44.001122', '2025-06-24 22:18:11.112233');
27+
INSERT INTO organization.profile VALUES ('4a6b7ec1-d32f-4a5b-b8c9-a4e0fa0b1c2d', 'james.oconnor', 'james.oconnor@example.com', 'James', 'O''Connor', 'MALE', '{VEGETARIAN,GLUTEN_FREE}', NULL, '2025-06-07 07:42:55.223344', '2025-06-24 10:39:06.998013');
28+
INSERT INTO organization.profile VALUES ('7136abd9-fac8-415e-806b-add50275fafc', 'kaan.ozgen12', 'kaan.ozgen12@gmail.com', 'Kaan', 'Özgen', 'MALE', '{VEGAN}', NULL, '2025-06-24 10:35:45.320503', '2025-06-24 10:39:29.019129');
2929

3030

3131
INSERT INTO organization.employee VALUES ('a3f2f969-d8cd-4af1-9391-85eb57b0c6b4', 'Munich', '2025-06-18');

‎backend/src/main/java/com/itestra/eep/validators/GenderValidator.java‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎backend/src/main/java/com/itestra/eep/validators/ValidGender.java‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎backend/src/test/java/com/itestra/eep/controllers/ProfileControllerIntegrationTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.fasterxml.jackson.databind.ObjectMapper;
44
import com.itestra.eep.dtos.EmployeeCreateDTO;
55
import com.itestra.eep.enums.DietaryPreference;
6+
import com.itestra.eep.enums.Gender;
67
import com.itestra.eep.enums.Role;
78
import com.itestra.eep.models.Employee;
89
import com.itestra.eep.models.Profile;
@@ -60,7 +61,7 @@ public class ProfileControllerIntegrationTest {
6061
new EmployeeCreateDTO.ProfileCreateDTO(
6162
profile.getName(),
6263
profile.getLastName(),
63-
profile.getGender(),
64+
Gender.fromStringOrNull(profile.getGender()),
6465
profile.getGitlabUsername(),
6566
profile.getNotes(),
6667
profile.getEmail(),

0 commit comments

Comments
 (0)