const knex = require('../../../knex').web

module.exports = function () {
  return knex('reduction_reason')
    .join('reduction_category', 'reduction_reason.category_id', 'reduction_category.id')
    .select('reduction_reason.id',
            'category',
            'reason',
            'reason_short_name AS reasonShortName',
            'allowance_percentage AS allowancePercentage',
            'max_allowance_percentage AS maxAllowancePercentage',
            'months_to_expiry AS monthsToExpiry'
           )
}

const knex = require('../../../knex').web

module.exports = function () {
  return knex('reduction_reason')
    .join('reduction_category', 'reduction_reason.category_id', 'reduction_category.id')
    .select('reduction_reason.id',
            'category',
            'reason',
            'reason_short_name AS reasonShortName',
            'allowance_percentage AS allowancePercentage',
            'max_allowance_percentage AS maxAllowancePercentage',
            'months_to_expiry AS monthsToExpiry')
    .orderBy('reason_short_name')
}

Sort reduction reasons data services by reason short name
Sort reduction reasons data services by reason short name
