001/*
002 * Stallion Core: A Modern Web Framework
003 *
004 * Copyright (C) 2015 - 2016 Stallion Software LLC.
005 *
006 * This program is free software: you can redistribute it and/or modify it under the terms of the
007 * GNU General Public License as published by the Free Software Foundation, either version 2 of
008 * the License, or (at your option) any later version. This program is distributed in the hope that
009 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
011 * License for more details. You should have received a copy of the GNU General Public License
012 * along with this program.  If not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
013 *
014 *
015 *
016 */
017
018package io.stallion.services;
019
020import java.time.ZonedDateTime;
021import java.util.Map;
022
023import io.stallion.dataAccess.ModelBase;
024import io.stallion.dataAccess.db.Converter;
025import io.stallion.dataAccess.db.converters.JsonMapConverter;
026
027import javax.persistence.Column;
028import javax.persistence.Table;
029
030@Table(name="stallion_transaction_log")
031public class TransactionLog extends ModelBase {
032    private String subject;
033    private String body;
034    private Long userId;
035    private Long orgId;
036    private String type;
037    private String customKey;
038    private String toAddress;
039    private Map<String, Object> extra;
040    private ZonedDateTime createdAt;
041
042    @Column
043    public String getSubject() {
044        return subject;
045    }
046
047    public TransactionLog setSubject(String subject) {
048        this.subject = subject;
049        return this;
050    }
051
052    @Column(columnDefinition = "longtext")
053    public String getBody() {
054        return body;
055    }
056
057    public TransactionLog setBody(String body) {
058        this.body = body;
059        return this;
060    }
061
062    @Column
063    public Long getUserId() {
064        return userId;
065    }
066
067    public TransactionLog setUserId(Long userId) {
068        this.userId = userId;
069        return this;
070    }
071
072    @Column
073    public Long getOrgId() {
074        return orgId;
075    }
076
077    public TransactionLog setOrgId(Long orgId) {
078        this.orgId = orgId;
079        return this;
080    }
081
082    @Column(length = 65)
083    public String getType() {
084        return type;
085    }
086
087    public TransactionLog setType(String type) {
088        this.type = type;
089        return this;
090    }
091
092    @Column(length = 65)
093    public String getCustomKey() {
094        return customKey;
095    }
096
097    public TransactionLog setCustomKey(String customKey) {
098        this.customKey = customKey;
099        return this;
100    }
101
102    @Column
103    public String getToAddress() {
104        return toAddress;
105    }
106
107    public TransactionLog setToAddress(String toAddress) {
108        this.toAddress = toAddress;
109        return this;
110    }
111
112    @Column(columnDefinition = "longtext")
113    @Converter(cls=JsonMapConverter.class)
114    public Map<String, Object> getExtra() {
115        return extra;
116    }
117
118    public TransactionLog setExtra(Map<String, Object> extra) {
119        this.extra = extra;
120        return this;
121    }
122
123    @Column
124    public ZonedDateTime getCreatedAt() {
125        return createdAt;
126    }
127
128    public TransactionLog setCreatedAt(ZonedDateTime createdAt) {
129        this.createdAt = createdAt;
130        return this;
131    }
132}