Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User profile replica #173

Merged
merged 46 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
17d960d
started implementation for profile managment
GabrieleMaiocchiFilippo May 15, 2024
a54a736
user
ElisKina-dev May 15, 2024
1ef1500
delete user and getAll users
ElisKina-dev May 15, 2024
c243cbf
implemented CRUD for profile
GabrieleMaiocchiFilippo May 16, 2024
f4f51f4
Merge remote-tracking branch 'origin/managing_profile' into userProfile
ElisKina-dev May 16, 2024
2d00dd1
user profile association
ElisKina-dev May 16, 2024
c8f9557
get user profiles
ElisKina-dev May 17, 2024
73dbc09
one to many association
ElisKina-dev May 17, 2024
dc8dec8
inserting a list of profileIds for a user
ElisKina-dev May 21, 2024
1d05282
updated retirive of user by id with only profiles associatated to it …
GabrieleMaiocchiFilippo May 21, 2024
4b9e223
junit tests for User
ElisKina-dev May 23, 2024
46e8f77
junit tests for UserProfiles
ElisKina-dev May 24, 2024
6fe6045
revisioning
GiacomoBrancazi May 27, 2024
1a05225
remove annotation jsonignore
GiacomoBrancazi May 28, 2024
feacba5
fix path /users
GiacomoBrancazi May 28, 2024
b75f307
fixed tests
ElisKina-dev May 28, 2024
9584dc1
UserProfilesServiceImpl tests
ElisKina-dev May 28, 2024
74e2dd7
added test for profile
GabrieleMaiocchiFilippo May 28, 2024
2af7e5c
name and surname added in User
ElisKina-dev May 29, 2024
11e0cfe
Merge branch 'userProfile' of https://github.com/pagopa/atm-layer-mod…
GiacomoBrancazi May 29, 2024
18fdfbd
updated test of UserResourceTest and UserServiceImplTest and added Us…
GabrieleMaiocchiFilippo May 29, 2024
794b2e0
Merge branch 'userProfile' of https://github.com/pagopa/atm-layer-mod…
GiacomoBrancazi May 30, 2024
b42d30f
updated UserProfiles update
GabrieleMaiocchiFilippo May 31, 2024
689b50d
fixed insert test of UserProfiles
ElisKina-dev Jun 3, 2024
613590f
adding mapper tests
ElisKina-dev Jun 3, 2024
fb5615b
added UserProfilesResource update test
GabrieleMaiocchiFilippo Jun 4, 2024
6503975
Merge remote-tracking branch 'origin/userProfile' into userProfile
GabrieleMaiocchiFilippo Jun 4, 2024
3706e65
Merge branch 'userProfile' of https://github.com/pagopa/atm-layer-mod…
GiacomoBrancazi Jun 5, 2024
0442f1f
update user
ElisKina-dev Jun 5, 2024
2d3111a
Merge branch 'userProfile' of https://github.com/pagopa/atm-layer-mod…
GiacomoBrancazi Jun 6, 2024
7ad204f
rollback test in workflowResource added
ElisKina-dev Jun 6, 2024
7f8ecd8
Merge branch 'userProfile' of https://github.com/pagopa/atm-layer-mod…
GiacomoBrancazi Jun 6, 2024
947beab
pulizia del codice
ElisKina-dev Jun 6, 2024
65f270f
added insertUserWithProfiles and its relatives' tests
GabrieleMaiocchiFilippo Jun 6, 2024
4c99370
Merge branch 'userProfile' of https://github.com/pagopa/atm-layer-mod…
GiacomoBrancazi Jun 6, 2024
acd1b75
test error fix
ElisKina-dev Jun 6, 2024
bc3dfc9
add first access
GiacomoBrancazi Jun 6, 2024
1797533
Merge branch 'userProfile' of https://github.com/pagopa/atm-layer-mod…
GiacomoBrancazi Jun 6, 2024
fcd6fa3
test error fix
ElisKina-dev Jun 7, 2024
dfbbef4
test first access
ElisKina-dev Jun 7, 2024
52b0161
updated insertUserWithProfiles and its relatives' files and tests
GabrieleMaiocchiFilippo Jun 7, 2024
11b72cc
undeploy test of bpmnResource
ElisKina-dev Jun 10, 2024
7983d21
fixed the insert in userprofiles
ElisKina-dev Jun 11, 2024
7a6a06b
made some update and added some test
GabrieleMaiocchiFilippo Jun 14, 2024
1456876
Merge remote-tracking branch 'origin/dev' into userProfileReplica
ElisKina-dev Jul 18, 2024
974c6e6
merged dev into userProfile
ElisKina-dev Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.*;

@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

@NoArgsConstructor
@Data
public class ProfileCreationDto {
@NotEmpty
private String description;
@NotNull
@Range(min = 1)
private int profileId;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@EqualsAndHashCode
public class UserInsertionDTO {
@NotBlank
@Email(message = "must be an email address in the correct format")
@Schema(required = true, example = "[email protected]")
private String userId;
private String name;
private String surname;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.hibernate.validator.constraints.Range;

import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@EqualsAndHashCode
public class UserInsertionWithProfilesDTO {
@NotBlank
@Email(message = "must be an email address in the correct format")
@Schema(required = true, example = "[email protected]")
private String userId;
private String name;
private String surname;
@NotNull
@Size(min = 1)
private List<@Range(min=1) Integer> profileIds;
}
Original file line number Diff line number Diff line change
@@ -1,22 +0,0 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import it.gov.pagopa.atmlayer.service.model.enumeration.UserProfileEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

import java.sql.Timestamp;

@NoArgsConstructor
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserProfileAllDto {
@Schema(example = "[email protected]", format = "byte", maxLength = 255)
private String userId;
private UserProfileEnum profile;
@Schema(example = "{\"date\":\"2023-11-03T14:18:36.635+00:00\"}")
private Timestamp createdAt;
@Schema(example = "{\"date\":\"2023-11-03T14:18:36.635+00:00\"}")
private Timestamp lastUpdatedAt;
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import lombok.*;

import java.sql.Timestamp;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@EqualsAndHashCode
public class UserProfilesDTO {
private String userId;
private int profileId;
private Timestamp createdAt;
private Timestamp lastUpdatedAt;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import org.hibernate.validator.constraints.Range;

import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@EqualsAndHashCode
public class UserProfilesInsertionDTO {
@NotBlank
private String userId;
@NotNull
@Size(min = 1)
private List<@Range(min=1) Integer> profileIds;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package it.gov.pagopa.atmlayer.service.model.dto;

import it.gov.pagopa.atmlayer.service.model.model.ProfileDTO;
import lombok.*;

import java.sql.Timestamp;
import java.util.List;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@EqualsAndHashCode
public class UserWithProfilesDTO {
private String userId;
private String name;
private String surname;
private List<ProfileDTO> profiles;
private Timestamp createdAt;
private Timestamp lastUpdatedAt;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.*;

import java.io.Serializable;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package it.gov.pagopa.atmlayer.service.model.entity;

import jakarta.persistence.*;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -15,17 +18,22 @@
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "user_profile")
public class UserProfile {
@Table(name = "profile")
public class Profile {

@Id
@Column(name = "user_id")
private String userId;
@Column(name = "profile")
private int profile;
@Column(name = "profile_id")
private int profileId;

@Column(name = "description")
private String description;

@CreationTimestamp
@Column(name = "created_at")
private Timestamp createdAt;

@UpdateTimestamp
@Column(name = "last_updated_at")
private Timestamp lastUpdatedAt;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package it.gov.pagopa.atmlayer.service.model.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.quarkus.hibernate.reactive.panache.PanacheEntityBase;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

@Entity
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "users")
public class User extends PanacheEntityBase implements Serializable {

@Id
@Column(name = "user_id")
private String userId;

@Column(name = "name")
private String name;

@Column(name = "surname")
private String surname;

@JsonIgnore
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
private List<UserProfiles> userProfiles;

@CreationTimestamp
@Column(name = "created_at")
private Timestamp createdAt;

@UpdateTimestamp
@Column(name = "last_updated_at")
private Timestamp lastUpdatedAt;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package it.gov.pagopa.atmlayer.service.model.entity;

import io.quarkus.hibernate.reactive.panache.PanacheEntityBase;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.io.Serializable;
import java.sql.Timestamp;

@Entity
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "user_profiles")
public class UserProfiles extends PanacheEntityBase implements Serializable {

@EmbeddedId
private UserProfilesPK userProfilesPK;

@ManyToOne
@JoinColumn(name = "user_id", referencedColumnName = "user_id", insertable = false, updatable = false)
private User user;

@ManyToOne
@JoinColumn(name = "profile_id", referencedColumnName = "profile_id", insertable = false, updatable = false)
private Profile profile;

@CreationTimestamp
@Column(name = "created_at")
private Timestamp createdAt;

@UpdateTimestamp
@Column(name = "last_updated_at")
private Timestamp lastUpdatedAt;
public UserProfiles(UserProfilesPK userProfilesPK) {
this.userProfilesPK = userProfilesPK;
};
}
Loading
Loading