module.exports = {
    formatWithModifier: async (data, modifiedByField = 'modified_by') => {
        return Promise.all(
            data.map(async (item) => {
                const modifier = await dbSAPPS.User.findOne({
                    where: {
                        id: item[modifiedByField]
                    },
                    attributes: ['full_name']
                });

                return {
                    ...item,
                    modifier: modifier?.full_name
                };
            })
        );
    },
};
