mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Change listUnconfirmedContributions to adminListAllContributions.
This commit is contained in:
parent
8c00fcd6cc
commit
ad16aff1ea
@ -2675,84 +2675,217 @@ describe('ContributionResolver', () => {
|
||||
expect.objectContaining({
|
||||
data: {
|
||||
adminListAllContributions: {
|
||||
contributionCount: 4,
|
||||
contributionCount: 14,
|
||||
contributionList: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
amount: '500',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
firstName: 'Peter',
|
||||
lastName: 'Lustig',
|
||||
email: 'peter@lustig.de',
|
||||
date: expect.any(String),
|
||||
memo: 'Das war leider zu Viel!',
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Grundeinkommen',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '200',
|
||||
moderator: admin.id,
|
||||
creation: ['1000', '800', '500'],
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: expect.any(Number),
|
||||
firstName: 'Peter',
|
||||
lastName: 'Lustig',
|
||||
email: 'peter@lustig.de',
|
||||
date: expect.any(String),
|
||||
memo: 'Grundeinkommen',
|
||||
amount: '500',
|
||||
moderator: admin.id,
|
||||
creation: ['1000', '800', '500'],
|
||||
}),
|
||||
expect.not.objectContaining({
|
||||
id: expect.any(Number),
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
date: expect.any(String),
|
||||
memo: 'Test contribution to delete',
|
||||
amount: '100',
|
||||
moderator: null,
|
||||
creation: ['1000', '1000', '90'],
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: expect.any(Number),
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
date: expect.any(String),
|
||||
memo: 'Test PENDING contribution update',
|
||||
amount: '10',
|
||||
moderator: null,
|
||||
creation: ['1000', '1000', '90'],
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: expect.any(Number),
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
date: expect.any(String),
|
||||
memo: 'Test IN_PROGRESS contribution',
|
||||
amount: '100',
|
||||
moderator: null,
|
||||
creation: ['1000', '1000', '90'],
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: expect.any(Number),
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
date: expect.any(String),
|
||||
memo: 'Grundeinkommen',
|
||||
amount: '500',
|
||||
moderator: admin.id,
|
||||
creation: ['1000', '1000', '90'],
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: expect.any(Number),
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
email: 'bibi@bloxberg.de',
|
||||
date: expect.any(String),
|
||||
memo: 'Aktives Grundeinkommen',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '500',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Peter',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Lustig',
|
||||
memo: 'Grundeinkommen',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '200',
|
||||
moderator: admin.id,
|
||||
creation: ['1000', '1000', '90'],
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Peter',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Lustig',
|
||||
memo: 'Das war leider zu Viel!',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '166',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Peter',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Lustig',
|
||||
memo: 'Whatever contribution',
|
||||
messagesCount: 0,
|
||||
state: 'DELETED',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '166',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: expect.any(String),
|
||||
deniedBy: expect.any(Number),
|
||||
firstName: 'Räuber',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Hotzenplotz',
|
||||
memo: 'Whatever contribution',
|
||||
messagesCount: 0,
|
||||
state: 'DENIED',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '166',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Räuber',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Hotzenplotz',
|
||||
memo: 'Whatever contribution',
|
||||
messagesCount: 0,
|
||||
state: 'DELETED',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '166',
|
||||
confirmedAt: expect.any(String),
|
||||
confirmedBy: expect.any(Number),
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Räuber',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Hotzenplotz',
|
||||
memo: 'Whatever contribution',
|
||||
messagesCount: 0,
|
||||
state: 'CONFIRMED',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '100',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: expect.any(String),
|
||||
deniedBy: expect.any(Number),
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Test contribution to deny',
|
||||
messagesCount: 0,
|
||||
state: 'DENIED',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '100',
|
||||
confirmedAt: expect.any(String),
|
||||
confirmedBy: expect.any(Number),
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Test contribution to confirm',
|
||||
messagesCount: 0,
|
||||
state: 'CONFIRMED',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '100',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Test IN_PROGRESS contribution',
|
||||
messagesCount: 0,
|
||||
state: 'IN_PROGRESS',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '10',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Test PENDING contribution update',
|
||||
messagesCount: 0,
|
||||
state: 'PENDING',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '100',
|
||||
confirmedAt: null,
|
||||
confirmedBy: null,
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Test contribution to delete',
|
||||
messagesCount: 0,
|
||||
state: 'DELETED',
|
||||
}),
|
||||
expect.objectContaining({
|
||||
amount: '1000',
|
||||
confirmedAt: expect.any(String),
|
||||
confirmedBy: expect.any(Number),
|
||||
contributionDate: expect.any(String),
|
||||
createdAt: expect.any(String),
|
||||
deniedAt: null,
|
||||
deniedBy: null,
|
||||
firstName: 'Bibi',
|
||||
id: expect.any(Number),
|
||||
lastName: 'Bloxberg',
|
||||
memo: 'Herzlich Willkommen bei Gradido!',
|
||||
messagesCount: 0,
|
||||
state: 'CONFIRMED',
|
||||
}),
|
||||
]),
|
||||
},
|
||||
|
||||
@ -30,12 +30,11 @@ import { backendLogger as logger } from '@/server/logger'
|
||||
import {
|
||||
getCreationDates,
|
||||
getUserCreation,
|
||||
getUserCreations,
|
||||
validateContribution,
|
||||
updateCreations,
|
||||
isValidDateString,
|
||||
} from './util/creations'
|
||||
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS, FULL_CREATION_AVAILABLE } from './const/const'
|
||||
import { MEMO_MAX_CHARS, MEMO_MIN_CHARS } from './const/const'
|
||||
import {
|
||||
Event,
|
||||
EventContributionCreate,
|
||||
@ -504,8 +503,6 @@ export class ContributionResolver {
|
||||
.offset((currentPage - 1) * pageSize)
|
||||
.getManyAndCount()
|
||||
|
||||
console.log('dbContributions', dbContributions)
|
||||
console.log('count', count)
|
||||
return new ContributionListResult(
|
||||
count,
|
||||
dbContributions.map((contribution) => new Contribution(contribution, contribution.user)),
|
||||
|
||||
@ -198,7 +198,7 @@ query ($currentPage: Int = 1, $pageSize: Int = 5, $order: Order = DESC, $statusF
|
||||
export const adminListAllContributions = gql`
|
||||
query (
|
||||
$currentPage: Int = 1
|
||||
$pageSize: Int = 3
|
||||
$pageSize: Int = 25
|
||||
$order: Order = DESC
|
||||
$statusFilter: [ContributionStatus!]
|
||||
) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user