Merge remote-tracking branch 'origin/master' into

3263-feature-gms-publish-user-backend-update-user-settings
This commit is contained in:
Claus-Peter Huebner 2024-01-08 22:37:03 +01:00
commit 548a09fefd
13 changed files with 23 additions and 6 deletions

View File

@ -12,7 +12,7 @@ Decimal.set({
})
const constants = {
DB_VERSION: '0079-introduce_gms_registration',
DB_VERSION: '0080-introduce_gms_registration',
DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0
LOG4JS_CONFIG: 'log4js-config.json',
// default log level on production should be info

View File

@ -451,6 +451,7 @@ export class ContributionResolver {
transaction.userId = contribution.userId
transaction.userGradidoID = user.gradidoID
transaction.userName = fullName(user.firstName, user.lastName)
transaction.linkedUserId = contribution.moderatorId
transaction.previous = lastTransaction ? lastTransaction.id : null
transaction.amount = contribution.amount
transaction.creationDate = contribution.contributionDate

View File

@ -254,6 +254,9 @@ export class TransactionResolver {
// userTransactions.forEach((transaction: dbTransaction) => {
// use normal for loop because of timing problems with await in forEach-loop
for (const transaction of userTransactions) {
if (transaction.typeId === TransactionTypeId.CREATION) {
continue
}
if (transaction.linkedUserId && !involvedUserIds.includes(transaction.linkedUserId)) {
involvedUserIds.push(transaction.linkedUserId)
}

View File

@ -1 +1 @@
export { Community } from './0079-introduce_gms_registration/Community'
export { Community } from './0080-introduce_gms_registration/Community'

View File

@ -1 +1 @@
export { User } from './0079-introduce_gms_registration/User'
export { User } from './0080-introduce_gms_registration/User'

View File

@ -1 +1 @@
export { UserContact } from './0079-introduce_gms_registration/UserContact'
export { UserContact } from './0080-introduce_gms_registration/UserContact'

View File

@ -0,0 +1,13 @@
export async function upgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
await queryFn(
`UPDATE \`transactions\` AS t
JOIN \`contributions\` AS c ON t.id = c.transaction_id
SET t.linked_user_id = c.confirmed_by
WHERE t.type_id = ?`,
[1],
)
}
export async function downgrade(queryFn: (query: string, values?: any[]) => Promise<Array<any>>) {
await queryFn(`UPDATE \`transactions\` SET \`linked_user_id\` = NULL where \`type_id\` = ?;`, [1])
}

View File

@ -4,7 +4,7 @@ import dotenv from 'dotenv'
dotenv.config()
const constants = {
DB_VERSION: '0079-introduce_gms_registration',
DB_VERSION: '0080-introduce_gms_registration',
LOG4JS_CONFIG: 'log4js-config.json',
// default log level on production should be info
LOG_LEVEL: process.env.LOG_LEVEL || 'info',

View File

@ -10,7 +10,7 @@ Decimal.set({
})
const constants = {
DB_VERSION: '0079-introduce_gms_registration',
DB_VERSION: '0080-introduce_gms_registration',
DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0
LOG4JS_CONFIG: 'log4js-config.json',
// default log level on production should be info