Closed mgupta83 closed 1 week ago
This pull request implements an audit functionality for the violation ticket domain model, specifically for the ActivityDetail
class. It adds an @Audit
decorator to the setActivityBy
method and updates the implementation to use an AuditContextFactory
for setting the activityBy
property. The changes aim to improve the tracking of who performed specific activities in the violation ticket system.
Change | Details | Files |
---|---|---|
Implement audit functionality for ActivityDetail |
|
data-access/src/app/domain/contexts/cases/violation-ticket/v1/activity-detail.ts |
Update ActivityDetailDomainAdapter to use AuditContextFactory |
|
data-access/src/infrastructure-services-impl/datastore/mongodb/infrastructure/cases/violation-ticket/v1/violation-ticket.domain-adapter.ts |
sequenceDiagram
participant Client
participant ActivityDetail
participant AuditContextFactory
participant ActivityDetailProps
Client->>ActivityDetail: setActivityBy(AuditContextFactory)
activate ActivityDetail
ActivityDetail->>AuditContextFactory: getMemberRef()
activate AuditContextFactory
AuditContextFactory-->>ActivityDetail: memberRef
deactivate AuditContextFactory
ActivityDetail->>ActivityDetailProps: setActivityByRef(memberRef)
deactivate ActivityDetail
Related to #301
Add
Audit
decorator to setactivityBy
in the activity log of the violation-ticket domain model.data-access/src/app/domain/contexts/cases/violation-ticket/v1/activity-detail.ts
@Audit
decorator tosetActivityBy
method.setActivityBy
method to acceptAuditContextFactoryType
as an argument.AuditContextFactoryType
to setactivityBy
insetActivityBy
method.data-access/src/infrastructure-services-impl/datastore/mongodb/infrastructure/cases/violation-ticket/v1/violation-ticket.domain-adapter.ts
AuditContextFactory
fromdata-access/src/app/init/audit-context
.ActivityDetailDomainAdapter
class to useAuditContextFactory
to setactivityBy
insetActivityByRef
method.For more details, open the Copilot Workspace session.
Summary by Sourcery
Fix the violation ticket audit by adding an
Audit
decorator and updating methods to useAuditContextFactory
for settingactivityBy
in the activity log.Bug Fixes:
Audit
decorator to ensureactivityBy
is correctly set in the activity log.Enhancements:
setActivityBy
method to acceptAuditContextFactoryType
as an argument for improved context handling.