Skip to content

Commit f78f439

Browse files
committed
chore: update PaymentCounter to use UUID for productCode and add toString method
1 parent 6a99f64 commit f78f439

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/main/java/com/acme/statistics/PaymentCounter.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
import jakarta.nosql.Entity;
88
import jakarta.nosql.Id;
99

10+
import java.util.UUID;
11+
1012
@Entity
1113
@JsonbVisibility(JsonFieldStrategy.class)
1214
public class PaymentCounter {
1315

1416
@Id
15-
private String productCode;
17+
private UUID productCode;
1618

1719
@Column
1820
private Product product;
@@ -38,4 +40,13 @@ public void paymentFailed() {
3840
public void paymentSucceeded() {
3941
this.successfulPayments++;
4042
}
43+
44+
@Override
45+
public String toString() {
46+
return "PaymentCounter{" +
47+
"productCode=" + productCode +
48+
", successfulPayments=" + successfulPayments +
49+
", failedPayments=" + failedPayments +
50+
'}';
51+
}
4152
}

0 commit comments

Comments
 (0)