feat: PAY-2613 add missing status field for select (#19071)

Co-authored-by: Stephen Wright <stephen.wright@Mac.Home>
This commit is contained in:
Stephen Wright
2025-09-02 13:34:27 +01:00
committed by GitHub
parent 1ced801358
commit 9569965a0b
3 changed files with 14 additions and 0 deletions

View File

@@ -706,6 +706,7 @@ export class ExecutionRepository extends Repository<ExecutionEntity> {
'workflowId', 'workflowId',
'waitTill', 'waitTill',
'finished', 'finished',
'status',
], ],
where, where,
order: { id: 'DESC' }, order: { id: 'DESC' },

View File

@@ -33,3 +33,6 @@ properties:
format: date-time format: date-time
customData: customData:
type: object type: object
status:
type: string
enum: ['canceled', 'crashed', 'error', 'new', 'running', 'success', 'unknown', 'waiting']

View File

@@ -263,6 +263,7 @@ describe('GET /executions', () => {
stoppedAt, stoppedAt,
workflowId, workflowId,
waitTill, waitTill,
status,
} = response.body.data[0]; } = response.body.data[0];
expect(id).toBeDefined(); expect(id).toBeDefined();
@@ -274,6 +275,7 @@ describe('GET /executions', () => {
expect(stoppedAt).not.toBeNull(); expect(stoppedAt).not.toBeNull();
expect(workflowId).toBe(successfulExecution.workflowId); expect(workflowId).toBe(successfulExecution.workflowId);
expect(waitTill).toBeNull(); expect(waitTill).toBeNull();
expect(status).toBe(successfulExecution.status);
}); });
test('should paginate two executions', async () => { test('should paginate two executions', async () => {
@@ -317,6 +319,7 @@ describe('GET /executions', () => {
stoppedAt, stoppedAt,
workflowId, workflowId,
waitTill, waitTill,
status,
} = executions[i]; } = executions[i];
expect(id).toBeDefined(); expect(id).toBeDefined();
@@ -328,6 +331,7 @@ describe('GET /executions', () => {
expect(stoppedAt).not.toBeNull(); expect(stoppedAt).not.toBeNull();
expect(workflowId).toBe(successfulExecutions[i].workflowId); expect(workflowId).toBe(successfulExecutions[i].workflowId);
expect(waitTill).toBeNull(); expect(waitTill).toBeNull();
expect(status).toBe(successfulExecutions[i].status);
} }
}); });
@@ -356,6 +360,7 @@ describe('GET /executions', () => {
stoppedAt, stoppedAt,
workflowId, workflowId,
waitTill, waitTill,
status,
} = response.body.data[0]; } = response.body.data[0];
expect(id).toBeDefined(); expect(id).toBeDefined();
@@ -367,6 +372,7 @@ describe('GET /executions', () => {
expect(stoppedAt).not.toBeNull(); expect(stoppedAt).not.toBeNull();
expect(workflowId).toBe(errorExecution.workflowId); expect(workflowId).toBe(errorExecution.workflowId);
expect(waitTill).toBeNull(); expect(waitTill).toBeNull();
expect(status).toBe(errorExecution.status);
}); });
test('should return all waiting executions', async () => { test('should return all waiting executions', async () => {
@@ -396,6 +402,7 @@ describe('GET /executions', () => {
stoppedAt, stoppedAt,
workflowId, workflowId,
waitTill, waitTill,
status,
} = response.body.data[0]; } = response.body.data[0];
expect(id).toBeDefined(); expect(id).toBeDefined();
@@ -407,6 +414,7 @@ describe('GET /executions', () => {
expect(stoppedAt).not.toBeNull(); expect(stoppedAt).not.toBeNull();
expect(workflowId).toBe(waitingExecution.workflowId); expect(workflowId).toBe(waitingExecution.workflowId);
expect(new Date(waitTill).getTime()).toBeGreaterThan(Date.now() - 1000); expect(new Date(waitTill).getTime()).toBeGreaterThan(Date.now() - 1000);
expect(status).toBe(waitingExecution.status);
}); });
test('should retrieve all executions of specific workflow', async () => { test('should retrieve all executions of specific workflow', async () => {
@@ -434,6 +442,7 @@ describe('GET /executions', () => {
stoppedAt, stoppedAt,
workflowId, workflowId,
waitTill, waitTill,
status,
} = execution; } = execution;
expect(savedExecutions.some((exec) => exec.id === id)).toBe(true); expect(savedExecutions.some((exec) => exec.id === id)).toBe(true);
@@ -445,6 +454,7 @@ describe('GET /executions', () => {
expect(stoppedAt).not.toBeNull(); expect(stoppedAt).not.toBeNull();
expect(workflowId).toBe(workflow.id); expect(workflowId).toBe(workflow.id);
expect(waitTill).toBeNull(); expect(waitTill).toBeNull();
expect(status).toBe(execution.status);
} }
}); });