2024-08-15 12:57:01 +02:00
|
|
|
import { AuditEntity } from 'src/entities/audit.entity';
|
|
|
|
import { DatabaseAction, EntityType } from 'src/enum';
|
2024-03-20 19:32:04 +01:00
|
|
|
import { authStub } from 'test/fixtures/auth.stub';
|
2023-08-24 21:28:50 +02:00
|
|
|
|
|
|
|
export const auditStub = {
|
|
|
|
create: Object.freeze<AuditEntity>({
|
|
|
|
id: 1,
|
|
|
|
entityId: 'asset-created',
|
|
|
|
action: DatabaseAction.CREATE,
|
|
|
|
entityType: EntityType.ASSET,
|
2023-12-10 05:34:12 +01:00
|
|
|
ownerId: authStub.admin.user.id,
|
2023-08-24 21:28:50 +02:00
|
|
|
createdAt: new Date(),
|
|
|
|
}),
|
|
|
|
update: Object.freeze<AuditEntity>({
|
|
|
|
id: 2,
|
|
|
|
entityId: 'asset-updated',
|
|
|
|
action: DatabaseAction.UPDATE,
|
|
|
|
entityType: EntityType.ASSET,
|
2023-12-10 05:34:12 +01:00
|
|
|
ownerId: authStub.admin.user.id,
|
2023-08-24 21:28:50 +02:00
|
|
|
createdAt: new Date(),
|
|
|
|
}),
|
|
|
|
delete: Object.freeze<AuditEntity>({
|
|
|
|
id: 3,
|
|
|
|
entityId: 'asset-deleted',
|
|
|
|
action: DatabaseAction.DELETE,
|
|
|
|
entityType: EntityType.ASSET,
|
2023-12-10 05:34:12 +01:00
|
|
|
ownerId: authStub.admin.user.id,
|
2023-08-24 21:28:50 +02:00
|
|
|
createdAt: new Date(),
|
|
|
|
}),
|
|
|
|
};
|