Skip to content

Commit

Permalink
feat(chore): provision to get tenant wise logs (#102)
Browse files Browse the repository at this point in the history
Provision to get tenant wise logs

BREAKING CHANGE:
Provision to get tenant wise logs

101
  • Loading branch information
Tyagi-Sunny authored Feb 7, 2024
1 parent b52b4d1 commit ed83622
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/__tests__/acceptance/fixtures/models/audit.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ export class TestAuditLog extends Entity {
})
actor: string;

@property({
name: 'tenant_id',
type: 'string',
required: true,
})
tenantId: string;

@property({
type: 'object',
})
Expand Down
1 change: 1 addition & 0 deletions src/mixins/audit.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function AuditRepositoryMixin<
entityId: entity.getId(),
actedOn: this.entityClass.modelName,
actionKey: opts.actionKey,
tenantId: user.tenantId,
...extras,
});
}
Expand Down
7 changes: 7 additions & 0 deletions src/models/audit-log.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ export class AuditLog extends Entity {
})
actor: string;

@property({
name: 'tenant_id',
type: 'string',
required: true,
})
tenantId: string;

@property({
type: 'object',
})
Expand Down

0 comments on commit ed83622

Please sign in to comment.