const SUBJECT_TEMPLATE = `
// classRoomTitle
ClassRoom::factory()->create([
    'classRoomTitle' => '_classRoomTitle_',
    'location' => '_location_',
    'capacity' => '_capacity_',
    'deleted' => 'false',
]);
`.trim();

const fs = require('fs');

const classroom_list_raw = fs.readFileSync('./classroom_list.txt', { encoding: 'utf-8' });
const classroom_list = classroom_list_raw.split('\n').map(r => r.split(': '));

const classroom_list_out = classroom_list.map(s =>
    SUBJECT_TEMPLATE.replace(/_classRoomTitle_/g, s[0])
        .replace(/_location_/g, s[1])
        .replace(/_capacity_/g, s[2]),
);

fs.writeFileSync('./write_classroom.out', classroom_list_out.join('\n\n'), { encoding: 'utf-8' });
