Skip to content

Commit

Permalink
Merge pull request #190 from Uplace/request-creator
Browse files Browse the repository at this point in the history
Fix for inquire and Updated to 0.1.8.4-SNAPSHOT
  • Loading branch information
arnaugarcia committed Jun 4, 2018
2 parents 136a3f1 + 8e3f7f7 commit 882c424
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "uplace",
"version": "0.1.8.3-SNAPSHOT",
"version": "0.1.8.4-SNAPSHOT",
"description": "Description for uplace",
"private": true,
"license": "GPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -4,7 +4,7 @@

<groupId>com.arnaugarcia.uplace</groupId>
<artifactId>uplace</artifactId>
<version>0.1.8.3-SNAPSHOT</version>
<version>0.1.8.4-SNAPSHOT</version>
<packaging>war</packaging>
<name>Uplace</name>

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/arnaugarcia/uplace/domain/Request.java
Expand Up @@ -78,6 +78,7 @@ public class Request implements Serializable {
private String message;

@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Property property;

// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
Expand Down
Expand Up @@ -38,6 +38,8 @@ public ResponseEntity<Request> sendInquire(String propertyReference, Request req
throw new BadRequestAlertException("Property not found", "PROPERTY", ErrorConstants.ERR_BAD_REFERENCE);
}

request.setProperty(property);

request.setRequestStatus(RequestStatus.OPEN);

request.setDate(ZonedDateTime.now());
Expand All @@ -61,14 +63,14 @@ public ResponseEntity<Request> sendInquire(String propertyReference, Request req
// TODO : Send a notification to the agent
// TODO : Send an email to the agent
// TODO : Make the template of contact
Mail mail = new Mail(
/*Mail mail = new Mail(
request.getEmail(),
request.getFirstName() + ", " + request.getLastName(),
ZonedDateTime.now(),
"Uplace - Muchas gracias por su interés",
"Estimad@ " + request.getFirstName() + " hemos recibido su solicitud con éxito en breves nos pondremos en contacto con usted"
);
mailService.sendPropertyInfo(mail, property,"infoProperty","email.inquire.title");
mailService.sendPropertyInfo(mail, property,"infoProperty","email.inquire.title");*/
return new ResponseEntity<>(request, HttpStatus.OK);
}
}
Expand Up @@ -146,7 +146,7 @@ public void removeProperty(@PathVariable String references) {
*/
@PostMapping("/properties/{reference}/inquire")
@Timed
public void removeProperty(@PathVariable String reference, @RequestBody Request request) {
public void sendInquire(@PathVariable String reference, @RequestBody Request request) {
log.debug("REST request to create inquire by reference " + reference);
inquireService.sendInquire(reference, request);
}
Expand Down

0 comments on commit 882c424

Please sign in to comment.