Coflyr · Backend model field catalog

AuditLogEntry

Audit.AuditLogEntries.

26 mapped fields · 3 proposed fields7 field groupsGenerated 2026-10-06
Model class
coflyr.models.common.AuditLogEntry
Source
Features/Shared/Audit/Models/AuditLogEntry.cs
Table
Audit.AuditLogEntries
Review
Implemented in backend and database. EntityType and EntryKind remain for history; PreviousEntryId remains under review. AuditText, RecordStatus, ApprovalStatus, IsUpdated, ValidFrom and ValidUpTo are implemented. BusinessStatus, DocumentStatus, ReceivingDate and ReleaseState were removed again on 2026-10-07. The EntityAuditState table, projection model and CurrentAuditStates view are removed; current records are queried directly from AuditLogEntries.

This page records the original 26-field review and the implemented decisions. Removed rows remain visible for traceability; the current AuditLogEntry model has 22 mapped scalar fields. Current audit records are queried directly from AuditLogEntries.

← All model classes · AMOS Workpackage example

Identity and naming

2 fields
#FieldEF typeStorageBusiness purposeReview
1IdGuidRequiredStable identifier for this record.Keep
2SequenceNumberintRequiredRecords sequence number for this audit log entry.Keep

Relationships and references

6 fields
#FieldEF typeStorageBusiness purposeReview
1CorrelationIdstringNullableStores the HTTP request trace identifier that produced this audit entry. Entries written during one request can share this value for investigation; it is not a foreign key to a correlation record.Keep
2EntityIdGuidRequiredIdentifies the record this audit entry describes. Use it with EntityType to retrieve that record’s audit history; it is not a foreign key to one fixed table. For example, all audit entries for a work order share that work order’s EntityId.Keep
3PreviousEntryIdGuid?NullablePoints to the preceding field-change audit entry for the same entity, creating an explicit change-entry chain. The writer already finds that preceding change using EntityType, EntityId, EntryKind and descending SequenceNumber. Whether the stored pointer adds enough value to keep it is under review; UpdateId separately links formal business-record revisions.Under review
4RecordedByUserIdGuid?NullableSelects the related recorded by user record.Reviewed
5SentToDepartmentIdGuid?NullableSelects the related sent to department record.Reviewed
6SentToUserIdGuid?NullableSelects the related sent to user record.Reviewed

Status and controls

4 mapped · 1 proposed
#FieldEF typeStorageBusiness purposeReview
1RecordStatus (rename from BusinessStatus)Status? enum
Current EF: string
None
Active
Inactive
Deleted
Updated
NullableCaptures the record status at the time of this audit entry. Proposed stored names: None, Active, Inactive, Deleted, Updated. Use Inactive for both retired records and temporary holds; Suspended is merged into Inactive in this proposal. Use Deleted for a withdrawn record. Archived is proposed for removal from the shared RecordStatus choices; existing Archived and Suspended values need a reviewed mapping to Inactive before any migration. Null means this entry does not carry a business status. The database now stores the enum name as a string.Applied: string-backed enum · Applied
2ApprovalStatus (rename from DocumentStatus)ApprovalStatus?
Current enum
Created
Approved
Modified
Validated
Released
Rejected
ReturnForCorrection
Forwarded
NullableCaptures the approval workflow status at the time of this audit entry. Enum values are listed under EF type; Deactivated has been removed.
Source: shared/audit/viewmodels/AuditViewModel.java, approvalStatuses; the FE currently labels this dropdown “Approval Status”. Rename the current DocumentStatus field to ApprovalStatus in the proposed model. Reconcile this with the existing RelatedAuditStatus field before backend work so approval state is not duplicated. Backend and database now use ApprovalStatus as a string-backed enum.
Applied: enum · Applied
3HashstringNullableFor a field-change entry, stores the hexadecimal SHA-256 digest of SnapshotJson followed by ChangeSetJson. It can be recomputed to detect whether that stored payload changed. It is null on entries without a field-change payload. The current code writes the hash but does not verify it on read; this is not a digital signature or a hash chain. Recommendation: remove this field unless a complete verification and trusted anchoring design is introduced.Dropped · Applied
4PreApprovedboolRequiredIndicates whether pre approved applies to this audit log entry.Keep
5IsUpdatedboolRequired; default NoFlag indicating that this audit entry records an update to an existing record. Review whether it is needed separately: EntryKind = Change already identifies field-change entries, while RecordStatus = Updated is a proposed status value. The audit writer sets it for update actions and field-change entries.Added · Applied

Dates and timing

2 mapped · 2 proposed
#FieldEF typeStorageBusiness purposeReview
1EffectiveDateDateTime?NullableRecords the effective date for this audit log entry.Keep
2ReceivingDateDateTime?NullableSnapshots the business record’s receiving date at this audit event, when that date applies. For example, a received maintenance document may carry the date it was received. It is separate from RecordedAt, which timestamps when the audit entry was written. The generic audit model does not enforce what “received” means for each entity type. Reviewed decision: remove this generic audit field; retain receiving dates only in the business records that need them.Drop · Applied
3ValidFromDateTime?NullableSnapshot of the start of the audited record’s validity period at this event. The current audit state already has ValidFrom; this would preserve its value in the append-only history.Added · Applied
4ValidUpToDateTime?NullableSnapshot of the end of the audited record’s validity period at this event. The current audit state calls this value ValidTo; the writer maps the business record’s ValidTo into this field.Added · Applied

Descriptions and details

2 fields
#FieldEF typeStorageBusiness purposeReview
1ChangeReasonstringNullableMerge any existing reason text into the common AuditText field when migrating historical entries. A separate reason column is not proposed.Drop; merge into AuditText · Applied
2AuditText (rename from EntryText)stringRequiredOne common human-readable text field for audit, change, and remark entries. It can describe what happened and include the reason where supplied; EntryKind and structured change fields still identify the event type and exact field differences.Keep; rename to AuditText · Applied

Audit and revision

1 fields
#FieldEF typeStorageBusiness purposeReview
1RelatedAuditStatusAuditEventStatus? enum
Current EF: integer
NullableSnapshots the audited record’s approval/audit workflow status at the time this entry is written. Coflyr copies it from AuditableEntity.AuditStatus for audit actions and from the remark’s AuditStatus for remark entries. Example: an approval event stores Approved. Reviewed decision: remove this duplicate field. Migrate any status history needed into the proposed ApprovalStatus field before dropping the column.Drop · Applied

Other fields

9 fields
#FieldEF typeStorageBusiness purposeReview
1ChangeSetJsonstringNullableRecords change set json for this audit log entry.Keep
2EntityTypestringRequiredIdentifies which mapped entity table owns the audited record, using the schema.table name. Together with EntityId it identifies the record whose history this is.Keep
3EntryKindintRequiredClassifies what kind of history row this is: Audit (1), Change (2), Remark (3), or Revision (4). For example, a field edit uses Change; a user note uses Remark. It distinguishes audit, change, remark, and revision entries.Keep
4RecordedAtDateTimeRequiredRecords the recorded at for this audit log entry.Keep
5RecordedBystringNullableRecords recorded by for this audit log entry.Keep
6ReleaseStateint?NullableCurrently snapshots the audited record’s release state. Reviewed decision: remove this audit-log field; preserve any required release history through the remaining audit design before migration.Drop · Applied
7SnapshotJsonstringNullableRecords snapshot json for this audit log entry.Keep
8SourceApnint?NullableRecords source apn for this audit log entry.Keep
9SourceFormCodestringNullableRecords source form code for this audit log entry.Keep