Skip to content

feat: add admin payment dashboard - #49

Closed
Mathieu-bot wants to merge 17 commits into
hei-school:preprodfrom
NickyHariniaina:feat/admin-ui
Closed

feat: add admin payment dashboard#49
Mathieu-bot wants to merge 17 commits into
hei-school:preprodfrom
NickyHariniaina:feat/admin-ui

Conversation

@Mathieu-bot

@Mathieu-bot Mathieu-bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds an admin payment dashboard with authentication, filters, pagination, and CSV export.

  • SessionConfig. Spring Session JDBC needs its own tables but the project uses Flyway for schema management (it comes from the Poja generator). Setting spring.session.jdbc.initialize-schema would bypass Flyway and cause trouble. Instead, a @PostConstruct hook manually runs the session schema script with setContinueOnError(true) so it works cleanly whether the tables already exist or not. It also detects H2 vs PostgreSQL automatically.

  • SecurityConf. Form login backed by ADMIN_EMAIL and ADMIN_PASSWORD environment variables. Sessions are stored in the database through @EnableJdbcHttpSession. CSRF protection is on for admin forms and off for webhook endpoints.

  • PaymentViewController. The dashboard page at /payments. Paginated (15 per page, newest first), filterable by application, scope, and date range. Shows total collected, payment count, and pending count. The CSV export button passes the current filters along.

  • PaymentController fix. Empty or blank scope parameters are now normalized to null so they don't break the CSV export query.

  • Templates. Modular Thymeleaf fragments for the header (with a logout confirmation dialog), the filter form (with scope autocomplete), pagination controls, and stat cards.

image

@Mathieu-bot Mathieu-bot changed the title feat: add admin payment dashboard with Thymeleaf views feat: add admin payment dashboard Jul 27, 2026
SalomiaZK and others added 10 commits July 30, 2026 08:42
* feat: add CSV export endpoint and service methods

* test: add CSV export integration and service tests

* refactor: make applicationName optional in CSV export endpoint

* refactor: replace System.currentTimeMillis() with static import

* refactor: ZoneOffset.UTC as static import

* refactor: improve CSV builder readability with String.format

* refactor: use English instead of French for csv title

* chore: add .env to .gitignore

* test: replace inline CSV assertions with expected-export.csv comparison

* test: replace inline CSV assertions with expected-export.csv comparison

* test: remove unused PaymentRepository import

---------

Co-authored-by: Mathieu-bot <mathieu-bot@users.noreply.github.com>

* test: simplify CSV test to single data row

* feat(security): require apiKey on GET /payments/export/csv, remove applicationName param

* feat: add AdminAuthorizer, applicationName param for CSV export

* fix: validate admin API key via env var instead of DB

* style: inline format string in String.format

* style: format code

---------

Co-authored-by: Tafita Mathieu <199898191+Mathieu-bot@users.noreply.github.com>
Co-authored-by: Mathieu-bot <mathieu-bot@users.noreply.github.com>
@Mathieu-bot
Mathieu-bot marked this pull request as ready for review July 30, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants