mirror of
https://github.com/IT4Change/gradido.git
synced 2026-04-06 01:25:28 +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,
|
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
|
|
||||||
}
|
|
||||||
|
|||||||
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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',
|
||||||
|
|||||||
@ -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),
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user