[feat] negodata: 협력사 총매출액(total_revenue) 추가 + 우선선정(priority) 제거
Helped-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
3176ec4262
commit
1ac42ddc9c
24 files changed
+61
-124
No files matched your search
@@ -14,7 +14,7 @@ from common.utils.gtime import GTime
|
||||
# 협력사 CRUD. 모든 조회/변경은 company_id 로 스코프된다(멀티테넌트).
|
||||
class ISupplierCRUD(ABC):
|
||||
@abstractmethod
|
||||
async def search(self, cdb: AsyncSession, company_id, search, priority, skip, limit) -> Tuple[ErrorType, list, int]:
|
||||
async def search(self, cdb: AsyncSession, company_id, search, skip, limit) -> Tuple[ErrorType, list, int]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
@@ -44,7 +44,7 @@ class ISupplierCRUD(ABC):
|
||||
|
||||
class SupplierCRUD(ISupplierCRUD):
|
||||
async def search(
|
||||
self, cdb: AsyncSession, company_id, search: Optional[str], priority: Optional[str], skip: int, limit: int
|
||||
self, cdb: AsyncSession, company_id, search: Optional[str], skip: int, limit: int
|
||||
) -> Tuple[ErrorType, list, int]:
|
||||
try:
|
||||
conditions = [suppliers.deleted == False, suppliers.company_id == company_id] # noqa: E712
|
||||
@@ -56,8 +56,6 @@ class SupplierCRUD(ISupplierCRUD):
|
||||
suppliers.manager_name.ilike(f"%{search}%"),
|
||||
)
|
||||
)
|
||||
if priority:
|
||||
conditions.append(suppliers.priority == priority)
|
||||
where = and_(*conditions)
|
||||
|
||||
cnt_err, cnt_rows = await DB_SESSION_MNG.execute(cdb, select(func.count()).select_from(suppliers).where(where))
|
||||
|
||||
Reference in new issue
Block a user