diff --git a/core/api/src/domain/quiz/index.ts b/core/api/src/domain/quiz/index.ts index 19ea6a2bea..a50fd44955 100644 --- a/core/api/src/domain/quiz/index.ts +++ b/core/api/src/domain/quiz/index.ts @@ -51,13 +51,13 @@ export const fillQuizInformation = ( QuizzesSections.find((section) => section.quiz.includes(id as QuizQuestionId)) ?.order ?? NaN - const lastQuizCreatedAt = - quizzesCompleted[quizzesCompleted.length - 1]?.createdAt ?? new Date() - - const completed = Boolean(quizCompleted) + const completed = !!quizCompleted let notBefore: Date | undefined = undefined if (section !== 0 && !completed) { + const lastQuizCreatedAt = + quizzesCompleted[quizzesCompleted.length - 1]?.createdAt ?? new Date() + notBefore = new Date(lastQuizCreatedAt.getTime() + milliSecondsBetweenSections) } diff --git a/core/api/src/domain/quiz/script.ts b/core/api/src/domain/quiz/script.ts index e8e4d4bfe4..5a24c7257b 100644 --- a/core/api/src/domain/quiz/script.ts +++ b/core/api/src/domain/quiz/script.ts @@ -1,3 +1,7 @@ +// this script generates the content saved to ./sections.ts +// it assumes: +// - galoy-mobile is the source of truth for the different sections +// - galoy-mobile is in the same root as galoy repo // pnpm tsx src/domain/earn/script.ts /* eslint @typescript-eslint/ban-ts-comment: "off" */ // @ts-nocheck diff --git a/core/api/src/graphql/public/types/payload/account-delete.ts b/core/api/src/graphql/public/types/payload/account-delete.ts index 51c3693a87..2042d39998 100644 --- a/core/api/src/graphql/public/types/payload/account-delete.ts +++ b/core/api/src/graphql/public/types/payload/account-delete.ts @@ -1,4 +1,4 @@ -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" diff --git a/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts b/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts index 1480fac6e1..e2b0dce652 100644 --- a/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts +++ b/core/api/src/graphql/public/types/payload/account-update-default-wallet-id.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import ConsumerAccount from "../object/consumer-account" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const AccountUpdateDefaultWalletIdPayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/account-update-display-currency.ts b/core/api/src/graphql/public/types/payload/account-update-display-currency.ts index e36229be33..3a7075d02e 100644 --- a/core/api/src/graphql/public/types/payload/account-update-display-currency.ts +++ b/core/api/src/graphql/public/types/payload/account-update-display-currency.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import ConsumerAccount from "../object/consumer-account" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const AccountUpdateDisplayCurrencyPayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts b/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts index 8c160b6397..57f7d78771 100644 --- a/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts +++ b/core/api/src/graphql/public/types/payload/account-update-notification-settings.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import ConsumerAccount from "../object/consumer-account" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const AccountUpdateNotificationSettingsPayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts b/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts index 1e287a1b87..a71bf22f65 100644 --- a/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts +++ b/core/api/src/graphql/public/types/payload/callback-endpoint-add.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import EndpointId from "../scalar/endpoint-id" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const CallbackEndpointAddPayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts b/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts index 2ff383f4e0..60aefdb5eb 100644 --- a/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts +++ b/core/api/src/graphql/public/types/payload/ln-invoice-payment-status.ts @@ -1,7 +1,6 @@ -import IError from "../../../shared/types/abstract/error" - import InvoicePaymentStatus from "../../../shared/types/scalar/invoice-payment-status" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const LnInvoicePaymentStatusPayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/ln-invoice.ts b/core/api/src/graphql/public/types/payload/ln-invoice.ts index 1cce9af689..6e50a5e9d5 100644 --- a/core/api/src/graphql/public/types/payload/ln-invoice.ts +++ b/core/api/src/graphql/public/types/payload/ln-invoice.ts @@ -1,7 +1,6 @@ -import IError from "../../../shared/types/abstract/error" - import LnInvoice from "../../../shared/types/object/ln-invoice" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const LnInvoicePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts b/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts index ee8d3671bc..f94e3c7594 100644 --- a/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts +++ b/core/api/src/graphql/public/types/payload/ln-noamount-invoice.ts @@ -1,7 +1,6 @@ -import IError from "../../../shared/types/abstract/error" - import LnNoAmountInvoice from "../../../shared/types/object/ln-noamount-invoice" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const LnNoAmountInvoicePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/on-chain-address.ts b/core/api/src/graphql/public/types/payload/on-chain-address.ts index 2502c9c7eb..6331d5ebd2 100644 --- a/core/api/src/graphql/public/types/payload/on-chain-address.ts +++ b/core/api/src/graphql/public/types/payload/on-chain-address.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import OnChainAddress from "../../../shared/types/scalar/on-chain-address" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const OnChainAddressPayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/price.ts b/core/api/src/graphql/public/types/payload/price.ts index 6993022665..a351ef695d 100644 --- a/core/api/src/graphql/public/types/payload/price.ts +++ b/core/api/src/graphql/public/types/payload/price.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import Price from "../object/price" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const PricePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/quiz-completed.ts b/core/api/src/graphql/public/types/payload/quiz-completed.ts index cb60f8d6a2..909d3d3ecc 100644 --- a/core/api/src/graphql/public/types/payload/quiz-completed.ts +++ b/core/api/src/graphql/public/types/payload/quiz-completed.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import Quiz from "../object/quiz" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" // deprecated diff --git a/core/api/src/graphql/public/types/payload/realtime-price.ts b/core/api/src/graphql/public/types/payload/realtime-price.ts index 18e3b0a322..3e7328387e 100644 --- a/core/api/src/graphql/public/types/payload/realtime-price.ts +++ b/core/api/src/graphql/public/types/payload/realtime-price.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import RealtimePrice from "../object/realtime-price" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const RealtimePricePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/upgrade-payload.ts b/core/api/src/graphql/public/types/payload/upgrade-payload.ts index 3ae646157c..ed15665868 100644 --- a/core/api/src/graphql/public/types/payload/upgrade-payload.ts +++ b/core/api/src/graphql/public/types/payload/upgrade-payload.ts @@ -1,4 +1,4 @@ -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" diff --git a/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts b/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts index b85b43f421..9681037fa1 100644 --- a/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts +++ b/core/api/src/graphql/public/types/payload/user-contact-update-alias.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import AccountContact from "../object/account-contact" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const AccountContactUpdateAliasPayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-email-delete.ts b/core/api/src/graphql/public/types/payload/user-email-delete.ts index 665d09fc99..9039ea403c 100644 --- a/core/api/src/graphql/public/types/payload/user-email-delete.ts +++ b/core/api/src/graphql/public/types/payload/user-email-delete.ts @@ -1,6 +1,6 @@ import GraphQLUser from "../object/user" -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserEmailDeletePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts b/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts index 3a724f14da..37461afea0 100644 --- a/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts +++ b/core/api/src/graphql/public/types/payload/user-email-registration-initiate.ts @@ -1,7 +1,7 @@ -import IError from "../../../shared/types/abstract/error" import EmailRegistrationId from "../scalar/email-verify-id" import GraphQLUser from "../object/user" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserEmailRegistrationInitiatePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts b/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts index 176ff6a2d5..fab552b617 100644 --- a/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts +++ b/core/api/src/graphql/public/types/payload/user-email-registration-validate.ts @@ -1,6 +1,6 @@ import GraphQLUser from "../object/user" -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserEmailRegistrationValidatePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-phone-delete.ts b/core/api/src/graphql/public/types/payload/user-phone-delete.ts index b4d5d7883c..178320c297 100644 --- a/core/api/src/graphql/public/types/payload/user-phone-delete.ts +++ b/core/api/src/graphql/public/types/payload/user-phone-delete.ts @@ -1,6 +1,6 @@ import GraphQLUser from "../object/user" -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserPhoneDeletePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts b/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts index 095e679a8b..d98122494d 100644 --- a/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts +++ b/core/api/src/graphql/public/types/payload/user-phone-registration-validate.ts @@ -1,6 +1,6 @@ import GraphQLUser from "../object/user" -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserPhoneRegistrationValidatePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-totp-delete.ts b/core/api/src/graphql/public/types/payload/user-totp-delete.ts index 0446f4760b..2876901888 100644 --- a/core/api/src/graphql/public/types/payload/user-totp-delete.ts +++ b/core/api/src/graphql/public/types/payload/user-totp-delete.ts @@ -1,6 +1,6 @@ import GraphQLUser from "../object/user" -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserTotpDeletePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts b/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts index 6423fe25f4..ac333d2285 100644 --- a/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts +++ b/core/api/src/graphql/public/types/payload/user-totp-registration-initiate.ts @@ -1,7 +1,7 @@ -import IError from "../../../shared/types/abstract/error" import TotpRegistrationId from "../scalar/totp-verify-id" import TotpSecret from "../scalar/totp-secret" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserTotpRegistrationInitiatePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts b/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts index 83e7a809f9..5da7c05bb3 100644 --- a/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts +++ b/core/api/src/graphql/public/types/payload/user-totp-registration-validate.ts @@ -1,6 +1,6 @@ -import IError from "../../../shared/types/abstract/error" import GraphQLUser from "../object/user" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserTotpRegistrationValidatePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-update-language.ts b/core/api/src/graphql/public/types/payload/user-update-language.ts index 5bc600fe01..16e54526f0 100644 --- a/core/api/src/graphql/public/types/payload/user-update-language.ts +++ b/core/api/src/graphql/public/types/payload/user-update-language.ts @@ -1,6 +1,6 @@ import GraphQLUser from "../object/user" -import IError from "../../../shared/types/abstract/error" +import IError from "@/graphql/shared/types/abstract/error" import { GT } from "@/graphql/index" const UserUpdateLanguagePayload = GT.Object({ diff --git a/core/api/src/graphql/public/types/payload/user-update-username.ts b/core/api/src/graphql/public/types/payload/user-update-username.ts index 89892eb36d..409be963d7 100644 --- a/core/api/src/graphql/public/types/payload/user-update-username.ts +++ b/core/api/src/graphql/public/types/payload/user-update-username.ts @@ -1,6 +1,7 @@ -import IError from "../../../shared/types/abstract/error" import GraphQLUser from "../object/user" +import IError from "@/graphql/shared/types/abstract/error" + import { GT } from "@/graphql/index" const UserUpdateUsernamePayload = GT.Object({