// Function transforms orders table 'total' property from string (returned by database call) to number
// IN: row : orders table row being transformed
// OUT: orders table row with transformed property
function transform_order_monies(row) {
    row.total = Number(row.total);

    return row;
}

// Function transforms parts table 'price' property from string (returned by database call) to number
// IN: row : parts table row being transformed
// OUT: parts table row with transformed property
function transform_part_monies(row) {
    row.price = Number(row.price);

    return row;
}

// Function transforms requests table 'subtotal' property from string (returned by database call) to number
// IN: row : requests table row being transformed
// OUT: requests table row with transformed property
function transform_request_monies(row) {
    row.subtotal = Number(row.subtotal);

    return row;
}

// Export functions for use in other modules
module.exports = {
    transform_order_monies: (row) => transform_order_monies(row),
    transform_part_monies: (row) => transform_part_monies(row),
    transform_request_monies: (row) => transform_request_monies(row),
};
