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

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

Signup,Login,FlightSearch,Booking and Payment working!

  • Property mode set to 100644
File size: 1.4 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 @Setter
16 @Id
17 @GeneratedValue(strategy = GenerationType.IDENTITY)
18 @Column(name = "PaymentID")
19
20 private Integer paymentID;
21
22 //@Column(name = "bookingId")
23 @Setter
24 @Column(name="bookingid")
25 private Integer bookingId;
26 @Getter
27 @Column(name = "userid")
28
29 private Integer userId;
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;
44 @Setter
45 @Getter
46 @Column(name = "payment_status")
47
48 @Enumerated(EnumType.STRING)
49 private PaymentStatus status;
50
51
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() {
65 return bookingId;
66 }
67
68 public void setUserID(Integer userId) {
69 this.userId = userId;
70 }
71
72 public void setUserId(Long userId) {
73 this.userId = Math.toIntExact(userId);
74 }
75
76}
77
Note: See TracBrowser for help on using the repository browser.