fix: resolve audit report gaps across bulk imports, auth, scoping, and exports
This commit is contained in:
@@ -84,6 +84,8 @@ def list_warranties(
|
||||
department_id: Optional[int] = None,
|
||||
asset_id: Optional[int] = None,
|
||||
status_filter: Optional[CoverageStatusFilter] = Query(None, alias="status"),
|
||||
expiry_from: Optional[date] = None,
|
||||
expiry_to: Optional[date] = None,
|
||||
page: int = Query(1, ge=1),
|
||||
page_size: int = Query(200, ge=1, le=500),
|
||||
db: Session = Depends(get_db),
|
||||
@@ -108,6 +110,10 @@ def list_warranties(
|
||||
|
||||
if asset_id is not None:
|
||||
query = query.filter(Warranty.asset_id == asset_id)
|
||||
if expiry_from is not None:
|
||||
query = query.filter(Warranty.end_date >= expiry_from)
|
||||
if expiry_to is not None:
|
||||
query = query.filter(Warranty.end_date <= expiry_to)
|
||||
if q and q.strip():
|
||||
like = f"%{q.strip()}%"
|
||||
query = query.filter(
|
||||
|
||||
Reference in New Issue
Block a user