import { FaceImageRequest } from '../../../../../grpc/generated/exposed/humand/timetracking/v1/timetracking_kiosk_service';

export const mapFaceImageRequestToMulterFile = (faceImageRequest: FaceImageRequest): Express.Multer.File => {
    return {
        buffer: Buffer.from(faceImageRequest.content),
        mimetype: faceImageRequest.contentType,
        originalname: faceImageRequest.filename,
        size: faceImageRequest.sizeBytes ?? faceImageRequest.content.length,
    } as Express.Multer.File;
};
