You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
3.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package com.gcc.communityHall.entity;
  2. import jakarta.persistence.*;
  3. import java.time.LocalDateTime;
  4. /**
  5. * Audit log table that records every refund-follow-up mail dispatched
  6. * for 6-month-old bookings from the /sixmonthold-transactions page.
  7. *
  8. * DDL (run once):
  9. * CREATE TABLE six_month_mail_log (
  10. * id BIGINT AUTO_INCREMENT PRIMARY KEY,
  11. * booking_id INT NOT NULL,
  12. * booking_status VARCHAR(50),
  13. * transaction_id VARCHAR(100),
  14. * tpsl_id VARCHAR(100),
  15. * refund_amount DOUBLE,
  16. * sent_by VARCHAR(100),
  17. * sent_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  18. * mail_content TEXT
  19. * );
  20. *
  21. * Also add to booking_details (run once):
  22. * ALTER TABLE booking_details
  23. * ADD COLUMN mail_sent TINYINT(1) DEFAULT 0,
  24. * ADD COLUMN mail_sent_date DATETIME NULL;
  25. */
  26. @Entity
  27. @Table(name = "six_month_mail_log")
  28. public class SixMonthMailLog {
  29. @Id
  30. @GeneratedValue(strategy = GenerationType.IDENTITY)
  31. private Long id;
  32. @Column(name = "booking_id", nullable = false)
  33. private int bookingId;
  34. @Column(name = "booking_status", length = 50)
  35. private String bookingStatus;
  36. @Column(name = "transaction_id", length = 100)
  37. private String transactionId;
  38. @Column(name = "tpsl_id", length = 100)
  39. private String tpslId;
  40. @Column(name = "refund_amount")
  41. private Double refundAmount;
  42. @Column(name = "sent_by", length = 100)
  43. private String sentBy;
  44. @Column(name = "sent_at")
  45. private LocalDateTime sentAt;
  46. @Column(name = "mail_content", columnDefinition = "TEXT")
  47. private String mailContent;
  48. // ──── Constructors ────────────────────────────────────────────────────────
  49. public SixMonthMailLog() {
  50. }
  51. public SixMonthMailLog(int bookingId, String bookingStatus, String transactionId,
  52. String tpslId, Double refundAmount, String sentBy, String mailContent) {
  53. this.bookingId = bookingId;
  54. this.bookingStatus = bookingStatus;
  55. this.transactionId = transactionId;
  56. this.tpslId = tpslId;
  57. this.refundAmount = refundAmount;
  58. this.sentBy = sentBy;
  59. this.sentAt = LocalDateTime.now();
  60. this.mailContent = mailContent;
  61. }
  62. // ──── Getters & Setters ───────────────────────────────────────────────────
  63. public Long getId() { return id; }
  64. public void setId(Long id) { this.id = id; }
  65. public int getBookingId() { return bookingId; }
  66. public void setBookingId(int bookingId) { this.bookingId = bookingId; }
  67. public String getBookingStatus() { return bookingStatus; }
  68. public void setBookingStatus(String bookingStatus) { this.bookingStatus = bookingStatus; }
  69. public String getTransactionId() { return transactionId; }
  70. public void setTransactionId(String transactionId) { this.transactionId = transactionId; }
  71. public String getTpslId() { return tpslId; }
  72. public void setTpslId(String tpslId) { this.tpslId = tpslId; }
  73. public Double getRefundAmount() { return refundAmount; }
  74. public void setRefundAmount(Double refundAmount) { this.refundAmount = refundAmount; }
  75. public String getSentBy() { return sentBy; }
  76. public void setSentBy(String sentBy) { this.sentBy = sentBy; }
  77. public LocalDateTime getSentAt() { return sentAt; }
  78. public void setSentAt(LocalDateTime sentAt) { this.sentAt = sentAt; }
  79. public String getMailContent() { return mailContent; }
  80. public void setMailContent(String mailContent) { this.mailContent = mailContent; }
  81. }