Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit b0781f1

Browse files
committed
update: gql types after unused model removal
1 parent 18d2ae5 commit b0781f1

8 files changed

Lines changed: 9 additions & 1035 deletions

File tree

apps/admin-ui/gql/gql-types.ts

Lines changed: 2 additions & 236 deletions
Large diffs are not rendered by default.

apps/ui/gql/gql-types.ts

Lines changed: 2 additions & 240 deletions
Large diffs are not rendered by default.

apps/ui/modules/__tests__/reservation.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ function createMockReservationUnit({
3535
reservationsMinDaysBefore,
3636
reservationEnds,
3737
canBeCancelledTimeBefore,
38-
needsHandling,
3938
}: {
4039
reservationsMinDaysBefore?: number;
4140
reservationEnds?: Date;
@@ -46,7 +45,6 @@ function createMockReservationUnit({
4645
canBeCancelledTimeBefore: canBeCancelledTimeBefore ?? 0,
4746
id: "fr8ejifod",
4847
name: "Cancellation rule",
49-
needsHandling: needsHandling ?? false,
5048
};
5149
return {
5250
authentication: Authentication.Weak,
@@ -85,7 +83,6 @@ function createMockReservationUnit({
8583
qualifiers: [],
8684
equipments: [],
8785
resources: [],
88-
services: [],
8986
spaces: [],
9087
cancellationRule,
9188
reservations: [],
@@ -256,20 +253,17 @@ describe("isReservationCancellable", () => {
256253
function constructInput({
257254
begin,
258255
state,
259-
needsHandling,
260256
canBeCancelledTimeBefore,
261257
}: {
262258
begin: Date; // reservation begin time
263259
state?: ReservationStateChoice; // reservation state
264-
needsHandling?: boolean; // if the reservation unit needs handling
265260
canBeCancelledTimeBefore?: number; // in seconds
266261
}) {
267262
return {
268263
...createMockReservation({
269264
begin,
270265
state: state ?? ReservationStateChoice.Confirmed,
271266
reservationUnit: createMockReservationUnit({
272-
needsHandling: needsHandling ?? false,
273267
canBeCancelledTimeBefore: canBeCancelledTimeBefore ?? 0,
274268
}),
275269
}),
@@ -308,14 +302,6 @@ describe("isReservationCancellable", () => {
308302
expect(isReservationCancellable(input)).toBe(false);
309303
});
310304

311-
test("NO for reservation unit that needs handling", () => {
312-
const input = constructInput({
313-
begin: addDays(new Date(), 1),
314-
needsHandling: true,
315-
});
316-
expect(isReservationCancellable(input)).toBe(false);
317-
});
318-
319305
test("YES for reservation that does not need handling", () => {
320306
const input = constructInput({
321307
begin: addDays(new Date(), 1),

apps/ui/modules/__tests__/reservationUnit.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,6 @@ describe("isReservationUnitReservable", () => {
10351035
reservationPendingInstructions: "",
10361036
reservationStartInterval: ReservationStartInterval.Interval_15Mins,
10371037
resources: [],
1038-
services: [],
10391038
spaces: [],
10401039
maxPersons: 10,
10411040
uuid: "be4fa7a2-05b7-11ee-be56-0242ac120004",

apps/ui/modules/queries/reservation.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ const CANCELLATION_RULE_FRAGMENT = gql`
6262
cancellationRule {
6363
id
6464
canBeCancelledTimeBefore
65-
needsHandling
6665
}
6766
}
6867
`;

apps/ui/modules/reservation.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ export function isReservationCancellable(
158158
// TODO why can't user cancel if the reservation is waiting for handling?
159159
if (reservation.state !== ReservationStateChoice.Confirmed) return false;
160160
if (reservationUnit.cancellationRule == null) return false;
161-
// TODO why isn't the user allowed to cancel if the reservation has been handled?
162-
if (reservationUnit.cancellationRule.needsHandling) return false;
163161
if (isTooCloseToCancel(reservation)) {
164162
return false;
165163
}
@@ -276,10 +274,7 @@ export function getWhyReservationCantBeChanged(
276274
}
277275

278276
const reservationUnit = reservation.reservationUnits?.[0];
279-
if (
280-
reservationUnit?.cancellationRule == null ||
281-
reservationUnit.cancellationRule.needsHandling
282-
) {
277+
if (reservationUnit?.cancellationRule == null) {
283278
return "CANCELLATION_NOT_ALLOWED";
284279
}
285280

0 commit comments

Comments
 (0)