require("dotenv").config();

// =============================================
// Environment Configuration
// =============================================

const env = {

    server: {

        port: Number(process.env.PORT || 5000),

        nodeEnv: process.env.NODE_ENV || "development"

    },

    database: {

        host: process.env.DB_HOST,

        port: Number(process.env.DB_PORT || 3306),

        user: process.env.DB_USER,

        password: process.env.DB_PASSWORD,

        name: process.env.DB_NAME

    },

    attendance: {

        startTime: process.env.ATTENDANCE_START_TIME || "09:00",

        lateTime: process.env.ATTENDANCE_LATE_TIME || "10:00",

        endTime: process.env.ATTENDANCE_END_TIME || "17:00"

    },

    upload: {

        maxFileSize: Number(
            process.env.MAX_FILE_SIZE || 5242880
        ),

        imageQuality: Number(
            process.env.IMAGE_QUALITY || 90
        )

    },

    face: {

        threshold: Number(
            process.env.FACE_MATCH_THRESHOLD || 0.65
        ),

        saveUnknown:

            process.env.UNKNOWN_FACE_SAVE === "true"

    },

    device: {

        allowUnknown:

            process.env.ALLOW_UNKNOWN_DEVICE === "true",

        timeout: Number(
            process.env.DEVICE_TIMEOUT || 30
        )

    }

};

module.exports = env;