feat(cleaner): record all material operations in database, including successful deletions
Previously only skipped and failed materials were persisted. Now every material (deleted, uncertain, skipped, failed) is recorded in CleanerMaterialDetail for full audit traceability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -433,9 +433,22 @@ export class CleanerApplicationService {
|
||||
detail.errors.length > 0 ? detail.errors.join('\n') : undefined
|
||||
)
|
||||
|
||||
// Insert material details for skipped and failed materials
|
||||
// Insert material details for all materials
|
||||
const materialDetails: InsertMaterialDetailInput[] = []
|
||||
|
||||
for (const deleted of detail.deletedMaterials) {
|
||||
materialDetails.push({
|
||||
orderNumber: detail.orderNumber,
|
||||
materialCode: deleted.materialCode,
|
||||
materialName: deleted.materialName,
|
||||
rowNumber: deleted.rowNumber,
|
||||
result: deleted.outcome,
|
||||
reason: null,
|
||||
attemptCount: 1,
|
||||
finalErrorCategory: null
|
||||
})
|
||||
}
|
||||
|
||||
for (const skipped of detail.skippedMaterials) {
|
||||
materialDetails.push({
|
||||
orderNumber: detail.orderNumber,
|
||||
|
||||
Reference in New Issue
Block a user