Skip to main content

Audit Logs

The Audit Logging system provides a comprehensive trail of all user actions across the entire application. Every create, update, delete, and status change operation is logged with full details for compliance, troubleshooting, and data recovery.

info

Audit logs are ADMIN-only. Access the audit log at Admin Panel → Audit Log (7th tab).

What Gets Logged

Estimation Modules (6 modules)

All CRUD operations for estimation items:

ModuleActions Logged
ConcreteCREATE, UPDATE, DELETE, DUPLICATE
LaborCREATE, UPDATE, DELETE
EquipmentCREATE, UPDATE, DELETE
MaterialsCREATE, UPDATE, DELETE + pricing overrides
SubcontractorCREATE, UPDATE, DELETE
MiscCREATE, UPDATE, DELETE

Core Modules (3 modules)

Bid, scope, and variable operations:

ModuleActions Logged
BidCREATE, UPDATE, DELETE, STATUS_CHANGE, DUPLICATE, OST_IMPORT, SHARE_CODE_GENERATED, SHARE_CODE_REVOKED, BID_IMPORTED
ScopeCREATE, UPDATE, DELETE, RESTORE
VariablesBulk updates for factors/fees

Admin Modules (6 modules)

Admin panel and configuration changes:

ModuleActions Logged
PricingCREATE, UPDATE, DELETE, BULK_UPDATE, BULK_DELETE
Rebar RatesCREATE, UPDATE, DELETE, BULK_UPDATE, BULK_DELETE
Pump PricingCREATE, UPDATE, DELETE, BULK_UPDATE, BULK_DELETE
Module PermissionsCREATE, UPDATE, RESET
EmployeesCREATE, UPDATE, UPDATE_STATUS, DELETE
UsersCREATE, UPDATE, DELETE, INVITATION_SENT, INVITATION_ACCEPTED
ClientsCREATE, UPDATE, DELETE

Accessing Audit Logs

1
Navigate to Admin Panel

Go to Admin Panel from the main navigation.

2
Open Audit Log Tab

Click the Audit Log tab (7th tab).

3
View Log Entries

The audit log displays in a table with:

  • Timestamp
  • User (who performed the action)
  • Action (CREATE, UPDATE, DELETE, etc.)
  • Entity Type (ConcreteItem, Bid, etc.)
  • Details (summary of changes)
  • Actions (View Details, Restore)

Log Entry Structure

Each audit log entry contains:

FieldDescription
TimestampWhen the action occurred
UserEmail of user who performed action
ActionType of action (CREATE, UPDATE, DELETE, etc.)
Entity TypeWhat was affected (Bid, Scope, ConcreteItem, etc.)
Entity IDUUID of the affected entity
Bid IDLink to parent bid (if applicable)
Scope IDLink to parent scope (if applicable)
DetailsJSON snapshot of changes
Snapshot TypeFULL (complete snapshot) or DELTA (changes only)
IP AddressClient IP address

Snapshot Types

FULL Snapshots

Complete entity state captured for:

ActionPurpose
DELETEEnable restoration
STATUS_CHANGE (critical)Preserve milestone state (SUBMITTED, AWARDED, LOST)

Example FULL snapshot:

{
"id": "uuid-123",
"name": "Foundation Scope",
"totalCost": 45000.00,
"multiplier": 1.0,
"concreteItems": [...],
"laborItems": [...],
// ... complete entity
}

DELTA Snapshots

Only changed fields for routine operations:

ActionPurpose
CREATEBasic info (name, dimensions, cost)
UPDATEChanged fields only

Example DELTA snapshot:

{
"changes": [
{
"field": "name",
"oldValue": "Slab",
"newValue": "Foundation Slab"
},
{
"field": "totalCost",
"oldValue": 12000.00,
"newValue": 15000.00
}
]
}

Filtering Audit Logs

Filter to see actions performed by a specific user:

  1. Click "Show Filters"
  2. Select user from User dropdown
  3. Click Apply

Viewing Log Details

1
Expand Row

Click the arrow icon to expand a log entry for quick preview:

Shows:

  • Entity ID
  • Bid ID
  • Scope ID
  • Snapshot Type
2
View Full Details

Click "Details" button to see complete JSON snapshot in a modal dialog.

Full JSON includes:

  • All changed fields (for DELTA)
  • Complete entity state (for FULL)
  • Related items (for nested deletions)

Restoring Deleted Entities

Deleted scopes can be fully restored with all their items:

1
Find Deletion Log

Filter by:

  • Action: DELETE
  • Entity Type: Scope

Find the scope you want to restore.

2
Click Restore Button

Click the orange "Undo" button next to the deletion log entry.

note

Restore button only appears for DELETE actions with FULL snapshots.

3
Confirm Restoration

Review the restoration details:

  • Scope name
  • Number of items to restore (concrete, labor, equipment, materials, subcontractor, misc)

Click "Restore" to proceed.

4
Verify Restoration

The scope and all its items are restored:

  • Original scope with original ID
  • All estimation items (6 types)
  • Costs recalculated
  • Restoration logged in audit trail
warning

Restoration creates a new log entry documenting the restore action.

Bulk Operations Logging

Bulk operations (bulk update/delete) are logged with special metadata:

Bulk Update Log

{
"bulkUpdate": true,
"itemCount": 15,
"updates": ["basePrice", "taxRate"],
"entityId": "id1,id2,id3,..." // Comma-separated list
}

Bulk Delete Log

{
"bulkDelete": true,
"itemCount": 8,
"deletedItems": [
{ "id": "uuid1", "description": "Dozer 750", "category": "Rental" },
{ "id": "uuid2", "description": "Excavator", "category": "Rental" }
],
"entityId": "uuid1,uuid2,uuid3,..." // Comma-separated list
}

Action Color Coding

The audit log UI uses color-coded badges for quick visual identification:

ActionColorMeaning
CREATEGreenNew item created
UPDATEBlueItem modified
DELETERedItem deleted
STATUS_CHANGEOrangeBid status changed
RESTOREPurpleDeleted item restored

Pagination

Audit logs support pagination for performance:

SettingOptions
Rows per page50, 100, 200
NavigationPrevious, Next, Jump to page
tip

Use filters to narrow down results before paginating through large audit trails.

Audit Statistics

Click "Stats" to view aggregate statistics:

MetricDescription
Total Log EntriesTotal number of audit logs
By ActionBreakdown by CREATE, UPDATE, DELETE, etc.
By Entity TypeActivity per entity type
By UserMost active users
Date RangeActivity over time

API Endpoints

MethodEndpointDescriptionAuth
GET/api/audit/logsList logs with filtersADMIN
GET/api/audit/logs/:idGet single log entryADMIN
GET/api/audit/statsAction/entity/user statisticsADMIN
POST/api/audit/restore/:logIdRestore deleted entityADMIN

Query Parameters

The /api/audit/logs endpoint supports filtering:

ParameterDescriptionExample
userIdFilter by user?userId=uuid-123
bidIdFilter by bid?bidId=uuid-456
scopeIdFilter by scope?scopeId=uuid-789
actionFilter by action?action=DELETE
entityTypeFilter by entity type?entityType=ConcreteItem
startDateStart date?startDate=2025-01-01
endDateEnd date?endDate=2025-01-31
limitResults per page?limit=100
offsetPage offset?offset=50

Storage and Performance

Storage Efficiency
  • DELTA logs: ~100 bytes per entry (routine operations)
  • FULL snapshots: ~5-10 KB per entry (deletions, milestones)
  • Projected: ~75 MB/year for 10 active users
Database Indexes

All key fields are indexed for fast queries:

  • userId (DESC)
  • bidId (DESC)
  • scopeId (DESC)
  • entityType (DESC)
  • action (DESC)
  • timestamp (DESC)

Recent-first queries are optimized.

Data Retention

Audit logs are retained indefinitely for compliance. Future versions may implement archival policies.

Use Cases

Scenario: Annual audit requires proof of who made changes to bids.

Steps:

  1. Filter by date range (audit period)
  2. Filter by entity type: Bid
  3. Export audit log to CSV
  4. Provide to auditors

Best Practices

📅

Regular Review

Periodically review audit logs to ensure system integrity and identify unusual activity.

🔍

Filter Before Exporting

Apply filters before exporting to CSV to reduce file size and focus on relevant data.

📖

Document Restorations

When restoring deleted entities, document the reason in bid notes or project documentation.

📈

Use Stats for Insights

Review audit statistics to understand usage patterns and identify training opportunities.

Troubleshooting

Cannot find specific log entry

Check:

  1. Date range filter (may be excluding the entry)
  2. Entity type filter (ensure correct type selected)
  3. User filter (log may be by different user)
  4. Pagination (entry may be on another page)
Restore button not appearing

Restore button only appears for:

  • DELETE actions
  • FULL snapshot type
  • Scope entities (currently)

Other entity types may not support restoration yet.

Empty details JSON

Some actions (like STATUS_CHANGE between non-critical statuses) may have minimal DELTA snapshots. This is expected behavior.

Excluded from Audit Logs

Certain system-generated actions are excluded to reduce noise:

EntityExclusion
Labor Items"Auto Use" items (auto-managed by system)
System ActionsBackground recalculations, auto-saves

Next Steps