/**
 * ==================================================
 * Smart Attendance System
 * Media Service
 * ==================================================
 */

const fs = require("fs");
const path = require("path");

const STORAGE = path.join(

    process.cwd(),

    "storage",

    "students",

    "profiles"

);

class MediaService {

    /**
     * Find Student Photo
     */

    getStudentPhoto(studentId, filename) {

        if (!filename) {

            return null;

        }

        return path.join(

            STORAGE,

            String(studentId),

            filename

        );

    }

}

module.exports = new MediaService();