28 lines
913 B
TypeScript
28 lines
913 B
TypeScript
import { protocolAgenda } from "../../../../entity/club/protocol/protocolAgenda";
|
|
import { ProtocolAgendaViewModel } from "../../../../viewmodel/admin/club/protocol/protocolAgenda.models";
|
|
|
|
export default abstract class ProtocolAgendaFactory {
|
|
/**
|
|
* @description map record to protocolAgenda
|
|
* @param {protocol} record
|
|
* @returns {ProtocolAgendaViewModel}
|
|
*/
|
|
public static mapToSingle(record: protocolAgenda): ProtocolAgendaViewModel {
|
|
return {
|
|
id: record.id,
|
|
topic: record.topic,
|
|
context: record.context,
|
|
sort: record.sort,
|
|
protocolId: record.protocolId,
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @description map records to protocolAgenda
|
|
* @param {Array<protocol>} records
|
|
* @returns {Array<ProtocolAgendaViewModel>}
|
|
*/
|
|
public static mapToBase(records: Array<protocolAgenda>): Array<ProtocolAgendaViewModel> {
|
|
return records.map((r) => this.mapToSingle(r));
|
|
}
|
|
}
|