2025-12-03 05:57:02 +00:00
|
|
|
import { IsString, IsNotEmpty, Length, IsEnum } from 'class-validator';
|
2025-11-06 07:10:04 +00:00
|
|
|
|
|
|
|
|
export class StoreLogDto {
|
2025-12-04 04:10:10 +00:00
|
|
|
@IsNotEmpty({ message: 'ID is required' })
|
|
|
|
|
@IsString({ message: 'ID must be a string' })
|
2025-11-06 07:10:04 +00:00
|
|
|
id: string;
|
2025-10-27 06:41:51 +00:00
|
|
|
|
2025-12-04 04:10:10 +00:00
|
|
|
@IsNotEmpty({ message: 'Event is required' })
|
|
|
|
|
@IsString({ message: 'Event must be a string' })
|
2025-10-27 06:41:51 +00:00
|
|
|
@IsEnum(
|
|
|
|
|
[
|
|
|
|
|
'tindakan_dokter_created',
|
2025-11-17 04:14:13 +00:00
|
|
|
'obat_created',
|
2025-10-27 06:41:51 +00:00
|
|
|
'rekam_medis_created',
|
|
|
|
|
'tindakan_dokter_updated',
|
|
|
|
|
'obat_updated',
|
|
|
|
|
'rekam_medis_updated',
|
|
|
|
|
'tindakan_dokter_deleted',
|
|
|
|
|
'obat_deleted',
|
|
|
|
|
'rekam_medis_deleted',
|
|
|
|
|
],
|
|
|
|
|
{
|
2025-12-04 04:10:10 +00:00
|
|
|
message: 'Invalid event',
|
2025-10-27 06:41:51 +00:00
|
|
|
},
|
|
|
|
|
)
|
2025-12-04 04:10:10 +00:00
|
|
|
@Length(1, 100, { message: 'Event must be at most 100 characters' })
|
2025-10-27 06:41:51 +00:00
|
|
|
event: string;
|
|
|
|
|
|
2025-12-04 04:10:10 +00:00
|
|
|
@IsNotEmpty({ message: 'User ID is required' })
|
|
|
|
|
@IsString({ message: 'User ID must be a string' })
|
2025-12-03 05:57:02 +00:00
|
|
|
user_id: string;
|
2025-11-06 07:10:04 +00:00
|
|
|
|
2025-12-04 04:10:10 +00:00
|
|
|
@IsNotEmpty({ message: 'Payload is required' })
|
|
|
|
|
@IsString({ message: 'Payload must be a string' })
|
2025-11-06 07:10:04 +00:00
|
|
|
payload: string;
|
2025-10-27 06:41:51 +00:00
|
|
|
}
|