Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
86ffce2
Bump symfony/process from 6.3.4 to 6.4.15
dependabot[bot] Nov 25, 2024
5470293
feat(composer): Add no-timeout option to long running script
Dec 3, 2025
61d46aa
feat(TaxRulesGroup): Add partial update on status
Dec 3, 2025
1f1c163
feat(TaxRulesGroup): Add endpoint unit test
Dec 4, 2025
65f966f
Add manufacturer endpoint
MattKelvin Aug 22, 2025
be03d02
add bulk delete
MattKelvin Aug 27, 2025
aac4362
add bulk delete in getProtectedEndpoints
MattKelvin Aug 28, 2025
165766c
add constraints validation
MattKelvin Aug 28, 2025
b5f4a29
cs fixer
MattKelvin Aug 28, 2025
df6e814
add constraint
MattKelvin Aug 29, 2025
0c95883
improve exception and add more case to test
MattKelvin Aug 29, 2025
610868c
cs fixer
MattKelvin Aug 29, 2025
582061c
change constraint to create action only
MattKelvin Aug 29, 2025
40282a2
add removed testRemoveManufacturer test
MattKelvin Aug 29, 2025
cff85a9
fix and clean testBulkRemoveManufacturers test
MattKelvin Aug 29, 2025
d93c5ad
improve syntax
MattKelvin Aug 29, 2025
ef6fe80
change method to static
MattKelvin Sep 24, 2025
c5aa581
add iframe validation
MattKelvin Sep 24, 2025
f8a8e4e
fix mapping
MattKelvin Nov 20, 2025
26019b8
remove manufacturer detail endpoint (currently blocked by core)
MattKelvin Nov 22, 2025
5ef7a32
apply rector rules
MattKelvin Nov 23, 2025
a8fb36d
Add dynamic PHP matrix generation to use less runners on each PR, the…
jolelievre Feb 18, 2026
c239b22
Merge pull request #141 from jolelievre/optimize-ci-matrix
jolelievre Feb 19, 2026
c74a019
Make validTo nullable
nicosomb Feb 24, 2026
1131fcf
Introduce new PHPStan and associated Rector rules to enforce that Api…
jolelievre Feb 27, 2026
a6140e6
Add PHPStan rule to prevent adding normalizers and API Platform provi…
jolelievre Mar 2, 2026
b1d4573
Clean useless normalizers and processors, adapt integration tests and…
jolelievre Mar 3, 2026
37937a9
github: new workflow to add issue to project
ga-devfront Mar 2, 2026
07d7baf
Merge pull request #145 from ga-devfront/github/add-issue-to-project
jolelievre Mar 3, 2026
09cb32b
Merge pull request #144 from jolelievre/add-new-ci-restrictions
jolelievre Mar 4, 2026
fdc382c
Update src/ApiPlatform/Resources/TaxRulesGroup/TaxRulesGroup.php
Kaikina Mar 4, 2026
0e61a0d
Update TaxRulesGroupEndpointTest.php
Kaikina Mar 4, 2026
a946622
Update TaxRulesGroupEndpointTest.php
Kaikina Mar 4, 2026
117ca39
Merge pull request #142 from PrestaShop/change-validto
jolelievre Mar 12, 2026
8acbc15
add get country single /countries/{countryId}
kseghair Mar 12, 2026
f3e301b
Remove zipcodeformat from query mapping
kseghair Mar 12, 2026
dc04698
Add claude skill to generate endpoints
kseghair Mar 12, 2026
e17f0e1
Merge pull request #153 from kseghair/country-get-single
Quetzacoalt91 Mar 12, 2026
216fce3
Add POST /countries endpoint to create a country
mattgoud Mar 12, 2026
cb8f95f
Fix expected validation message for names field in CountryEndpointTest
mattgoud Mar 16, 2026
30ae45c
Add README
kseghair Mar 18, 2026
183fec3
Add Normalizer to avoid touching the core
boherm Mar 11, 2026
81b64ac
Fix search alias endpoints
boherm Mar 11, 2026
09d080d
Fix tests
boherm Mar 11, 2026
7aeac58
Merge pull request #149 from boherm/fix-searchalias-endpoints
jolelievre Mar 20, 2026
83b9023
Update tests/Integration/ApiPlatform/CountryEndpointTest.php
mattgoud Mar 20, 2026
73692a2
feat(api): add country must return id
mattgoud Mar 20, 2026
8b9d73f
Add new function to test admin api bulk command with expected errors
boherm Mar 19, 2026
d566ec0
Fix bulk error status code
boherm Mar 18, 2026
e66d804
Merge pull request #161 from boherm/fix-bulk-error-status-code
boherm Mar 24, 2026
e010ecd
feat(search-engine): Add create endpoint for search-engines
cnavarro-prestashop Mar 12, 2026
e6a5738
search-engine-delete
Mar 12, 2026
ed8c0e3
add tests
Mar 12, 2026
fa3419c
Fix search engines endpoints
boherm Mar 18, 2026
7e310c9
Fix search engines tests
boherm Mar 18, 2026
67ff569
Merge pull request #154 from kseghair/claude-skill-for-endpoint-creation
jolelievre Mar 24, 2026
8b73320
Merge pull request #40 from PrestaShop/dependabot/composer/symfony/pr…
jolelievre Mar 25, 2026
09330a0
Bump phpunit/phpunit from 10.5.38 to 10.5.62
dependabot[bot] Mar 25, 2026
1315964
Bump symfony/process from 6.4.15 to 6.4.33
dependabot[bot] Mar 25, 2026
61931a1
Product category endpoints
Codencode Nov 5, 2025
8e72af2
Add API response for product category
Codencode Nov 13, 2025
29ddef4
Update product category endpoints tests
Codencode Nov 13, 2025
d2048ed
Refactor: Align code with CQRS API guidelines
Codencode Nov 24, 2025
ea6e9c6
Refactor product category write endpoints to remove custom normalizer
Codencode Mar 11, 2026
c0bda2d
Merge pull request #163 from PrestaShop/dependabot/composer/phpunit/p…
jolelievre Mar 25, 2026
a8772f1
Merge pull request #164 from PrestaShop/dependabot/composer/symfony/p…
jolelievre Mar 25, 2026
8de741a
feat: add SearchCartRules Query
MatthieuCutin Mar 30, 2026
5555598
Merge pull request #157 from mattgoud/create-country
mattgoud Mar 31, 2026
20c5182
add du delete des country
AureRita Mar 12, 2026
b98df57
Add test Remove Country
AureRita Mar 12, 2026
c21b285
resolve conflict
AureRita Mar 31, 2026
894f103
change CQRS Delete to use scopes wirte
AureRita Mar 13, 2026
050640b
add a create country on the remove to remove this new country
AureRita Mar 31, 2026
e1ddadb
Remove support for 9.0.x
Progi1984 Apr 7, 2026
61a7f4d
Merge pull request #189 from Progi1984/remove90x
Progi1984 Apr 7, 2026
88675a2
feat: Add Profile API Platform resource with CQRS GET and CREATE oper…
tblivet Mar 12, 2026
68014c8
refactor: remove avatarUrl property from Profile API resource.
tblivet Mar 12, 2026
2c1bbc3
refactor: update profile endpoint tests to use locale keys for names …
tblivet Mar 12, 2026
4723d8e
🐾 add delete endpoint
ingridusta Mar 12, 2026
a026bc1
test: update locale code from en-EN to en-US in profile endpoint test
tblivet Mar 12, 2026
1947bca
test: Add integration test for the profile DELETE endpoint.
tblivet Mar 12, 2026
df81ad1
chore: lint
tblivet Mar 12, 2026
381d876
chore: cs fixer
tblivet Mar 12, 2026
c2aa3d6
feat: add language
tblivet Mar 12, 2026
7cfebc9
chore: fix CI
tblivet Mar 13, 2026
67d6366
Refacto ApiTestCase to automatically setup an additional fr
jolelievre Mar 31, 2026
8e5101a
Merge pull request #152 from tblivet/feat/profile-api
jolelievre Apr 9, 2026
f2e8747
Add AI context and rework on the skill endpoint
boherm Apr 13, 2026
c5724d1
Merge pull request #162 from boherm/search-engine-endpoints
boherm Apr 13, 2026
cfb790c
Fix after comments
boherm Apr 15, 2026
024a657
fix(category): rename parentId to parentCategoryId
alexll Apr 15, 2026
49ca174
Merge pull request #190 from boherm/#188-add-ai-context
jolelievre Apr 15, 2026
52c29ac
now it should be good
AureRita Apr 15, 2026
5fd3fca
CS fixer used
AureRita Apr 15, 2026
5637893
Add Claude AI pre-review workflow and enrich CONTEXT.md
jolelievre Apr 16, 2026
9b75135
change addcountry on remove country to a @depends
AureRita Apr 17, 2026
505e5d2
Add listing endpoint field alignment checks to CONTEXT.md and REVIEW_…
jolelievre Apr 22, 2026
0ac585c
Merge pull request #192 from jolelievre/ai-prereview
jolelievre Apr 22, 2026
2172996
Update the url for the check guard action
jolelievre Apr 22, 2026
1f2b531
Add debug-secrets job and temporarily use fork guard workflow for tes…
jolelievre Apr 22, 2026
690c30d
Use pull_request_target event to access org secrets on fork PRs and r…
jolelievre Apr 22, 2026
1249be9
Merge pull request #194 from jolelievre/use-official-action
jolelievre Apr 22, 2026
d587478
Temporarily use fork guard workflow with debug output for testing
jolelievre Apr 22, 2026
4ffd401
Use official guard workflow from PrestaShop/.github@master
jolelievre Apr 22, 2026
d53d1b4
Add explicit failure when guard check is not fulfilled
jolelievre Apr 22, 2026
75ade61
Remove unnecessary comment
jolelievre Apr 22, 2026
058e9fd
Remove Need AI review label when guard check fails
jolelievre Apr 22, 2026
81b546b
Merge pull request #195 from jolelievre/test-debug-guard-workflow
jolelievre Apr 22, 2026
a2a9896
Fix claude-code-action inputs and update label management
jolelievre Apr 22, 2026
0c08213
Add validation step to detect Claude action internal failures
jolelievre Apr 22, 2026
31a2907
Merge pull request #196 from jolelievre/fix-claude-action-inputs
jolelievre Apr 22, 2026
7f5c03a
Increase max turns, add missing tools, focus prompt on PR diff, and i…
jolelievre Apr 22, 2026
6da46dd
Increase max turns to 25 and improve execution report in summary
jolelievre Apr 22, 2026
e297fe2
Increase max turns to 30
jolelievre Apr 22, 2026
4a46fe2
Merge pull request #197 from jolelievre/improve-claude-review-config
jolelievre Apr 22, 2026
ad49a95
Fix jq parsing: execution file is a JSON array, result is last element
jolelievre Apr 22, 2026
e1884b5
Handle both JSON array and single object formats in execution file
jolelievre Apr 22, 2026
82faa78
Merge pull request #198 from jolelievre/fix-execution-file-parsing
jolelievre Apr 22, 2026
457056e
Simplify workflow to use reusable ai-guarded-review from .github
jolelievre Apr 23, 2026
a6c0d11
Merge pull request #199 from jolelievre/use-guarded-review-workflow
jolelievre Apr 23, 2026
9ca29ed
Add job display names and upgrade actions/checkout to v6
jolelievre Apr 23, 2026
29037df
Merge pull request #200 from jolelievre/improve-workflow-display
jolelievre Apr 23, 2026
498724b
Merge pull request #158 from AureRita/add_delete_country
boherm May 7, 2026
d07ce65
Merge pull request #125 from Kaikina/settaxrulesgroup
boherm May 7, 2026
bebf22c
Merge pull request #191 from alexll/fix/category-parent-category-id
boherm May 7, 2026
bd789b8
Merge pull request #63 from MattKelvin/add-manufacturer-endpoint
nicosomb May 7, 2026
e906dea
Merge pull request #124 from Kaikina/dev
nicosomb May 7, 2026
030aa75
Merge pull request #104 from Codencode/product-category-endpoints
nicosomb May 7, 2026
8ff9e1a
Implement [PATCH] Country
Quetzacoalt91 May 8, 2026
e9d975c
Add projection of coverage after merging PRs from queue
kpodemski May 12, 2026
4dd6e2e
Merge pull request #204 from kpodemski/improvements-to-tracking-table
kpodemski May 12, 2026
13ba6c1
Merge pull request #203 from Quetzacoalt91/country-edit-command
tleon May 18, 2026
1d92974
Document admin_api_multistore feature flag prerequisite
jolelievre May 20, 2026
4ab4382
Document DateTimeImmutable as a second allowed property type
jolelievre May 20, 2026
56a5397
Merge pull request #205 from jolelievre/docs/multi-shop-feature-flag
jolelievre May 20, 2026
057d45b
Merge pull request #187 from MatthieuCutin/dev
tleon May 20, 2026
af9a0f1
Bump 0.7.0
jolelievre May 21, 2026
3cb84ef
Merge pull request #206 from jolelievre/bump-070
jolelievre May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions .claude/REVIEW_PROMPT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
REPO: ${REPO}
PR NUMBER: ${PR_NUMBER}
PR TITLE: ${PR_TITLE}
PR AUTHOR: ${PR_AUTHOR}

You are performing an AI-assisted **pre-review** of a pull request on the `ps_apiresources` module.
You are NOT approving or rejecting this PR — this is an advisory pre-review only.

## Critical: read the repository guidelines first

The file `CONTEXT.md` at the repository root is the **source of truth** for all
conventions, architecture rules, property naming, mapping directions, multi-shop
handling, forbidden practices, testing expectations, and canonical examples.
**You must read `CONTEXT.md` before starting your review.** Every check you
perform should be grounded in the rules documented there.

## How to inspect the PR

**Your review must focus on the code changed in the PR — not the entire codebase.**
Start by fetching the diff and PR metadata:
- `gh pr diff $PR_NUMBER --repo $REPO` — the changed lines are your primary review scope
- `gh pr view $PR_NUMBER --repo $REPO` — PR description and metadata

Only read other files when directly referenced or imported by the changed code.
Focus on PHP and YAML files under `src/ApiPlatform/**`,
`tests/Integration/ApiPlatform/**`, and `config/**`.
Ignore `vendor/`, `*.lock`, binary files, and asset files.

**Do not explore the full repository.** Use `Grep` or `Glob` only to verify
specific conventions or check related code referenced by the diff.

## Additional references

Beyond `CONTEXT.md`, consult these external references when needed:
- Official contribution guide: https://devdocs.prestashop-project.org/9/admin-api/contribute-to-core-api/
- CQRS API guidelines ADR: https://github.com/PrestaShop/ADR/blob/master/0023-cqrs-api-guidelines.md

## Common pitfalls to watch for

These are frequent mistakes that are easy to miss — flag them explicitly:
- `QUERY_MAPPING` keys inverted (using API field name as key instead of QueryResult field name)
- Missing `CQRSQuery` on `CQRSCreate` when the full object must be returned
- Using `Response::HTTP_BAD_REQUEST` (400) instead of `HTTP_UNPROCESSABLE_ENTITY` (422) for constraint violations
- Identifier property named `$id` instead of `${entity}Id`
- Missing `#[ApiProperty(identifier: true)]` on the ID property
- `$isEnabled`, `$isActive`, `$active` instead of `$enabled`
- `$localizedNames` instead of `$names` (with `#[LocalizedValue]`)
- Custom normalizer or processor added in the module (always flag as a **hard blocker**)
- Test asserting only the identifier without checking the rest of the response fields

### Listing endpoints (`PaginatedList` / `CQRSPaginate`)

When the PR adds or modifies a list endpoint, cross-check the DTO against
the data source (see "Field alignment" in `CONTEXT.md`):

- Trace the `gridDataFactory` to its query builder; compare SQL SELECT
fields with DTO properties. Flag missing DTO properties (data the grid
returns but the API silently drops) and orphan DTO properties (no
matching query field → always `null`).
- When a SQL column name differs from the DTO property, verify an
`ApiResourceMapping` entry covers the rename.
- Check `filtersMapping` covers every filterable field whose API name
differs from the grid filter name.
- For `CQRSPaginate`: same checks, but against the CQRS query result DTO
instead of the query builder.

## Output format

Post a **single comment** using `gh pr comment $PR_NUMBER --repo $REPO` with the following
structured format. Use Markdown with `<details>` for the longer sections.
Start the comment body with `<!-- ai-prereview -->` on the very first line.

```markdown
<!-- ai-prereview -->
> 🤖 **Claude AI Pre-Review** — Automated analysis. Does not replace human review.

## 📋 Summary of changes
[2–4 sentences: which endpoint(s) are added/modified, which CQRS entity is exposed]

## ⏱️ Estimated review time
[X–Y minutes — brief justification]

## 🎯 Scope
- **Exposed operations:** GET / POST / PATCH / DELETE / list
- **CQRS entity:** [Command/Query name from the Core]
- **Integration test:** yes / no / partial

<details>
<summary>🧱 API Platform / CQRS architecture compliance</summary>

[Verify against CONTEXT.md rules: URI conventions, operation attributes, property
naming, scope naming, mapping directions, exception handling, validation groups,
multilang handling, multi-shop handling, forbidden practices]

</details>

<details>
<summary>💡 Improvement suggestions</summary>

[Actionable suggestions: naming, null guards, missing fields, etc.]

</details>

## ✅ Pre-review checklist

Check each item against the PR. Mark items as checked when compliant,
leave unchecked when violated or not applicable.
Base every check on the rules from `CONTEXT.md`.

**URI & routing**
- [ ] URI is plural, lowercase, kebab-case
- [ ] Identifier uses domain name + `Id` suffix
- [ ] Sub-resources follow parent path
- [ ] Bulk operation URI uses `bulk-` prefix and plural `Ids` parameter

**Operations & scopes**
- [ ] Correct operation attribute per HTTP method
- [ ] Scope format: `{entity_snake_case}_read` / `_write`, singular form

**API Resource properties**
- [ ] All properties strictly typed, scalars/arrays only (no Value Objects)
- [ ] Naming conventions respected (no `is` prefix, `enabled` not `active`, no `localized` prefix)
- [ ] `#[ApiProperty(identifier: true)]` on ID property
- [ ] `#[LocalizedValue]` on localized fields, `#[DefaultLanguage]` with correct `fieldName`

**CQRS mapping**
- [ ] `QUERY_MAPPING` direction: QueryResult field → API field
- [ ] `CQRSCommandMapping` direction: API field → Command parameter
- [ ] `CQRSQuery` present on `CQRSCreate`/`CQRSPartialUpdate` when full object must be returned
- [ ] No `SerializedName` — mappings only

**Forbidden practices (CI-enforced)**
- [ ] No custom normalizers or processors in the module
- [ ] No Value Objects in properties

**Exception handling & validation**
- [ ] `ConstraintException` → 422, `NotFoundException` → 404
- [ ] Correct `validationContext` groups on Create / Update operations

**Multi-shop**
- [ ] `shopIds` present and mapped if entity is shop-associated, absent otherwise
- [ ] Shop context (`[_context][shopId]`, `[_context][shopConstraint]`) passed when needed

**Listing field alignment** (when PR includes a list endpoint)
- [ ] DTO properties match fields from the grid query builder / CQRS query result
- [ ] `ApiResourceMapping` covers every name mismatch between source fields and DTO
- [ ] `filtersMapping` covers every filter name that differs from the API field name
- [ ] No orphan DTO property (property with no matching source field → always `null`)

**Integration test**
- [ ] Extends `ApiTestCase`, `@depends` chain, asserts all fields
- [ ] `testInvalid*` with `assertValidationErrors`
- [ ] `getProtectedEndpoints()` lists all URIs
- [ ] `DatabaseDump::restoreTables()` covers all affected tables
- [ ] `declare(strict_types=1)` present
```
68 changes: 68 additions & 0 deletions .claude/skills/ps-api-endpoint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# ps-api-endpoint skill

Generates new PrestaShop Admin API endpoints for the `ps_apiresources` module — specifically, an **ApiResource PHP class** and a matching **integration test** — following the module's CQRS patterns and contribution guidelines.

## Trigger

Claude invokes this skill automatically when you express intent to:

- Add a new REST endpoint to the Admin API
- Expose a new entity via the Admin API
- Contribute a new resource to `ps_apiresources`
- Wire up a CQRS command or query to an API endpoint in PrestaShop 9

Example phrases: `"I want to add TaxRule to the API"`, `"create an endpoint for Warehouse"`, `"how do I expose AttributeGroup via the Admin API?"`

## Prerequisites

Have the following ready before invoking:

1. **Entity name** — PascalCase singular (e.g. `TaxRule`, `Warehouse`)
2. **Operations** — which HTTP methods are needed: GET, POST, PATCH, DELETE, list (paginated), bulk operations
3. **PrestaShop core path** — absolute path to a local PS 9.x checkout (e.g. `/home/user/prestashop-90x`), so the skill can discover CQRS classes. You can skip this if you already know the CQRS class names.

## What it generates

| File | Path |
|------|------|
| ApiResource class | `src/ApiPlatform/Resources/{Entity}/{Entity}.php` |
| Integration test | `tests/Integration/ApiPlatform/{Entity}EndpointTest.php` |

The **ApiResource class** contains:
- `#[ApiResource]` attribute with all requested operations (`CQRSGet`, `CQRSCreate`, `CQRSPartialUpdate`, `CQRSDelete`, `PaginatedList`)
- Public properties with strict types and Symfony validation constraints
- `QUERY_MAPPING` — maps CQRS query result fields to API response fields
- `CREATE_COMMAND_MAPPING` / `UPDATE_COMMAND_MAPPING` (or a shared `COMMAND_MAPPING`) — maps API request fields to CQRS command parameters
- OAuth2 scopes (`{entity}_read`, `{entity}_write`) and exception-to-HTTP-status mappings

The **integration test** contains:
- Full CRUD test methods chained via `@depends`
- A `testInvalid*` method covering validation errors
- `getProtectedEndpoints()` verifying all endpoints require authentication
- `setUpBeforeClass`/`tearDownAfterClass` with table restoration via `DatabaseDump`

## Usage example

```
User: I want to add a GET and POST endpoint for TaxRule.
My PS core is at /home/dev/prestashop.

Claude: [invokes ps-api-endpoint skill]
— Asks for confirmation of operations and fields
— Reads /home/dev/prestashop/src/Core/Domain/TaxRule/...
— Generates src/ApiPlatform/Resources/TaxRule/TaxRule.php
— Generates tests/Integration/ApiPlatform/TaxRuleEndpointTest.php
— Reports file locations and how to run the tests
```

## Skill file structure

```
.claude/skills/ps-api-endpoint/
├── README.md # This file — human-facing orientation
├── SKILL.md # Skill logic executed by Claude (step-by-step instructions,
│ # templates for ApiResource class and integration test)
└── references/
└── conventions.md # Naming and structural conventions (URI format, scope naming,
# property rules, mapping patterns, forbidden practices)
```
Loading
Loading