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:
1 parent
8f80f52c04
commit
bb39e6b805
6 files changed
+11
-11
No files matched your search
+2
-2
@@ -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
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user