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, Community as DbCommunity,
FederatedCommunity as DbFederatedCommunity, FederatedCommunity as DbFederatedCommunity,
getHomeCommunity, getHomeCommunity,
getReachableCommunities,
} from 'database' } from 'database'
import { IsNull } from 'typeorm' import { IsNull } from 'typeorm'
@ -16,9 +15,6 @@ import { getLogger } from 'log4js'
import { startCommunityAuthentication } from './authenticateCommunities' import { startCommunityAuthentication } from './authenticateCommunities'
import { PublicCommunityInfoLoggingView } from './client/1_0/logging/PublicCommunityInfoLogging.view' import { PublicCommunityInfoLoggingView } from './client/1_0/logging/PublicCommunityInfoLogging.view'
import { ApiVersionType } from 'core' 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`) const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.federation.validateCommunities`)
@ -146,11 +142,3 @@ async function writeForeignCommunity(
await DbCommunity.save(com) 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) { if (transactionLink.deletedAt) {
dbTransactionLink.deletedAt = new Date() dbTransactionLink.deletedAt = new Date(dbTransactionLink.createdAt.getTime() + 1000)
await dbTransactionLink.save() await dbTransactionLink.save()
} }
} }

View File

@ -40,11 +40,15 @@ export const userFactory = async (
} }
// get last changes of user from database // 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 || user.deletedAt || user.role) {
if (user.createdAt) { if (user.createdAt) {
dbUser.createdAt = 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) { if (user.deletedAt) {
dbUser.deletedAt = user.deletedAt dbUser.deletedAt = user.deletedAt

View File

@ -4,8 +4,7 @@ export const transactionLinks: TransactionLinkInterface[] = [
{ {
email: 'bibi@bloxberg.de', email: 'bibi@bloxberg.de',
amount: 19.99, amount: 19.99,
memo: 'Leider wollte niemand meine Gradidos zum Neujahr haben :(', memo: 'Leider wollte niemand meine Gradidos haben :(',
createdAt: new Date(2022, 0, 1),
}, },
{ {
email: 'bibi@bloxberg.de', email: 'bibi@bloxberg.de',

View File

@ -9,4 +9,6 @@ export const bibiBloxberg: UserInterface = {
emailChecked: true, emailChecked: true,
language: 'de', language: 'de',
publisherId: 1234, publisherId: 1234,
// move user createdAt before transaction link
createdAt: new Date(2021, 9, 17),
} }