-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReviewRequest.java
More file actions
71 lines (56 loc) · 2.16 KB
/
Copy pathReviewRequest.java
File metadata and controls
71 lines (56 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.knoc.review.entity;
import com.knoc.order.entity.Order;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.time.LocalDateTime;
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "review_request")
public class ReviewRequest {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "order_id", nullable = false, unique = true)
private Order order;
@Column(name = "github_pr_url", nullable = false, length = 512)
private String githubPrUrl;
@Column(name = "project_context", nullable = false, columnDefinition = "TEXT")
private String projectContext;
@Column(name = "concern_point", nullable = false, columnDefinition = "TEXT")
private String concernPoint;
@Column(name = "ai_pr_summary", columnDefinition = "TEXT")
private String aiPrSummary;
@Column(name = "changed_files", nullable = false)
private int changedFiles;
@Column(nullable = false)
private int additions;
@Column(nullable = false)
private int deletions;
@CreatedDate
@Column(name = "created_at", nullable = false, updatable = false)
private LocalDateTime createdAt;
@Builder
public ReviewRequest(Order order, String githubPrUrl, String projectContext,
String concernPoint, int changedFiles, int additions, int deletions) {
this.order = order;
this.githubPrUrl = githubPrUrl;
this.projectContext = projectContext;
this.concernPoint = concernPoint;
this.changedFiles = changedFiles;
this.additions = additions;
this.deletions = deletions;
}
public void update(String githubPrUrl, String projectContext, String concernPoint) {
this.githubPrUrl = githubPrUrl;
this.projectContext = projectContext;
this.concernPoint = concernPoint;
}
}