Skip to content

(feat): add percentage field to Leges#15

Open
SimonvanWijhe wants to merge 2 commits intomasterfrom
feat/percentage
Open

(feat): add percentage field to Leges#15
SimonvanWijhe wants to merge 2 commits intomasterfrom
feat/percentage

Conversation

@SimonvanWijhe
Copy link
Contributor

@SimonvanWijhe SimonvanWijhe commented Mar 13, 2026

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for storing and displaying a “percentage” value on Leges across the metabox, admin list/quick edit, shortcode rendering, and REST output.

Changes:

  • Adds _pdc-lege-percentage to Leges meta and exposes it via REST (percentage) and admin list column.
  • Updates shortcode rendering to output a percentage when set, and updates unit tests accordingly.
  • Extends quick edit to include the percentage field and introduces 4-decimal sanitization in NumberSanitizer.
  • Updates composer.lock with broad dependency upgrades.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Unit/Leges/Shortcode/ShortcodeTest.php Adds unit test coverage for percentage shortcode output.
tests/Unit/Leges/Admin/QuickEdit/QuickEditServiceProviderTest.php Updates quick edit row-actions tests for the new percentage meta attribute.
src/Leges/Traits/NumberSanitizer.php Adds 4-decimal float sanitization via a shared helper.
src/Leges/Shortcode/Shortcode.php Adds percentage meta extraction + early return rendering path.
src/Leges/RestAPI/Repositories/LegesRepository.php Adds percentage field to REST transform output.
src/Leges/PostType/LegesPostTypeServiceProvider.php Adds an admin column to display the percentage.
src/Leges/Metabox/Metabox.php Adds a metabox field for percentage with 4-decimal sanitization.
src/Leges/Admin/QuickEdit/QuickEditServiceProvider.php Adds percentage quick-edit handler + sanitize callback support; refactors field rendering.
composer.lock Large set of dependency upgrades (WordPress, Symfony, WP-CLI, etc.).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@mvdhoek1 mvdhoek1 left a comment

Choose a reason for hiding this comment

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

Moet er niet iets gedaan worden met het percentage? Bijvoorbeeld een procentuele verhoging doorvoeren ieder jaar? Of is het alleen voor display purposes only?

Er is een cron-job die de data checked van de leges waarop deze verhoogd moeten worden. Die vervangt de oude prijs met de nieuwe, vooraf ingestelde, prijs. Zou kunnen dat die nieuwe prijs bepaald moest worden o.b.v. het ingestelde percentage.

},
],
'percentage' => [
'title' => __('Lege percentage (%)', 'pdc-leges'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Ik weet even niet meer wat het doel is van de percentages, wellicht een kleine omschrijving erbij plaatsen?

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