import { Factory } from '@mikro-orm/seeder';

import { PostEntity } from '@/modules/content/entities/post.entity';
import { getFaker } from '@/modules/database/helpers';

export class ContentPostFactory extends Factory<PostEntity> {
    model = PostEntity;

    definition(): Partial<PostEntity> {
        const faker = getFaker();
        return {
            title: faker.lorem.sentence({ min: 3, max: 9 }),
            body: faker.lorem.paragraphs({ min: 1, max: 5 }, '<br/>\n'),
            keywords: faker.lorem.words({ min: 0, max: 6 }).split(' '),
        };
    }
}
