From 4cea97e0f1fc31e71e96c0aa52499bac99c48443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Mon, 6 Nov 2023 08:44:37 +0000 Subject: [PATCH] chore: Move Hasura to lib folder --- api.planx.uk/inviteToPay/createPaymentSendEvents.test.ts | 4 ++-- api.planx.uk/inviteToPay/createPaymentSendEvents.ts | 2 +- api.planx.uk/{ => lib}/hasura/metadata/index.test.ts | 0 api.planx.uk/{ => lib}/hasura/metadata/index.ts | 0 api.planx.uk/{ => lib}/hasura/schema/index.test.ts | 0 api.planx.uk/{ => lib}/hasura/schema/index.ts | 0 .../webhooks/service/lowcalSessionEvents/index.test.ts | 4 ++-- .../modules/webhooks/service/lowcalSessionEvents/index.ts | 2 +- .../modules/webhooks/service/lowcalSessionEvents/schema.ts | 2 +- .../webhooks/service/paymentRequestEvents/index.test.ts | 4 ++-- .../modules/webhooks/service/paymentRequestEvents/index.ts | 2 +- .../modules/webhooks/service/paymentRequestEvents/schema.ts | 2 +- .../service/sanitiseApplicationData/operations.test.ts | 4 ++-- api.planx.uk/send/createSendEvents.ts | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) rename api.planx.uk/{ => lib}/hasura/metadata/index.test.ts (100%) rename api.planx.uk/{ => lib}/hasura/metadata/index.ts (100%) rename api.planx.uk/{ => lib}/hasura/schema/index.test.ts (100%) rename api.planx.uk/{ => lib}/hasura/schema/index.ts (100%) diff --git a/api.planx.uk/inviteToPay/createPaymentSendEvents.test.ts b/api.planx.uk/inviteToPay/createPaymentSendEvents.test.ts index 2f7cf22b28..4855cb0b36 100644 --- a/api.planx.uk/inviteToPay/createPaymentSendEvents.test.ts +++ b/api.planx.uk/inviteToPay/createPaymentSendEvents.test.ts @@ -1,10 +1,10 @@ import supertest from "supertest"; import app from "../server"; -import { createScheduledEvent } from "../hasura/metadata"; +import { createScheduledEvent } from "../lib/hasura/metadata"; import { queryMock } from "../tests/graphqlQueryMock"; import { flowWithInviteToPay } from "../tests/mocks/inviteToPayData"; -jest.mock("../hasura/metadata"); +jest.mock("../lib/hasura/metadata"); const mockedCreateScheduledEvent = createScheduledEvent as jest.MockedFunction< typeof createScheduledEvent >; diff --git a/api.planx.uk/inviteToPay/createPaymentSendEvents.ts b/api.planx.uk/inviteToPay/createPaymentSendEvents.ts index 799ab3bbba..35ac8e3787 100644 --- a/api.planx.uk/inviteToPay/createPaymentSendEvents.ts +++ b/api.planx.uk/inviteToPay/createPaymentSendEvents.ts @@ -5,7 +5,7 @@ import { $api, $public } from "../client"; import { ScheduledEventResponse, createScheduledEvent, -} from "../hasura/metadata"; +} from "../lib/hasura/metadata"; import { getMostRecentPublishedFlow } from "../helpers"; import { Flow, Node, Team } from "../types"; diff --git a/api.planx.uk/hasura/metadata/index.test.ts b/api.planx.uk/lib/hasura/metadata/index.test.ts similarity index 100% rename from api.planx.uk/hasura/metadata/index.test.ts rename to api.planx.uk/lib/hasura/metadata/index.test.ts diff --git a/api.planx.uk/hasura/metadata/index.ts b/api.planx.uk/lib/hasura/metadata/index.ts similarity index 100% rename from api.planx.uk/hasura/metadata/index.ts rename to api.planx.uk/lib/hasura/metadata/index.ts diff --git a/api.planx.uk/hasura/schema/index.test.ts b/api.planx.uk/lib/hasura/schema/index.test.ts similarity index 100% rename from api.planx.uk/hasura/schema/index.test.ts rename to api.planx.uk/lib/hasura/schema/index.test.ts diff --git a/api.planx.uk/hasura/schema/index.ts b/api.planx.uk/lib/hasura/schema/index.ts similarity index 100% rename from api.planx.uk/hasura/schema/index.ts rename to api.planx.uk/lib/hasura/schema/index.ts diff --git a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts index 303310aa3b..ac5e7cb5b2 100644 --- a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts +++ b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.test.ts @@ -1,10 +1,10 @@ import supertest from "supertest"; import app from "../../../../server"; -import { createScheduledEvent } from "../../../../hasura/metadata"; +import { createScheduledEvent } from "../../../../lib/hasura/metadata"; const { post } = supertest(app); -jest.mock("../../../../hasura/metadata"); +jest.mock("../../../../lib/hasura/metadata"); const mockedCreateScheduledEvent = createScheduledEvent as jest.MockedFunction< typeof createScheduledEvent >; diff --git a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.ts b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.ts index b8ec4cf072..58064a5e6a 100644 --- a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.ts +++ b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/index.ts @@ -1,6 +1,6 @@ import { addDays } from "date-fns"; -import { createScheduledEvent } from "../../../../hasura/metadata"; +import { createScheduledEvent } from "../../../../lib/hasura/metadata"; import { DAYS_UNTIL_EXPIRY, REMINDER_DAYS_FROM_EXPIRY, diff --git a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/schema.ts b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/schema.ts index f8b17aa24f..2bafddb4b5 100644 --- a/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/schema.ts +++ b/api.planx.uk/modules/webhooks/service/lowcalSessionEvents/schema.ts @@ -1,6 +1,6 @@ import { z } from "zod"; import { ValidatedRequestHandler } from "../../../../shared/middleware/validate"; -import { ScheduledEventResponse } from "../../../../hasura/metadata"; +import { ScheduledEventResponse } from "../../../../lib/hasura/metadata"; export const createSessionEventSchema = z.object({ body: z.object({ diff --git a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts index 20beeefd98..70fd705cdc 100644 --- a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts +++ b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.test.ts @@ -1,11 +1,11 @@ import supertest from "supertest"; import app from "../../../../server"; -import { createScheduledEvent } from "../../../../hasura/metadata"; +import { createScheduledEvent } from "../../../../lib/hasura/metadata"; import { CreatePaymentEvent } from "./schema"; const { post } = supertest(app); -jest.mock("../../../../hasura/metadata"); +jest.mock("../../../../lib/hasura/metadata"); const mockedCreateScheduledEvent = createScheduledEvent as jest.MockedFunction< typeof createScheduledEvent >; diff --git a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.ts b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.ts index 9679c7931e..b438ce5236 100644 --- a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.ts +++ b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/index.ts @@ -1,6 +1,6 @@ import { addDays } from "date-fns"; -import { createScheduledEvent } from "../../../../hasura/metadata"; +import { createScheduledEvent } from "../../../../lib/hasura/metadata"; import { DAYS_UNTIL_EXPIRY, REMINDER_DAYS_FROM_EXPIRY, diff --git a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/schema.ts b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/schema.ts index 042ea05f71..20fe20abd7 100644 --- a/api.planx.uk/modules/webhooks/service/paymentRequestEvents/schema.ts +++ b/api.planx.uk/modules/webhooks/service/paymentRequestEvents/schema.ts @@ -1,6 +1,6 @@ import { z } from "zod"; import { ValidatedRequestHandler } from "../../../../shared/middleware/validate"; -import { ScheduledEventResponse } from "../../../../hasura/metadata"; +import { ScheduledEventResponse } from "../../../../lib/hasura/metadata"; export const createPaymentEventSchema = z.object({ body: z.object({ diff --git a/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.test.ts b/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.test.ts index c6d77a547b..50a863c391 100644 --- a/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.test.ts +++ b/api.planx.uk/modules/webhooks/service/sanitiseApplicationData/operations.test.ts @@ -1,4 +1,4 @@ -import { runSQL } from "../../../../hasura/schema"; +import { runSQL } from "../../../../lib/hasura/schema"; import { queryMock } from "../../../../tests/graphqlQueryMock"; import { mockIds, @@ -25,7 +25,7 @@ import { deleteHasuraScheduledEventsForSubmittedSessions, } from "./operations"; -jest.mock("../../../../hasura/schema"); +jest.mock("../../../../lib/hasura/schema"); const mockRunSQL = runSQL as jest.MockedFunction; const mockFindSession = jest.fn(); diff --git a/api.planx.uk/send/createSendEvents.ts b/api.planx.uk/send/createSendEvents.ts index 8f5c12af4e..67c86db3a8 100644 --- a/api.planx.uk/send/createSendEvents.ts +++ b/api.planx.uk/send/createSendEvents.ts @@ -2,7 +2,7 @@ import { NextFunction, Request, Response } from "express"; import { ScheduledEventResponse, createScheduledEvent, -} from "../hasura/metadata"; +} from "../lib/hasura/metadata"; interface CombinedResponse { bops?: ScheduledEventResponse;