feat: company-scoped emails and audit log, company on admin password emails
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
b7d9da8ec0
commit
00ce47bc49
13 files changed
+435
-25
No files matched your search
+3
-3
@@ -46,7 +46,7 @@ class AdminAuditLogControllerTest {
|
||||
|
||||
@Test
|
||||
void list_passesEveryParam() throws Exception {
|
||||
when(audit.search("boss", "LEADS", "UPDATE", "SUCCESS", "2026-11-01", "2026-11-30", 1, 5))
|
||||
when(audit.search("boss", "LEADS", "UPDATE", "SUCCESS", "2026-11-01", "2026-11-30", 1, 5, null))
|
||||
.thenReturn(Map.of("content", List.of(Map.of("id", 7))));
|
||||
mvc.perform(get("/api/admin/audit-log").param("actor", "boss").param("module", "LEADS").param("action", "UPDATE")
|
||||
.param("outcome", "SUCCESS").param("from", "2026-11-01").param("to", "2026-11-30")
|
||||
@@ -56,9 +56,9 @@ class AdminAuditLogControllerTest {
|
||||
|
||||
@Test
|
||||
void list_defaultsToFirstPageOfTwenty() throws Exception {
|
||||
when(audit.search(null, null, null, null, null, null, 0, 20)).thenReturn(Map.of());
|
||||
when(audit.search(null, null, null, null, null, null, 0, 20, null)).thenReturn(Map.of());
|
||||
mvc.perform(get("/api/admin/audit-log")).andExpect(status().isOk());
|
||||
verify(audit).search(null, null, null, null, null, null, 0, 20);
|
||||
verify(audit).search(null, null, null, null, null, null, 0, 20, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ class AdminEmailControllerTest {
|
||||
|
||||
@Test
|
||||
void list_passesFiltersAndPaging() throws Exception {
|
||||
when(emails.list("sales1", "Reset", "2026-11-01", "2026-11-30", 1, 5))
|
||||
when(emails.list("sales1", "Reset", "2026-11-01", "2026-11-30", 1, 5, null))
|
||||
.thenReturn(Map.of("content", List.of(Map.of("id", 7)), "totalElements", 6));
|
||||
mvc.perform(get("/api/admin/emails").param("recipient", "sales1").param("subject", "Reset")
|
||||
.param("from", "2026-11-01").param("to", "2026-11-30").param("page", "1").param("size", "5"))
|
||||
@@ -51,9 +51,9 @@ class AdminEmailControllerTest {
|
||||
|
||||
@Test
|
||||
void list_defaultsToFirstPageOfTwenty() throws Exception {
|
||||
when(emails.list(null, null, null, null, 0, 20)).thenReturn(Map.of("content", List.of()));
|
||||
when(emails.list(null, null, null, null, 0, 20, null)).thenReturn(Map.of("content", List.of()));
|
||||
mvc.perform(get("/api/admin/emails")).andExpect(status().isOk());
|
||||
verify(emails).list(null, null, null, null, 0, 20);
|
||||
verify(emails).list(null, null, null, null, 0, 20, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user