Skip to content

feat: add employee resource#155

Open
fox-john wants to merge 6 commits into
PrestaShop:devfrom
fox-john:feature/add-employee
Open

feat: add employee resource#155
fox-john wants to merge 6 commits into
PrestaShop:devfrom
fox-john:feature/add-employee

Conversation

@fox-john
Copy link
Copy Markdown

@fox-john fox-john commented Mar 12, 2026

Questions Answers
Description? Add Employee resource
Type? new feature
BC breaks? no
Deprecations? no
Sponsor company PrestaShop

@ps-jarvis
Copy link
Copy Markdown

Hello @fox-john!

This is your first pull request on ps_apiresources repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Mar 12, 2026
CQRSQueryMapping: self::QUERY_MAPPING,
CQRSCommandMapping: self::COMMAND_MAPPING,
),
new CQRSPartialUpdate(
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.

The handler doesn't handle partial update so you shoud use a CQRSUpdate here instead
It uses the PUT word indicating you must provide the whole JSON, not partial fields

operations: [
new PaginatedList(
uriTemplate: '/employees',
provider: QueryListProvider::class,
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.

No need this is the default value with PaginatedList

Comment thread src/ApiPlatform/Resources/Employee/EmployeeList.php
@ps-jarvis ps-jarvis moved this from Ready for review to Waiting for author in PR Dashboard Mar 12, 2026
{
$itemsCount = $this->countItems('/employees', ['employee_read']);

$employee = $this->requestApi('POST', '/employees', null, ['employee_write'], Response::HTTP_CREATED);
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.

Please use createItem (same for other tests, prefer the explicit help for the appropaite action)

@nicosomb
Copy link
Copy Markdown
Contributor

nicosomb commented May 7, 2026

@fox-john CI is red, could you have a look please?

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

Projects

Status: Waiting for author

Development

Successfully merging this pull request may close these issues.

5 participants