Skip to content

Commit

Permalink
Reservation package classes were refactored a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunagatov committed Jul 23, 2023
1 parent 6e0e237 commit 21c66bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.time.Instant;

public record ReservationDto(

@NotNull(message = "ReservationId is the mandatory attribute")
Integer reservationId,

Expand All @@ -17,8 +18,8 @@ public record ReservationDto(
@NotNull(message = "ReservedQuantity is the mandatory attribute")
Integer reservedQuantity,

@NotNull(message = "CreatedAt is the mandatory attribute")
@Past
@NotNull(message = "CreatedAt is the mandatory attribute")
Instant createdAt,

@NotBlank(message = "Status is the mandatory attribute")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public class Reservation {
private ReservationStatus status;

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Reservation that = (Reservation) o;
public boolean equals(Object object) {
if (this == object)
return true;
if (object == null || getClass() != object.getClass())
return false;
Reservation that = (Reservation) object;
return reservationId.equals(that.reservationId) && productId.equals(that.productId);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.zufar.onlinestore.reservation.entity;

public enum ReservationStatus {
CREATED, CONFIRMED, CANCELLED
CREATED,
CONFIRMED,
CANCELLED
}

0 comments on commit 21c66bb

Please sign in to comment.