Ignore:
Timestamp:
01/05/23 01:31:58 (18 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
676144b
Parents:
ab952ab
Message:

Added functionalities

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/model/Warehouseman.java

    rab952ab r7d43957  
    2323public class Warehouseman extends User{
    2424    LocalDate employed_from;
     25    public static final LocalDate defaultEmployedFrom = LocalDate.of(2020,1,1);
    2526    @ManyToOne
    2627    @JoinColumn(name = "id_warehouse")
    2728    Warehouse warehouse;
     29
     30    public Warehouseman(String username, String name, String email, String password, String number, Warehouse warehouse) {
     31        super(username, name, email, password, number);
     32        this.employed_from=defaultEmployedFrom;
     33        this.warehouse= warehouse;
     34    }
    2835
    2936    @Override
     
    4148    @Override
    4249    public Collection<? extends GrantedAuthority> getAuthorities() {
    43         return Collections.singletonList(Role.ROLE_WAREHOUSEMAN);
     50        if(employed_from==defaultEmployedFrom)
     51            return Collections.singletonList(Role.ROLE_PENDING_WAREHOUSEMAN);
     52        else
     53            return Collections.singletonList(Role.ROLE_WAREHOUSEMAN);
    4454    }
    4555}
Note: See TracChangeset for help on using the changeset viewer.