From 2ec928a78ecadde671e91b2bff15c87164a30c0c Mon Sep 17 00:00:00 2001 From: Nicolas Burtey Date: Wed, 20 Dec 2023 17:58:26 -0600 Subject: [PATCH] chore: addressing some feedback --- core/api/src/app/quiz/add.ts | 2 +- core/api/src/{services/quiz/index.ts => app/quiz/get.ts} | 5 ++--- core/api/src/app/quiz/index.ts | 1 + core/api/src/config/index.ts | 2 +- core/api/src/{app/quiz => domain/earn}/config.ts | 0 core/api/src/domain/earn/index.ts | 1 + core/api/src/graphql/public/types/object/consumer-account.ts | 3 +-- 7 files changed, 7 insertions(+), 7 deletions(-) rename core/api/src/{services/quiz/index.ts => app/quiz/get.ts} (80%) rename core/api/src/{app/quiz => domain/earn}/config.ts (100%) create mode 100644 core/api/src/domain/earn/index.ts diff --git a/core/api/src/app/quiz/add.ts b/core/api/src/app/quiz/add.ts index aaa72ab77a1..c163c0dddb9 100644 --- a/core/api/src/app/quiz/add.ts +++ b/core/api/src/app/quiz/add.ts @@ -1,6 +1,6 @@ import { intraledgerPaymentSendWalletIdForBtcWallet } from "../payments/send-intraledger" -import { QuizzesValue } from "./config" +import { QuizzesValue } from "@/domain/earn" import { getQuizzesConfig } from "@/config" diff --git a/core/api/src/services/quiz/index.ts b/core/api/src/app/quiz/get.ts similarity index 80% rename from core/api/src/services/quiz/index.ts rename to core/api/src/app/quiz/get.ts index 53e5f3d7797..e410b6ac38c 100644 --- a/core/api/src/services/quiz/index.ts +++ b/core/api/src/app/quiz/get.ts @@ -1,6 +1,5 @@ -import { QuizRepository } from "../mongoose" - -import { QuizzesValue } from "@/app/quiz/config" +import { QuizzesValue } from "@/domain/earn/config" +import { QuizRepository } from "@/services/mongoose" export const getQuizzesByAccountId = async (accountId: AccountId) => { const quizzes = await QuizRepository(accountId).fetchAll() diff --git a/core/api/src/app/quiz/index.ts b/core/api/src/app/quiz/index.ts index 363cc3148e1..aa853ba7b7c 100644 --- a/core/api/src/app/quiz/index.ts +++ b/core/api/src/app/quiz/index.ts @@ -1 +1,2 @@ export * from "./add" +export * from "./get" diff --git a/core/api/src/config/index.ts b/core/api/src/config/index.ts index 5b08de0e8c9..d2256b1c201 100644 --- a/core/api/src/config/index.ts +++ b/core/api/src/config/index.ts @@ -13,7 +13,7 @@ export * from "./schema" import { ConfigError } from "./error" import { toDays } from "@/domain/primitives" -import { QuizzesValue } from "@/app/quiz/config" +import { QuizzesValue } from "@/domain/earn" export const MS_PER_SEC = 1000 as MilliSeconds export const MS_PER_5_MINS = (60 * 5 * MS_PER_SEC) as MilliSeconds diff --git a/core/api/src/app/quiz/config.ts b/core/api/src/domain/earn/config.ts similarity index 100% rename from core/api/src/app/quiz/config.ts rename to core/api/src/domain/earn/config.ts diff --git a/core/api/src/domain/earn/index.ts b/core/api/src/domain/earn/index.ts new file mode 100644 index 00000000000..6502e92cf57 --- /dev/null +++ b/core/api/src/domain/earn/index.ts @@ -0,0 +1 @@ +export * from "./config" diff --git a/core/api/src/graphql/public/types/object/consumer-account.ts b/core/api/src/graphql/public/types/object/consumer-account.ts index bc2e04720ce..8c194a8fe93 100644 --- a/core/api/src/graphql/public/types/object/consumer-account.ts +++ b/core/api/src/graphql/public/types/object/consumer-account.ts @@ -34,8 +34,7 @@ import DisplayCurrency from "@/graphql/shared/types/scalar/display-currency" import { listEndpoints } from "@/app/callback" import { IInvoiceConnection } from "@/graphql/shared/types/abstract/invoice" - -import { getQuizzesByAccountId } from "@/services/quiz" +import { getQuizzesByAccountId } from "@/app/quiz" const ConsumerAccount = GT.Object({ name: "ConsumerAccount",