完善店务员工工时与订单记录
This commit is contained in:
+1
-1
@@ -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}")
|
||||
|
||||
+4
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user