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
|
@NoArgsConstructor
|
||||||
public class CreateShift {
|
public class CreateShift {
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public String name;
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public LocalTime startTime;
|
public LocalTime startTime;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public class ShiftEntity extends BaseEntity {
|
|||||||
@JoinColumn(name = "eatery_id")
|
@JoinColumn(name = "eatery_id")
|
||||||
public EateryEntity eatery;
|
public EateryEntity eatery;
|
||||||
|
|
||||||
@Column(nullable = false)
|
@Column(nullable = true)
|
||||||
public String name;
|
public String name;
|
||||||
|
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
|
|||||||
@@ -116,7 +116,6 @@ public class ShiftService {
|
|||||||
|
|
||||||
ShiftEntity shift = new ShiftEntity();
|
ShiftEntity shift = new ShiftEntity();
|
||||||
shift.eatery = eatery;
|
shift.eatery = eatery;
|
||||||
shift.name = input.name;
|
|
||||||
shift.startTime = input.startTime;
|
shift.startTime = input.startTime;
|
||||||
shift.endTime = input.endTime;
|
shift.endTime = input.endTime;
|
||||||
shift.maxStaff = input.maxStaff;
|
shift.maxStaff = input.maxStaff;
|
||||||
@@ -145,7 +144,6 @@ public class ShiftService {
|
|||||||
!shift.eatery.ownerId.toString().equals(ownerId)
|
!shift.eatery.ownerId.toString().equals(ownerId)
|
||||||
) throw new GraphQLException("InvalidShiftId");
|
) throw new GraphQLException("InvalidShiftId");
|
||||||
|
|
||||||
shift.name = input.name;
|
|
||||||
shift.startTime = input.startTime;
|
shift.startTime = input.startTime;
|
||||||
shift.endTime = input.endTime;
|
shift.endTime = input.endTime;
|
||||||
shift.maxStaff = input.maxStaff;
|
shift.maxStaff = input.maxStaff;
|
||||||
|
|||||||
Reference in New Issue
Block a user