Skip to content

Commit

Permalink
Merge pull request #96 from TTBMP/release/v1.0-beta
Browse files Browse the repository at this point in the history
Release/v1.0-beta
  • Loading branch information
buracchi authored Jun 19, 2021
2 parents 32fbc61 + f311415 commit 5ab354d
Show file tree
Hide file tree
Showing 249 changed files with 3,083 additions and 6,238 deletions.
66 changes: 7 additions & 59 deletions app/src/main/java/com/ttbmp/cinehub/app/dto/CinemaDto.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
package com.ttbmp.cinehub.app.dto;

import com.ttbmp.cinehub.domain.Cinema;
import lombok.Value;

import java.util.List;
import java.util.stream.Collectors;

/**
* @author Ivan Palmieri, Fabio Buracchi
*/
@Value
public class CinemaDto {

private int id;
private String name;
private String address;
private String city;
private List<HallDto> halList;
int id;
String name;
String address;
String city;
List<HallDto> halList;

public CinemaDto(Cinema cinema) {
this.id = cinema.getId();
Expand All @@ -26,58 +28,4 @@ public CinemaDto(Cinema cinema) {
.collect(Collectors.toList());
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public String getCity() {
return city;
}

public void setCity(String city) {
this.city = city;
}

public List<HallDto> getHalList() {
return halList;
}

public void setHalList(List<HallDto> halList) {
this.halList = halList;
}

@Override
public boolean equals(Object obj) {
if (obj == null || this.getClass() != obj.getClass()) {
return false;
}
var other = (CinemaDto) obj;
return this.id == other.id;
}

@Override
public int hashCode() {
return id;
}

}
22 changes: 4 additions & 18 deletions app/src/main/java/com/ttbmp/cinehub/app/dto/HallDto.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
package com.ttbmp.cinehub.app.dto;

import com.ttbmp.cinehub.domain.Hall;
import lombok.Value;

/**
* @author Ivan Palmieri
*/
@Value
public class HallDto {

private Integer id;
private String name;
Integer id;
String name;

public HallDto(Hall hall) {
this.id = hall.getId();
this.name = hall.getName();
}

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

}
72 changes: 9 additions & 63 deletions app/src/main/java/com/ttbmp/cinehub/app/dto/MovieDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@


import com.ttbmp.cinehub.domain.Movie;
import lombok.Value;

/**
* @author Ivan Palmieri
*/
@Value
public class MovieDto {

private int id;
private String name;
private String overview;
private String duration;
private String movieUrl;
private String vote;
private String releases;
int id;
String name;
String overview;
String duration;
String movieUrl;
String vote;
String releases;

public MovieDto(Movie movie) {
this.id = movie.getId();
Expand All @@ -26,60 +28,4 @@ public MovieDto(Movie movie) {
this.releases = movie.getReleaseDate();
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getVote() {
return vote;
}

public void setVote(String vote) {
this.vote = vote;
}

public String getOverview() {
return overview;
}

public void setOverview(String overview) {
this.overview = overview;
}

public String getReleases() {
return releases;
}

public void setReleases(String releases) {
this.releases = releases;
}

public String getMovieUrl() {
return movieUrl;
}

public void setMovieUrl(String movieUrl) {
this.movieUrl = movieUrl;
}

public String getDuration() {
return duration;
}

public void setDuration(String duration) {
this.duration = duration;
}

}
62 changes: 8 additions & 54 deletions app/src/main/java/com/ttbmp/cinehub/app/dto/ProjectionDto.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package com.ttbmp.cinehub.app.dto;

import com.ttbmp.cinehub.domain.Projection;
import lombok.Value;

/**
* @author Ivan Palmieri
*/
@Value
public class ProjectionDto {

private int id;
private String date;
private String startTime;
private long basePrice;
private MovieDto movieDto;
private HallDto hallDto;
int id;
String date;
String startTime;
long basePrice;
MovieDto movieDto;
HallDto hallDto;

public ProjectionDto(Projection projection) {
this.id = projection.getId();
Expand All @@ -23,52 +25,4 @@ public ProjectionDto(Projection projection) {
this.hallDto = new HallDto(projection.getHall());
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getDate() {
return date;
}

public void setDate(String date) {
this.date = date;
}

public String getStartTime() {
return startTime;
}

public void setStartTime(String startTime) {
this.startTime = startTime;
}

public long getBasePrice() {
return basePrice;
}

public void setBasePrice(long basePrice) {
this.basePrice = basePrice;
}

public MovieDto getMovieDto() {
return movieDto;
}

public void setMovieDto(MovieDto movieDto) {
this.movieDto = movieDto;
}

public HallDto getHallDto() {
return hallDto;
}

public void setHallDto(HallDto hallDto) {
this.hallDto = hallDto;
}

}
32 changes: 5 additions & 27 deletions app/src/main/java/com/ttbmp/cinehub/app/dto/SeatDto.java
Original file line number Diff line number Diff line change
@@ -1,44 +1,22 @@
package com.ttbmp.cinehub.app.dto;

import com.ttbmp.cinehub.domain.Seat;
import lombok.Value;

/**
* @author Ivan Palmieri
*/
@Value
public class SeatDto {

private int id;
private String position;
private boolean isBooked;
int id;
String position;
boolean isBooked;

public SeatDto(Seat seat, boolean isBooked) {
this.id = seat.getId();
this.position = seat.getPosition();
this.isBooked = isBooked;
}

public String getPosition() {
return position;
}

public void setPosition(String position) {
this.position = position;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public boolean isBooked() {
return isBooked;
}

public void setBooked(boolean booked) {
isBooked = booked;
}

}
34 changes: 6 additions & 28 deletions app/src/main/java/com/ttbmp/cinehub/app/dto/TicketDto.java
Original file line number Diff line number Diff line change
@@ -1,44 +1,22 @@
package com.ttbmp.cinehub.app.dto;

import com.ttbmp.cinehub.domain.ticket.component.Ticket;
import com.ttbmp.cinehub.domain.ticket.Ticket;
import lombok.Value;

/**
* @author Ivan Palmieri
*/
@Value
public class TicketDto {

private int id;
private long price;
private SeatDto seatDto;
int id;
long price;
SeatDto seatDto;

public TicketDto(Ticket ticket) {
this.id = ticket.getId();
this.price = ticket.getPrice();
this.seatDto = new SeatDto(ticket.getSeat(), true);
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public long getPrice() {
return price;
}

public void setPrice(long price) {
this.price = price;
}

public SeatDto getSeatDto() {
return seatDto;
}

public void setSeatDto(SeatDto seatDto) {
this.seatDto = seatDto;
}

}
Loading

0 comments on commit 5ab354d

Please sign in to comment.