fix(pl): 取消承运商审核与资质协议准入门禁
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b071687a71
commit
d92bd7940e
3 files changed
+29
-68
No files matched your search
@@ -34,14 +34,6 @@ def carrier_audit_approved(carrier: PlCarrier) -> bool:
|
||||
|
||||
|
||||
def carrier_eligible_for_transport(carrier: PlCarrier, today: Optional[date] = None) -> bool:
|
||||
if carrier.status != "1":
|
||||
return False
|
||||
if not carrier_audit_approved(carrier):
|
||||
return False
|
||||
if not carrier_qualification_complete(carrier):
|
||||
return False
|
||||
if carrier_agreement_expired(carrier, today):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@@ -50,19 +42,7 @@ def assert_carrier_eligible_for_transport(
|
||||
*,
|
||||
rearrange: bool = False,
|
||||
) -> None:
|
||||
if carrier.status != "1":
|
||||
raise HTTPException(status_code=400, detail="该承运商已终止合作,无法安排运输")
|
||||
if not carrier_audit_approved(carrier):
|
||||
raise HTTPException(status_code=400, detail="该承运商尚未审核通过,无法安排运输")
|
||||
if not carrier_qualification_complete(carrier):
|
||||
raise HTTPException(status_code=400, detail="该承运商资质附件不完整,无法安排运输")
|
||||
if carrier_agreement_expired(carrier):
|
||||
if rearrange:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
detail="该承运商运输协议已过期,请先更新协议后再调整运输",
|
||||
)
|
||||
raise HTTPException(status_code=400, detail="该承运商运输协议已过期,无法安排运输")
|
||||
return
|
||||
|
||||
|
||||
def normalize_carrier_urls(value: Optional[str]) -> Optional[str]:
|
||||
|
||||
Reference in new issue
Block a user