[feat] negodata: 회원관리 / 최고관리자(OWNER)
- OWNER 권한 신설, 최고관리자가 자기 회사 소속 직원(USER) 계정 생성·수정·삭제 관리 - 회사 사용자 API(/v1/company/user/*), 회원관리 페이지·폼 - 로그인/프로필 흐름 정비, 무인증 계정생성(/auth/create) 제거 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7da1925365
commit
a40257ddc1
45 files changed
+1928
-150
No files matched your search
@@ -0,0 +1,58 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import ConfigDict
|
||||
|
||||
from common.enums import UserRole, UserStatus
|
||||
from common.models.gmodel import Res_PageProtocol, Res_WebPacketProtocol, WebPacketProtocol
|
||||
|
||||
|
||||
# 최고관리자가 자기 회사 유저를 관리하는 도메인. company_id 는 토큰값으로 강제된다.
|
||||
class CompanyUserProtocol(WebPacketProtocol):
|
||||
pass
|
||||
|
||||
|
||||
class Req_CreateCompanyUser(CompanyUserProtocol):
|
||||
# role 은 받지 않는다 — 최고관리자가 만드는 계정은 항상 일반(USER) 로 서버에서 고정.
|
||||
id: str = ""
|
||||
password: str = ""
|
||||
name: str = ""
|
||||
email: str = ""
|
||||
contact_number: str = ""
|
||||
|
||||
|
||||
class Req_UpdateCompanyUser(CompanyUserProtocol):
|
||||
name: Optional[str] = None
|
||||
email: Optional[str] = None
|
||||
contact_number: Optional[str] = None
|
||||
status: Optional[UserStatus] = None # 활성/비활성 전환
|
||||
password: Optional[str] = None # 비밀번호 초기화(옵션)
|
||||
|
||||
|
||||
class CompanyUserData(WebPacketProtocol):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
user_id: uuid.UUID
|
||||
company_id: uuid.UUID
|
||||
id: str
|
||||
name: Optional[str] = None
|
||||
email: Optional[str] = None
|
||||
contact_number: Optional[str] = None
|
||||
status: UserStatus
|
||||
role: UserRole
|
||||
last_accessed_at: Optional[datetime] = None
|
||||
created_at: Optional[datetime] = None
|
||||
updated_at: Optional[datetime] = None
|
||||
|
||||
|
||||
class Res_CompanyUser(Res_WebPacketProtocol):
|
||||
user: Optional[CompanyUserData] = None
|
||||
|
||||
|
||||
class Res_CompanyUserList(Res_PageProtocol):
|
||||
users: list[CompanyUserData] = []
|
||||
|
||||
|
||||
class Res_DeleteCompanyUser(Res_WebPacketProtocol):
|
||||
pass
|
||||
Reference in new issue
Block a user