feat: add report material workflows and gateway safeguards
This commit is contained in:
@@ -77,11 +77,15 @@ function createPrismaMock() {
|
||||
status: 'pending',
|
||||
failureCode: 'SUBMIT_PROCESSING_FAILED',
|
||||
failureMessage: 'network down',
|
||||
rawPayload: '{"upstream":{"passwordCipher":"secret"}}',
|
||||
commandPayload: { upstream: { account: 'sp', passwordCipher: 'secret' } },
|
||||
tenant: { name: '租户A' },
|
||||
application: { name: '应用A' },
|
||||
channel: { code: 'CMPP-A' },
|
||||
}]),
|
||||
count: jest.fn().mockResolvedValue(1),
|
||||
groupBy: jest.fn().mockResolvedValue([{ status: 'pending', _count: { _all: 1 } }]),
|
||||
findFirst: jest.fn().mockResolvedValue({ createdAt: new Date('2026-07-08T12:00:00.000Z') }),
|
||||
},
|
||||
gatewayDownstreamRecoveryStatus: {
|
||||
findMany: jest.fn().mockResolvedValue([{
|
||||
@@ -408,10 +412,22 @@ describe('OperationsService', () => {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
})).resolves.toEqual({
|
||||
items: [expect.objectContaining({ id: 'dead-1', status: 'pending' })],
|
||||
items: [expect.objectContaining({
|
||||
id: 'dead-1',
|
||||
status: 'pending',
|
||||
rawPayloadAvailable: true,
|
||||
commandPayload: { upstream: { account: 'sp', passwordCipher: '[REDACTED]' } },
|
||||
})],
|
||||
total: 1,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
summary: {
|
||||
pending: 1,
|
||||
requeueing: 0,
|
||||
requeued: 0,
|
||||
resolved: 0,
|
||||
oldestPendingAt: new Date('2026-07-08T12:00:00.000Z'),
|
||||
},
|
||||
});
|
||||
|
||||
expect(prisma.gatewaySubmitDeadLetter.findMany).toHaveBeenCalledWith({
|
||||
|
||||
Reference in New Issue
Block a user