-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from TTBMP/release/v1.0
Release/v1.0
- Loading branch information
Showing
82 changed files
with
664 additions
and
789 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/ttbmp/cinehub/app/CinehubException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.ttbmp.cinehub.app; | ||
|
||
/** | ||
* @author Fabio Buracchi | ||
*/ | ||
public class CinehubException extends Exception { | ||
|
||
public CinehubException(String message) { | ||
super(message); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
app/src/main/java/com/ttbmp/cinehub/app/dto/EmployeeDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.ttbmp.cinehub.app.dto; | ||
|
||
import com.ttbmp.cinehub.domain.employee.Employee; | ||
import com.ttbmp.cinehub.domain.employee.Projectionist; | ||
import com.ttbmp.cinehub.domain.employee.Usher; | ||
import lombok.AccessLevel; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
import lombok.experimental.FieldDefaults; | ||
|
||
/** | ||
* @author Massimo Mazzetti | ||
*/ | ||
@Getter | ||
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) | ||
@ToString | ||
@EqualsAndHashCode | ||
public class EmployeeDto { | ||
|
||
String id; | ||
String name; | ||
String surname; | ||
CinemaDto cinema; | ||
EmployeeRole role; | ||
|
||
public EmployeeDto(Employee employee) { | ||
this.id = employee.getId(); | ||
this.name = employee.getName(); | ||
this.surname = employee.getSurname(); | ||
this.cinema = new CinemaDto(employee.getCinema()); | ||
if (employee instanceof Projectionist) { | ||
this.role = EmployeeRole.PROJECTIONIST; | ||
} else if (employee instanceof Usher) { | ||
this.role = EmployeeRole.USHER; | ||
} else { | ||
throw new IllegalStateException("Unexpected value: " + employee); | ||
} | ||
} | ||
|
||
public enum EmployeeRole { | ||
PROJECTIONIST("Projectionist"), | ||
USHER("Usher"); | ||
|
||
private final String name; | ||
|
||
EmployeeRole(final String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
|
||
} | ||
|
||
} |
33 changes: 0 additions & 33 deletions
33
app/src/main/java/com/ttbmp/cinehub/app/dto/employee/EmployeeDto.java
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
app/src/main/java/com/ttbmp/cinehub/app/dto/employee/EmployeeDtoFactory.java
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
app/src/main/java/com/ttbmp/cinehub/app/dto/employee/ProjectionistDto.java
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
app/src/main/java/com/ttbmp/cinehub/app/dto/employee/UsherDto.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
app/src/main/java/com/ttbmp/cinehub/app/service/email/EmailServiceAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package com.ttbmp.cinehub.app.service.email; | ||
|
||
import com.ttbmp.cinehub.service.email.emailservice.SendEmailService; | ||
import com.ttbmp.cinehub.service.email.emailservice.SendEmailServiceException; | ||
|
||
public class EmailServiceAdapter implements EmailService { | ||
|
||
private final SendEmailService service = new SendEmailService(); | ||
|
||
@Override | ||
public void sendMail(EmailServiceRequest emailServiceRequest) { | ||
service.sendMail(emailServiceRequest.getEmail()); | ||
public void sendMail(EmailServiceRequest request) throws EmailServiceException { | ||
try { | ||
service.sendMail(request.getEmail(), request.getObject()); | ||
} catch (SendEmailServiceException e) { | ||
throw new EmailServiceException(e.getMessage()); | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/ttbmp/cinehub/app/service/email/EmailServiceException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.ttbmp.cinehub.app.service.email; | ||
|
||
public class EmailServiceException extends Exception { | ||
|
||
public EmailServiceException(String message) { | ||
super(message); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.