refactor(backend): update reimbursement and related services
- endpoints/reimbursements.py: update reimbursement API endpoint - schemas/reimbursement.py: update reimbursement data schemas - services/expense_claims.py: update expense claims service - services/ontology.py: update ontology service - services/user_agent.py: update user agent service
This commit is contained in:
@@ -169,6 +169,19 @@ EXPENSE_TYPE_KEYWORDS = {
|
||||
"招待费": "entertainment",
|
||||
"招待": "entertainment",
|
||||
"宴请": "entertainment",
|
||||
"办公费": "office",
|
||||
"办公用品": "office",
|
||||
"文具": "office",
|
||||
"耗材": "office",
|
||||
"办公耗材": "office",
|
||||
"打印纸": "office",
|
||||
"办公设备": "office",
|
||||
"培训费": "training",
|
||||
"培训": "training",
|
||||
"通讯费": "communication",
|
||||
"话费": "communication",
|
||||
"福利费": "welfare",
|
||||
"团建": "welfare",
|
||||
}
|
||||
|
||||
EXPENSE_NARRATIVE_KEYWORDS = (
|
||||
@@ -1117,6 +1130,21 @@ class SemanticOntologyService:
|
||||
):
|
||||
upsert(self._make_entity("expense_type", "餐费", "meal", role="filter", confidence=0.84))
|
||||
|
||||
if any(
|
||||
keyword in query
|
||||
for keyword in ("办公用品", "文具", "耗材", "办公耗材", "打印纸", "办公设备", "键盘", "鼠标", "白板")
|
||||
):
|
||||
upsert(self._make_entity("expense_type", "办公费", "office", role="filter", confidence=0.87))
|
||||
|
||||
if any(keyword in query for keyword in ("培训", "讲师费", "课时费", "课程费")):
|
||||
upsert(self._make_entity("expense_type", "培训费", "training", role="filter", confidence=0.84))
|
||||
|
||||
if any(keyword in query for keyword in ("通讯费", "话费", "流量费", "宽带费")):
|
||||
upsert(self._make_entity("expense_type", "通讯费", "communication", role="filter", confidence=0.84))
|
||||
|
||||
if any(keyword in query for keyword in ("福利费", "团建", "慰问", "节日福利", "体检费")):
|
||||
upsert(self._make_entity("expense_type", "福利费", "welfare", role="filter", confidence=0.84))
|
||||
|
||||
for amount in self._extract_amount_entities(query):
|
||||
upsert(amount)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user