Skip to content

CCM-18132: Get proofing request by ID endpoint#960

Open
m-salaudeen wants to merge 27 commits into
mainfrom
feature/CCM-18132_get-proofing-request-endopont
Open

CCM-18132: Get proofing request by ID endpoint#960
m-salaudeen wants to merge 27 commits into
mainfrom
feature/CCM-18132_get-proofing-request-endopont

Conversation

@m-salaudeen
Copy link
Copy Markdown
Contributor

Description

This endoint is aimed at returning a proofing request data by using it ID (which is provided in the URL)

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@m-salaudeen m-salaudeen self-assigned this May 15, 2026
@m-salaudeen m-salaudeen marked this pull request as ready for review May 19, 2026 08:29
@m-salaudeen m-salaudeen requested review from a team as code owners May 19, 2026 08:29

expect(result).toEqual({
statusCode: 200,
data: expect.objectContaining({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to assert the whole object here, instead of using objectContaining

});
});

test.describe('auth', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test similar to returns 404 if contact detail is owned by a different user in tests/test-team/template-mgmt-api-tests/create-proofing-request.api.spec.ts where a different user belonging to the same client is shown to not be able to access the request?

}'
```

### GET - /v1/proofing-request/:proofingRequestId - Get a digital proofing request. by id
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense and it's interrupting 'POST - /v1/template/:templateId/proofing-request' halfway through

}
}

private getOwnerKey(user: User) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be used within put too

proofingRequestId: string,
user: User
): Promise<ApplicationResult<ProofRequest>> {
return await this.proofRequestRepository.getById(proofingRequestId, user);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may need to check for the digital proofing feature flag here as well. It feels slightly overkill on the GET but is consistent with how I'd expect a feature flag to behave. You shouldn't be able to fetch resources you haven't been granted permission to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't done for contact details

expect(result).toEqual({ data: proofRequest });
});

it('returns 404 when proofing request is not found', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this test, because the 404 specific behavior belongs to the repository.

returns error when repository lookup fails could be re-worded to be more generic: returns error when repository returns error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants