Merge remote-tracking branch 'origin/main' into feat/source-state

This commit is contained in:
민헌 committed 2026-08-07 14:36:41 +09:00
commit 67612b477c
63 files changed
+2162 -491

No files matched your search

+22
View File
@@ -55,6 +55,10 @@ class IQuotationCRUD(ABC):
async def get_company_settings(self, cdb: AsyncSession, user_id) -> dict:
pass
@abstractmethod
async def get_company_brand(self, cdb: AsyncSession, user_id) -> Tuple[str, dict]:
pass
@abstractmethod
async def add_rows(self, cdb: AsyncSession, obj_list: list) -> ErrorType:
pass
@@ -408,6 +412,24 @@ class QuotationCRUD(IQuotationCRUD):
LOG.e_no_callstack(ex)
return {}
async def get_company_brand(self, cdb: AsyncSession, user_id):
# 이 유저가 속한 회사의 (이름, settings). 초청 메일 헤더 기본값이 회사명이라 이름까지 같이 읽는다.
try:
query = (
select(companies.name, companies.settings)
.select_from(users)
.join(companies, companies.company_id == users.company_id)
.where(users.user_id == user_id, companies.deleted == False) # noqa: E712
.limit(1)
)
err, rows = await DB_SESSION_MNG.execute(cdb, query)
if err != ErrorType.SUCCESS or not rows:
return "", {}
return rows[0][0] or "", rows[0][1] or {}
except Exception as ex:
LOG.e_no_callstack(ex)
return "", {}
async def get_item_companies(self, cdb: AsyncSession, item_ids) -> Tuple[ErrorType, dict]:
"""item_id -> company_id(소유 회사) 매핑. 앵커링 칸(회사×유형×가격구간) 해석 입력."""
try: