source: src/main/java/com/example/skychasemk/model/Payment.java@ 3d60932

Last change on this file since 3d60932 was 3d60932, checked in by ste08 <sjovanoska@…>, 4 months ago

Fix commiT

  • Property mode set to 100644
File size: 2.2 KB
Line 
1package com.example.skychasemk.model;
2
3import jakarta.persistence.*;
4import lombok.Getter;
5import lombok.Setter;
6
7import java.math.BigDecimal;
8import java.time.LocalDate;
9
10@Getter
11@Entity
12@Table(name="Payment")
13public class Payment {
14
15 @Id
16 @GeneratedValue(strategy = GenerationType.IDENTITY)
17 @Column(name = "PaymentID")
18
19 private Integer paymentID;
20
21 @Column(name = "bookingid")
22
23 private Integer bookingID;
24 @Column(name = "UserID")
25
26 private Integer userID;
27 @Setter
28 @Column(name = "payment_method")
29
30 @Enumerated(EnumType.STRING)
31 private PaymentMethod method;
32 @Setter
33 @Column(name = "Amount")
34
35 private BigDecimal amount;
36 @Setter
37 @Getter
38 @Column(name = "transaction_date")
39
40 private LocalDate transactionDate;
41 @Column(name = "payment_status")
42
43 @Enumerated(EnumType.STRING)
44 private PaymentStatus status;
45
46 public enum PaymentStatus {
47 PENDING,
48 COMPLETED,
49 CANCELLED
50 }
51
52 public enum PaymentMethod {
53 PAYPAL,
54 DEBIT,
55 CREDIT
56 }
57
58 public Integer getPaymentID() {
59 return paymentID;
60 }
61
62 public Integer getBookingID() {
63 return bookingID;
64 }
65
66 public Integer getUserID() {
67 return userID;
68 }
69
70 public void setUserID(Integer userID) {
71 this.userID = userID;
72 }
73
74 public PaymentMethod getMethod() {
75 return method;
76 }
77
78 public void setMethod(PaymentMethod method) {
79 this.method = method;
80 }
81
82 public BigDecimal getAmount() {
83 return amount;
84 }
85
86 public void setPaymentID(Integer paymentID) {
87 this.paymentID = paymentID;
88 }
89
90 public void setBookingID(Integer bookingID) {
91 this.bookingID = bookingID;
92 }
93
94 public void setAmount(BigDecimal amount) {
95 this.amount = amount;
96 }
97
98 public LocalDate getTransactionDate() {
99 return transactionDate;
100 }
101
102 public void setTransactionDate(LocalDate transactionDate) {
103 this.transactionDate = transactionDate;
104 }
105
106 public PaymentStatus getStatus() {
107 return status;
108 }
109
110 public void setStatus(PaymentStatus status) {
111 this.status = status;
112 }
113
114 public void setUserID(Long userID) {
115 this.userID = Math.toIntExact(userID);
116 }
117
118}
119
Note: See TracBrowser for help on using the repository browser.