2020-10-13 18:03:37 +02:00
|
|
|
package com.plannaplan.responses.models;
|
|
|
|
|
|
|
|
import com.plannaplan.entities.Assignment;
|
|
|
|
import com.plannaplan.entities.Groups;
|
2020-11-08 16:55:56 +01:00
|
|
|
import io.swagger.annotations.ApiModel;
|
2020-10-13 18:03:37 +02:00
|
|
|
|
2021-01-15 17:45:29 +01:00
|
|
|
/**
|
|
|
|
* Group api response featuring group capacity
|
|
|
|
*/
|
2020-11-08 17:20:00 +01:00
|
|
|
@ApiModel(description = "Response shows information about group with included capacity.", value = "GroupWithCapacityResponse")
|
|
|
|
public class GroupWithCapacityResponse extends GroupDefaultResponse {
|
2020-10-13 18:03:37 +02:00
|
|
|
|
|
|
|
private int capacity;
|
|
|
|
|
2021-01-15 17:45:29 +01:00
|
|
|
/**
|
|
|
|
* create new instance
|
|
|
|
*
|
|
|
|
* @param group entity to map to api response
|
|
|
|
*/
|
2020-11-08 17:20:00 +01:00
|
|
|
public GroupWithCapacityResponse(Groups group) {
|
2020-10-13 18:03:37 +02:00
|
|
|
super(group);
|
|
|
|
this.capacity = group.getCapacity();
|
|
|
|
}
|
|
|
|
|
2021-01-15 17:45:29 +01:00
|
|
|
/**
|
|
|
|
* create new instance
|
|
|
|
*
|
|
|
|
* @param group entity to map to api response
|
|
|
|
* @param takenPlaces group taken places
|
|
|
|
*/
|
2020-11-20 16:20:38 +01:00
|
|
|
public GroupWithCapacityResponse(Groups group, int takenPlaces) {
|
|
|
|
super(group, takenPlaces);
|
|
|
|
this.capacity = group.getCapacity();
|
|
|
|
}
|
|
|
|
|
2021-01-15 17:45:29 +01:00
|
|
|
/**
|
|
|
|
* create new instance
|
|
|
|
*
|
|
|
|
* @param assignment entity to map to api response
|
|
|
|
*/
|
2020-11-08 17:20:00 +01:00
|
|
|
public GroupWithCapacityResponse(Assignment assignment) {
|
2020-10-13 18:03:37 +02:00
|
|
|
this(assignment.getGroup());
|
|
|
|
}
|
|
|
|
|
2021-01-15 17:45:29 +01:00
|
|
|
/**
|
|
|
|
* create new instance
|
|
|
|
*
|
|
|
|
* @param assignment entity to map to api response
|
|
|
|
* @param takenPlaces group taken places
|
|
|
|
*/
|
2020-11-30 12:35:35 +01:00
|
|
|
public GroupWithCapacityResponse(Assignment assignment, int takenPlaces) {
|
2021-01-20 15:38:42 +01:00
|
|
|
super(assignment, takenPlaces);
|
2020-11-30 12:35:35 +01:00
|
|
|
}
|
|
|
|
|
2021-01-15 17:45:29 +01:00
|
|
|
/**
|
|
|
|
* @return group taken places
|
|
|
|
*/
|
2020-10-13 18:03:37 +02:00
|
|
|
public int getCapacity() {
|
|
|
|
return capacity;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|