From b57969e3113260d5e435de1fe5dfbfdcfde31d03 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:27:31 +0300 Subject: [PATCH 01/23] feat: add active column to club table --- .../resources/db/migration/V2_4__Add_active_to_club_table.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/main/resources/db/migration/V2_4__Add_active_to_club_table.sql diff --git a/src/main/resources/db/migration/V2_4__Add_active_to_club_table.sql b/src/main/resources/db/migration/V2_4__Add_active_to_club_table.sql new file mode 100644 index 0000000..53a4f80 --- /dev/null +++ b/src/main/resources/db/migration/V2_4__Add_active_to_club_table.sql @@ -0,0 +1,2 @@ +alter table club + add column active boolean not null default true; From f5e76a21231b3120e3462134160d220156176a69 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:33:49 +0300 Subject: [PATCH 02/23] feat: add active field to JClub entity --- .../java/school/hei/klioba/repository/jpa/model/JClub.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/school/hei/klioba/repository/jpa/model/JClub.java b/src/main/java/school/hei/klioba/repository/jpa/model/JClub.java index 4b46cd0..2b83aa1 100644 --- a/src/main/java/school/hei/klioba/repository/jpa/model/JClub.java +++ b/src/main/java/school/hei/klioba/repository/jpa/model/JClub.java @@ -1,5 +1,6 @@ package school.hei.klioba.repository.jpa.model; +import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.ManyToMany; @@ -23,6 +24,9 @@ public class JClub { private String name; + @Column(nullable = false) + private boolean active; + @ManyToMany(mappedBy = "clubs") private List users = new ArrayList<>(); } From 408b58a6bcecb8122557f9d20d76669049345c39 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:33:52 +0300 Subject: [PATCH 03/23] feat: add active field to Club domain model --- src/main/java/school/hei/klioba/model/Club.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/school/hei/klioba/model/Club.java b/src/main/java/school/hei/klioba/model/Club.java index d2b1965..dbfca1f 100644 --- a/src/main/java/school/hei/klioba/model/Club.java +++ b/src/main/java/school/hei/klioba/model/Club.java @@ -10,4 +10,5 @@ public final class Club { private final String id; private final String name; + private final boolean active; } From 39722f5ba3e70c18e63088f782227d849b9dba89 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:33:56 +0300 Subject: [PATCH 04/23] feat: map active field in JClubMapper --- .../java/school/hei/klioba/repository/mapper/JClubMapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/school/hei/klioba/repository/mapper/JClubMapper.java b/src/main/java/school/hei/klioba/repository/mapper/JClubMapper.java index 18a3f32..f724e9a 100644 --- a/src/main/java/school/hei/klioba/repository/mapper/JClubMapper.java +++ b/src/main/java/school/hei/klioba/repository/mapper/JClubMapper.java @@ -8,13 +8,14 @@ public class JClubMapper { public Club toDomain(JClub jClub) { - return new Club(jClub.getId(), jClub.getName()); + return new Club(jClub.getId(), jClub.getName(), jClub.isActive()); } public JClub toEntity(Club club) { JClub jClub = new JClub(); jClub.setId(club.getId()); jClub.setName(club.getName()); + jClub.setActive(club.isActive()); return jClub; } } From af08691aa31b3bc851d4dcd39bd2fe6e5238ebcb Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:33:59 +0300 Subject: [PATCH 05/23] feat: add active field to ClubStats record --- src/main/java/school/hei/klioba/service/ClubService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/school/hei/klioba/service/ClubService.java b/src/main/java/school/hei/klioba/service/ClubService.java index 8e0aa30..3c07bff 100644 --- a/src/main/java/school/hei/klioba/service/ClubService.java +++ b/src/main/java/school/hei/klioba/service/ClubService.java @@ -18,7 +18,7 @@ public class ClubService { private final EventService eventService; public record ClubStats( - String id, String name, int totalCotisations, int members, int remainingFund) {} + String id, String name, int totalCotisations, int members, int remainingFund, boolean active) {} public List getAllClubStats() { return clubRepository.findAll().stream().map(this::computeStats).toList(); @@ -46,6 +46,7 @@ private ClubStats computeStats(Club club) { club.getName(), totalCotisations, Math.toIntExact(members), - totalCotisations - expenses); + totalCotisations - expenses, + club.isActive()); } } From 01abe89b0e2a7d9a9b1ba1c50883ff45ba033a14 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:34:02 +0300 Subject: [PATCH 06/23] test: update Club constructor calls with active parameter --- .../java/school/hei/klioba/model/ClubTest.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/java/school/hei/klioba/model/ClubTest.java b/src/test/java/school/hei/klioba/model/ClubTest.java index 30dcb4d..3821063 100644 --- a/src/test/java/school/hei/klioba/model/ClubTest.java +++ b/src/test/java/school/hei/klioba/model/ClubTest.java @@ -8,16 +8,17 @@ class ClubTest { @Test void club_creation_succeeds() { - var club = new Club("cuisine", "Club Cuisine"); + var club = new Club("cuisine", "Club Cuisine", true); assertNotNull(club); assertEquals("cuisine", club.getId()); assertEquals("Club Cuisine", club.getName()); + assertTrue(club.isActive()); } @Test void club_with_different_id_and_name() { - var club = new Club("sport", "Club Sport"); + var club = new Club("sport", "Club Sport", true); assertEquals("sport", club.getId()); assertEquals("Club Sport", club.getName()); @@ -25,7 +26,7 @@ void club_with_different_id_and_name() { @Test void club_toString_contains_id_and_name() { - var club = new Club("cuisine", "Club Cuisine"); + var club = new Club("cuisine", "Club Cuisine", true); var str = club.toString(); assertNotNull(str); @@ -35,7 +36,7 @@ void club_toString_contains_id_and_name() { @Test void club_with_null_id() { - var club = new Club(null, "Club Null"); + var club = new Club(null, "Club Null", true); assertNotNull(club); assertNull(club.getId()); @@ -44,7 +45,7 @@ void club_with_null_id() { @Test void club_with_null_name() { - var club = new Club("null-name", null); + var club = new Club("null-name", null, true); assertNotNull(club); assertEquals("null-name", club.getId()); @@ -53,15 +54,15 @@ void club_with_null_name() { @Test void club_with_empty_id() { - var club = new Club("", "Club Empty"); + var club = new Club("", "Club Empty", true); assertEquals("", club.getId()); } @Test void club_two_instances_with_same_values_are_distinct_objects() { - var club1 = new Club("cuisine", "Club Cuisine"); - var club2 = new Club("cuisine", "Club Cuisine"); + var club1 = new Club("cuisine", "Club Cuisine", true); + var club2 = new Club("cuisine", "Club Cuisine", true); assertNotSame(club1, club2); assertEquals("cuisine", club1.getId()); From b7078bfbe86352909c33ae26f0489225dd66eb39 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:34:05 +0300 Subject: [PATCH 07/23] test: update ClubService tests with active parameter in Club constructor --- src/test/java/school/hei/klioba/service/ClubServiceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/school/hei/klioba/service/ClubServiceTest.java b/src/test/java/school/hei/klioba/service/ClubServiceTest.java index 923216d..31eea37 100644 --- a/src/test/java/school/hei/klioba/service/ClubServiceTest.java +++ b/src/test/java/school/hei/klioba/service/ClubServiceTest.java @@ -23,8 +23,8 @@ class ClubServiceTest { EventService eventService = mock(EventService.class); ClubService clubService = new ClubService(clubRepository, eventService); - Club club = new Club("c1", "Club 1"); - Club club2 = new Club("c2", "Club 2"); + Club club = new Club("c1", "Club 1", true); + Club club2 = new Club("c2", "Club 2", true); User user1 = new User("u1", "John", "Doe", "john@email.com"); User user2 = new User("u2", "Jane", "Smith", "jane@email.com"); From 3394c04243f832c4f0a1e2d201f99a5234a1ab57 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:34:08 +0300 Subject: [PATCH 08/23] feat: add active status indicator to club card --- src/main/resources/templates/fragments/club-card.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/fragments/club-card.html b/src/main/resources/templates/fragments/club-card.html index cee0c06..2af104b 100644 --- a/src/main/resources/templates/fragments/club-card.html +++ b/src/main/resources/templates/fragments/club-card.html @@ -1,11 +1,14 @@ -
+
groups

Club Name

-
+
+ 12 membres
From 09e28e7f1b6988a6dcf9d1baca62385cab3bb4f4 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:34:11 +0300 Subject: [PATCH 09/23] feat: add active filter dropdown to dashboard --- src/main/resources/templates/dashboard.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/dashboard.html b/src/main/resources/templates/dashboard.html index 611bc8d..ab85a23 100644 --- a/src/main/resources/templates/dashboard.html +++ b/src/main/resources/templates/dashboard.html @@ -45,9 +45,15 @@

Membres inscrits

Clubs

-
- search - +
+ +
+ search + +
From 0f6092cfa58789b610e8f2a3c293d143604d4df8 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:34:14 +0300 Subject: [PATCH 10/23] feat: add active filter logic to dashboard JS --- src/main/resources/static/script/dashboard.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/script/dashboard.js b/src/main/resources/static/script/dashboard.js index f7ce3ee..a77e783 100644 --- a/src/main/resources/static/script/dashboard.js +++ b/src/main/resources/static/script/dashboard.js @@ -4,6 +4,7 @@ document.addEventListener("DOMContentLoaded", function() { const nextBtn = document.getElementById('page-next'); const pageInfo = document.getElementById('page-info'); const searchInput = document.getElementById('club-search'); + const activeFilter = document.getElementById('active-filter'); const noResults = document.getElementById('no-search-results'); if (!cards.length || !prevBtn || !nextBtn || !pageInfo) return; @@ -43,10 +44,14 @@ document.addEventListener("DOMContentLoaded", function() { function filterCards() { const query = searchInput ? searchInput.value.toLowerCase().trim() : ''; + const showActive = activeFilter ? activeFilter.value : 'true'; cards.forEach(c => { const nameEl = c.querySelector('h3'); const name = (nameEl ? nameEl.textContent : '').toLowerCase(); - c.classList.toggle('search-hidden', query.length > 0 && !name.includes(query)); + const matchesSearch = query.length === 0 || name.includes(query); + const isActive = c.dataset.active === 'true'; + const matchesActive = isActive === (showActive === 'true'); + c.classList.toggle('search-hidden', !matchesSearch || !matchesActive); }); currentPage = 0; showPage(0); @@ -56,6 +61,10 @@ document.addEventListener("DOMContentLoaded", function() { searchInput.addEventListener('input', filterCards); } + if (activeFilter) { + activeFilter.addEventListener('change', filterCards); + } + prevBtn.addEventListener('click', () => { if (currentPage > 0) showPage(currentPage - 1); }); nextBtn.addEventListener('click', () => { if (currentPage < totalPages() - 1) showPage(currentPage + 1); }); From b96316c52f840cd89e2532de74049f71042214af Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:38:08 +0300 Subject: [PATCH 11/23] refactor: replace status dot with top-right Inactif label in club card --- src/main/resources/templates/fragments/club-card.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/fragments/club-card.html b/src/main/resources/templates/fragments/club-card.html index 2af104b..ac66ad2 100644 --- a/src/main/resources/templates/fragments/club-card.html +++ b/src/main/resources/templates/fragments/club-card.html @@ -1,14 +1,16 @@
+
+ Inactif +
groups

Club Name

-
- +
12 membres
From fa1c3b9a9b5b5a9912918dcc8d57d0f130397911 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:38:11 +0300 Subject: [PATCH 12/23] fix: style select dropdown with custom chevron to fix arrow alignment --- src/main/resources/templates/dashboard.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/resources/templates/dashboard.html b/src/main/resources/templates/dashboard.html index ab85a23..8d21346 100644 --- a/src/main/resources/templates/dashboard.html +++ b/src/main/resources/templates/dashboard.html @@ -46,10 +46,13 @@

Membres inscrits

Clubs

- +
+ + unfold_more +
search From 4f1fac436e01ca5698e3bef7ce52427607e78e1a Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:39:47 +0300 Subject: [PATCH 13/23] fix: match history icon height with payer cotisation button --- src/main/resources/templates/fragments/club-card.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/fragments/club-card.html b/src/main/resources/templates/fragments/club-card.html index ac66ad2..934c259 100644 --- a/src/main/resources/templates/fragments/club-card.html +++ b/src/main/resources/templates/fragments/club-card.html @@ -45,7 +45,7 @@

+ class="flex items-center justify-center border border-gray-200 hover:bg-gray-50 text-gray-600 rounded-lg transition-colors px-2.5 sm:px-3 py-2.5 sm:py-3"> history

From 5d9c6a6626180117ef413d76a2274c06153716d2 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:40:27 +0300 Subject: [PATCH 14/23] refactor: make Inactif label more visible and less flush to edge --- src/main/resources/templates/fragments/club-card.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/fragments/club-card.html b/src/main/resources/templates/fragments/club-card.html index 934c259..be7c3df 100644 --- a/src/main/resources/templates/fragments/club-card.html +++ b/src/main/resources/templates/fragments/club-card.html @@ -1,8 +1,8 @@
-
+
Inactif + class="text-xs text-gray-400 font-medium">Inactif
From 74c4f2294ac2738b694651280a83fa9fa2615865 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:41:33 +0300 Subject: [PATCH 15/23] refactor: reduce Inactif label font weight from medium to normal --- src/main/resources/templates/fragments/club-card.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/fragments/club-card.html b/src/main/resources/templates/fragments/club-card.html index be7c3df..65a8ae6 100644 --- a/src/main/resources/templates/fragments/club-card.html +++ b/src/main/resources/templates/fragments/club-card.html @@ -2,7 +2,7 @@ th:attr="data-active=${club.active}">
Inactif + class="text-xs text-gray-400 font-normal">Inactif
From c286f798f3c2f498edd05df6178271fb0af5edb1 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:42:56 +0300 Subject: [PATCH 16/23] refactor: make Inactif label a subtle badge --- src/main/resources/templates/fragments/club-card.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/fragments/club-card.html b/src/main/resources/templates/fragments/club-card.html index 65a8ae6..e54d6da 100644 --- a/src/main/resources/templates/fragments/club-card.html +++ b/src/main/resources/templates/fragments/club-card.html @@ -2,7 +2,7 @@ th:attr="data-active=${club.active}">
Inactif + class="text-[10px] text-gray-300 bg-gray-50 px-1.5 py-0.5 rounded">Inactif
From 1b96804d0b79a6d22fc46709ff746dbf4481656e Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:44:12 +0300 Subject: [PATCH 17/23] style: darken inactif badge for less sublte look --- src/main/resources/templates/fragments/club-card.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/fragments/club-card.html b/src/main/resources/templates/fragments/club-card.html index e54d6da..831ddea 100644 --- a/src/main/resources/templates/fragments/club-card.html +++ b/src/main/resources/templates/fragments/club-card.html @@ -2,7 +2,7 @@ th:attr="data-active=${club.active}">
Inactif + class="text-[10px] text-gray-400 bg-gray-50 px-1.5 py-0.5 rounded">Inactif
From f19bebe10f8a2df4fa756521f5b98e1c8bc850bf Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:54:04 +0300 Subject: [PATCH 18/23] chore: format --- src/main/java/school/hei/klioba/service/ClubService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/school/hei/klioba/service/ClubService.java b/src/main/java/school/hei/klioba/service/ClubService.java index 3c07bff..4cd3274 100644 --- a/src/main/java/school/hei/klioba/service/ClubService.java +++ b/src/main/java/school/hei/klioba/service/ClubService.java @@ -18,7 +18,12 @@ public class ClubService { private final EventService eventService; public record ClubStats( - String id, String name, int totalCotisations, int members, int remainingFund, boolean active) {} + String id, + String name, + int totalCotisations, + int members, + int remainingFund, + boolean active) {} public List getAllClubStats() { return clubRepository.findAll().stream().map(this::computeStats).toList(); From 1799d53e9c12869ee8471cab0e591d7f970a068b Mon Sep 17 00:00:00 2001 From: colombefioren Date: Tue, 23 Jun 2026 15:59:29 +0300 Subject: [PATCH 19/23] refactor: put inactif instead of non actif for inactive club dropdown --- src/main/resources/templates/dashboard.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/templates/dashboard.html b/src/main/resources/templates/dashboard.html index 8d21346..728290f 100644 --- a/src/main/resources/templates/dashboard.html +++ b/src/main/resources/templates/dashboard.html @@ -49,7 +49,7 @@

Clubs

unfold_more
From 7cd1f4feb997c7e6d1f3475c33db2e179ba3f852 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Wed, 24 Jun 2026 17:37:39 +0300 Subject: [PATCH 20/23] feat: add scope param to Psp interface --- src/main/java/school/hei/klioba/model/psp/Psp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/school/hei/klioba/model/psp/Psp.java b/src/main/java/school/hei/klioba/model/psp/Psp.java index d6e33af..54f73dd 100644 --- a/src/main/java/school/hei/klioba/model/psp/Psp.java +++ b/src/main/java/school/hei/klioba/model/psp/Psp.java @@ -3,7 +3,7 @@ import school.hei.klioba.model.Payment; public interface Psp { - Payment create(String kliobaId, PspType pspType, String pspId, String email); + Payment create(String kliobaId, PspType pspType, String pspId, String email, String scope); Payment get(String kliobaId, PspType pspType, String pspId, String email); } From 4c735330c9d053e7015d2184bf8c7ae1cba0ddf2 Mon Sep 17 00:00:00 2001 From: colombefioren Date: Wed, 24 Jun 2026 17:37:55 +0300 Subject: [PATCH 21/23] feat: pass scope in VolaPsp.create --- src/main/java/school/hei/klioba/model/psp/vola/VolaPsp.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/school/hei/klioba/model/psp/vola/VolaPsp.java b/src/main/java/school/hei/klioba/model/psp/vola/VolaPsp.java index 87ba484..ff234ab 100644 --- a/src/main/java/school/hei/klioba/model/psp/vola/VolaPsp.java +++ b/src/main/java/school/hei/klioba/model/psp/vola/VolaPsp.java @@ -18,8 +18,9 @@ public class VolaPsp implements Psp { private final VolaClient volaClient; @Override - public Payment create(String kliobaId, PspType pspType, String pspId, String email) { - var volaPayment = volaClient.create(pspType, pspId, email); + public Payment create( + String kliobaId, PspType pspType, String pspId, String email, String scope) { + var volaPayment = volaClient.create(pspType, pspId, email, scope); return toPayment(kliobaId, volaPayment); } From 8d28241ba5c29b765b1fe996cff9ad28705f1a5d Mon Sep 17 00:00:00 2001 From: colombefioren Date: Wed, 24 Jun 2026 17:38:36 +0300 Subject: [PATCH 22/23] feat: add scope param to VolaClient and PaymentControllerApi --- .../hei/klioba/model/psp/vola/api/VolaClient.java | 4 ++-- .../vola/api/gen/client/api/PaymentControllerApi.java | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/school/hei/klioba/model/psp/vola/api/VolaClient.java b/src/main/java/school/hei/klioba/model/psp/vola/api/VolaClient.java index f76b43a..022d468 100644 --- a/src/main/java/school/hei/klioba/model/psp/vola/api/VolaClient.java +++ b/src/main/java/school/hei/klioba/model/psp/vola/api/VolaClient.java @@ -16,8 +16,8 @@ public VolaClient(String baseUrl, String apiKey) { this.paymentControllerApi = new PaymentControllerApi(apiClient); } - public Payment create(PspType pspType, String pspId, String email) { - return paymentControllerApi.createPayment(apiKey, email, pspType.toString(), pspId); + public Payment create(PspType pspType, String pspId, String email, String scope) { + return paymentControllerApi.createPayment(apiKey, email, pspType.toString(), pspId, scope); } public Payment get(PspType pspType, String pspId, String email) { diff --git a/src/main/java/school/hei/klioba/model/psp/vola/api/gen/client/api/PaymentControllerApi.java b/src/main/java/school/hei/klioba/model/psp/vola/api/gen/client/api/PaymentControllerApi.java index 9b6428d..516672b 100644 --- a/src/main/java/school/hei/klioba/model/psp/vola/api/gen/client/api/PaymentControllerApi.java +++ b/src/main/java/school/hei/klioba/model/psp/vola/api/gen/client/api/PaymentControllerApi.java @@ -49,9 +49,9 @@ public void setApiClient(ApiClient apiClient) { * @throws RestClientException if an error occurs while attempting to invoke the API */ public Payment createPayment( - String apiKey, String payerEmail, String pspType, String pspPaymentId) + String apiKey, String payerEmail, String pspType, String pspPaymentId, String scope) throws RestClientException { - return createPaymentWithHttpInfo(apiKey, payerEmail, pspType, pspPaymentId).getBody(); + return createPaymentWithHttpInfo(apiKey, payerEmail, pspType, pspPaymentId, scope).getBody(); } /** @@ -61,11 +61,12 @@ public Payment createPayment( * @param payerEmail (required) * @param pspType (required) * @param pspPaymentId (required) + * @param scope (optional) * @return ResponseEntity<Payment> * @throws RestClientException if an error occurs while attempting to invoke the API */ public ResponseEntity createPaymentWithHttpInfo( - String apiKey, String payerEmail, String pspType, String pspPaymentId) + String apiKey, String payerEmail, String pspType, String pspPaymentId, String scope) throws RestClientException { Object postBody = null; // verify the required parameter 'apiKey' is set @@ -101,6 +102,9 @@ public ResponseEntity createPaymentWithHttpInfo( queryParams.putAll(apiClient.parameterToMultiValueMap(null, "payerEmail", payerEmail)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "pspType", pspType)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "pspPaymentId", pspPaymentId)); + if (scope != null) { + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "scope", scope)); + } final String[] accepts = {"*/*"}; final List accept = apiClient.selectHeaderAccept(accepts); From d587503efe7d5f37a97901441b176311cbd911ce Mon Sep 17 00:00:00 2001 From: colombefioren Date: Wed, 24 Jun 2026 17:40:44 +0300 Subject: [PATCH 23/23] feat: pass club name as scope when creating payment --- .../service/MembershipFeeCreationFormConsumer.java | 14 +++++++++----- .../school/hei/klioba/service/EventServiceIT.java | 2 +- .../MembershipFeeCreationFormConsumerIT.java | 6 +++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/main/java/school/hei/klioba/service/MembershipFeeCreationFormConsumer.java b/src/main/java/school/hei/klioba/service/MembershipFeeCreationFormConsumer.java index 48b3a26..f7d1d99 100644 --- a/src/main/java/school/hei/klioba/service/MembershipFeeCreationFormConsumer.java +++ b/src/main/java/school/hei/klioba/service/MembershipFeeCreationFormConsumer.java @@ -39,15 +39,19 @@ public void accept( throw new IllegalArgumentException("pspId format incorrect format"); } - var paymentCreatedInVola = - volaPsp.create( - randomUUID().toString(), pspType(), membershipFeeCreationForm.pspId(), email); - var payment = paymentRepository.save(paymentCreatedInVola); - var user = userFrom(membershipFeeCreationForm, email); var club = clubRepository .findById(clubId) .orElseThrow(() -> new NoSuchElementException("Club not found: " + clubId)); + var paymentCreatedInVola = + volaPsp.create( + randomUUID().toString(), + pspType(), + membershipFeeCreationForm.pspId(), + email, + club.getName()); + var payment = paymentRepository.save(paymentCreatedInVola); + var user = userFrom(membershipFeeCreationForm, email); eventRepository.save(Event.from(randomUUID().toString(), payment, user, club, now(), "")); assignUserToClub(user, clubId); } diff --git a/src/test/java/school/hei/klioba/service/EventServiceIT.java b/src/test/java/school/hei/klioba/service/EventServiceIT.java index 491cc03..ae78f37 100644 --- a/src/test/java/school/hei/klioba/service/EventServiceIT.java +++ b/src/test/java/school/hei/klioba/service/EventServiceIT.java @@ -49,7 +49,7 @@ void create_then_confirm() { var ref1 = generateValidPspId(); var newEmail = randomUUID() + "@cute.dev"; - when(volaClientMock.create(any(), eq(ref1), eq(newEmail))) + when(volaClientMock.create(any(), eq(ref1), eq(newEmail), any())) .thenReturn(VolaTestUtils.aVolaPayment(VERIFYING)); membershipCreationFormConsumer.accept( new MembershipFeeCreationForm("Lou", "Andria", ref1), newEmail, "cuisine"); diff --git a/src/test/java/school/hei/klioba/service/MembershipFeeCreationFormConsumerIT.java b/src/test/java/school/hei/klioba/service/MembershipFeeCreationFormConsumerIT.java index 051b08b..f756197 100644 --- a/src/test/java/school/hei/klioba/service/MembershipFeeCreationFormConsumerIT.java +++ b/src/test/java/school/hei/klioba/service/MembershipFeeCreationFormConsumerIT.java @@ -49,9 +49,9 @@ void payFee_then_read_fees() { var ref2 = generateValidPspId(); var newEmail = randomUUID() + "@cute.dev"; - when(volaClientMock.create(any(), eq(ref1), eq(newEmail))) + when(volaClientMock.create(any(), eq(ref1), eq(newEmail), any())) .thenReturn(VolaTestUtils.aVolaPayment(VerificationStatusEnum.VERIFYING, null, ref1)); - when(volaClientMock.create(any(), eq(ref2), eq(newEmail))) + when(volaClientMock.create(any(), eq(ref2), eq(newEmail), any())) .thenReturn(VolaTestUtils.aVolaPayment(VerificationStatusEnum.VERIFYING, null, ref2)); membershipCreationFormConsumer.accept( @@ -86,7 +86,7 @@ void payFee_then_read_fees() { void fees_cannot_have_same_pspId() { String pspId = generateValidPspId(); - when(volaClientMock.create(any(), any(), any())) + when(volaClientMock.create(any(), any(), any(), any())) .thenReturn(VolaTestUtils.aVolaPayment(VerificationStatusEnum.VERIFYING, null, pspId)); membershipCreationFormConsumer.accept(