diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js index d8d232b25..2654104dc 100644 --- a/backend/.eslintrc.js +++ b/backend/.eslintrc.js @@ -94,6 +94,8 @@ module.exports = { 'no-void': ['error', { allowAsStatement: true }], // ignore prefer-regexp-exec rule to allow string.match(regex) '@typescript-eslint/prefer-regexp-exec': 'off', + // this should not run on ts files: https://github.com/import-js/eslint-plugin-import/issues/2215#issuecomment-911245486 + 'import/unambiguous': 'off', }, parserOptions: { tsconfigRootDir: './', diff --git a/backend/src/apis/KlicktippController.ts b/backend/src/apis/KlicktippController.ts index a291bb945..70c0f95b1 100644 --- a/backend/src/apis/KlicktippController.ts +++ b/backend/src/apis/KlicktippController.ts @@ -4,6 +4,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +// eslint-disable-next-line import/no-relative-parent-imports import KlicktippConnector from 'klicktipp-api' import CONFIG from '@/config' diff --git a/backend/src/event/EVENT_ACTIVATE_ACCOUNT.ts b/backend/src/event/EVENT_ACTIVATE_ACCOUNT.ts index 755cc8fe2..98328a008 100644 --- a/backend/src/event/EVENT_ACTIVATE_ACCOUNT.ts +++ b/backend/src/event/EVENT_ACTIVATE_ACCOUNT.ts @@ -1,5 +1,6 @@ import { User as DbUser } from '@entity/User' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ACTIVATE_ACCOUNT = async (user: DbUser): Promise => diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CONFIRM.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CONFIRM.ts index c85a7a12c..fab0708a4 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CONFIRM.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CONFIRM.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_CONFIRM = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CREATE.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CREATE.ts index a10ff1a35..db3fdef32 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CREATE.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_CREATE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_CREATE = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DELETE.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DELETE.ts index d3dd5508e..515813bef 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DELETE.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DELETE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_DELETE = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DENY.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DENY.ts index 5f1203766..6fcdc0312 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DENY.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_DENY.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_DENY = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_CREATE.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_CREATE.ts index 2ead791ed..a85df138b 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_CREATE.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_CREATE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { ContributionLink as DbContributionLink } from '@entity/ContributionLink' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_LINK_CREATE = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_DELETE.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_DELETE.ts index b5816e45d..1e6f9f2eb 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_DELETE.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_DELETE.ts @@ -1,6 +1,7 @@ import { User as DbUser } from '@entity/User' import { ContributionLink as DbContributionLink } from '@entity/ContributionLink' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_LINK_DELETE = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE.ts index 6824833b8..73cc6ce88 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { ContributionLink as DbContributionLink } from '@entity/ContributionLink' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE.ts index f07d38e98..7e87d53ec 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE.ts @@ -2,6 +2,7 @@ import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE = async ( diff --git a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_UPDATE.ts b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_UPDATE.ts index 60315249a..8728e6cd5 100644 --- a/backend/src/event/EVENT_ADMIN_CONTRIBUTION_UPDATE.ts +++ b/backend/src/event/EVENT_ADMIN_CONTRIBUTION_UPDATE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_CONTRIBUTION_UPDATE = async ( diff --git a/backend/src/event/EVENT_ADMIN_SEND_CONFIRMATION_EMAIL.ts b/backend/src/event/EVENT_ADMIN_SEND_CONFIRMATION_EMAIL.ts index da4907930..d0e363b05 100644 --- a/backend/src/event/EVENT_ADMIN_SEND_CONFIRMATION_EMAIL.ts +++ b/backend/src/event/EVENT_ADMIN_SEND_CONFIRMATION_EMAIL.ts @@ -1,5 +1,6 @@ import { User as DbUser } from '@entity/User' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_ADMIN_SEND_CONFIRMATION_EMAIL = async ( diff --git a/backend/src/event/EVENT_CONTRIBUTION_CREATE.ts b/backend/src/event/EVENT_CONTRIBUTION_CREATE.ts index 50cdbcd18..ebf6c1970 100644 --- a/backend/src/event/EVENT_CONTRIBUTION_CREATE.ts +++ b/backend/src/event/EVENT_CONTRIBUTION_CREATE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_CONTRIBUTION_CREATE = async ( diff --git a/backend/src/event/EVENT_CONTRIBUTION_DELETE.ts b/backend/src/event/EVENT_CONTRIBUTION_DELETE.ts index eab04bf47..153c9ef36 100644 --- a/backend/src/event/EVENT_CONTRIBUTION_DELETE.ts +++ b/backend/src/event/EVENT_CONTRIBUTION_DELETE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_CONTRIBUTION_DELETE = async ( diff --git a/backend/src/event/EVENT_CONTRIBUTION_LINK_REDEEM.ts b/backend/src/event/EVENT_CONTRIBUTION_LINK_REDEEM.ts index 395772ac9..5297fb114 100644 --- a/backend/src/event/EVENT_CONTRIBUTION_LINK_REDEEM.ts +++ b/backend/src/event/EVENT_CONTRIBUTION_LINK_REDEEM.ts @@ -1,9 +1,10 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Transaction as DbTransaction } from '@entity/Transaction' import { Contribution as DbContribution } from '@entity/Contribution' import { ContributionLink as DbContributionLink } from '@entity/ContributionLink' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_CONTRIBUTION_LINK_REDEEM = async ( diff --git a/backend/src/event/EVENT_CONTRIBUTION_MESSAGE_CREATE.ts b/backend/src/event/EVENT_CONTRIBUTION_MESSAGE_CREATE.ts index b06685a6d..8e7896d58 100644 --- a/backend/src/event/EVENT_CONTRIBUTION_MESSAGE_CREATE.ts +++ b/backend/src/event/EVENT_CONTRIBUTION_MESSAGE_CREATE.ts @@ -2,6 +2,7 @@ import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_CONTRIBUTION_MESSAGE_CREATE = async ( diff --git a/backend/src/event/EVENT_CONTRIBUTION_UPDATE.ts b/backend/src/event/EVENT_CONTRIBUTION_UPDATE.ts index 82f14edd6..b998acaa0 100644 --- a/backend/src/event/EVENT_CONTRIBUTION_UPDATE.ts +++ b/backend/src/event/EVENT_CONTRIBUTION_UPDATE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Contribution as DbContribution } from '@entity/Contribution' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_CONTRIBUTION_UPDATE = async ( diff --git a/backend/src/event/EVENT_LOGIN.ts b/backend/src/event/EVENT_LOGIN.ts index 2c1e763ec..f7e5f80d8 100644 --- a/backend/src/event/EVENT_LOGIN.ts +++ b/backend/src/event/EVENT_LOGIN.ts @@ -1,5 +1,6 @@ import { User as DbUser } from '@entity/User' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_LOGIN = async (user: DbUser): Promise => diff --git a/backend/src/event/EVENT_REGISTER.ts b/backend/src/event/EVENT_REGISTER.ts index 73c6bf4f9..4300bc7f3 100644 --- a/backend/src/event/EVENT_REGISTER.ts +++ b/backend/src/event/EVENT_REGISTER.ts @@ -1,5 +1,6 @@ import { User as DbUser } from '@entity/User' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_REGISTER = async (user: DbUser): Promise => diff --git a/backend/src/event/EVENT_SEND_ACCOUNT_MULTIREGISTRATION_EMAIL.ts b/backend/src/event/EVENT_SEND_ACCOUNT_MULTIREGISTRATION_EMAIL.ts index 3110ece1f..7c991fba4 100644 --- a/backend/src/event/EVENT_SEND_ACCOUNT_MULTIREGISTRATION_EMAIL.ts +++ b/backend/src/event/EVENT_SEND_ACCOUNT_MULTIREGISTRATION_EMAIL.ts @@ -1,5 +1,6 @@ import { User as DbUser } from '@entity/User' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_SEND_ACCOUNT_MULTIREGISTRATION_EMAIL = async (user: DbUser): Promise => diff --git a/backend/src/event/EVENT_SEND_CONFIRMATION_EMAIL.ts b/backend/src/event/EVENT_SEND_CONFIRMATION_EMAIL.ts index b387c0e60..78fc2b867 100644 --- a/backend/src/event/EVENT_SEND_CONFIRMATION_EMAIL.ts +++ b/backend/src/event/EVENT_SEND_CONFIRMATION_EMAIL.ts @@ -1,5 +1,6 @@ import { User as DbUser } from '@entity/User' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_SEND_CONFIRMATION_EMAIL = async (user: DbUser): Promise => diff --git a/backend/src/event/EVENT_TRANSACTION_LINK_CREATE.ts b/backend/src/event/EVENT_TRANSACTION_LINK_CREATE.ts index 36fdb3ff0..3a520dee4 100644 --- a/backend/src/event/EVENT_TRANSACTION_LINK_CREATE.ts +++ b/backend/src/event/EVENT_TRANSACTION_LINK_CREATE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_TRANSACTION_LINK_CREATE = async ( diff --git a/backend/src/event/EVENT_TRANSACTION_LINK_DELETE.ts b/backend/src/event/EVENT_TRANSACTION_LINK_DELETE.ts index d15c786a8..3ffc3c9c0 100644 --- a/backend/src/event/EVENT_TRANSACTION_LINK_DELETE.ts +++ b/backend/src/event/EVENT_TRANSACTION_LINK_DELETE.ts @@ -1,6 +1,7 @@ import { User as DbUser } from '@entity/User' import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_TRANSACTION_LINK_DELETE = async ( diff --git a/backend/src/event/EVENT_TRANSACTION_LINK_REDEEM.ts b/backend/src/event/EVENT_TRANSACTION_LINK_REDEEM.ts index 58307a4e1..01ab046e3 100644 --- a/backend/src/event/EVENT_TRANSACTION_LINK_REDEEM.ts +++ b/backend/src/event/EVENT_TRANSACTION_LINK_REDEEM.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_TRANSACTION_LINK_REDEEM = async ( diff --git a/backend/src/event/EVENT_TRANSACTION_RECEIVE.ts b/backend/src/event/EVENT_TRANSACTION_RECEIVE.ts index acb2f5881..7cb4b96a8 100644 --- a/backend/src/event/EVENT_TRANSACTION_RECEIVE.ts +++ b/backend/src/event/EVENT_TRANSACTION_RECEIVE.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Transaction as DbTransaction } from '@entity/Transaction' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_TRANSACTION_RECEIVE = async ( diff --git a/backend/src/event/EVENT_TRANSACTION_SEND.ts b/backend/src/event/EVENT_TRANSACTION_SEND.ts index a342cb0aa..6d2960314 100644 --- a/backend/src/event/EVENT_TRANSACTION_SEND.ts +++ b/backend/src/event/EVENT_TRANSACTION_SEND.ts @@ -1,7 +1,8 @@ -import Decimal from 'decimal.js-light' +import { Decimal } from 'decimal.js-light' import { User as DbUser } from '@entity/User' import { Transaction as DbTransaction } from '@entity/Transaction' import { Event as DbEvent } from '@entity/Event' +/* eslint-disable-next-line import/no-cycle */ import { Event, EventType } from './Event' export const EVENT_TRANSACTION_SEND = async ( diff --git a/backend/src/event/Event.ts b/backend/src/event/Event.ts index cdb05748c..cce5946ee 100644 --- a/backend/src/event/Event.ts +++ b/backend/src/event/Event.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/no-cycle */ import { Event as DbEvent } from '@entity/Event' import { User as DbUser } from '@entity/User' import { Transaction as DbTransaction } from '@entity/Transaction' @@ -5,8 +6,8 @@ import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink' import { Contribution as DbContribution } from '@entity/Contribution' import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage' import { ContributionLink as DbContributionLink } from '@entity/ContributionLink' -import Decimal from 'decimal.js-light' -import { EventType } from './Event' +import { Decimal } from 'decimal.js-light' +import { EventType } from './EventType' export const Event = ( type: EventType, @@ -34,7 +35,7 @@ export const Event = ( return event } -export { EventType } from './EventType' +export { EventType } export { EVENT_ACTIVATE_ACCOUNT } from './EVENT_ACTIVATE_ACCOUNT' export { EVENT_ADMIN_CONTRIBUTION_CONFIRM } from './EVENT_ADMIN_CONTRIBUTION_CONFIRM' diff --git a/backend/src/graphql/resolver/CommunityResolver.test.ts b/backend/src/graphql/resolver/CommunityResolver.test.ts index 1e8f6a00f..f4352c095 100644 --- a/backend/src/graphql/resolver/CommunityResolver.test.ts +++ b/backend/src/graphql/resolver/CommunityResolver.test.ts @@ -5,8 +5,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ -import { getCommunities } from '@/seeds/graphql/queries' import { Community as DbCommunity } from '@entity/Community' +import { getCommunities } from '@/seeds/graphql/queries' import { testEnvironment } from '@test/helpers' let query: any diff --git a/backend/src/graphql/resolver/CommunityResolver.ts b/backend/src/graphql/resolver/CommunityResolver.ts index 1292fa55f..6aca41472 100644 --- a/backend/src/graphql/resolver/CommunityResolver.ts +++ b/backend/src/graphql/resolver/CommunityResolver.ts @@ -1,7 +1,7 @@ import { Resolver, Query, Authorized } from 'type-graphql' -import { Community } from '@model/Community' import { Community as DbCommunity } from '@entity/Community' +import { Community } from '@model/Community' import { RIGHTS } from '@/auth/RIGHTS' diff --git a/backend/src/graphql/resolver/ContributionLinkResolver.test.ts b/backend/src/graphql/resolver/ContributionLinkResolver.test.ts index 961f85bcd..6a69e257e 100644 --- a/backend/src/graphql/resolver/ContributionLinkResolver.test.ts +++ b/backend/src/graphql/resolver/ContributionLinkResolver.test.ts @@ -7,6 +7,7 @@ import { Decimal } from 'decimal.js-light' import { GraphQLError } from 'graphql' import { ContributionLink as DbContributionLink } from '@entity/ContributionLink' +import { Event as DbEvent } from '@entity/Event' import { logger } from '@test/testSetup' import { login, @@ -20,7 +21,6 @@ import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg' import { peterLustig } from '@/seeds/users/peter-lustig' import { userFactory } from '@/seeds/factory/user' import { EventType } from '@/event/Event' -import { Event as DbEvent } from '@entity/Event' let mutate: any, query: any, con: any let testEnv: any diff --git a/backend/src/graphql/resolver/ContributionMessageResolver.test.ts b/backend/src/graphql/resolver/ContributionMessageResolver.test.ts index 7e685c44e..6b2c7c4d8 100644 --- a/backend/src/graphql/resolver/ContributionMessageResolver.test.ts +++ b/backend/src/graphql/resolver/ContributionMessageResolver.test.ts @@ -7,6 +7,7 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { GraphQLError } from 'graphql' +import { Event as DbEvent } from '@entity/Event' import { cleanDB, resetToken, testEnvironment } from '@test/helpers' import { logger, i18n as localization } from '@test/testSetup' import { @@ -21,7 +22,6 @@ import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg' import { peterLustig } from '@/seeds/users/peter-lustig' import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants' import { EventType } from '@/event/Event' -import { Event as DbEvent } from '@entity/Event' jest.mock('@/emails/sendEmailVariants', () => { const originalModule = jest.requireActual('@/emails/sendEmailVariants') diff --git a/backend/src/graphql/resolver/ContributionResolver.test.ts b/backend/src/graphql/resolver/ContributionResolver.test.ts index 1d92ed8b9..84dd6cb19 100644 --- a/backend/src/graphql/resolver/ContributionResolver.test.ts +++ b/backend/src/graphql/resolver/ContributionResolver.test.ts @@ -12,6 +12,7 @@ import { Contribution } from '@entity/Contribution' import { Transaction as DbTransaction } from '@entity/Transaction' import { User } from '@entity/User' import { UserInputError } from 'apollo-server-express' +import { Event as DbEvent } from '@entity/Event' import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg' import { bobBaumeister } from '@/seeds/users/bob-baumeister' import { stephenHawking } from '@/seeds/users/stephen-hawking' @@ -50,7 +51,6 @@ import { userFactory } from '@/seeds/factory/user' import { creationFactory } from '@/seeds/factory/creation' import { creations } from '@/seeds/creation/index' import { peterLustig } from '@/seeds/users/peter-lustig' -import { Event as DbEvent } from '@entity/Event' import { EventType } from '@/event/Event' import { logger, i18n as localization } from '@test/testSetup' import { raeuberHotzenplotz } from '@/seeds/users/raeuber-hotzenplotz' diff --git a/backend/src/graphql/resolver/ContributionResolver.ts b/backend/src/graphql/resolver/ContributionResolver.ts index 1df8360c4..83cf29fc7 100644 --- a/backend/src/graphql/resolver/ContributionResolver.ts +++ b/backend/src/graphql/resolver/ContributionResolver.ts @@ -12,6 +12,13 @@ import { Transaction as DbTransaction } from '@entity/Transaction' import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const' import { getLastTransaction } from './util/getLastTransaction' import { findContributions } from './util/findContributions' +import { + getUserCreation, + validateContribution, + updateCreations, + isValidDateString, + getOpenCreations, +} from './util/creations' import { AdminUpdateContribution } from '@model/AdminUpdateContribution' import { Contribution, ContributionListResult } from '@model/Contribution' import { Decay } from '@model/Decay' @@ -30,13 +37,6 @@ import AdminUpdateContributionArgs from '@arg/AdminUpdateContributionArgs' import { RIGHTS } from '@/auth/RIGHTS' import { Context, getUser, getClientTimezoneOffset } from '@/server/context' import { backendLogger as logger } from '@/server/logger' -import { - getUserCreation, - validateContribution, - updateCreations, - isValidDateString, - getOpenCreations, -} from './util/creations' import { EVENT_CONTRIBUTION_CREATE, EVENT_CONTRIBUTION_DELETE, diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.test.ts b/backend/src/graphql/resolver/TransactionLinkResolver.test.ts index 2466f9f6f..5c2fff0ad 100644 --- a/backend/src/graphql/resolver/TransactionLinkResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionLinkResolver.test.ts @@ -10,6 +10,9 @@ import { ContributionLink as DbContributionLink } from '@entity/ContributionLink import { User } from '@entity/User' import { Decimal } from 'decimal.js-light' import { GraphQLError } from 'graphql' +import { Transaction } from '@entity/Transaction' +import { Event as DbEvent } from '@entity/Event' +import { UserContact } from '@entity/UserContact' import { transactionLinkCode } from './TransactionLinkResolver' import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg' import { peterLustig } from '@/seeds/users/peter-lustig' @@ -29,13 +32,10 @@ import { confirmContribution, } from '@/seeds/graphql/mutations' import { listTransactionLinksAdmin } from '@/seeds/graphql/queries' -import { Transaction } from '@entity/Transaction' import { UnconfirmedContribution } from '@model/UnconfirmedContribution' import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK' import { logger } from '@test/testSetup' import { EventType } from '@/event/Event' -import { Event as DbEvent } from '@entity/Event' -import { UserContact } from '@entity/UserContact' // mock semaphore to allow use fake timers jest.mock('@/util/TRANSACTIONS_LOCK') diff --git a/backend/src/graphql/resolver/TransactionResolver.test.ts b/backend/src/graphql/resolver/TransactionResolver.test.ts index 696fc2c54..f26234363 100644 --- a/backend/src/graphql/resolver/TransactionResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionResolver.test.ts @@ -9,6 +9,7 @@ import { Decimal } from 'decimal.js-light' import { Transaction } from '@entity/Transaction' import { User } from '@entity/User' import { GraphQLError } from 'graphql' +import { Event as DbEvent } from '@entity/Event' import { findUserByEmail } from './UserResolver' import { EventType } from '@/event/Event' import { userFactory } from '@/seeds/factory/user' @@ -22,7 +23,6 @@ import { bobBaumeister } from '@/seeds/users/bob-baumeister' import { garrickOllivander } from '@/seeds/users/garrick-ollivander' import { peterLustig } from '@/seeds/users/peter-lustig' import { stephenHawking } from '@/seeds/users/stephen-hawking' -import { Event as DbEvent } from '@entity/Event' import { cleanDB, testEnvironment } from '@test/helpers' import { logger } from '@test/testSetup' diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index f92b01f3f..5a372bf72 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -11,6 +11,7 @@ import { User } from '@entity/User' import { TransactionLink } from '@entity/TransactionLink' import { validate as validateUUID, version as versionUUID } from 'uuid' import { UserContact } from '@entity/UserContact' +import { Event as DbEvent } from '@entity/Event' import { OptInType } from '@enum/OptInType' import { UserContactType } from '@enum/UserContactType' import { PasswordEncryptionType } from '@enum/PasswordEncryptionType' @@ -45,7 +46,6 @@ import { contributionLinkFactory } from '@/seeds/factory/contributionLink' import { transactionLinkFactory } from '@/seeds/factory/transactionLink' import { ContributionLink } from '@model/ContributionLink' import { EventType } from '@/event/Event' -import { Event as DbEvent } from '@entity/Event' import { peterLustig } from '@/seeds/users/peter-lustig' import { bobBaumeister } from '@/seeds/users/bob-baumeister' import { stephenHawking } from '@/seeds/users/stephen-hawking'