refactor: remove name field from CreateShift and update ShiftEntity to allow nullable name
This commit is contained in:
@@ -7,9 +7,6 @@ import org.eclipse.microprofile.graphql.NonNull;
|
||||
@NoArgsConstructor
|
||||
public class CreateShift {
|
||||
|
||||
@NonNull
|
||||
public String name;
|
||||
|
||||
@NonNull
|
||||
public LocalTime startTime;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ShiftEntity extends BaseEntity {
|
||||
@JoinColumn(name = "eatery_id")
|
||||
public EateryEntity eatery;
|
||||
|
||||
@Column(nullable = false)
|
||||
@Column(nullable = true)
|
||||
public String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
|
||||
@@ -116,7 +116,6 @@ public class ShiftService {
|
||||
|
||||
ShiftEntity shift = new ShiftEntity();
|
||||
shift.eatery = eatery;
|
||||
shift.name = input.name;
|
||||
shift.startTime = input.startTime;
|
||||
shift.endTime = input.endTime;
|
||||
shift.maxStaff = input.maxStaff;
|
||||
@@ -145,7 +144,6 @@ public class ShiftService {
|
||||
!shift.eatery.ownerId.toString().equals(ownerId)
|
||||
) throw new GraphQLException("InvalidShiftId");
|
||||
|
||||
shift.name = input.name;
|
||||
shift.startTime = input.startTime;
|
||||
shift.endTime = input.endTime;
|
||||
shift.maxStaff = input.maxStaff;
|
||||
|
||||
Reference in New Issue
Block a user