diff --git a/core/api/src/app/payments/add-earn.ts b/core/api/src/app/earn/add-earn.ts similarity index 98% rename from core/api/src/app/payments/add-earn.ts rename to core/api/src/app/earn/add-earn.ts index bd614c5b3d1..79d76d28566 100644 --- a/core/api/src/app/payments/add-earn.ts +++ b/core/api/src/app/earn/add-earn.ts @@ -1,4 +1,4 @@ -import { intraledgerPaymentSendWalletIdForBtcWallet } from "./send-intraledger" +import { intraledgerPaymentSendWalletIdForBtcWallet } from "../payments/send-intraledger" import { getRewardsConfig, OnboardingEarn } from "@/config" diff --git a/core/api/src/app/earn/index.ts b/core/api/src/app/earn/index.ts new file mode 100644 index 00000000000..6192959ea2d --- /dev/null +++ b/core/api/src/app/earn/index.ts @@ -0,0 +1 @@ +export * from "./add-earn" diff --git a/core/api/src/app/index.ts b/core/api/src/app/index.ts index 243fd1ed988..7e7939a3a87 100644 --- a/core/api/src/app/index.ts +++ b/core/api/src/app/index.ts @@ -3,6 +3,7 @@ import * as AuthenticationMod from "./authentication" import * as AdminMod from "./admin" import * as CallbackMod from "./callback" import * as CommMod from "./comm" +import * as EarnMod from "./earn" import * as LightningMod from "./lightning" import * as OnChainMod from "./on-chain" import * as PricesMod from "./prices" @@ -20,6 +21,7 @@ const allFunctions = { Admin: { ...AdminMod }, Callback: { ...CallbackMod }, Comm: { ...CommMod }, + Earn: { ...EarnMod }, Lightning: { ...LightningMod }, OnChain: { ...OnChainMod }, Prices: { ...PricesMod }, @@ -49,6 +51,7 @@ export const { Admin, Callback, Comm, + Earn, Lightning, OnChain, Prices, diff --git a/core/api/src/app/payments/index.ts b/core/api/src/app/payments/index.ts index 0b1d63068e6..c10e216d1f7 100644 --- a/core/api/src/app/payments/index.ts +++ b/core/api/src/app/payments/index.ts @@ -1,4 +1,3 @@ -export * from "./add-earn" export * from "./get-protocol-fee" export * from "./reimburse-fee" export * from "./send-intraledger" diff --git a/core/api/src/graphql/public/root/mutation/quiz-completed.ts b/core/api/src/graphql/public/root/mutation/quiz-completed.ts index 191ff02f377..3cb804096b3 100644 --- a/core/api/src/graphql/public/root/mutation/quiz-completed.ts +++ b/core/api/src/graphql/public/root/mutation/quiz-completed.ts @@ -1,4 +1,4 @@ -import { Payments } from "@/app" +import { Earn } from "@/app" import { mapAndParseErrorForGqlResponse } from "@/graphql/error-map" import { GT } from "@/graphql/index" @@ -26,7 +26,7 @@ const QuizCompletedMutation = GT.Field< resolve: async (_, args, { domainAccount, ip }) => { const { id } = args.input - const question = await Payments.addEarn({ + const question = await Earn.addEarn({ quizQuestionId: id, accountId: domainAccount.id, ip, diff --git a/core/api/test/integration/app/payments/add-earn.spec.ts b/core/api/test/integration/app/payments/add-earn.spec.ts index 6d922b0f771..fc6bf6d567f 100644 --- a/core/api/test/integration/app/payments/add-earn.spec.ts +++ b/core/api/test/integration/app/payments/add-earn.spec.ts @@ -1,6 +1,6 @@ import crypto from "crypto" -import { Payments } from "@/app" +import { Earn } from "@/app" import { InvalidIpMetadataError } from "@/domain/errors" import { @@ -18,7 +18,7 @@ afterEach(async () => { describe("addEarn", () => { it("fails if ip is undefined", async () => { - const result = await Payments.addEarn({ + const result = await Earn.addEarn({ accountId: crypto.randomUUID() as AccountId, quizQuestionId: "fakeQuizQuestionId", ip: undefined, @@ -39,7 +39,7 @@ describe("addEarn", () => { consume: () => new RateLimiterExceededError(), }) - const result = await Payments.addEarn({ + const result = await Earn.addEarn({ accountId: crypto.randomUUID() as AccountId, quizQuestionId: "fakeQuizQuestionId", ip: "192.168.13.13" as IpAddress,