fix: send companyId as a string in backend property filters

The services-system and services-counter property maps are String-valued;
a numeric companyId failed the cast there and the scoped lists came back empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-11-30 20:46:35 +08:00
1 parent 8f80f52c04
commit bb39e6b805
6 files changed
+11 -11

No files matched your search

@@ -172,13 +172,13 @@ class AdminEventLeadServiceCompanyScopeTest {
@Test
void events_staffIgnoresRequestedCompany() {
caller(5L, false);
assertThat(eventsCompany(9L)).isEqualTo(5L);
assertThat(eventsCompany(9L)).isEqualTo("5");
}
@Test
void events_superPassesRequestedOrAll() {
caller(null, true);
assertThat(eventsCompany(7L)).isEqualTo(7L);
assertThat(eventsCompany(7L)).isEqualTo("7");
}
@Test
@@ -126,13 +126,13 @@ class AdminEventServiceCompanyScopeTest {
@Test
void list_staffIgnoresRequestedCompany() {
caller(5L, false);
assertThat(listedCompany(9L)).isEqualTo(5L);
assertThat(listedCompany(9L)).isEqualTo("5");
}
@Test
void list_superPassesRequestedCompany() {
caller(null, true);
assertThat(listedCompany(7L)).isEqualTo(7L);
assertThat(listedCompany(7L)).isEqualTo("7");
}
@Test
@@ -217,7 +217,7 @@ class AdminEventServiceCompanyScopeTest {
service.salespersonOptions(9L);
ArgumentCaptor<Object> body = ArgumentCaptor.forClass(Object.class);
verify(rest).postForEntity(eq(USERS), any(ParameterizedTypeReference.class), body.capture());
assertThat((Map<String, Object>) ((Map<String, Object>) body.getValue()).get("property")).containsEntry("companyId", 5L);
assertThat((Map<String, Object>) ((Map<String, Object>) body.getValue()).get("property")).containsEntry("companyId", "5");
}
@Test
@@ -159,7 +159,7 @@ class AdminUserServiceCompanyScopeTest {
void list_staffAskedForOwnCompanyWhateverWasRequested() {
stubPage(row(1, "ann@ins", 7L));
service.list(null, null, 0, 20, null, null, 9L);
assertThat(sentProperty()).containsEntry("companyId", 7L).containsEntry("type", "A");
assertThat(sentProperty()).containsEntry("companyId", "7").containsEntry("type", "A");
}
@Test
@@ -175,7 +175,7 @@ class AdminUserServiceCompanyScopeTest {
superAdmin();
stubPage(row(1, "ann@ins", 9L));
service.list(null, null, 0, 20, null, null, 9L);
assertThat(sentProperty()).containsEntry("companyId", 9L);
assertThat(sentProperty()).containsEntry("companyId", "9");
}
@Test