Skip to content

Commit

Permalink
hot fix
Browse files Browse the repository at this point in the history
  • Loading branch information
abdelhak-zaaim committed Jul 30, 2024
1 parent 85fde85 commit a8714d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import lombok.Builder;
import lombok.Value;

import java.time.ZonedDateTime;
import java.util.Date;

@Value
Expand All @@ -39,15 +40,15 @@ public class MyUserResponseDto {
Address address;


Date registeredAt;
ZonedDateTime registeredAt;


Date lastUpdateDate;
ZonedDateTime lastUpdateDate;


String cin;

public MyUserResponseDto(String firstName, String lastName, String email, String role, String phoneNumber, Address address, Date registeredAt, Date lastUpdateDate, String cin) {
public MyUserResponseDto(String firstName, String lastName, String email, String role, String phoneNumber, Address address, ZonedDateTime registeredAt, ZonedDateTime lastUpdateDate, String cin) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/fsdm/pfe/delix/entity/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.PrePersist;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.*;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
Expand All @@ -34,7 +32,8 @@
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Data
@Getter
@Setter
@DiscriminatorValue(Role.ADMIN_ROLE)
public class Admin extends Employee implements UserDetails {
private final static String ROLE_PREFIX = "ROLE_";
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/fsdm/pfe/delix/entity/Area.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@Entity
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/com/fsdm/pfe/delix/entity/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
Expand Down Expand Up @@ -50,14 +52,6 @@ public Customer(RegisterRequestDto registerRequestDto) {
}


@PrePersist
protected void onCreated() {
super.setStatus(UserStatus.EMAIL_NOT_VERIFIED);
Date date = new Date();
this.setRegisteredAt(date);
this.setLastUpdateDate(date);
}

@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
List<GrantedAuthority> authorities = new ArrayList<>();
Expand Down

0 comments on commit a8714d0

Please sign in to comment.