Skip to content

Commit

Permalink
add new chang
Browse files Browse the repository at this point in the history
  • Loading branch information
Yura Novak committed Nov 20, 2023
1 parent 34f1ec4 commit f48fd9b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/com/champions/carsharingservice/model/Payment.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,43 @@

@Getter
@Setter
@EqualsAndHashCode(exclude = {"rental"})
@ToString(exclude = {"rental"})
@EqualsAndHashCode(exclude = "rental")
@ToString(exclude = "rental")
@Entity
@Table(name = "payments")
public class Payment {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false)
@Enumerated(EnumType.STRING)
private PaymentStatus status;

@Column(nullable = false)
@Enumerated(EnumType.STRING)
private PaymentType type;

@Column(nullable = false)
private URL sessionUrl;

@Column(nullable = false)
private String sessionId;

@Column(nullable = false)
private BigDecimal amountToPay;
@ManyToOne(fetch = FetchType.LAZY, optional = false) // ?Lilja

@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "rental_id", nullable = false)
private Rental rental;

private enum PaymentStatus {
public enum PaymentStatus {
PENDING,
PAID,
CANCELED
}

private enum PaymentType {
public enum PaymentType {
PAYMENT,
FINE
}
Expand Down

0 comments on commit f48fd9b

Please sign in to comment.