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({
|
expect.objectContaining({
|
||||||
data: {
|
data: {
|
||||||
adminListAllContributions: {
|
adminListAllContributions: {
|
||||||
contributionCount: 4,
|
contributionCount: 14,
|
||||||
contributionList: expect.arrayContaining([
|
contributionList: expect.arrayContaining([
|
||||||
expect.objectContaining({
|
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),
|
id: expect.any(Number),
|
||||||
firstName: 'Peter',
|
lastName: 'Bloxberg',
|
||||||
lastName: 'Lustig',
|
memo: 'Grundeinkommen',
|
||||||
email: 'peter@lustig.de',
|
messagesCount: 0,
|
||||||
date: expect.any(String),
|
state: 'PENDING',
|
||||||
memo: 'Das war leider zu Viel!',
|
}),
|
||||||
|
expect.objectContaining({
|
||||||
amount: '200',
|
amount: '200',
|
||||||
moderator: admin.id,
|
confirmedAt: null,
|
||||||
creation: ['1000', '800', '500'],
|
confirmedBy: null,
|
||||||
}),
|
contributionDate: expect.any(String),
|
||||||
expect.objectContaining({
|
createdAt: expect.any(String),
|
||||||
id: expect.any(Number),
|
deniedAt: null,
|
||||||
firstName: 'Peter',
|
deniedBy: null,
|
||||||
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),
|
|
||||||
firstName: 'Bibi',
|
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),
|
id: expect.any(Number),
|
||||||
firstName: 'Bibi',
|
|
||||||
lastName: 'Bloxberg',
|
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',
|
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',
|
amount: '200',
|
||||||
moderator: admin.id,
|
confirmedAt: null,
|
||||||
creation: ['1000', '1000', '90'],
|
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 {
|
import {
|
||||||
getCreationDates,
|
getCreationDates,
|
||||||
getUserCreation,
|
getUserCreation,
|
||||||
getUserCreations,
|
|
||||||
validateContribution,
|
validateContribution,
|
||||||
updateCreations,
|
updateCreations,
|
||||||
isValidDateString,
|
isValidDateString,
|
||||||
} from './util/creations'
|
} 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 {
|
import {
|
||||||
Event,
|
Event,
|
||||||
EventContributionCreate,
|
EventContributionCreate,
|
||||||
@ -504,8 +503,6 @@ export class ContributionResolver {
|
|||||||
.offset((currentPage - 1) * pageSize)
|
.offset((currentPage - 1) * pageSize)
|
||||||
.getManyAndCount()
|
.getManyAndCount()
|
||||||
|
|
||||||
console.log('dbContributions', dbContributions)
|
|
||||||
console.log('count', count)
|
|
||||||
return new ContributionListResult(
|
return new ContributionListResult(
|
||||||
count,
|
count,
|
||||||
dbContributions.map((contribution) => new Contribution(contribution, contribution.user)),
|
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`
|
export const adminListAllContributions = gql`
|
||||||
query (
|
query (
|
||||||
$currentPage: Int = 1
|
$currentPage: Int = 1
|
||||||
$pageSize: Int = 3
|
$pageSize: Int = 25
|
||||||
$order: Order = DESC
|
$order: Order = DESC
|
||||||
$statusFilter: [ContributionStatus!]
|
$statusFilter: [ContributionStatus!]
|
||||||
) {
|
) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user