mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #2911 from gradido/fix-import-order
fix(backend): import order
This commit is contained in:
commit
a43c58e5b7
@ -76,7 +76,30 @@ module.exports = {
|
|||||||
'import/no-named-default': 'error',
|
'import/no-named-default': 'error',
|
||||||
'import/no-namespace': 'error',
|
'import/no-namespace': 'error',
|
||||||
'import/no-unassigned-import': 'error',
|
'import/no-unassigned-import': 'error',
|
||||||
'import/order': 'error',
|
'import/order': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
|
||||||
|
'newlines-between': 'always',
|
||||||
|
pathGroups: [
|
||||||
|
{
|
||||||
|
pattern: '@?*/**',
|
||||||
|
group: 'external',
|
||||||
|
position: 'after',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: '@/**',
|
||||||
|
group: 'external',
|
||||||
|
position: 'after',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
alphabetize: {
|
||||||
|
order: 'asc' /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
|
||||||
|
caseInsensitive: true /* ignore case. Options: [true, false] */,
|
||||||
|
},
|
||||||
|
distinctGroup: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
'import/prefer-default-export': 'off', // TODO
|
'import/prefer-default-export': 'off', // TODO
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export const apiPost = async (url: string, payload: unknown): Promise<any> => {
|
export const apiPost = async (url: string, payload: unknown): Promise<any> => {
|
||||||
|
|||||||
@ -4,9 +4,10 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-relative-parent-imports
|
// eslint-disable-next-line import/no-relative-parent-imports
|
||||||
import KlicktippConnector from 'klicktipp-api'
|
import KlicktippConnector from 'klicktipp-api'
|
||||||
import CONFIG from '@/config'
|
|
||||||
|
|
||||||
const klicktippConnector = new KlicktippConnector()
|
const klicktippConnector = new KlicktippConnector()
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import { verify, sign } from 'jsonwebtoken'
|
import { verify, sign } from 'jsonwebtoken'
|
||||||
import { CustomJwtPayload } from './CustomJwtPayload'
|
|
||||||
import CONFIG from '@/config/'
|
import CONFIG from '@/config/'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
|
||||||
|
import { CustomJwtPayload } from './CustomJwtPayload'
|
||||||
|
|
||||||
export const decode = (token: string): CustomJwtPayload | null => {
|
export const decode = (token: string): CustomJwtPayload | null => {
|
||||||
if (!token) throw new LogError('401 Unauthorized')
|
if (!token) throw new LogError('401 Unauthorized')
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env)
|
// ATTENTION: DO NOT PUT ANY SECRETS IN HERE (or the .env)
|
||||||
|
|
||||||
import dotenv from 'dotenv'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import dotenv from 'dotenv'
|
||||||
|
|
||||||
dotenv.config()
|
dotenv.config()
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/unbound-method */
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
import { createTransport } from 'nodemailer'
|
import { createTransport } from 'nodemailer'
|
||||||
import { sendEmailTranslated } from './sendEmailTranslated'
|
|
||||||
import { logger, i18n } from '@test/testSetup'
|
import { logger, i18n } from '@test/testSetup'
|
||||||
|
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
|
import { sendEmailTranslated } from './sendEmailTranslated'
|
||||||
|
|
||||||
CONFIG.EMAIL = false
|
CONFIG.EMAIL = false
|
||||||
CONFIG.EMAIL_SMTP_URL = 'EMAIL_SMTP_URL'
|
CONFIG.EMAIL_SMTP_URL = 'EMAIL_SMTP_URL'
|
||||||
CONFIG.EMAIL_SMTP_PORT = '1234'
|
CONFIG.EMAIL_SMTP_PORT = '1234'
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { createTransport } from 'nodemailer'
|
|
||||||
import Email from 'email-templates'
|
import Email from 'email-templates'
|
||||||
import i18n from 'i18n'
|
import i18n from 'i18n'
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
import { createTransport } from 'nodemailer'
|
||||||
|
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
export const sendEmailTranslated = async (params: {
|
export const sendEmailTranslated = async (params: {
|
||||||
receiver: {
|
receiver: {
|
||||||
|
|||||||
@ -4,6 +4,13 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
|
import { testEnvironment } from '@test/helpers'
|
||||||
|
import { logger, i18n as localization } from '@test/testSetup'
|
||||||
|
|
||||||
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
|
import { sendEmailTranslated } from './sendEmailTranslated'
|
||||||
import {
|
import {
|
||||||
sendAddedContributionMessageEmail,
|
sendAddedContributionMessageEmail,
|
||||||
sendAccountActivationEmail,
|
sendAccountActivationEmail,
|
||||||
@ -15,10 +22,6 @@ import {
|
|||||||
sendTransactionLinkRedeemedEmail,
|
sendTransactionLinkRedeemedEmail,
|
||||||
sendTransactionReceivedEmail,
|
sendTransactionReceivedEmail,
|
||||||
} from './sendEmailVariants'
|
} from './sendEmailVariants'
|
||||||
import { sendEmailTranslated } from './sendEmailTranslated'
|
|
||||||
import { testEnvironment } from '@test/helpers'
|
|
||||||
import { logger, i18n as localization } from '@test/testSetup'
|
|
||||||
import CONFIG from '@/config'
|
|
||||||
|
|
||||||
let con: any
|
let con: any
|
||||||
let testEnv: any
|
let testEnv: any
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { sendEmailTranslated } from './sendEmailTranslated'
|
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
import { decimalSeparatorByLanguage } from '@/util/utilities'
|
import { decimalSeparatorByLanguage } from '@/util/utilities'
|
||||||
|
|
||||||
|
import { sendEmailTranslated } from './sendEmailTranslated'
|
||||||
|
|
||||||
export const sendAddedContributionMessageEmail = (data: {
|
export const sendAddedContributionMessageEmail = (data: {
|
||||||
firstName: string
|
firstName: string
|
||||||
lastName: string
|
lastName: string
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_CONFIRM = async (
|
export const EVENT_ADMIN_CONTRIBUTION_CONFIRM = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_CREATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_CREATE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_DELETE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_DELETE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_DENY = async (
|
export const EVENT_ADMIN_CONTRIBUTION_DENY = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_LINK_CREATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_LINK_CREATE = async (
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_LINK_DELETE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_LINK_DELETE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_CONTRIBUTION_UPDATE = async (
|
export const EVENT_ADMIN_CONTRIBUTION_UPDATE = async (
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_USER_DELETE = async (user: DbUser, moderator: DbUser): Promise<DbEvent> =>
|
export const EVENT_ADMIN_USER_DELETE = async (user: DbUser, moderator: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_USER_ROLE_SET = async (
|
export const EVENT_ADMIN_USER_ROLE_SET = async (
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_ADMIN_USER_UNDELETE = async (
|
export const EVENT_ADMIN_USER_UNDELETE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_CREATE = async (
|
export const EVENT_CONTRIBUTION_CREATE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_DELETE = async (
|
export const EVENT_CONTRIBUTION_DELETE = async (
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
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 { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_LINK_REDEEM = async (
|
export const EVENT_CONTRIBUTION_LINK_REDEEM = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_MESSAGE_CREATE = async (
|
export const EVENT_CONTRIBUTION_MESSAGE_CREATE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_CONTRIBUTION_UPDATE = async (
|
export const EVENT_CONTRIBUTION_UPDATE = async (
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_EMAIL_ACCOUNT_MULTIREGISTRATION = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_EMAIL_ADMIN_CONFIRMATION = async (
|
export const EVENT_EMAIL_ADMIN_CONFIRMATION = async (
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_EMAIL_CONFIRMATION = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_EMAIL_CONFIRMATION = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_EMAIL_FORGOT_PASSWORD = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_EMAIL_FORGOT_PASSWORD = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
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'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_LINK_CREATE = async (
|
export const EVENT_TRANSACTION_LINK_CREATE = async (
|
||||||
|
|||||||
@ -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'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_LINK_DELETE = async (
|
export const EVENT_TRANSACTION_LINK_DELETE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
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'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_LINK_REDEEM = async (
|
export const EVENT_TRANSACTION_LINK_REDEEM = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
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'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_RECEIVE = async (
|
export const EVENT_TRANSACTION_RECEIVE = async (
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
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'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_TRANSACTION_SEND = async (
|
export const EVENT_TRANSACTION_SEND = async (
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_USER_ACTIVATE_ACCOUNT = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_ACTIVATE_ACCOUNT = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_USER_INFO_UPDATE = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_INFO_UPDATE = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_USER_LOGIN = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_LOGIN = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_USER_LOGOUT = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_LOGOUT = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
|
||||||
import { Event, EventType } from './Event'
|
import { Event, EventType } from './Event'
|
||||||
|
|
||||||
export const EVENT_USER_REGISTER = async (user: DbUser): Promise<DbEvent> =>
|
export const EVENT_USER_REGISTER = async (user: DbUser): Promise<DbEvent> =>
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
|
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
|
||||||
import { EventType } from './EventType'
|
import { EventType } from './EventType'
|
||||||
|
|
||||||
export const Event = (
|
export const Event = (
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
import { gql } from 'graphql-request'
|
|
||||||
import { Community as DbCommunity } from '@entity/Community'
|
import { Community as DbCommunity } from '@entity/Community'
|
||||||
|
import { gql } from 'graphql-request'
|
||||||
|
|
||||||
import { GraphQLGetClient } from '@/federation/client/GraphQLGetClient'
|
import { GraphQLGetClient } from '@/federation/client/GraphQLGetClient'
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
export async function requestGetPublicKey(dbCom: DbCommunity): Promise<string | undefined> {
|
export async function requestGetPublicKey(dbCom: DbCommunity): Promise<string | undefined> {
|
||||||
let endpoint = dbCom.endPoint.endsWith('/') ? dbCom.endPoint : dbCom.endPoint + '/'
|
let endpoint = dbCom.endPoint.endsWith('/') ? dbCom.endPoint : dbCom.endPoint + '/'
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
import { gql } from 'graphql-request'
|
|
||||||
import { Community as DbCommunity } from '@entity/Community'
|
import { Community as DbCommunity } from '@entity/Community'
|
||||||
|
import { gql } from 'graphql-request'
|
||||||
|
|
||||||
import { GraphQLGetClient } from '@/federation/client/GraphQLGetClient'
|
import { GraphQLGetClient } from '@/federation/client/GraphQLGetClient'
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
export async function requestGetPublicKey(dbCom: DbCommunity): Promise<string | undefined> {
|
export async function requestGetPublicKey(dbCom: DbCommunity): Promise<string | undefined> {
|
||||||
let endpoint = dbCom.endPoint.endsWith('/') ? dbCom.endPoint : dbCom.endPoint + '/'
|
let endpoint = dbCom.endPoint.endsWith('/') ? dbCom.endPoint : dbCom.endPoint + '/'
|
||||||
|
|||||||
@ -6,9 +6,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { Community as DbCommunity } from '@entity/Community'
|
import { Community as DbCommunity } from '@entity/Community'
|
||||||
import { validateCommunities } from './validateCommunities'
|
|
||||||
import { logger } from '@test/testSetup'
|
|
||||||
import { testEnvironment, cleanDB } from '@test/helpers'
|
import { testEnvironment, cleanDB } from '@test/helpers'
|
||||||
|
import { logger } from '@test/testSetup'
|
||||||
|
|
||||||
|
import { validateCommunities } from './validateCommunities'
|
||||||
|
|
||||||
let con: any
|
let con: any
|
||||||
let testEnv: any
|
let testEnv: any
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
import { Community as DbCommunity } from '@entity/Community'
|
|
||||||
import { IsNull } from '@dbTools/typeorm'
|
import { IsNull } from '@dbTools/typeorm'
|
||||||
|
import { Community as DbCommunity } from '@entity/Community'
|
||||||
|
|
||||||
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
import { requestGetPublicKey as v1_0_requestGetPublicKey } from './client/1_0/FederationClient'
|
import { requestGetPublicKey as v1_0_requestGetPublicKey } from './client/1_0/FederationClient'
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
import { requestGetPublicKey as v1_1_requestGetPublicKey } from './client/1_1/FederationClient'
|
import { requestGetPublicKey as v1_1_requestGetPublicKey } from './client/1_1/FederationClient'
|
||||||
import { ApiVersionType } from './enum/apiVersionType'
|
import { ApiVersionType } from './enum/apiVersionType'
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import LogError from '@/server/LogError'
|
|
||||||
|
|
||||||
export function startValidateCommunities(timerInterval: number): void {
|
export function startValidateCommunities(timerInterval: number): void {
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, InputType } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ArgsType, Field, InputType } from 'type-graphql'
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ArgsType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class AdminUpdateContributionArgs {
|
export default class AdminUpdateContributionArgs {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, InputType } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ArgsType, Field, InputType } from 'type-graphql'
|
||||||
|
|
||||||
@InputType()
|
@InputType()
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ArgsType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class ContributionLinkArgs {
|
export default class ContributionLinkArgs {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable type-graphql/invalid-nullable-input-type */
|
/* eslint-disable type-graphql/invalid-nullable-input-type */
|
||||||
import { ArgsType, Field, Int } from 'type-graphql'
|
import { ArgsType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
import { Order } from '@enum/Order'
|
import { Order } from '@enum/Order'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { ArgsType, Field, Int } from 'type-graphql'
|
import { ArgsType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
import SearchUsersFilters from '@arg/SearchUsersFilters'
|
import SearchUsersFilters from '@arg/SearchUsersFilters'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ArgsType, Field } from 'type-graphql'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class TransactionLinkArgs {
|
export default class TransactionLinkArgs {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ArgsType, Field } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ArgsType, Field } from 'type-graphql'
|
||||||
|
|
||||||
@ArgsType()
|
@ArgsType()
|
||||||
export default class TransactionSendArgs {
|
export default class TransactionSendArgs {
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
|
import { User } from '@entity/User'
|
||||||
import { AuthChecker } from 'type-graphql'
|
import { AuthChecker } from 'type-graphql'
|
||||||
|
|
||||||
import { User } from '@entity/User'
|
|
||||||
import { decode, encode } from '@/auth/JWT'
|
|
||||||
import { ROLE_UNAUTHORIZED, ROLE_USER, ROLE_ADMIN } from '@/auth/ROLES'
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
|
||||||
import { INALIENABLE_RIGHTS } from '@/auth/INALIENABLE_RIGHTS'
|
import { INALIENABLE_RIGHTS } from '@/auth/INALIENABLE_RIGHTS'
|
||||||
|
import { decode, encode } from '@/auth/JWT'
|
||||||
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
|
import { ROLE_UNAUTHORIZED, ROLE_USER, ROLE_ADMIN } from '@/auth/ROLES'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
|
||||||
const isAuthorized: AuthChecker<any> = async ({ context }, rights) => {
|
const isAuthorized: AuthChecker<any> = async ({ context }, rights) => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class AdminUpdateContribution {
|
export class AdminUpdateContribution {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class Balance {
|
export class Balance {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Community as DbCommunity } from '@entity/Community'
|
import { Community as DbCommunity } from '@entity/Community'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class Community {
|
export class Community {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class DynamicStatisticsFields {
|
export class DynamicStatisticsFields {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { Contribution as dbContribution } from '@entity/Contribution'
|
import { Contribution as dbContribution } from '@entity/Contribution'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class Contribution {
|
export class Contribution {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { ContributionLink as dbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as dbContributionLink } from '@entity/ContributionLink'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
import { ContributionLink } from '@model/ContributionLink'
|
import { ContributionLink } from '@model/ContributionLink'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Field, Int, ObjectType } from 'type-graphql'
|
|
||||||
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
import { Field, Int, ObjectType } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class ContributionMessage {
|
export class ContributionMessage {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
interface DecayInterface {
|
interface DecayInterface {
|
||||||
balance: Decimal
|
balance: Decimal
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
import { ObjectType, Field, Float, Int } from 'type-graphql'
|
import { ObjectType, Field, Float, Int } from 'type-graphql'
|
||||||
|
|
||||||
import { GdtEntryType } from '@enum/GdtEntryType'
|
import { GdtEntryType } from '@enum/GdtEntryType'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
import { ObjectType, Field, Int, Float } from 'type-graphql'
|
||||||
|
|
||||||
import { GdtEntry } from './GdtEntry'
|
import { GdtEntry } from './GdtEntry'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class OpenCreation {
|
export class OpenCreation {
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
|
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
||||||
|
|
||||||
import { Decay } from './Decay'
|
import { Decay } from './Decay'
|
||||||
import { User } from './User'
|
import { User } from './User'
|
||||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class Transaction {
|
export class Transaction {
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||||
import { User } from './User'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
import CONFIG from '@/config'
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
|
import { User } from './User'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class TransactionLink {
|
export class TransactionLink {
|
||||||
constructor(transactionLink: dbTransactionLink, user: User, redeemedBy: User | null = null) {
|
constructor(transactionLink: dbTransactionLink, user: User, redeemedBy: User | null = null) {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { ObjectType, Field } from 'type-graphql'
|
import { ObjectType, Field } from 'type-graphql'
|
||||||
import { Transaction } from './Transaction'
|
|
||||||
import { Balance } from './Balance'
|
import { Balance } from './Balance'
|
||||||
|
import { Transaction } from './Transaction'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class TransactionList {
|
export class TransactionList {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { Contribution } from '@entity/Contribution'
|
import { Contribution } from '@entity/Contribution'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class UnconfirmedContribution {
|
export class UnconfirmedContribution {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { User as dbUser } from '@entity/User'
|
import { User as dbUser } from '@entity/User'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
import { KlickTipp } from './KlickTipp'
|
import { KlickTipp } from './KlickTipp'
|
||||||
import { UserContact } from './UserContact'
|
import { UserContact } from './UserContact'
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class UserAdmin {
|
export class UserAdmin {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ObjectType, Field, Int } from 'type-graphql'
|
|
||||||
import { UserContact as dbUserContact } from '@entity/UserContact'
|
import { UserContact as dbUserContact } from '@entity/UserContact'
|
||||||
|
import { ObjectType, Field, Int } from 'type-graphql'
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class UserContact {
|
export class UserContact {
|
||||||
|
|||||||
@ -1,21 +1,20 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { Resolver, Query, Ctx, Authorized } from 'type-graphql'
|
|
||||||
import { getCustomRepository } from '@dbTools/typeorm'
|
import { getCustomRepository } from '@dbTools/typeorm'
|
||||||
|
|
||||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { Resolver, Query, Ctx, Authorized } from 'type-graphql'
|
||||||
|
|
||||||
|
import { Balance } from '@model/Balance'
|
||||||
|
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
||||||
|
|
||||||
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
|
import { Context, getUser } from '@/server/context'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
import { calculateDecay } from '@/util/decay'
|
||||||
|
|
||||||
import { GdtResolver } from './GdtResolver'
|
import { GdtResolver } from './GdtResolver'
|
||||||
import { getLastTransaction } from './util/getLastTransaction'
|
import { getLastTransaction } from './util/getLastTransaction'
|
||||||
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
|
||||||
|
|
||||||
import { Balance } from '@model/Balance'
|
|
||||||
|
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import { Context, getUser } from '@/server/context'
|
|
||||||
import { calculateDecay } from '@/util/decay'
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
|
||||||
|
|
||||||
@Resolver()
|
@Resolver()
|
||||||
export class BalanceResolver {
|
export class BalanceResolver {
|
||||||
|
|||||||
@ -6,9 +6,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { Community as DbCommunity } from '@entity/Community'
|
import { Community as DbCommunity } from '@entity/Community'
|
||||||
import { getCommunities } from '@/seeds/graphql/queries'
|
|
||||||
import { testEnvironment } from '@test/helpers'
|
import { testEnvironment } from '@test/helpers'
|
||||||
|
|
||||||
|
import { getCommunities } from '@/seeds/graphql/queries'
|
||||||
|
|
||||||
let query: any
|
let query: any
|
||||||
|
|
||||||
// to do: We need a setup for the tests that closes the connection
|
// to do: We need a setup for the tests that closes the connection
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
import { Community as DbCommunity } from '@entity/Community'
|
||||||
import { Resolver, Query, Authorized } from 'type-graphql'
|
import { Resolver, Query, Authorized } from 'type-graphql'
|
||||||
|
|
||||||
import { Community as DbCommunity } from '@entity/Community'
|
|
||||||
import { Community } from '@model/Community'
|
import { Community } from '@model/Community'
|
||||||
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
|
|||||||
@ -4,11 +4,16 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { GraphQLError } from 'graphql'
|
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { GraphQLError } from 'graphql'
|
||||||
|
|
||||||
|
import { cleanDB, testEnvironment, resetToken } from '@test/helpers'
|
||||||
import { logger } from '@test/testSetup'
|
import { logger } from '@test/testSetup'
|
||||||
|
|
||||||
|
import { EventType } from '@/event/Event'
|
||||||
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
login,
|
login,
|
||||||
createContributionLink,
|
createContributionLink,
|
||||||
@ -16,11 +21,8 @@ import {
|
|||||||
updateContributionLink,
|
updateContributionLink,
|
||||||
} from '@/seeds/graphql/mutations'
|
} from '@/seeds/graphql/mutations'
|
||||||
import { listContributionLinks } from '@/seeds/graphql/queries'
|
import { listContributionLinks } from '@/seeds/graphql/queries'
|
||||||
import { cleanDB, testEnvironment, resetToken } from '@test/helpers'
|
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
|
||||||
import { EventType } from '@/event/Event'
|
|
||||||
|
|
||||||
let mutate: any, query: any, con: any
|
let mutate: any, query: any, con: any
|
||||||
let testEnv: any
|
let testEnv: any
|
||||||
|
|||||||
@ -1,31 +1,32 @@
|
|||||||
|
import { MoreThan, IsNull } from '@dbTools/typeorm'
|
||||||
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Resolver, Args, Arg, Authorized, Mutation, Query, Int, Ctx } from 'type-graphql'
|
import { Resolver, Args, Arg, Authorized, Mutation, Query, Int, Ctx } from 'type-graphql'
|
||||||
import { MoreThan, IsNull } from '@dbTools/typeorm'
|
|
||||||
|
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
// TODO: this is a strange construct
|
||||||
|
import ContributionLinkArgs from '@arg/ContributionLinkArgs'
|
||||||
|
import Paginated from '@arg/Paginated'
|
||||||
|
import { Order } from '@enum/Order'
|
||||||
|
import { ContributionLink } from '@model/ContributionLink'
|
||||||
|
import { ContributionLinkList } from '@model/ContributionLinkList'
|
||||||
|
|
||||||
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
|
import {
|
||||||
|
EVENT_ADMIN_CONTRIBUTION_LINK_CREATE,
|
||||||
|
EVENT_ADMIN_CONTRIBUTION_LINK_DELETE,
|
||||||
|
EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE,
|
||||||
|
} from '@/event/Event'
|
||||||
|
import { Context, getUser } from '@/server/context'
|
||||||
|
import LogError from '@/server/LogError'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CONTRIBUTIONLINK_NAME_MAX_CHARS,
|
CONTRIBUTIONLINK_NAME_MAX_CHARS,
|
||||||
CONTRIBUTIONLINK_NAME_MIN_CHARS,
|
CONTRIBUTIONLINK_NAME_MIN_CHARS,
|
||||||
MEMO_MAX_CHARS,
|
MEMO_MAX_CHARS,
|
||||||
MEMO_MIN_CHARS,
|
MEMO_MIN_CHARS,
|
||||||
} from './const/const'
|
} from './const/const'
|
||||||
import { isStartEndDateValid } from './util/creations'
|
|
||||||
import { transactionLinkCode as contributionLinkCode } from './TransactionLinkResolver'
|
import { transactionLinkCode as contributionLinkCode } from './TransactionLinkResolver'
|
||||||
import { ContributionLinkList } from '@model/ContributionLinkList'
|
import { isStartEndDateValid } from './util/creations'
|
||||||
import { ContributionLink } from '@model/ContributionLink'
|
|
||||||
import ContributionLinkArgs from '@arg/ContributionLinkArgs'
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
import Paginated from '@arg/Paginated'
|
|
||||||
|
|
||||||
// TODO: this is a strange construct
|
|
||||||
import LogError from '@/server/LogError'
|
|
||||||
import { Context, getUser } from '@/server/context'
|
|
||||||
import {
|
|
||||||
EVENT_ADMIN_CONTRIBUTION_LINK_CREATE,
|
|
||||||
EVENT_ADMIN_CONTRIBUTION_LINK_DELETE,
|
|
||||||
EVENT_ADMIN_CONTRIBUTION_LINK_UPDATE,
|
|
||||||
} from '@/event/Event'
|
|
||||||
|
|
||||||
@Resolver()
|
@Resolver()
|
||||||
export class ContributionLinkResolver {
|
export class ContributionLinkResolver {
|
||||||
|
|||||||
@ -6,10 +6,15 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { GraphQLError } from 'graphql'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { GraphQLError } from 'graphql'
|
||||||
|
|
||||||
import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
|
import { cleanDB, resetToken, testEnvironment } from '@test/helpers'
|
||||||
import { logger, i18n as localization } from '@test/testSetup'
|
import { logger, i18n as localization } from '@test/testSetup'
|
||||||
|
|
||||||
|
import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
||||||
|
import { EventType } from '@/event/Event'
|
||||||
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
adminCreateContributionMessage,
|
adminCreateContributionMessage,
|
||||||
createContribution,
|
createContribution,
|
||||||
@ -17,11 +22,8 @@ import {
|
|||||||
login,
|
login,
|
||||||
} from '@/seeds/graphql/mutations'
|
} from '@/seeds/graphql/mutations'
|
||||||
import { listContributionMessages } from '@/seeds/graphql/queries'
|
import { listContributionMessages } from '@/seeds/graphql/queries'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
|
||||||
import { EventType } from '@/event/Event'
|
|
||||||
|
|
||||||
jest.mock('@/emails/sendEmailVariants', () => {
|
jest.mock('@/emails/sendEmailVariants', () => {
|
||||||
const originalModule = jest.requireActual('@/emails/sendEmailVariants')
|
const originalModule = jest.requireActual('@/emails/sendEmailVariants')
|
||||||
|
|||||||
@ -1,27 +1,26 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
|
||||||
import { getConnection } from '@dbTools/typeorm'
|
import { getConnection } from '@dbTools/typeorm'
|
||||||
|
|
||||||
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { UserContact as DbUserContact } from '@entity/UserContact'
|
import { ContributionMessage as DbContributionMessage } from '@entity/ContributionMessage'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { UserContact as DbUserContact } from '@entity/UserContact'
|
||||||
|
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
||||||
|
|
||||||
import { ContributionMessage, ContributionMessageListResult } from '@model/ContributionMessage'
|
|
||||||
import ContributionMessageArgs from '@arg/ContributionMessageArgs'
|
import ContributionMessageArgs from '@arg/ContributionMessageArgs'
|
||||||
import { ContributionMessageType } from '@enum/MessageType'
|
|
||||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
import Paginated from '@arg/Paginated'
|
import Paginated from '@arg/Paginated'
|
||||||
|
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||||
|
import { ContributionMessageType } from '@enum/MessageType'
|
||||||
|
import { Order } from '@enum/Order'
|
||||||
|
import { ContributionMessage, ContributionMessageListResult } from '@model/ContributionMessage'
|
||||||
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
import { Context, getUser } from '@/server/context'
|
|
||||||
import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
import { sendAddedContributionMessageEmail } from '@/emails/sendEmailVariants'
|
||||||
import LogError from '@/server/LogError'
|
|
||||||
import {
|
import {
|
||||||
EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE,
|
EVENT_ADMIN_CONTRIBUTION_MESSAGE_CREATE,
|
||||||
EVENT_CONTRIBUTION_MESSAGE_CREATE,
|
EVENT_CONTRIBUTION_MESSAGE_CREATE,
|
||||||
} from '@/event/Event'
|
} from '@/event/Event'
|
||||||
|
import { Context, getUser } from '@/server/context'
|
||||||
|
import LogError from '@/server/LogError'
|
||||||
|
|
||||||
@Resolver()
|
@Resolver()
|
||||||
export class ContributionMessageResolver {
|
export class ContributionMessageResolver {
|
||||||
|
|||||||
@ -6,17 +6,36 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { GraphQLError } from 'graphql'
|
|
||||||
import { Contribution } from '@entity/Contribution'
|
import { Contribution } from '@entity/Contribution'
|
||||||
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
import { UserInputError } from 'apollo-server-express'
|
import { UserInputError } from 'apollo-server-express'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
import { GraphQLError } from 'graphql'
|
||||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
|
||||||
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||||
import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
|
import { Order } from '@enum/Order'
|
||||||
|
import { ContributionListResult } from '@model/Contribution'
|
||||||
|
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
||||||
|
import {
|
||||||
|
cleanDB,
|
||||||
|
resetToken,
|
||||||
|
testEnvironment,
|
||||||
|
contributionDateFormatter,
|
||||||
|
resetEntity,
|
||||||
|
} from '@test/helpers'
|
||||||
|
import { logger, i18n as localization } from '@test/testSetup'
|
||||||
|
|
||||||
|
import {
|
||||||
|
sendContributionConfirmedEmail,
|
||||||
|
sendContributionDeletedEmail,
|
||||||
|
sendContributionDeniedEmail,
|
||||||
|
} from '@/emails/sendEmailVariants'
|
||||||
|
import { EventType } from '@/event/Event'
|
||||||
|
import { creations } from '@/seeds/creation/index'
|
||||||
|
import { creationFactory } from '@/seeds/factory/creation'
|
||||||
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
createContribution,
|
createContribution,
|
||||||
updateContribution,
|
updateContribution,
|
||||||
@ -35,29 +54,12 @@ import {
|
|||||||
listContributions,
|
listContributions,
|
||||||
adminListContributions,
|
adminListContributions,
|
||||||
} from '@/seeds/graphql/queries'
|
} from '@/seeds/graphql/queries'
|
||||||
import {
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
sendContributionConfirmedEmail,
|
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||||
sendContributionDeletedEmail,
|
import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
|
||||||
sendContributionDeniedEmail,
|
|
||||||
} from '@/emails/sendEmailVariants'
|
|
||||||
import {
|
|
||||||
cleanDB,
|
|
||||||
resetToken,
|
|
||||||
testEnvironment,
|
|
||||||
contributionDateFormatter,
|
|
||||||
resetEntity,
|
|
||||||
} from '@test/helpers'
|
|
||||||
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 { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
import { EventType } from '@/event/Event'
|
|
||||||
import { logger, i18n as localization } from '@test/testSetup'
|
|
||||||
import { raeuberHotzenplotz } from '@/seeds/users/raeuber-hotzenplotz'
|
import { raeuberHotzenplotz } from '@/seeds/users/raeuber-hotzenplotz'
|
||||||
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
||||||
import { ContributionListResult } from '@model/Contribution'
|
|
||||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
|
|
||||||
jest.mock('@/emails/sendEmailVariants')
|
jest.mock('@/emails/sendEmailVariants')
|
||||||
|
|
||||||
|
|||||||
@ -1,42 +1,34 @@
|
|||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
|
||||||
import { IsNull, getConnection } from '@dbTools/typeorm'
|
import { IsNull, getConnection } from '@dbTools/typeorm'
|
||||||
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { ContributionMessage } from '@entity/ContributionMessage'
|
import { ContributionMessage } from '@entity/ContributionMessage'
|
||||||
import { UserContact } from '@entity/UserContact'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { UserContact } from '@entity/UserContact'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { Arg, Args, Authorized, Ctx, Int, Mutation, Query, Resolver } from 'type-graphql'
|
||||||
|
|
||||||
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const'
|
import AdminCreateContributionArgs from '@arg/AdminCreateContributionArgs'
|
||||||
import { getLastTransaction } from './util/getLastTransaction'
|
import AdminUpdateContributionArgs from '@arg/AdminUpdateContributionArgs'
|
||||||
import { findContributions } from './util/findContributions'
|
import ContributionArgs from '@arg/ContributionArgs'
|
||||||
import {
|
import Paginated from '@arg/Paginated'
|
||||||
getUserCreation,
|
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||||
validateContribution,
|
import { ContributionType } from '@enum/ContributionType'
|
||||||
updateCreations,
|
import { ContributionMessageType } from '@enum/MessageType'
|
||||||
isValidDateString,
|
import { Order } from '@enum/Order'
|
||||||
getOpenCreations,
|
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
||||||
} from './util/creations'
|
|
||||||
import { AdminUpdateContribution } from '@model/AdminUpdateContribution'
|
import { AdminUpdateContribution } from '@model/AdminUpdateContribution'
|
||||||
import { Contribution, ContributionListResult } from '@model/Contribution'
|
import { Contribution, ContributionListResult } from '@model/Contribution'
|
||||||
import { Decay } from '@model/Decay'
|
import { Decay } from '@model/Decay'
|
||||||
import { OpenCreation } from '@model/OpenCreation'
|
import { OpenCreation } from '@model/OpenCreation'
|
||||||
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
||||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
import { ContributionType } from '@enum/ContributionType'
|
|
||||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
|
||||||
import { ContributionMessageType } from '@enum/MessageType'
|
|
||||||
import ContributionArgs from '@arg/ContributionArgs'
|
|
||||||
import Paginated from '@arg/Paginated'
|
|
||||||
import AdminCreateContributionArgs from '@arg/AdminCreateContributionArgs'
|
|
||||||
import AdminUpdateContributionArgs from '@arg/AdminUpdateContributionArgs'
|
|
||||||
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
import {
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
sendContributionConfirmedEmail,
|
||||||
|
sendContributionDeletedEmail,
|
||||||
|
sendContributionDeniedEmail,
|
||||||
|
} from '@/emails/sendEmailVariants'
|
||||||
import {
|
import {
|
||||||
EVENT_CONTRIBUTION_CREATE,
|
EVENT_CONTRIBUTION_CREATE,
|
||||||
EVENT_CONTRIBUTION_DELETE,
|
EVENT_CONTRIBUTION_DELETE,
|
||||||
@ -47,14 +39,22 @@ import {
|
|||||||
EVENT_ADMIN_CONTRIBUTION_CONFIRM,
|
EVENT_ADMIN_CONTRIBUTION_CONFIRM,
|
||||||
EVENT_ADMIN_CONTRIBUTION_DENY,
|
EVENT_ADMIN_CONTRIBUTION_DENY,
|
||||||
} from '@/event/Event'
|
} from '@/event/Event'
|
||||||
import { calculateDecay } from '@/util/decay'
|
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||||
import {
|
|
||||||
sendContributionConfirmedEmail,
|
|
||||||
sendContributionDeletedEmail,
|
|
||||||
sendContributionDeniedEmail,
|
|
||||||
} from '@/emails/sendEmailVariants'
|
|
||||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
import { calculateDecay } from '@/util/decay'
|
||||||
|
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||||
|
|
||||||
|
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const'
|
||||||
|
import {
|
||||||
|
getUserCreation,
|
||||||
|
validateContribution,
|
||||||
|
updateCreations,
|
||||||
|
isValidDateString,
|
||||||
|
getOpenCreations,
|
||||||
|
} from './util/creations'
|
||||||
|
import { findContributions } from './util/findContributions'
|
||||||
|
import { getLastTransaction } from './util/getLastTransaction'
|
||||||
|
|
||||||
@Resolver()
|
@Resolver()
|
||||||
export class ContributionResolver {
|
export class ContributionResolver {
|
||||||
|
|||||||
@ -6,10 +6,12 @@
|
|||||||
|
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { GraphQLError } from 'graphql'
|
import { GraphQLError } from 'graphql'
|
||||||
|
|
||||||
import { testEnvironment, cleanDB } from '@test/helpers'
|
import { testEnvironment, cleanDB } from '@test/helpers'
|
||||||
|
|
||||||
|
import CONFIG from '@/config'
|
||||||
import { createUser, setPassword, forgotPassword } from '@/seeds/graphql/mutations'
|
import { createUser, setPassword, forgotPassword } from '@/seeds/graphql/mutations'
|
||||||
import { queryOptIn } from '@/seeds/graphql/queries'
|
import { queryOptIn } from '@/seeds/graphql/queries'
|
||||||
import CONFIG from '@/config'
|
|
||||||
|
|
||||||
let mutate: any, query: any, con: any
|
let mutate: any, query: any, con: any
|
||||||
let testEnv: any
|
let testEnv: any
|
||||||
|
|||||||
@ -3,14 +3,14 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
import { Resolver, Query, Args, Ctx, Authorized, Arg, Int, Float } from 'type-graphql'
|
import { Resolver, Query, Args, Ctx, Authorized, Arg, Int, Float } from 'type-graphql'
|
||||||
|
|
||||||
import { GdtEntryList } from '@model/GdtEntryList'
|
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
import Paginated from '@arg/Paginated'
|
import Paginated from '@arg/Paginated'
|
||||||
|
import { Order } from '@enum/Order'
|
||||||
|
import { GdtEntryList } from '@model/GdtEntryList'
|
||||||
|
|
||||||
import { Context, getUser } from '@/server/context'
|
|
||||||
import CONFIG from '@/config'
|
|
||||||
import { apiGet, apiPost } from '@/apis/HttpRequest'
|
import { apiGet, apiPost } from '@/apis/HttpRequest'
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
|
import CONFIG from '@/config'
|
||||||
|
import { Context, getUser } from '@/server/context'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
|
||||||
@Resolver()
|
@Resolver()
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { Resolver, Query, Authorized, FieldResolver } from 'type-graphql'
|
|
||||||
import { getConnection } from '@dbTools/typeorm'
|
import { getConnection } from '@dbTools/typeorm'
|
||||||
|
|
||||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { Resolver, Query, Authorized, FieldResolver } from 'type-graphql'
|
||||||
|
|
||||||
import { CommunityStatistics, DynamicStatisticsFields } from '@model/CommunityStatistics'
|
import { CommunityStatistics, DynamicStatisticsFields } from '@model/CommunityStatistics'
|
||||||
|
|
||||||
|
|||||||
@ -7,21 +7,22 @@
|
|||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { Transaction } from '@entity/Transaction'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
import { UserContact } from '@entity/UserContact'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { GraphQLError } from 'graphql'
|
import { GraphQLError } from 'graphql'
|
||||||
import { Transaction } from '@entity/Transaction'
|
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
||||||
import { UserContact } from '@entity/UserContact'
|
|
||||||
import { transactionLinkCode } from './TransactionLinkResolver'
|
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
|
||||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
|
||||||
import { cleanDB, testEnvironment, resetToken, resetEntity } from '@test/helpers'
|
import { cleanDB, testEnvironment, resetToken, resetEntity } from '@test/helpers'
|
||||||
import { creationFactory } from '@/seeds/factory/creation'
|
import { logger } from '@test/testSetup'
|
||||||
|
|
||||||
|
import { EventType } from '@/event/Event'
|
||||||
import { creations } from '@/seeds/creation/index'
|
import { creations } from '@/seeds/creation/index'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { creationFactory } from '@/seeds/factory/creation'
|
||||||
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
||||||
import { transactionLinks } from '@/seeds/transactionLink/index'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
login,
|
login,
|
||||||
createContributionLink,
|
createContributionLink,
|
||||||
@ -33,10 +34,12 @@ import {
|
|||||||
confirmContribution,
|
confirmContribution,
|
||||||
} from '@/seeds/graphql/mutations'
|
} from '@/seeds/graphql/mutations'
|
||||||
import { listTransactionLinksAdmin } from '@/seeds/graphql/queries'
|
import { listTransactionLinksAdmin } from '@/seeds/graphql/queries'
|
||||||
import { UnconfirmedContribution } from '@model/UnconfirmedContribution'
|
import { transactionLinks } from '@/seeds/transactionLink/index'
|
||||||
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
|
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||||
import { logger } from '@test/testSetup'
|
|
||||||
import { EventType } from '@/event/Event'
|
import { transactionLinkCode } from './TransactionLinkResolver'
|
||||||
|
|
||||||
// mock semaphore to allow use fake timers
|
// mock semaphore to allow use fake timers
|
||||||
jest.mock('@/util/TRANSACTIONS_LOCK')
|
jest.mock('@/util/TRANSACTIONS_LOCK')
|
||||||
|
|||||||
@ -1,44 +1,45 @@
|
|||||||
import { randomBytes } from 'crypto'
|
import { randomBytes } from 'crypto'
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
|
|
||||||
import { getConnection } from '@dbTools/typeorm'
|
import { getConnection } from '@dbTools/typeorm'
|
||||||
|
|
||||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
|
||||||
import { User as DbUser } from '@entity/User'
|
|
||||||
import { Transaction as DbTransaction } from '@entity/Transaction'
|
|
||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
|
import { Transaction as DbTransaction } from '@entity/Transaction'
|
||||||
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { Resolver, Args, Arg, Authorized, Ctx, Mutation, Query, Int } from 'type-graphql'
|
import { Resolver, Args, Arg, Authorized, Ctx, Mutation, Query, Int } from 'type-graphql'
|
||||||
import { getUserCreation, validateContribution } from './util/creations'
|
|
||||||
import { executeTransaction } from './TransactionResolver'
|
import Paginated from '@arg/Paginated'
|
||||||
import { getLastTransaction } from './util/getLastTransaction'
|
import TransactionLinkArgs from '@arg/TransactionLinkArgs'
|
||||||
import transactionLinkList from './util/transactionLinkList'
|
import TransactionLinkFilters from '@arg/TransactionLinkFilters'
|
||||||
import { User } from '@model/User'
|
import { ContributionCycleType } from '@enum/ContributionCycleType'
|
||||||
|
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||||
|
import { ContributionType } from '@enum/ContributionType'
|
||||||
|
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
||||||
import { ContributionLink } from '@model/ContributionLink'
|
import { ContributionLink } from '@model/ContributionLink'
|
||||||
import { Decay } from '@model/Decay'
|
import { Decay } from '@model/Decay'
|
||||||
import { TransactionLink, TransactionLinkResult } from '@model/TransactionLink'
|
import { TransactionLink, TransactionLinkResult } from '@model/TransactionLink'
|
||||||
import { ContributionType } from '@enum/ContributionType'
|
import { User } from '@model/User'
|
||||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
|
||||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
|
||||||
import { ContributionCycleType } from '@enum/ContributionCycleType'
|
|
||||||
import TransactionLinkArgs from '@arg/TransactionLinkArgs'
|
|
||||||
import Paginated from '@arg/Paginated'
|
|
||||||
import TransactionLinkFilters from '@arg/TransactionLinkFilters'
|
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
|
||||||
import { calculateBalance } from '@/util/validate'
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
|
||||||
import { calculateDecay } from '@/util/decay'
|
|
||||||
import QueryLinkResult from '@union/QueryLinkResult'
|
import QueryLinkResult from '@union/QueryLinkResult'
|
||||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
|
||||||
import LogError from '@/server/LogError'
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
import {
|
import {
|
||||||
EVENT_CONTRIBUTION_LINK_REDEEM,
|
EVENT_CONTRIBUTION_LINK_REDEEM,
|
||||||
EVENT_TRANSACTION_LINK_CREATE,
|
EVENT_TRANSACTION_LINK_CREATE,
|
||||||
EVENT_TRANSACTION_LINK_DELETE,
|
EVENT_TRANSACTION_LINK_DELETE,
|
||||||
EVENT_TRANSACTION_LINK_REDEEM,
|
EVENT_TRANSACTION_LINK_REDEEM,
|
||||||
} from '@/event/Event'
|
} from '@/event/Event'
|
||||||
|
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||||
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
import { calculateDecay } from '@/util/decay'
|
||||||
|
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||||
|
import { calculateBalance } from '@/util/validate'
|
||||||
|
|
||||||
|
import { executeTransaction } from './TransactionResolver'
|
||||||
|
import { getUserCreation, validateContribution } from './util/creations'
|
||||||
|
import { getLastTransaction } from './util/getLastTransaction'
|
||||||
|
import transactionLinkList from './util/transactionLinkList'
|
||||||
|
|
||||||
// TODO: do not export, test it inside the resolver
|
// TODO: do not export, test it inside the resolver
|
||||||
export const transactionLinkCode = (date: Date): string => {
|
export const transactionLinkCode = (date: Date): string => {
|
||||||
|
|||||||
@ -5,12 +5,15 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Event as DbEvent } from '@entity/Event'
|
||||||
import { Transaction } from '@entity/Transaction'
|
import { Transaction } from '@entity/Transaction'
|
||||||
import { User } from '@entity/User'
|
import { User } from '@entity/User'
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { GraphQLError } from 'graphql'
|
import { GraphQLError } from 'graphql'
|
||||||
import { Event as DbEvent } from '@entity/Event'
|
|
||||||
import { findUserByEmail } from './UserResolver'
|
import { cleanDB, testEnvironment } from '@test/helpers'
|
||||||
|
import { logger } from '@test/testSetup'
|
||||||
|
|
||||||
import { EventType } from '@/event/Event'
|
import { EventType } from '@/event/Event'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
@ -23,8 +26,8 @@ import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
|||||||
import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
|
import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
|
||||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
||||||
import { cleanDB, testEnvironment } from '@test/helpers'
|
|
||||||
import { logger } from '@test/testSetup'
|
import { findUserByEmail } from './UserResolver'
|
||||||
|
|
||||||
let mutate: any, query: any, con: any
|
let mutate: any, query: any, con: any
|
||||||
let testEnv: any
|
let testEnv: any
|
||||||
|
|||||||
@ -2,42 +2,41 @@
|
|||||||
/* eslint-disable new-cap */
|
/* eslint-disable new-cap */
|
||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||||
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql'
|
|
||||||
import { getCustomRepository, getConnection, In } from '@dbTools/typeorm'
|
import { getCustomRepository, getConnection, In } from '@dbTools/typeorm'
|
||||||
|
|
||||||
import { User as dbUser } from '@entity/User'
|
|
||||||
import { Transaction as dbTransaction } from '@entity/Transaction'
|
import { Transaction as dbTransaction } from '@entity/Transaction'
|
||||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||||
import { BalanceResolver } from './BalanceResolver'
|
import { User as dbUser } from '@entity/User'
|
||||||
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { findUserByEmail } from './UserResolver'
|
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql'
|
||||||
import { getLastTransaction } from './util/getLastTransaction'
|
|
||||||
|
import Paginated from '@arg/Paginated'
|
||||||
|
import TransactionSendArgs from '@arg/TransactionSendArgs'
|
||||||
|
import { Order } from '@enum/Order'
|
||||||
|
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
||||||
|
import { Transaction } from '@model/Transaction'
|
||||||
|
import { TransactionList } from '@model/TransactionList'
|
||||||
|
import { User } from '@model/User'
|
||||||
import { TransactionRepository } from '@repository/Transaction'
|
import { TransactionRepository } from '@repository/Transaction'
|
||||||
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
import { TransactionLinkRepository } from '@repository/TransactionLink'
|
||||||
|
|
||||||
import { User } from '@model/User'
|
|
||||||
import { Transaction } from '@model/Transaction'
|
|
||||||
import { TransactionList } from '@model/TransactionList'
|
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
import { TransactionTypeId } from '@enum/TransactionTypeId'
|
|
||||||
import { calculateBalance } from '@/util/validate'
|
|
||||||
import TransactionSendArgs from '@arg/TransactionSendArgs'
|
|
||||||
import Paginated from '@arg/Paginated'
|
|
||||||
|
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import { Context, getUser } from '@/server/context'
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
import { communityUser } from '@/util/communityUser'
|
|
||||||
import { virtualLinkTransaction, virtualDecayTransaction } from '@/util/virtualTransactions'
|
|
||||||
import {
|
import {
|
||||||
sendTransactionLinkRedeemedEmail,
|
sendTransactionLinkRedeemedEmail,
|
||||||
sendTransactionReceivedEmail,
|
sendTransactionReceivedEmail,
|
||||||
} from '@/emails/sendEmailVariants'
|
} from '@/emails/sendEmailVariants'
|
||||||
import { EVENT_TRANSACTION_RECEIVE, EVENT_TRANSACTION_SEND } from '@/event/Event'
|
import { EVENT_TRANSACTION_RECEIVE, EVENT_TRANSACTION_SEND } from '@/event/Event'
|
||||||
|
import { Context, getUser } from '@/server/context'
|
||||||
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
import { communityUser } from '@/util/communityUser'
|
||||||
|
import { TRANSACTIONS_LOCK } from '@/util/TRANSACTIONS_LOCK'
|
||||||
|
import { calculateBalance } from '@/util/validate'
|
||||||
|
import { virtualLinkTransaction, virtualDecayTransaction } from '@/util/virtualTransactions'
|
||||||
|
|
||||||
|
import { BalanceResolver } from './BalanceResolver'
|
||||||
|
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const'
|
||||||
|
import { findUserByEmail } from './UserResolver'
|
||||||
|
import { getLastTransaction } from './util/getLastTransaction'
|
||||||
|
|
||||||
export const executeTransaction = async (
|
export const executeTransaction = async (
|
||||||
amount: Decimal,
|
amount: Decimal,
|
||||||
|
|||||||
@ -6,21 +6,32 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { GraphQLError } from 'graphql'
|
|
||||||
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 { Event as DbEvent } from '@entity/Event'
|
||||||
|
import { TransactionLink } from '@entity/TransactionLink'
|
||||||
|
import { User } from '@entity/User'
|
||||||
|
import { UserContact } from '@entity/UserContact'
|
||||||
|
import { GraphQLError } from 'graphql'
|
||||||
|
import { validate as validateUUID, version as versionUUID } from 'uuid'
|
||||||
|
|
||||||
import { OptInType } from '@enum/OptInType'
|
import { OptInType } from '@enum/OptInType'
|
||||||
import { UserContactType } from '@enum/UserContactType'
|
|
||||||
import { PasswordEncryptionType } from '@enum/PasswordEncryptionType'
|
import { PasswordEncryptionType } from '@enum/PasswordEncryptionType'
|
||||||
import { objectValuesToArray } from '@/util/utilities'
|
import { UserContactType } from '@enum/UserContactType'
|
||||||
|
import { ContributionLink } from '@model/ContributionLink'
|
||||||
import { testEnvironment, headerPushMock, resetToken, cleanDB } from '@test/helpers'
|
import { testEnvironment, headerPushMock, resetToken, cleanDB } from '@test/helpers'
|
||||||
import { logger, i18n as localization } from '@test/testSetup'
|
import { logger, i18n as localization } from '@test/testSetup'
|
||||||
import { printTimeDuration } from '@/util/time'
|
|
||||||
|
import CONFIG from '@/config'
|
||||||
|
import {
|
||||||
|
sendAccountActivationEmail,
|
||||||
|
sendAccountMultiRegistrationEmail,
|
||||||
|
sendResetPasswordEmail,
|
||||||
|
} from '@/emails/sendEmailVariants'
|
||||||
|
import { EventType } from '@/event/Event'
|
||||||
|
import { SecretKeyCryptographyCreateKey } from '@/password/EncryptorUtils'
|
||||||
|
import { encryptPassword } from '@/password/PasswordEncryptor'
|
||||||
|
import { contributionLinkFactory } from '@/seeds/factory/contributionLink'
|
||||||
|
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
|
||||||
import {
|
import {
|
||||||
login,
|
login,
|
||||||
logout,
|
logout,
|
||||||
@ -36,22 +47,13 @@ import {
|
|||||||
sendActivationEmail,
|
sendActivationEmail,
|
||||||
} from '@/seeds/graphql/mutations'
|
} from '@/seeds/graphql/mutations'
|
||||||
import { verifyLogin, queryOptIn, searchAdminUsers, searchUsers } from '@/seeds/graphql/queries'
|
import { verifyLogin, queryOptIn, searchAdminUsers, searchUsers } from '@/seeds/graphql/queries'
|
||||||
import CONFIG from '@/config'
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
import {
|
|
||||||
sendAccountActivationEmail,
|
|
||||||
sendAccountMultiRegistrationEmail,
|
|
||||||
sendResetPasswordEmail,
|
|
||||||
} from '@/emails/sendEmailVariants'
|
|
||||||
import { contributionLinkFactory } from '@/seeds/factory/contributionLink'
|
|
||||||
import { transactionLinkFactory } from '@/seeds/factory/transactionLink'
|
|
||||||
import { ContributionLink } from '@model/ContributionLink'
|
|
||||||
import { EventType } from '@/event/Event'
|
|
||||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
|
||||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||||
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
|
||||||
import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
|
import { garrickOllivander } from '@/seeds/users/garrick-ollivander'
|
||||||
import { encryptPassword } from '@/password/PasswordEncryptor'
|
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
import { SecretKeyCryptographyCreateKey } from '@/password/EncryptorUtils'
|
import { stephenHawking } from '@/seeds/users/stephen-hawking'
|
||||||
|
import { printTimeDuration } from '@/util/time'
|
||||||
|
import { objectValuesToArray } from '@/util/utilities'
|
||||||
|
|
||||||
// import { klicktippSignIn } from '@/apis/KlicktippController'
|
// import { klicktippSignIn } from '@/apis/KlicktippController'
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||||
|
import { getConnection, getCustomRepository, IsNull, Not } from '@dbTools/typeorm'
|
||||||
|
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
||||||
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
|
import { User as DbUser } from '@entity/User'
|
||||||
|
import { UserContact as DbUserContact } from '@entity/UserContact'
|
||||||
import i18n from 'i18n'
|
import i18n from 'i18n'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
|
||||||
import {
|
import {
|
||||||
Resolver,
|
Resolver,
|
||||||
Query,
|
Query,
|
||||||
@ -15,46 +19,31 @@ import {
|
|||||||
Mutation,
|
Mutation,
|
||||||
Int,
|
Int,
|
||||||
} from 'type-graphql'
|
} from 'type-graphql'
|
||||||
import { getConnection, getCustomRepository, IsNull, Not } from '@dbTools/typeorm'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
import { User as DbUser } from '@entity/User'
|
import CreateUserArgs from '@arg/CreateUserArgs'
|
||||||
import { UserContact as DbUserContact } from '@entity/UserContact'
|
import Paginated from '@arg/Paginated'
|
||||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
import SearchUsersArgs from '@arg/SearchUsersArgs'
|
||||||
import { ContributionLink as DbContributionLink } from '@entity/ContributionLink'
|
import UnsecureLoginArgs from '@arg/UnsecureLoginArgs'
|
||||||
import { getUserCreations } from './util/creations'
|
import UpdateUserInfosArgs from '@arg/UpdateUserInfosArgs'
|
||||||
import { FULL_CREATION_AVAILABLE } from './const/const'
|
|
||||||
import { PasswordEncryptionType } from '@enum/PasswordEncryptionType'
|
|
||||||
import { UserRepository } from '@repository/User'
|
|
||||||
|
|
||||||
import { User } from '@model/User'
|
|
||||||
import { SearchAdminUsersResult } from '@model/AdminUser'
|
|
||||||
import { UserAdmin, SearchUsersResult } from '@model/UserAdmin'
|
|
||||||
import { OptInType } from '@enum/OptInType'
|
import { OptInType } from '@enum/OptInType'
|
||||||
import { Order } from '@enum/Order'
|
import { Order } from '@enum/Order'
|
||||||
|
import { PasswordEncryptionType } from '@enum/PasswordEncryptionType'
|
||||||
import { UserContactType } from '@enum/UserContactType'
|
import { UserContactType } from '@enum/UserContactType'
|
||||||
|
import { SearchAdminUsersResult } from '@model/AdminUser'
|
||||||
|
import { User } from '@model/User'
|
||||||
|
import { UserAdmin, SearchUsersResult } from '@model/UserAdmin'
|
||||||
|
import { UserRepository } from '@repository/User'
|
||||||
|
|
||||||
|
import { klicktippSignIn } from '@/apis/KlicktippController'
|
||||||
|
import { encode } from '@/auth/JWT'
|
||||||
|
import { RIGHTS } from '@/auth/RIGHTS'
|
||||||
|
import CONFIG from '@/config'
|
||||||
import {
|
import {
|
||||||
sendAccountActivationEmail,
|
sendAccountActivationEmail,
|
||||||
sendAccountMultiRegistrationEmail,
|
sendAccountMultiRegistrationEmail,
|
||||||
sendResetPasswordEmail,
|
sendResetPasswordEmail,
|
||||||
} from '@/emails/sendEmailVariants'
|
} from '@/emails/sendEmailVariants'
|
||||||
|
|
||||||
import { getTimeDurationObject, printTimeDuration } from '@/util/time'
|
|
||||||
import CreateUserArgs from '@arg/CreateUserArgs'
|
|
||||||
import UnsecureLoginArgs from '@arg/UnsecureLoginArgs'
|
|
||||||
import UpdateUserInfosArgs from '@arg/UpdateUserInfosArgs'
|
|
||||||
import Paginated from '@arg/Paginated'
|
|
||||||
import SearchUsersArgs from '@arg/SearchUsersArgs'
|
|
||||||
|
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
|
||||||
import CONFIG from '@/config'
|
|
||||||
import { communityDbUser } from '@/util/communityUser'
|
|
||||||
import { encode } from '@/auth/JWT'
|
|
||||||
import { klicktippNewsletterStateMiddleware } from '@/middleware/klicktippMiddleware'
|
|
||||||
import { klicktippSignIn } from '@/apis/KlicktippController'
|
|
||||||
import { RIGHTS } from '@/auth/RIGHTS'
|
|
||||||
import { hasElopageBuys } from '@/util/hasElopageBuys'
|
|
||||||
import {
|
import {
|
||||||
Event,
|
Event,
|
||||||
EventType,
|
EventType,
|
||||||
@ -71,14 +60,23 @@ import {
|
|||||||
EVENT_ADMIN_USER_DELETE,
|
EVENT_ADMIN_USER_DELETE,
|
||||||
EVENT_ADMIN_USER_UNDELETE,
|
EVENT_ADMIN_USER_UNDELETE,
|
||||||
} from '@/event/Event'
|
} from '@/event/Event'
|
||||||
|
import { klicktippNewsletterStateMiddleware } from '@/middleware/klicktippMiddleware'
|
||||||
import { isValidPassword } from '@/password/EncryptorUtils'
|
import { isValidPassword } from '@/password/EncryptorUtils'
|
||||||
import { encryptPassword, verifyPassword } from '@/password/PasswordEncryptor'
|
import { encryptPassword, verifyPassword } from '@/password/PasswordEncryptor'
|
||||||
|
import { Context, getUser, getClientTimezoneOffset } from '@/server/context'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
import { communityDbUser } from '@/util/communityUser'
|
||||||
|
import { hasElopageBuys } from '@/util/hasElopageBuys'
|
||||||
|
import { getTimeDurationObject, printTimeDuration } from '@/util/time'
|
||||||
|
|
||||||
|
import { FULL_CREATION_AVAILABLE } from './const/const'
|
||||||
|
import { getUserCreations } from './util/creations'
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs
|
|
||||||
const sodium = require('sodium-native')
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs
|
||||||
const random = require('random-bigint')
|
const random = require('random-bigint')
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs
|
||||||
|
const sodium = require('sodium-native')
|
||||||
|
|
||||||
const LANGUAGES = ['de', 'en', 'es', 'fr', 'nl']
|
const LANGUAGES = ['de', 'en', 'es', 'fr', 'nl']
|
||||||
const DEFAULT_LANGUAGE = 'de'
|
const DEFAULT_LANGUAGE = 'de'
|
||||||
|
|||||||
@ -5,12 +5,11 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
|
||||||
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
|
||||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
|
||||||
import { creationFactory, nMonthsBefore } from '@/seeds/factory/creation'
|
|
||||||
import { cleanDB, testEnvironment, contributionDateFormatter } from '@test/helpers'
|
import { cleanDB, testEnvironment, contributionDateFormatter } from '@test/helpers'
|
||||||
|
|
||||||
|
import { creationFactory, nMonthsBefore } from '@/seeds/factory/creation'
|
||||||
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import {
|
import {
|
||||||
confirmContribution,
|
confirmContribution,
|
||||||
createContribution,
|
createContribution,
|
||||||
@ -20,6 +19,9 @@ import {
|
|||||||
createContributionLink,
|
createContributionLink,
|
||||||
sendCoins,
|
sendCoins,
|
||||||
} from '@/seeds/graphql/mutations'
|
} from '@/seeds/graphql/mutations'
|
||||||
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
|
import { bobBaumeister } from '@/seeds/users/bob-baumeister'
|
||||||
|
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
|
|
||||||
let mutate: any, con: any
|
let mutate: any, con: any
|
||||||
let testEnv: any
|
let testEnv: any
|
||||||
|
|||||||
@ -4,14 +4,17 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||||
|
|
||||||
import { User } from '@entity/User'
|
|
||||||
import { Contribution } from '@entity/Contribution'
|
import { Contribution } from '@entity/Contribution'
|
||||||
import { getUserCreation } from './creations'
|
import { User } from '@entity/User'
|
||||||
|
|
||||||
import { testEnvironment, cleanDB, contributionDateFormatter } from '@test/helpers'
|
import { testEnvironment, cleanDB, contributionDateFormatter } from '@test/helpers'
|
||||||
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
|
||||||
import { peterLustig } from '@/seeds/users/peter-lustig'
|
|
||||||
import { userFactory } from '@/seeds/factory/user'
|
import { userFactory } from '@/seeds/factory/user'
|
||||||
import { login, createContribution, adminCreateContribution } from '@/seeds/graphql/mutations'
|
import { login, createContribution, adminCreateContribution } from '@/seeds/graphql/mutations'
|
||||||
|
import { bibiBloxberg } from '@/seeds/users/bibi-bloxberg'
|
||||||
|
import { peterLustig } from '@/seeds/users/peter-lustig'
|
||||||
|
|
||||||
|
import { getUserCreation } from './creations'
|
||||||
|
|
||||||
let mutate: any, con: any
|
let mutate: any, con: any
|
||||||
let testEnv: any
|
let testEnv: any
|
||||||
|
|||||||
@ -3,10 +3,12 @@
|
|||||||
import { getConnection } from '@dbTools/typeorm'
|
import { getConnection } from '@dbTools/typeorm'
|
||||||
import { Contribution } from '@entity/Contribution'
|
import { Contribution } from '@entity/Contribution'
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { FULL_CREATION_AVAILABLE, MAX_CREATION_AMOUNT } from '@/graphql/resolver/const/const'
|
|
||||||
import { backendLogger as logger } from '@/server/logger'
|
|
||||||
import { OpenCreation } from '@model/OpenCreation'
|
import { OpenCreation } from '@model/OpenCreation'
|
||||||
|
|
||||||
|
import { FULL_CREATION_AVAILABLE, MAX_CREATION_AMOUNT } from '@/graphql/resolver/const/const'
|
||||||
import LogError from '@/server/LogError'
|
import LogError from '@/server/LogError'
|
||||||
|
import { backendLogger as logger } from '@/server/logger'
|
||||||
|
|
||||||
interface CreationMap {
|
interface CreationMap {
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { Contribution as DbContribution } from '@entity/Contribution'
|
|
||||||
import { In } from '@dbTools/typeorm'
|
import { In } from '@dbTools/typeorm'
|
||||||
|
import { Contribution as DbContribution } from '@entity/Contribution'
|
||||||
|
|
||||||
import { ContributionStatus } from '@enum/ContributionStatus'
|
import { ContributionStatus } from '@enum/ContributionStatus'
|
||||||
import { Order } from '@enum/Order'
|
import { Order } from '@enum/Order'
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
import { MoreThan } from '@dbTools/typeorm'
|
import { MoreThan } from '@dbTools/typeorm'
|
||||||
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
import { TransactionLink as DbTransactionLink } from '@entity/TransactionLink'
|
||||||
import { User as DbUser } from '@entity/User'
|
import { User as DbUser } from '@entity/User'
|
||||||
import { Order } from '@enum/Order'
|
|
||||||
import Paginated from '@arg/Paginated'
|
import Paginated from '@arg/Paginated'
|
||||||
import TransactionLinkFilters from '@arg/TransactionLinkFilters'
|
import TransactionLinkFilters from '@arg/TransactionLinkFilters'
|
||||||
|
import { Order } from '@enum/Order'
|
||||||
import { TransactionLink, TransactionLinkResult } from '@model/TransactionLink'
|
import { TransactionLink, TransactionLinkResult } from '@model/TransactionLink'
|
||||||
|
|
||||||
import { User } from '@/graphql/model/User'
|
import { User } from '@/graphql/model/User'
|
||||||
|
|
||||||
export default async function transactionLinkList(
|
export default async function transactionLinkList(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { GraphQLScalarType, Kind } from 'graphql'
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
import { Decimal } from 'decimal.js-light'
|
||||||
|
import { GraphQLScalarType, Kind } from 'graphql'
|
||||||
|
|
||||||
const DecimalType = new GraphQLScalarType({
|
const DecimalType = new GraphQLScalarType({
|
||||||
name: 'Decimal',
|
name: 'Decimal',
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
|
import { Decimal } from 'decimal.js-light'
|
||||||
import { GraphQLSchema } from 'graphql'
|
import { GraphQLSchema } from 'graphql'
|
||||||
import { buildSchema } from 'type-graphql'
|
import { buildSchema } from 'type-graphql'
|
||||||
|
|
||||||
import { Decimal } from 'decimal.js-light'
|
|
||||||
import isAuthorized from './directive/isAuthorized'
|
import isAuthorized from './directive/isAuthorized'
|
||||||
import DecimalScalar from './scalar/Decimal'
|
import DecimalScalar from './scalar/Decimal'
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { createUnionType } from 'type-graphql'
|
import { createUnionType } from 'type-graphql'
|
||||||
import { TransactionLink } from '@model/TransactionLink'
|
|
||||||
import { ContributionLink } from '@model/ContributionLink'
|
import { ContributionLink } from '@model/ContributionLink'
|
||||||
|
import { TransactionLink } from '@model/TransactionLink'
|
||||||
|
|
||||||
export default createUnionType({
|
export default createUnionType({
|
||||||
name: 'QueryLinkResult', // the name of the GraphQL union
|
name: 'QueryLinkResult', // the name of the GraphQL union
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
import createServer from './server/createServer'
|
|
||||||
|
|
||||||
// config
|
// config
|
||||||
import CONFIG from './config'
|
import CONFIG from './config'
|
||||||
import { startValidateCommunities } from './federation/validateCommunities'
|
import { startValidateCommunities } from './federation/validateCommunities'
|
||||||
|
import createServer from './server/createServer'
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const { app } = await createServer()
|
const { app } = await createServer()
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user