完善店务员工工时与订单记录

This commit is contained in:
2026-07-24 14:23:13 +08:00
parent 3a543f1d69
commit eff4e73427
20 changed files with 440 additions and 225 deletions
@@ -221,7 +221,7 @@ public class AdminManagerController {
return Result.success(nailArtistInfoService.getAllNailArtists());
}
Long shopId = adminScopeHelper.resolveShopScope(currentUser, null);
return Result.success(nailArtistInfoService.getByShopId(shopId));
return Result.success(nailArtistInfoService.getManageableByShopId(shopId, currentUser.getId()));
}
@GetMapping("/employees/{userId}")
@@ -539,18 +539,20 @@ class AdminManagerControllerTest {
}
@Test
void employeesShouldReturnScopedArtistsForNonPlatformUser() {
void employeesShouldReturnManageableArtistsForNonPlatformUser() {
MockHttpServletRequest request = new MockHttpServletRequest();
UserDO manager = new UserDO();
manager.setId(5L);
List<NailArtistInfoDTO> artists = List.of(new NailArtistInfoDTO());
when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager);
when(adminScopeHelper.isPlatformAdmin(manager)).thenReturn(false);
when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L);
when(nailArtistInfoService.getByShopId(8L)).thenReturn(artists);
when(nailArtistInfoService.getManageableByShopId(8L, 5L)).thenReturn(artists);
Result<List<NailArtistInfoDTO>> result = controller.employees(request);
assertThat(result.getData()).isSameAs(artists);
verify(nailArtistInfoService).getManageableByShopId(8L, 5L);
}
@Test