Merge branch 'fix_seeds' into dlt_export_existing_transactions_drizzleOrm

This commit is contained in:
einhornimmond 2025-11-14 12:10:27 +01:00
commit 0eecdaa5c3
5 changed files with 9 additions and 16 deletions

View File

@ -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
}

View File

@ -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()
}
}

View File

@ -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

View File

@ -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',

View File

@ -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),
}