Skip to content

Commit ed83622

Browse files
authored
feat(chore): provision to get tenant wise logs (#102)
Provision to get tenant wise logs BREAKING CHANGE: Provision to get tenant wise logs 101
1 parent b52b4d1 commit ed83622

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/__tests__/acceptance/fixtures/models/audit.model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ export class TestAuditLog extends Entity {
5454
})
5555
actor: string;
5656

57+
@property({
58+
name: 'tenant_id',
59+
type: 'string',
60+
required: true,
61+
})
62+
tenantId: string;
63+
5764
@property({
5865
type: 'object',
5966
})

src/mixins/audit.mixin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export function AuditRepositoryMixin<
5959
entityId: entity.getId(),
6060
actedOn: this.entityClass.modelName,
6161
actionKey: opts.actionKey,
62+
tenantId: user.tenantId,
6263
...extras,
6364
});
6465
}

src/models/audit-log.model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ export class AuditLog extends Entity {
6262
})
6363
actor: string;
6464

65+
@property({
66+
name: 'tenant_id',
67+
type: 'string',
68+
required: true,
69+
})
70+
tenantId: string;
71+
6572
@property({
6673
type: 'object',
6774
})

0 commit comments

Comments
 (0)