BrightSide Workbench Full Report + Source Code
FollowUp.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2016 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.financials.entity;
20 
21 import java.io.Serializable;
22 import java.util.Date;
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.GeneratedValue;
26 import javax.persistence.GenerationType;
27 import javax.persistence.Id;
28 import javax.persistence.OneToOne;
29 import javax.persistence.Temporal;
30 import javax.persistence.TemporalType;
31 import org.turro.string.Strings;
32 import org.turro.action.Contacts;
33 import org.turro.plugin.contacts.IContact;
34 
39 @Entity
40 public class FollowUp implements Serializable {
41 
42  @Id
43  @GeneratedValue(strategy=GenerationType.IDENTITY)
44  @Column(name="IDENTIFIER")
45  private long id;
46 
47  private String prepareId, deliverId;
48 
49  @OneToOne
50  private Document document;
51 
52  @Temporal(value = TemporalType.TIMESTAMP)
53  private Date preparedDate, deliveredDate;
54 
55  private String receiver, receiverId;
56 
57  public long getId() {
58  return id;
59  }
60 
61  public void setId(long id) {
62  this.id = id;
63  }
64 
65  public Document getDocument() {
66  return document;
67  }
68 
69  public void setDocument(Document document) {
70  this.document = document;
71  }
72 
73  public Date getPreparedDate() {
74  return preparedDate;
75  }
76 
77  public void setPreparedDate(Date preparedDate) {
78  this.preparedDate = preparedDate;
79  }
80 
81  public Date getDeliveredDate() {
82  return deliveredDate;
83  }
84 
85  public void setDeliveredDate(Date deliveredDate) {
86  this.deliveredDate = deliveredDate;
87  }
88 
89  public String getReceiver() {
90  return receiver;
91  }
92 
93  public void setReceiver(String receiver) {
94  this.receiver = receiver;
95  }
96 
97  public String getReceiverId() {
98  return receiverId;
99  }
100 
101  public void setReceiverId(String receiverId) {
102  this.receiverId = receiverId;
103  }
104 
105  /* Contact helper */
106 
107  public void setIPrepare(IContact contact) {
108  prepareId = contact.getId();
109  }
110 
112  if(!Strings.isBlank(prepareId)) {
113  return Contacts.getContactById(prepareId);
114  }
115  return null;
116  }
117 
118  public void setIDeliver(IContact contact) {
119  deliverId = contact.getId();
120  }
121 
123  if(!Strings.isBlank(deliverId)) {
124  return Contacts.getContactById(deliverId);
125  }
126  return null;
127  }
128 
129 }
static IContact getContactById(String id)
Definition: Contacts.java:72
void setDeliveredDate(Date deliveredDate)
Definition: FollowUp.java:85
void setIPrepare(IContact contact)
Definition: FollowUp.java:107
void setIDeliver(IContact contact)
Definition: FollowUp.java:118
void setPreparedDate(Date preparedDate)
Definition: FollowUp.java:77
void setReceiverId(String receiverId)
Definition: FollowUp.java:101
void setReceiver(String receiver)
Definition: FollowUp.java:93
void setDocument(Document document)
Definition: FollowUp.java:69