feat(versioning) : add entity versioning with numbered versions and restore
Backend: - Migration: version column on audit_logs and machines - AuditLog, Machine, Composant, Piece, Product: version + skipAudit properties - AbstractAuditSubscriber: auto-increment version, skip on restore, fix decimal diff - Enriched snapshots with slots, custom fields and version number - AuditLogRepository: findVersionHistory, findByVersion - EntityVersionService: list, preview, restore with skeleton/integrity checks - EntityVersionController: REST endpoints for all 4 entity types - 11 tests covering list, preview, restore, auth Frontend: update submodule pointer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -133,6 +133,8 @@ class Piece
|
||||
#[Groups(['piece:read'])]
|
||||
private int $version = 1;
|
||||
|
||||
private bool $skipAudit = false;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, name: 'createdAt')]
|
||||
#[Groups(['piece:read'])]
|
||||
private DateTimeImmutable $createdAt;
|
||||
@@ -354,4 +356,16 @@ class Piece
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSkipAudit(): bool
|
||||
{
|
||||
return $this->skipAudit;
|
||||
}
|
||||
|
||||
public function setSkipAudit(bool $skipAudit): static
|
||||
{
|
||||
$this->skipAudit = $skipAudit;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user