Ignore:
Timestamp:
01/12/21 02:42:18 (4 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
a70db1a
Parents:
8f1f460
Message:

bugfixes and refactoring

Location:
src/main/java/it/finki/tinki/model/dto/response/work
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/tinki/model/dto/response/work/InternshipResponseDTO.java

    r8f1f460 r33d4f5d  
    22
    33import it.finki.tinki.model.Address;
     4import it.finki.tinki.model.Skill;
    45import it.finki.tinki.model.Work.Internship;
    56import it.finki.tinki.model.Users.Company;
    67import lombok.Data;
     8
     9import java.util.List;
    710
    811@Data
     
    1114    int openSpots;
    1215    Address accountAddress;
     16    List<Skill> skillsTrained;
     17
     18    public InternshipResponseDTO(){
     19        super();
     20    }
    1321
    1422    public InternshipResponseDTO(Internship internship){
     
    1725        this.openSpots = internship.getOpenSpots();
    1826        this.accountAddress = ((Company) internship.getAccount()).getAddress();
     27        this.skillsTrained = internship.getSkillsTrained();
    1928    }
    2029}
  • src/main/java/it/finki/tinki/model/dto/response/work/JobResponseDTO.java

    r8f1f460 r33d4f5d  
    22
    33import it.finki.tinki.model.Address;
     4import it.finki.tinki.model.Skill;
    45import it.finki.tinki.model.Work.Job;
    56import it.finki.tinki.model.Users.Company;
     
    89import lombok.Data;
    910
     11import java.util.List;
     12
    1013@Data
    1114public class JobResponseDTO extends WorkResponseDTO {
    1215    Address accountAddress;
    1316    int members;
     17    List<Skill> skillsRequired;
     18
     19    public JobResponseDTO(){
     20        super();
     21    }
    1422
    1523    public JobResponseDTO(Job job){
    1624        super(job.getId(), job.getTitle(), job.getDescription(), job.getSalary(), job.getAccount());
     25        this.skillsRequired = job.getSkillsRequired();
    1726        if(job.getAccount().getAccountType()==AccountType.COMPANY){
    1827            this.accountAddress = ((Company) job.getAccount()).getAddress();
  • src/main/java/it/finki/tinki/model/dto/response/work/ProjectResponseDTO.java

    r8f1f460 r33d4f5d  
    11package it.finki.tinki.model.dto.response.work;
    22
     3import it.finki.tinki.model.Skill;
    34import it.finki.tinki.model.Work.Project;
    45import it.finki.tinki.model.Users.Team;
    56import lombok.Data;
    67
     8import java.util.Date;
     9import java.util.List;
     10
    711@Data
    812public class ProjectResponseDTO extends WorkResponseDTO {
    913    int members;
     14    Date validUntil;
     15    List<Skill> skillsRequired;
     16
     17    public ProjectResponseDTO(){
     18        super();
     19    }
    1020
    1121    public ProjectResponseDTO(Project project){
    1222        super(project.getId(), project.getTitle(), project.getDescription(), project.getSalary(), project.getAccount());
    1323        this.members = ((Team) project.getAccount()).getMembers();
     24        this.validUntil = project.getValidUntil();
     25        this.skillsRequired = project.getSkillsRequired();
    1426    }
    1527}
  • src/main/java/it/finki/tinki/model/dto/response/work/WorkResponseDTO.java

    r8f1f460 r33d4f5d  
    1414    String accountName;
    1515    AccountType accountType;
     16    String error;
    1617
    17     WorkResponseDTO(){}
     18    WorkResponseDTO(){
     19        this.error = "Error registering job!";
     20    }
    1821
    1922    WorkResponseDTO(Long id, String title, String description, int salary, Account account){
     23        this.error = null;
    2024        this.id = id;
    2125        this.title = title;
Note: See TracChangeset for help on using the changeset viewer.