Module: utils/activityLogger

Shared activity logging helper. Records user/system actions so the Activity page shows a complete timeline.

Type convention (dot-separated: <resource>.<action>)

project.create · crawl.start · crawl.complete · crawl.fail · test_run.start · test_run.complete · test_run.fail · test.create · test.generate · test.edit · test.delete · test.approve · test.reject · test.restore · test.bulk_approve · test.bulk_reject · test.bulk_restore · settings.update

Source:

Methods

(static) logActivity(opts) → {Object}

Log an activity entry to the database.

Parameters:
Name Type Description
opts Object
Properties
Name Type Attributes Default Description
type string

Activity type (e.g. "test.approve").

projectId string <optional>

Associated project ID.

projectName string <optional>

Project name for display.

testId string <optional>

Associated test ID.

testName string <optional>

Test name for display.

detail string <optional>

Human-readable description.

status string <optional>
"completed"

Activity status.

userId string <optional>

ID of the user who triggered the action (from req.authUser.sub).

userName string <optional>

Display name of the user (from req.authUser.name or email).

workspaceId string <optional>

Workspace ID for multi-tenancy scoping (ACL-001).

Source:
Returns:

The created activity record.

Type
Object