feat(shop-role): 实现店铺角色继承功能和权限检查优化
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m39s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m39s
- 新增店铺角色管理 API 和数据模型 - 实现角色继承和权限检查逻辑 - 添加流程测试框架和集成测试 - 更新权限服务和账号管理逻辑 - 添加数据库迁移脚本 - 归档 OpenSpec 变更文档 Ultraworked with Sisyphus
This commit is contained in:
@@ -69,7 +69,7 @@ func TestAccountService_Create_SuperAdminSuccess(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -111,7 +111,7 @@ func TestAccountService_Create_PlatformUserCreatePlatformAccount(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -150,7 +150,7 @@ func TestAccountService_Create_PlatformUserCreateAgentAccount(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -192,7 +192,7 @@ func TestAccountService_Create_AgentCreateSubordinateShopAccount(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
agentShopID := uint(10)
|
||||
subordinateShopID := uint(11)
|
||||
@@ -238,7 +238,7 @@ func TestAccountService_Create_AgentCreateOtherShopAccountForbidden(t *testing.T
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
agentShopID := uint(10)
|
||||
otherShopID := uint(99)
|
||||
@@ -281,7 +281,7 @@ func TestAccountService_Create_AgentCreatePlatformAccountForbidden(t *testing.T)
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -318,7 +318,7 @@ func TestAccountService_Create_EnterpriseUserForbidden(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -355,7 +355,7 @@ func TestAccountService_Create_UsernameDuplicate(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -404,7 +404,7 @@ func TestAccountService_Create_PhoneDuplicate(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -453,7 +453,7 @@ func TestAccountService_Create_Unauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -488,7 +488,7 @@ func TestAccountService_Update_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -534,7 +534,7 @@ func TestAccountService_Update_NotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -565,7 +565,7 @@ func TestAccountService_Update_AgentUnauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -619,7 +619,7 @@ func TestAccountService_Update_UsernameDuplicate(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -676,7 +676,7 @@ func TestAccountService_Update_PhoneDuplicate(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -735,7 +735,7 @@ func TestAccountService_Delete_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -778,7 +778,7 @@ func TestAccountService_Delete_NotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -804,7 +804,7 @@ func TestAccountService_Delete_AgentUnauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -855,7 +855,7 @@ func TestAccountService_AssignRoles_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -906,7 +906,7 @@ func TestAccountService_AssignRoles_SuperAdminForbidden(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -947,7 +947,7 @@ func TestAccountService_AssignRoles_RoleTypeMismatch(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -997,7 +997,7 @@ func TestAccountService_AssignRoles_EmptyArrayClearsRoles(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1049,7 +1049,7 @@ func TestAccountService_RemoveRole_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1104,7 +1104,7 @@ func TestAccountService_RemoveRole_AccountNotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1132,7 +1132,7 @@ func TestAccountService_GetRoles_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1183,7 +1183,7 @@ func TestAccountService_GetRoles_EmptyArray(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1224,7 +1224,7 @@ func TestAccountService_List_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1269,7 +1269,7 @@ func TestAccountService_List_FilterByUsername(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1318,7 +1318,7 @@ func TestAccountService_ValidatePassword_Correct(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1357,7 +1357,7 @@ func TestAccountService_ValidatePassword_Incorrect(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1398,7 +1398,7 @@ func TestAccountService_UpdatePassword_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1449,7 +1449,7 @@ func TestAccountService_UpdateStatus_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1494,7 +1494,7 @@ func TestAccountService_Get_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1534,7 +1534,7 @@ func TestAccountService_Get_NotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1560,7 +1560,7 @@ func TestAccountService_UpdatePassword_AccountNotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1586,7 +1586,7 @@ func TestAccountService_UpdateStatus_AccountNotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1612,7 +1612,7 @@ func TestAccountService_UpdatePassword_Unauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -1635,7 +1635,7 @@ func TestAccountService_UpdateStatus_Unauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -1658,7 +1658,7 @@ func TestAccountService_Delete_Unauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -1681,7 +1681,7 @@ func TestAccountService_AssignRoles_Unauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -1704,7 +1704,7 @@ func TestAccountService_RemoveRole_Unauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -1727,7 +1727,7 @@ func TestAccountService_Update_Unauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -1755,7 +1755,7 @@ func TestAccountService_AssignRoles_NotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1781,7 +1781,7 @@ func TestAccountService_GetRoles_NotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1807,7 +1807,7 @@ func TestAccountService_List_FilterByUserType(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1854,7 +1854,7 @@ func TestAccountService_List_FilterByStatus(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1901,7 +1901,7 @@ func TestAccountService_List_FilterByPhone(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1947,7 +1947,7 @@ func TestAccountService_Update_UpdatePassword(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -1993,7 +1993,7 @@ func TestAccountService_Update_UpdateStatus(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2037,7 +2037,7 @@ func TestAccountService_Update_UpdatePhone(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2081,7 +2081,7 @@ func TestAccountService_AssignRoles_AgentUnauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2130,7 +2130,7 @@ func TestAccountService_Create_EnterpriseAccountSuccess(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2173,7 +2173,7 @@ func TestAccountService_Create_AgentMissingShopID(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2209,7 +2209,7 @@ func TestAccountService_Create_EnterpriseMissingEnterpriseID(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2245,7 +2245,7 @@ func TestAccountService_RemoveRole_AgentUnauthorized(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2294,7 +2294,7 @@ func TestAccountService_AssignRoles_MultipleRoles(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2353,7 +2353,7 @@ func TestAccountService_Update_AllFields(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2409,7 +2409,7 @@ func TestAccountService_ListPlatformAccounts_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2454,7 +2454,7 @@ func TestAccountService_CreateSystemAccount_Success(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -2486,7 +2486,7 @@ func TestAccountService_CreateSystemAccount_MissingUsername(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -2517,7 +2517,7 @@ func TestAccountService_CreateSystemAccount_MissingPhone(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -2548,7 +2548,7 @@ func TestAccountService_CreateSystemAccount_MissingPassword(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -2579,7 +2579,7 @@ func TestAccountService_CreateSystemAccount_UsernameDuplicate(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -2625,7 +2625,7 @@ func TestAccountService_CreateSystemAccount_PhoneDuplicate(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -2671,7 +2671,7 @@ func TestAccountService_ListPlatformAccounts_FilterByUsername(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2717,7 +2717,7 @@ func TestAccountService_ListPlatformAccounts_FilterByPhone(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2763,7 +2763,7 @@ func TestAccountService_ListPlatformAccounts_FilterByStatus(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2810,7 +2810,7 @@ func TestAccountService_Create_PlatformUserCreateEnterpriseAccount(t *testing.T)
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2852,7 +2852,7 @@ func TestAccountService_List_DefaultPagination(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2882,7 +2882,7 @@ func TestAccountService_ListPlatformAccounts_DefaultPagination(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2912,7 +2912,7 @@ func TestAccountService_AssignRoles_RoleNotFound(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2953,7 +2953,7 @@ func TestAccountService_Update_SameUsername(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -2996,7 +2996,7 @@ func TestAccountService_Update_SamePhone(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3039,7 +3039,7 @@ func TestAccountService_AssignRoles_DuplicateRoles(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3086,7 +3086,7 @@ func TestAccountService_Create_PlatformUserCreateAgentWithShop(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3129,7 +3129,7 @@ func TestAccountService_AssignRoles_CustomerAccountType(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3179,7 +3179,7 @@ func TestAccountService_Delete_AgentAccountWithShop(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3231,7 +3231,7 @@ func TestAccountService_Update_AgentAccountWithShop(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3286,7 +3286,7 @@ func TestAccountService_AssignRoles_AgentAccountWithShop(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3344,7 +3344,7 @@ func TestAccountService_RemoveRole_AgentAccountWithShop(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3408,7 +3408,7 @@ func TestAccountService_Create_EnterpriseAccountWithShop(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
ctx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3454,7 +3454,7 @@ func TestAccountService_Delete_PlatformAccountByAgent(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3501,7 +3501,7 @@ func TestAccountService_Update_PlatformAccountByAgent(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3553,7 +3553,7 @@ func TestAccountService_AssignRoles_PlatformAccountByAgent(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
@@ -3600,7 +3600,7 @@ func TestAccountService_RemoveRole_PlatformAccountByAgent(t *testing.T) {
|
||||
mockShop := new(MockShopStore)
|
||||
mockEnterprise := new(MockEnterpriseStore)
|
||||
|
||||
svc := New(accountStore, roleStore, accountRoleStore, mockShop, mockEnterprise, mockAudit)
|
||||
svc := New(accountStore, roleStore, accountRoleStore, nil, mockShop, mockEnterprise, mockAudit)
|
||||
|
||||
superAdminCtx := middleware.SetUserContext(context.Background(), &middleware.UserContextInfo{
|
||||
UserID: 1,
|
||||
|
||||
Reference in New Issue
Block a user