@@ -0,0 +1,45 @@
|
||||
package ru.soune.nocopy.entity.payment;
|
||||
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import ru.soune.nocopy.entity.user.User;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "payment_methods")
|
||||
@Getter @Setter @NoArgsConstructor @AllArgsConstructor
|
||||
public class PaymentMethod {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "user_id", nullable = false)
|
||||
private User user;
|
||||
|
||||
@Column(name = "payment_method_id", nullable = false, unique = true)
|
||||
private String paymentMethodId;
|
||||
|
||||
@Column(name = "last_four")
|
||||
private String lastFour;
|
||||
|
||||
@Column(name = "card_type")
|
||||
private String cardType;
|
||||
|
||||
@Column(name = "expiry_month")
|
||||
private String expiryMonth;
|
||||
|
||||
@Column(name = "expiry_year")
|
||||
private String expiryYear;
|
||||
|
||||
@Column(name = "active")
|
||||
private boolean active = true;
|
||||
|
||||
@Column(name = "created_at")
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -37,4 +37,10 @@ public class TariffInfo {
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "tariff_id")
|
||||
private Tariff tariff;
|
||||
|
||||
@Column(name = "auto_renewal")
|
||||
private boolean autoRenewal = false;
|
||||
|
||||
@Column(name = "payment_method_id")
|
||||
private String paymentMethodId;
|
||||
}
|
||||
Reference in New Issue
Block a user