-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaidCustomer.java
More file actions
50 lines (40 loc) · 1.27 KB
/
PaidCustomer.java
File metadata and controls
50 lines (40 loc) · 1.27 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
package main.java.com.example.model;
import java.util.ArrayList;
import java.util.List;
public class PaidCustomer {
private int subscriptionId;
private int employerId;
private List<Payment> payments; // 여러 결제 정보를 저장
public PaidCustomer(int subscriptionId, int employerId) {
this.subscriptionId = subscriptionId;
this.employerId = employerId;
this.payments = new ArrayList<>(); // 초기화
}
public int getSubscriptionId() {
return subscriptionId;
}
public void setSubscriptionId(int subscriptionId) {
this.subscriptionId = subscriptionId;
}
public int getEmployerId() {
return employerId;
}
public void setEmployerId(int employerId) {
this.employerId = employerId;
}
public List<Payment> getPayments() {
return payments;
}
// 결제 정보 추가
public void addPayment(Payment payment) {
payments.add(payment);
}
public void displayCustomerInfo() {
System.out.println("Subscription ID: " + subscriptionId);
System.out.println("Employer ID: " + employerId);
System.out.println("Payments:");
for (Payment payment : payments) {
payment.displayPaymentDetails();
}
}
}