refactor(ticket): change role productionBoss to deliveryBoss
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-03-07 14:50:51 +01:00
parent 76b63c8c45
commit e8d7ce7cc7
3 changed files with 6 additions and 6 deletions

View File

@ -116,8 +116,8 @@ module.exports = Self => {
if (!isEditable) if (!isEditable)
throw new UserError(`The sales of this ticket can't be modified`); throw new UserError(`The sales of this ticket can't be modified`);
const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss', myOptions); const isDeliveryBoss = await models.Account.hasRole(userId, 'deliveryBoss', myOptions);
if (!isProductionBoss) { if (!isDeliveryBoss) {
const zoneShipped = await models.Agency.getShipped( const zoneShipped = await models.Agency.getShipped(
args.landed, args.landed,
args.addressFk, args.addressFk,

View File

@ -31,10 +31,10 @@ module.exports = Self => {
}, myOptions); }, myOptions);
const isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant', myOptions); const isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant', myOptions);
const isProductionBoss = await Self.app.models.Account.hasRole(userId, 'productionBoss', myOptions); const isDeliveryBoss = await Self.app.models.Account.hasRole(userId, 'deliveryBoss', myOptions);
const isBuyer = await Self.app.models.Account.hasRole(userId, 'buyer', myOptions); const isBuyer = await Self.app.models.Account.hasRole(userId, 'buyer', myOptions);
const isValidRole = isSalesAssistant || isProductionBoss || isBuyer; const isValidRole = isSalesAssistant || isDeliveryBoss || isBuyer;
let alertLevel = state ? state.alertLevel : null; let alertLevel = state ? state.alertLevel : null;
let ticket = await Self.app.models.Ticket.findById(id, { let ticket = await Self.app.models.Ticket.findById(id, {

View File

@ -78,8 +78,8 @@ module.exports = Self => {
if (!isEditable) if (!isEditable)
throw new UserError(`The sales of this ticket can't be modified`); throw new UserError(`The sales of this ticket can't be modified`);
const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss', myOptions); const isDeliveryBoss = await models.Account.hasRole(userId, 'deliveryBoss', myOptions);
if (!isProductionBoss) { if (!isDeliveryBoss) {
const zoneShipped = await models.Agency.getShipped( const zoneShipped = await models.Agency.getShipped(
args.landed, args.landed,
args.addressId, args.addressId,