2024-12-27 05:26:36 -08:00
|
|
|
import { nanoId, date, firstName, lastName, email } from 'minifaker';
|
|
|
|
import 'minifaker/locales/en';
|
|
|
|
|
2025-01-09 04:47:23 -08:00
|
|
|
import type { Project } from '@/databases/entities/project';
|
2024-12-27 05:26:36 -08:00
|
|
|
|
|
|
|
type RawProjectData = Pick<Project, 'name' | 'type' | 'createdAt' | 'updatedAt' | 'id'>;
|
|
|
|
|
|
|
|
const projectName = `${firstName()} ${lastName()} <${email}>`;
|
|
|
|
|
|
|
|
export const createRawProjectData = (payload: Partial<RawProjectData>): Project => {
|
|
|
|
return {
|
|
|
|
createdAt: date(),
|
|
|
|
updatedAt: date(),
|
|
|
|
id: nanoId.nanoid(),
|
|
|
|
name: projectName,
|
2025-01-09 04:47:23 -08:00
|
|
|
type: 'personal',
|
2024-12-27 05:26:36 -08:00
|
|
|
...payload,
|
|
|
|
} as Project;
|
|
|
|
};
|