26 lines
790 B
TypeScript
26 lines
790 B
TypeScript
import { education } from "../../../entity/configuration/education";
|
|
import { EducationViewModel } from "../../../viewmodel/admin/configuration/education.models";
|
|
|
|
export default abstract class EducationFactory {
|
|
/**
|
|
* @description map record to education
|
|
* @param {education} record
|
|
* @returns {AwardViewModel}
|
|
*/
|
|
public static mapToSingle(record: education): EducationViewModel {
|
|
return {
|
|
id: record.id,
|
|
education: record.education,
|
|
description: record.description,
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @description map records to education
|
|
* @param {Array<education>} records
|
|
* @returns {Array<AwardViewModel>}
|
|
*/
|
|
public static mapToBase(records: Array<education>): Array<EducationViewModel> {
|
|
return records.map((r) => this.mapToSingle(r));
|
|
}
|
|
}
|