const HttpException = require('../../../utils/HttpException.js');

exports.validateCreateStatusHisotryRequest = (body) => {
    const { new_status, note } = body;
    const errors = {};

    if (!new_status || new_status.trim() === '') {
        errors.new_status = ['new_status is required'];
    }

    if (Object.keys(errors).length > 0) {
        throw new HttpException(errors, 422);
    }

    return {
        new_status: new_status.trim(),
        note: note.trim()
    };
};
