Skip to content

Commit

Permalink
chore: addressing more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Dec 26, 2023
1 parent 24daa64 commit affbe9f
Show file tree
Hide file tree
Showing 26 changed files with 33 additions and 31 deletions.
8 changes: 4 additions & 4 deletions core/api/src/domain/quiz/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 4 additions & 0 deletions core/api/src/domain/quiz/script.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import IError from "../../../shared/types/abstract/error"
import IError from "@/graphql/shared/types/abstract/error"

import { GT } from "@/graphql/index"

Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
3 changes: 1 addition & 2 deletions core/api/src/graphql/public/types/payload/ln-invoice.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
2 changes: 1 addition & 1 deletion core/api/src/graphql/public/types/payload/price.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import IError from "../../../shared/types/abstract/error"
import IError from "@/graphql/shared/types/abstract/error"

import { GT } from "@/graphql/index"

Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
Original file line number Diff line number Diff line change
@@ -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({
Expand Down

0 comments on commit affbe9f

Please sign in to comment.