refs #5193 ticketCreateWithUser to ticket_add
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2023-03-01 12:24:36 +01:00
parent c47f64519d
commit 707ae232a7
3 changed files with 21 additions and 14 deletions

View File

@ -22,7 +22,7 @@ describe('ticket ticketCalculateClon()', () => {
originalTicketId: 11
};
stmt = new ParameterizedSQL('CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @result)', [
stmt = new ParameterizedSQL('CALL vn.ticket_add(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, @result)', [
params.clientFk,
params.shipped,
params.warehouseFk,
@ -31,7 +31,8 @@ describe('ticket ticketCalculateClon()', () => {
params.agencyType,
params.routeFk,
params.landed,
params.userId
params.userId,
true
]);
stmts.push(stmt);
@ -71,7 +72,7 @@ describe('ticket ticketCalculateClon()', () => {
originalTicketId: 11
};
stmt = new ParameterizedSQL('CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @result)', [
stmt = new ParameterizedSQL('CALL vn.ticket_add(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, @result)', [
params.clientFk,
params.shipped,
params.warehouseFk,
@ -80,7 +81,8 @@ describe('ticket ticketCalculateClon()', () => {
params.agencyType,
params.routeFk,
params.landed,
params.userId
params.userId,
true
]);
stmts.push(stmt);

View File

@ -1,7 +1,7 @@
const app = require('vn-loopback/server/server');
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
describe('ticket ticketCreateWithUser()', () => {
describe('ticket ticket_add()', () => {
const today = Date.vnNew();
it('should confirm the procedure creates the expected ticket', async() => {
let stmts = [];
@ -21,7 +21,7 @@ describe('ticket ticketCreateWithUser()', () => {
userId: 18
};
stmt = new ParameterizedSQL(`CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)`, [
stmt = new ParameterizedSQL(`CALL vn.ticket_add(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)`, [
params.clientFk,
params.shipped,
params.warehouseFk,
@ -30,7 +30,8 @@ describe('ticket ticketCreateWithUser()', () => {
params.agencyModeFk,
params.routeFk,
params.landed,
params.userId
params.userId,
true
]);
stmts.push(stmt);
@ -70,7 +71,7 @@ describe('ticket ticketCreateWithUser()', () => {
userId: 18
};
stmt = new ParameterizedSQL('CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)', [
stmt = new ParameterizedSQL('CALL vn.ticket_add(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)', [
params.clientFk,
params.shipped,
params.warehouseFk,
@ -79,7 +80,8 @@ describe('ticket ticketCreateWithUser()', () => {
params.agencyModeFk,
params.routeFk,
params.landed,
params.userId
params.userId,
true
]);
stmts.push(stmt);
@ -120,7 +122,7 @@ describe('ticket ticketCreateWithUser()', () => {
userId: 18
};
stmt = new ParameterizedSQL(`CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)`, [
stmt = new ParameterizedSQL(`CALL vn.ticket_add(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)`, [
params.clientFk,
params.shipped,
params.warehouseFk,
@ -129,7 +131,8 @@ describe('ticket ticketCreateWithUser()', () => {
params.agencyModeFk,
params.routeFk,
params.landed,
params.userId
params.userId,
true
]);
stmts.push(stmt);
@ -172,7 +175,7 @@ describe('ticket ticketCreateWithUser()', () => {
]);
stmts.push(stmt);
stmt = new ParameterizedSQL(`CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)`, [
stmt = new ParameterizedSQL(`CALL vn.ticket_add(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, @newTicketId)`, [
params.clientFk,
params.shipped,
params.warehouseFk,
@ -181,7 +184,8 @@ describe('ticket ticketCreateWithUser()', () => {
params.agencyModeFk,
params.routeFk,
params.landed,
params.userId
params.userId,
true
]);
stmts.push(stmt);
stmts.push(`select @newTicketId`);

View File

@ -111,7 +111,7 @@ module.exports = Self => {
args.landed = landedResult && landedResult.landed;
}
query = `CALL vn.ticketCreateWithUser(?, ?, ?, ?, ?, ?, ?, ?, ?, @result);
query = `CALL vn.ticket_add(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, @result);
SELECT @result newTicketId;`;
const result = await Self.rawSql(query, [
args.clientId,
@ -122,6 +122,7 @@ module.exports = Self => {
args.agencyModeId || null,
args.routeId || null,
args.landed,
true,
myUserId
], myOptions);