feat: per-position camera settings, material alias dialog, product delete, media browser links
- Per-render-position focal_length_mm/sensor_width_mm (DB → pipeline → Blender)
- FOV-based camera distance with min clamp fix for wide-angle lenses
- Unmapped materials blocking dialog on "Dispatch Renders" with batch alias creation
- Material check endpoint (GET /orders/{id}/check-materials)
- Batch alias endpoint (POST /materials/batch-aliases)
- Quick-map "No alias" badges on Materials page
- Full product hard-delete with storage cleanup (MinIO + disk files + orphaned CadFile)
- Delete button on ProductDetail page with confirmation
- Clickable product names in Media Browser (links to product page)
- Single-line render dispatch/retry (POST /orders/{id}/lines/{id}/dispatch-render)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -174,6 +174,62 @@ async def seed_aliases(
|
||||
return {"inserted": inserted, "total": total}
|
||||
|
||||
|
||||
class BatchAliasMapping(BaseModel):
|
||||
alias: str
|
||||
material_id: uuid.UUID
|
||||
|
||||
|
||||
class BatchAliasCreate(BaseModel):
|
||||
mappings: list[BatchAliasMapping]
|
||||
|
||||
|
||||
@router.post("/batch-aliases")
|
||||
async def batch_create_aliases(
|
||||
body: BatchAliasCreate,
|
||||
user: User = Depends(require_admin_or_pm),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
"""Create multiple material aliases in one request.
|
||||
|
||||
Skips aliases that already exist (case-insensitive). Validates that
|
||||
each material_id exists.
|
||||
"""
|
||||
created = 0
|
||||
skipped = 0
|
||||
|
||||
for mapping in body.mappings:
|
||||
alias_str = mapping.alias.strip()
|
||||
if not alias_str:
|
||||
skipped += 1
|
||||
continue
|
||||
|
||||
# Verify material exists
|
||||
mat_result = await db.execute(
|
||||
select(Material).where(Material.id == mapping.material_id)
|
||||
)
|
||||
if not mat_result.scalar_one_or_none():
|
||||
raise HTTPException(
|
||||
status.HTTP_404_NOT_FOUND,
|
||||
detail=f"Material {mapping.material_id} not found",
|
||||
)
|
||||
|
||||
# Check if alias already exists (case-insensitive)
|
||||
existing = await db.execute(
|
||||
select(MaterialAlias).where(
|
||||
func.lower(MaterialAlias.alias) == alias_str.lower()
|
||||
)
|
||||
)
|
||||
if existing.scalar_one_or_none():
|
||||
skipped += 1
|
||||
continue
|
||||
|
||||
db.add(MaterialAlias(material_id=mapping.material_id, alias=alias_str))
|
||||
created += 1
|
||||
|
||||
await db.commit()
|
||||
return {"created": created, "skipped": skipped}
|
||||
|
||||
|
||||
@router.delete("/aliases/{alias_id}", status_code=status.HTTP_204_NO_CONTENT)
|
||||
async def delete_alias(
|
||||
alias_id: uuid.UUID,
|
||||
|
||||
Reference in New Issue
Block a user