Rev | Line | |
---|
[57e58a3] | 1 | package com.example.skychasemk.model;
|
---|
| 2 |
|
---|
| 3 | import jakarta.persistence.*;
|
---|
| 4 | import lombok.Getter;
|
---|
| 5 | import lombok.Setter;
|
---|
| 6 |
|
---|
| 7 | import java.math.BigDecimal;
|
---|
| 8 | import java.time.LocalDate;
|
---|
| 9 |
|
---|
| 10 | @Getter
|
---|
| 11 | @Entity
|
---|
| 12 | @Table(name="Payment")
|
---|
| 13 | public class Payment {
|
---|
| 14 |
|
---|
[de83113] | 15 | @Setter
|
---|
[57e58a3] | 16 | @Id
|
---|
| 17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 18 | @Column(name = "PaymentID")
|
---|
| 19 |
|
---|
| 20 | private Integer paymentID;
|
---|
| 21 |
|
---|
[de83113] | 22 | //@Column(name = "bookingId")
|
---|
| 23 | @Setter
|
---|
| 24 | @Column(name="bookingid")
|
---|
| 25 | private Integer bookingId;
|
---|
| 26 | @Getter
|
---|
| 27 | @Column(name = "userid")
|
---|
[57e58a3] | 28 |
|
---|
[de83113] | 29 | private Integer userId;
|
---|
[57e58a3] | 30 | @Setter
|
---|
| 31 | @Column(name = "payment_method")
|
---|
| 32 |
|
---|
| 33 | @Enumerated(EnumType.STRING)
|
---|
| 34 | private PaymentMethod method;
|
---|
| 35 | @Setter
|
---|
| 36 | @Column(name = "Amount")
|
---|
| 37 |
|
---|
| 38 | private BigDecimal amount;
|
---|
| 39 | @Setter
|
---|
| 40 | @Getter
|
---|
| 41 | @Column(name = "transaction_date")
|
---|
| 42 |
|
---|
| 43 | private LocalDate transactionDate;
|
---|
[de83113] | 44 | @Setter
|
---|
| 45 | @Getter
|
---|
[57e58a3] | 46 | @Column(name = "payment_status")
|
---|
| 47 |
|
---|
| 48 | @Enumerated(EnumType.STRING)
|
---|
| 49 | private PaymentStatus status;
|
---|
| 50 |
|
---|
[de83113] | 51 |
|
---|
[57e58a3] | 52 | public enum PaymentStatus {
|
---|
| 53 | PENDING,
|
---|
| 54 | COMPLETED,
|
---|
| 55 | CANCELLED
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | public enum PaymentMethod {
|
---|
| 59 | PAYPAL,
|
---|
| 60 | DEBIT,
|
---|
| 61 | CREDIT
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | public Integer getBookingID() {
|
---|
[de83113] | 65 | return bookingId;
|
---|
[57e58a3] | 66 | }
|
---|
| 67 |
|
---|
[de83113] | 68 | public void setUserID(Integer userId) {
|
---|
| 69 | this.userId = userId;
|
---|
[57e58a3] | 70 | }
|
---|
| 71 |
|
---|
[de83113] | 72 | public void setUserId(Long userId) {
|
---|
| 73 | this.userId = Math.toIntExact(userId);
|
---|
[57e58a3] | 74 | }
|
---|
| 75 |
|
---|
| 76 | }
|
---|
| 77 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.