Compare commits

...

9 Commits

Author SHA1 Message Date
Robert Ferrús 329488d700 Merge branch 'dev' into 8127-entry_updateComission
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-18 08:46:49 +00:00
Sergio De la torre 7d5928bc3d Merge pull request 'feat: refs #8135 refs#8135 updateTicketACL' (!3210) from 8135-ticketACL into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3210
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-18 08:21:18 +00:00
Pablo Natek 55daa2d02b Merge pull request '7743-simpleTestForSendMail' (!3170) from 7743-simpleTestForSendMail into dev
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
Reviewed-on: #3170
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-15 11:54:23 +00:00
Guillermo Bonet b529ccfe29 feat: refs #7920 Added ItemShelving in shelvingLog
gitea/salix/pipeline/head This commit looks good Details
2024-11-15 12:43:15 +01:00
Pablo Natek 86e4e3e981 Merge branch 'dev' into 7743-simpleTestForSendMail
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-15 09:26:42 +00:00
Sergio De la torre 07318656b7 feat: refs #8135 refs#8135 updateTicketACL
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-15 08:47:30 +01:00
Pablo Natek c4fc51f4b8 Merge branch 'dev' into 7743-simpleTestForSendMail
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-11 07:12:27 +00:00
Pablo Natek 50a73c98a2 feat: refs #7743 add try catch stmt to the test
gitea/salix/pipeline/pr-dev Build queued... Details
2024-11-11 08:12:07 +01:00
Pablo Natek d6349f113c feat: refs #7743 add simple spec for sendMail 2024-11-11 08:06:22 +01:00
4 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,7 @@
UPDATE salix.ACL
SET principalId = 'deliveryAssistant'
WHERE model = 'Ticket'
AND property = 'updateAttributes'
AND principalId = "delivery";

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.shelvingLog
MODIFY COLUMN changedModel enum('Shelving', 'ItemShelving') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 'Shelving' NOT NULL;

View File

@ -1,5 +1,4 @@
const models = require('vn-loopback/server/server').models; const models = require('vn-loopback/server/server').models;
const LoopBackContext = require('loopback-context');
const UserError = require('vn-loopback/util/user-error'); const UserError = require('vn-loopback/util/user-error');
describe('workerTimeControl login()', () => { describe('workerTimeControl login()', () => {

View File

@ -0,0 +1,27 @@
const models = require('vn-loopback/server/server').models;
describe('sendMail', () => {
it('should insert in mail', async() => {
const tx = await models.Sale.beginTransaction({});
const options = {transaction: tx};
options.transaction = tx;
let mailCountBefore;
let mailCountAfter;
const ctx = {
req: {accessToken: {userId: 50}},
args: {workerFk: 1106, year: 2001, week: 1}
};
try {
mailCountBefore = await models.Mail.count(options);
await models.WorkerTimeControl.sendMail(ctx, options);
mailCountAfter = await models.Mail.count(options);
} catch (e) {
await tx.rollback();
throw e;
}
expect(mailCountAfter).toBeGreaterThan(mailCountBefore);
await tx.rollback();
});
});