mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
Merge branch 'fix_seeds' into dlt_export_existing_transactions_drizzleOrm
This commit is contained in:
commit
0eecdaa5c3
@ -2,7 +2,6 @@ import {
|
||||
Community as DbCommunity,
|
||||
FederatedCommunity as DbFederatedCommunity,
|
||||
getHomeCommunity,
|
||||
getReachableCommunities,
|
||||
} from 'database'
|
||||
import { IsNull } from 'typeorm'
|
||||
|
||||
@ -16,9 +15,6 @@ import { getLogger } from 'log4js'
|
||||
import { startCommunityAuthentication } from './authenticateCommunities'
|
||||
import { PublicCommunityInfoLoggingView } from './client/1_0/logging/PublicCommunityInfoLogging.view'
|
||||
import { ApiVersionType } from 'core'
|
||||
import { CONFIG } from '@/config'
|
||||
import * as path from 'node:path'
|
||||
import * as fs from 'node:fs'
|
||||
|
||||
const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.federation.validateCommunities`)
|
||||
|
||||
@ -146,11 +142,3 @@ async function writeForeignCommunity(
|
||||
await DbCommunity.save(com)
|
||||
}
|
||||
}
|
||||
|
||||
// prototype, later add api call to gradido dlt node server for adding/updating communities
|
||||
type CommunityForDltNodeServer = {
|
||||
communityId: string
|
||||
hieroTopicId: string
|
||||
alias: string
|
||||
folder: string
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ export const transactionLinkFactory = async (
|
||||
}
|
||||
|
||||
if (transactionLink.deletedAt) {
|
||||
dbTransactionLink.deletedAt = new Date()
|
||||
dbTransactionLink.deletedAt = new Date(dbTransactionLink.createdAt.getTime() + 1000)
|
||||
await dbTransactionLink.save()
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,11 +40,15 @@ export const userFactory = async (
|
||||
}
|
||||
|
||||
// get last changes of user from database
|
||||
dbUser = await User.findOneOrFail({ where: { id }, relations: ['userRoles'] })
|
||||
dbUser = await User.findOneOrFail({ where: { id }, relations: { userRoles: true, emailContact: true } })
|
||||
|
||||
if (user.createdAt || user.deletedAt || user.role) {
|
||||
if (user.createdAt) {
|
||||
dbUser.createdAt = user.createdAt
|
||||
// make sure emailContact is also updated for e2e test, prevent failing when time between seeding and test run is < 1 minute
|
||||
dbUser.emailContact.createdAt = user.createdAt
|
||||
dbUser.emailContact.updatedAt = user.createdAt
|
||||
await dbUser.emailContact.save()
|
||||
}
|
||||
if (user.deletedAt) {
|
||||
dbUser.deletedAt = user.deletedAt
|
||||
|
||||
@ -4,8 +4,7 @@ export const transactionLinks: TransactionLinkInterface[] = [
|
||||
{
|
||||
email: 'bibi@bloxberg.de',
|
||||
amount: 19.99,
|
||||
memo: 'Leider wollte niemand meine Gradidos zum Neujahr haben :(',
|
||||
createdAt: new Date(2022, 0, 1),
|
||||
memo: 'Leider wollte niemand meine Gradidos haben :(',
|
||||
},
|
||||
{
|
||||
email: 'bibi@bloxberg.de',
|
||||
|
||||
@ -9,4 +9,6 @@ export const bibiBloxberg: UserInterface = {
|
||||
emailChecked: true,
|
||||
language: 'de',
|
||||
publisherId: 1234,
|
||||
// move user createdAt before transaction link
|
||||
createdAt: new Date(2021, 9, 17),
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user