Skip to content

Commit

Permalink
Merge pull request #100 from TTBMP/release/v1.0
Browse files Browse the repository at this point in the history
Release/v1.0
  • Loading branch information
buracchi authored Jul 4, 2021
2 parents 647781c + 77b2b89 commit 128e03e
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 101 deletions.
12 changes: 6 additions & 6 deletions app/src/main/java/com/ttbmp/cinehub/app/dto/ShiftDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public ShiftDto(Shift shift) {
this.date = LocalDate.parse(shift.getDate());
this.start = LocalTime.parse(shift.getStart());
this.end = LocalTime.parse(shift.getEnd());
if(shift instanceof ProjectionistShift){
this.type=ShiftType.PROJECTIONIST_SHIFT;
this.hall = new HallDto (((ProjectionistShift) shift).getHall());
}else if(shift instanceof UsherShift){
this.type=ShiftType.USHER_SHIFT;
if (shift instanceof ProjectionistShift) {
this.type = ShiftType.PROJECTIONIST_SHIFT;
this.hall = new HallDto(((ProjectionistShift) shift).getHall());
} else if (shift instanceof UsherShift) {
this.type = ShiftType.USHER_SHIFT;
this.hall = null;
}else{
} else {
throw new IllegalStateException("Unexpected value: " + shift);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import com.ttbmp.cinehub.app.repository.hall.HallRepository;
import com.ttbmp.cinehub.domain.Cinema;
import com.ttbmp.cinehub.domain.Hall;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class CinemaProxy extends Cinema {

private final HallRepository hallRepository;
Expand Down Expand Up @@ -41,14 +43,4 @@ public void setHallList(List<Hall> hallList) {
super.setHallList(hallList);
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

@Override
public int hashCode() {
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import com.ttbmp.cinehub.domain.security.Permission;
import com.ttbmp.cinehub.domain.security.Role;
import com.ttbmp.cinehub.domain.ticket.Ticket;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class CustomerProxy extends Customer {

private final TicketRepository ticketRepository;
Expand Down Expand Up @@ -134,14 +136,4 @@ public void setOwnedTicketList(List<Ticket> ownedTicketList) {
super.setOwnedTicketList(ownedTicketList);
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

@Override
public int hashCode() {
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
import com.ttbmp.cinehub.domain.security.Permission;
import com.ttbmp.cinehub.domain.security.Role;
import com.ttbmp.cinehub.domain.shift.Shift;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class ProjectionistProxy extends Projectionist {

private final UserRepository userRepository;
Expand Down Expand Up @@ -167,14 +169,4 @@ public List<Shift> getShiftListBetween(LocalDate start, LocalDate end) {
}
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

@Override
public int hashCode() {
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
import com.ttbmp.cinehub.domain.security.Permission;
import com.ttbmp.cinehub.domain.security.Role;
import com.ttbmp.cinehub.domain.shift.Shift;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class UsherProxy extends Usher {

private final UserRepository userRepository;
Expand Down Expand Up @@ -169,14 +171,4 @@ public List<Shift> getShiftListBetween(LocalDate start, LocalDate end) {
}
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

@Override
public int hashCode() {
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import com.ttbmp.cinehub.app.repository.seat.SeatRepository;
import com.ttbmp.cinehub.domain.Hall;
import com.ttbmp.cinehub.domain.Seat;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class HallProxy extends Hall {

private final SeatRepository seatRepository;
Expand Down Expand Up @@ -41,14 +43,4 @@ public void setSeatList(List<Seat> seatList) {
super.setSeatList(seatList);
}

@Override
public int hashCode() {
return super.hashCode();
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import com.ttbmp.cinehub.app.service.movieapi.MovieApiService;
import com.ttbmp.cinehub.app.service.movieapi.MovieApiServiceException;
import com.ttbmp.cinehub.domain.Movie;
import lombok.EqualsAndHashCode;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class MovieProxy extends Movie {

private final MovieApiService movieApiService;
Expand Down Expand Up @@ -83,14 +85,4 @@ private void loadMovie() {
}
}

@Override
public int hashCode() {
return super.hashCode();
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
import com.ttbmp.cinehub.domain.Projection;
import com.ttbmp.cinehub.domain.employee.Projectionist;
import com.ttbmp.cinehub.domain.ticket.Ticket;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class ProjectionProxy extends Projection {

private final MovieRepository movieRepository;
Expand Down Expand Up @@ -110,14 +112,4 @@ public void setTicketList(List<Ticket> ticketList) {
super.setTicketList(ticketList);
}

@Override
public int hashCode() {
return super.hashCode();
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import com.ttbmp.cinehub.app.di.ServiceLocator;
import com.ttbmp.cinehub.domain.Seat;
import lombok.EqualsAndHashCode;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class SeatProxy extends Seat {

@SuppressWarnings("unused")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import com.ttbmp.cinehub.domain.Projection;
import com.ttbmp.cinehub.domain.employee.Employee;
import com.ttbmp.cinehub.domain.shift.ProjectionistShift;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class ProjectionistShiftProxy extends ProjectionistShift {

private final ProjectionistRepository projectionistRepository;
Expand Down Expand Up @@ -88,14 +90,4 @@ public void setProjectionList(List<Projection> projectionList) {
super.setProjectionList(projectionList);
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

@Override
public int hashCode() {
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import com.ttbmp.cinehub.app.repository.employee.usher.UsherRepository;
import com.ttbmp.cinehub.domain.employee.Employee;
import com.ttbmp.cinehub.domain.shift.UsherShift;
import lombok.EqualsAndHashCode;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class UsherShiftProxy extends UsherShift {

private final UsherRepository usherRepository;
Expand Down Expand Up @@ -40,14 +42,4 @@ public void setEmployee(Employee employee) {
super.setEmployee(employee);
}

@Override
public boolean equals(Object obj) {
return super.equals(obj);
}

@Override
public int hashCode() {
return super.hashCode();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import com.ttbmp.cinehub.app.di.ServiceLocator;
import com.ttbmp.cinehub.domain.User;
import com.ttbmp.cinehub.domain.security.Role;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
* @author Fabio Buracchi
*/
@EqualsAndHashCode(callSuper = true)
public class UserProxy extends User {

@SuppressWarnings("unused")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void onValidate() {
if (creditCard.creditCardNumber.length() < 12 || creditCard.creditCardNumber.length() > 16) {
addError(CREDIT_CARD_LENGTH_ERROR);
}
if (!email.contains("@")) {
if (!email.matches("\\w+@\\w+\\.\\w+")) {
addError(EMAIL_ERROR);
}
if (ticketOption.magicBoxOption == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private void modifyProjectionistShift(ShiftModifyRequest request, ProjectionistS
}

private void modifyUsherShift(ShiftModifyRequest request, UsherShift shift) throws ModifyShiftException {
shift.modifyShift( request.getDate(), request.getStart(), request.getEnd());
shift.modifyShift(request.getDate(), request.getStart(), request.getEnd());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public ViewPersonalScheduleViewModel() {
selectedShiftDateProperty.bind(ObjectBindings.map(selectedShiftProperty, shiftDto -> shiftDto.getDate().toString()));
selectedShiftStartProperty.bind(ObjectBindings.map(selectedShiftProperty, shiftDto -> shiftDto.getStart().toString()));
selectedShiftEndProperty.bind(ObjectBindings.map(selectedShiftProperty, shiftDto -> shiftDto.getEnd().toString()));
selectedProjectionistShiftHallProperty.bind(ObjectBindings.map(selectedShiftProperty, shiftDto -> shiftDto.getHall().getName()));
selectedProjectionistShiftHallProperty.bind(ObjectBindings.map(selectedShiftProperty, shiftDto -> shiftDto.getHall().getName()));
projectionsDetailButtonVisibleProperty.bind(ObjectBindings.map(selectedShiftEmployeeRoleProperty, e -> e.equals(EmployeeDto.EmployeeRole.PROJECTIONIST.toString())));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
<input th:name="shift.end" th:value="${scheduleForm.shift.end}" type="hidden"/>
<input th:name="shift.employeeId" th:value="${scheduleForm.shift.employeeId}" type="hidden"/>
<div th:if="${scheduleForm.employee.role.equals('Projectionist')}">
<input th:name="hall.id" th:value="${scheduleForm.shift.hall.id}" type="hidden"/>
<input th:name="hall.name" th:value="${scheduleForm.shift.hall.name}" type="hidden"/>
<input th:name="shift.hall.id" th:value="${scheduleForm.shift.hall.id}" type="hidden"/>
<input th:name="shift.hall.name" th:value="${scheduleForm.shift.hall.name}" type="hidden"/>
</div>
<input class="btn btn-primary" type="submit" value="BACK"/>
</form>
Expand Down

0 comments on commit 128e03e

Please sign in to comment.