3604-route_agencyTerm #893

Merged
carlosjr merged 20 commits from 3604-route_agencyTerm into dev 2022-03-15 14:18:27 +00:00
Contributor
No description provided.
vicent added the
CR / Tests passed
label 2022-03-07 13:38:19 +00:00
vicent added 14 commits 2022-03-07 13:38:21 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
19887bdd16
feat: add section autonomous
gitea/salix/pipeline/head There was a failure building this commit Details
ade34c1e0a
add section Autonomous
gitea/salix/pipeline/head This commit looks good Details
02aeb84c0c
jgallego change
gitea/salix/pipeline/head This commit looks good Details
d22be6620c
feat: add backTest
gitea/salix/pipeline/head This commit looks good Details
b58020978a
fix: check cannot attach more than one file
gitea/salix/pipeline/head This commit looks good Details
10d48f9bb4
refactor uppercase
gitea/salix/pipeline/head This commit looks good Details
f88f60ef27
refactor code and icons
gitea/salix/pipeline/head This commit looks good Details
03c8ceffb2
refactor code
carlosjr requested changes 2022-03-08 09:39:28 +00:00
@ -0,0 +1,2 @@
INSERT INTO salix.ACL (id, model, property, accessType, permission, principalType, principalId)
Contributor

move to /10430-ash

move to /10430-ash
vicent marked this conversation as resolved
@ -0,0 +1,2 @@
INSERT INTO salix.ACL (model,property,accessType,principalId)
Contributor

move to /10430-ash

move to /10430-ash
vicent marked this conversation as resolved
@ -0,0 +1,10 @@
CREATE TABLE `vn`.`agencyTermConfig` (
Contributor

move to /10430-ash

move to /10430-ash
vicent marked this conversation as resolved
@ -221,2 +221,3 @@
"You don't have privileges to create pay back": "No tienes permisos para crear un abono",
"The item is required": "El artículo es requerido"
"The item is required": "El artículo es requerido",
"reference duplicated": "reference duplicated"
Contributor

Reference is duplicated // Duplicated reference

Reference is duplicated // Duplicated reference
Contributor

this is still wrong

this is still wrong
vicent marked this conversation as resolved
@ -0,0 +1,99 @@
module.exports = Self => {
Self.remoteMethod('createInvoiceIn', {
description: 'create a invoce in from one or more agency terms',
Contributor

Creates an invoiceIn from one or more agency terms

Creates an invoiceIn from one or more agency terms
vicent marked this conversation as resolved
@ -0,0 +81,4 @@
transactionTypeSageFk: transactionTypeSage.value
}, myOptions);
// await Self.rawSql(`CALL invoiceInDueDay_calculate(?)`, [newInvoiceIn.id], myOptions);
Contributor

:(

:(
vicent marked this conversation as resolved
@ -0,0 +89,4 @@
UPDATE vn.route SET invoiceInFk = ? WHERE id = ?
`, [newInvoiceIn.id, route.id], myOptions);
}
Contributor

Maybe you want the endpoint to return the created invoiceIn.

Maybe you want the endpoint to return the created invoiceIn.
vicent marked this conversation as resolved
@ -0,0 +30,4 @@
if (typeof options == 'object')
Object.assign(myOptions, options);
let stmts = [];
Contributor

const

const
vicent marked this conversation as resolved
@ -0,0 +31,4 @@
Object.assign(myOptions, options);
let stmts = [];
let stmt;
Contributor

stmt is initialized once and assigned once, perhaps you want to create a constant directly on definition

stmt is initialized once and assigned once, perhaps you want to create a constant directly on definition
vicent marked this conversation as resolved
@ -0,0 +65,4 @@
stmt.merge(conn.makeSuffix(filter));
let agencyTerm = stmts.push(stmt) - 1;
Contributor

const

const
vicent marked this conversation as resolved
@ -0,0 +66,4 @@
stmt.merge(conn.makeSuffix(filter));
let agencyTerm = stmts.push(stmt) - 1;
let sql = ParameterizedSQL.join(stmts, ';');
Contributor

const

const
vicent marked this conversation as resolved
@ -0,0 +67,4 @@
let agencyTerm = stmts.push(stmt) - 1;
let sql = ParameterizedSQL.join(stmts, ';');
let result = await conn.executeStmt(sql, myOptions);
Contributor

const

const
vicent marked this conversation as resolved
@ -0,0 +1,49 @@
const models = require('vn-loopback/server/server').models;
xdescribe('AgencyTerm createInvoiceIn()', () => {
Contributor

if a test is excluded a reference to the issue create must be stated with a comment above it.

or maybe this is a mistake.

if a test is excluded a reference to the issue create must be stated with a comment above it. or maybe this is a mistake.
vicent marked this conversation as resolved
@ -0,0 +15,4 @@
}
];
it('should make a invoice in', async() => {
Contributor

an invoiceIn

an invoiceIn
vicent marked this conversation as resolved
@ -0,0 +28,4 @@
const oldInvoiceInDueDay = await models.InvoiceInDueDay.findById(invoiceInDueDayId, null, options);
const oldInvoiceInTax = await models.InvoiceInTax.findById(invoiceInTaxId, null, options);
// await models.AgencyTerm.createInvoiceIn(rows, dms, options);
Contributor

:(

:(
vicent marked this conversation as resolved
@ -0,0 +34,4 @@
const [newInvoiceInDueDay] = await models.InvoiceInDueDay.rawSql('SELECT MAX(id) id FROM invoiceInDueDay', null, options);
const [newInvoiceInTax] = await models.InvoiceInTax.rawSql('SELECT MAX(id) id FROM invoiceInTax', null, options);
conso;
Contributor

conso was left alone

conso was left alone
vicent marked this conversation as resolved
@ -0,0 +3,4 @@
describe('AgencyTerm filter()', () => {
const authUserId = 9;
it('should all return the tickets matching the filter', async() => {
Contributor

should return all the tickets...

should return all the tickets...
vicent marked this conversation as resolved
@ -0,0 +62,4 @@
describe('setDefaultParams()', () => {
it('should perform a GET query and define the dms property on controller', () => {
const params2 = {filter: {
Contributor

paramsTwo or myParams, or testParams

never use numbers for variable definitions

paramsTwo or myParams, or testParams never use numbers for variable definitions
vicent marked this conversation as resolved
@ -0,0 +65,4 @@
const params2 = {filter: {
where: {code: 'invoiceIn'}
}};
let serializedParams = $httpParamSerializer(params2);
Contributor

const

const
vicent marked this conversation as resolved
@ -0,0 +39,4 @@
};
}
exprBuilder(param, value) {
Contributor

The following approach requires less code for same functionality

exprBuilder(param, value) {
    switch (param) {
    case 'agencyFk':
        return {'a.agencyModeName': value};
    case 'supplierFk':
        return {'a.supplierName': value};
    case 'routeFk':
    case 'created':
    case 'agencyAgreement':
    case 'packages':
    case 'm3':
    case 'kmTotal':
    case 'price':
    case 'invoiceInFk':
        return {[`a.${param}`]: value};
    }
}
The following approach requires less code for same functionality ``` exprBuilder(param, value) { switch (param) { case 'agencyFk': return {'a.agencyModeName': value}; case 'supplierFk': return {'a.supplierName': value}; case 'routeFk': case 'created': case 'agencyAgreement': case 'packages': case 'm3': case 'kmTotal': case 'price': case 'invoiceInFk': return {[`a.${param}`]: value}; } } ```
vicent marked this conversation as resolved
@ -0,0 +45,4 @@
});
describe('preview()', () => {
it('should show the dialog summary', () => {
Contributor

should show the summary dialog

should show the summary dialog
vicent marked this conversation as resolved
@ -0,0 +63,4 @@
});
describe('createInvoiceIn()', () => {
it('should throw an error if are checked more than one autonomous', () => {
Contributor

should throw an error if more than one autonomous are checked

should throw an error if more than one autonomous are checked
vicent marked this conversation as resolved
@ -0,0 +74,4 @@
expect(controller.vnApp.showError).toHaveBeenCalled();
});
it('should call the function go() on $state to go to the file managment', () => {
Contributor

management

management
vicent marked this conversation as resolved
@ -0,0 +1,7 @@
picture: Foto
Contributor

the word picture should be capitalised.

Also some of the translations don't seem to be used at all. please double check their use on your templates.

the word picture should be capitalised. Also some of the translations don't seem to be used at all. please double check their use on your templates.
vicent marked this conversation as resolved
carlosjr removed the
CR / Tests passed
label 2022-03-08 09:40:28 +00:00
vicent added 1 commit 2022-03-08 12:42:57 +00:00
gitea/salix/pipeline/head This commit looks good Details
97f2341ae0
pull request changes
vicent added the
CR / Tests passed
label 2022-03-08 12:47:51 +00:00
vicent removed the
CR / Tests passed
label 2022-03-09 06:21:49 +00:00
vicent added 1 commit 2022-03-09 07:41:09 +00:00
vicent added the
CR / Tests passed
label 2022-03-09 07:41:12 +00:00
carlosjr requested changes 2022-03-09 09:09:26 +00:00
@ -0,0 +1,48 @@
const models = require('vn-loopback/server/server').models;
// Include test when the database export is done
Contributor

// Include after #3638 export database

// Include after #3638 export database
vicent marked this conversation as resolved
carlosjr removed the
CR / Tests passed
label 2022-03-09 09:09:59 +00:00
vicent added 1 commit 2022-03-11 11:25:09 +00:00
gitea/salix/pipeline/head This commit looks good Details
97f856afcc
corrected comment
vicent added the
CR / Tests passed
label 2022-03-11 11:25:25 +00:00
vicent added 1 commit 2022-03-15 11:23:40 +00:00
vicent requested review from carlosjr 2022-03-15 11:35:16 +00:00
carlosjr requested changes 2022-03-15 13:27:06 +00:00
@ -0,0 +1,5 @@
Agency route: Agencia ruta
Agency Agreement: Agencia acuerdo
Contributor

Acuerdo de agencia? Acuerdo agencia?

Acuerdo de agencia? Acuerdo agencia?
vicent marked this conversation as resolved
carlosjr removed the
CR / Tests passed
label 2022-03-15 13:38:48 +00:00
vicent added 1 commit 2022-03-15 14:05:20 +00:00
gitea/salix/pipeline/head This commit looks good Details
2f53733151
refactor translates
carlosjr approved these changes 2022-03-15 14:14:11 +00:00
carlosjr left a comment
Contributor

LGTM

LGTM
carlosjr added 1 commit 2022-03-15 14:14:22 +00:00
gitea/salix/pipeline/head This commit looks good Details
3098fc36fb
Merge branch 'dev' into 3604-route_agencyTerm
carlosjr merged commit 17c95a654e into dev 2022-03-15 14:18:27 +00:00
carlosjr deleted branch 3604-route_agencyTerm 2022-03-15 14:18:27 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#893
No description provided.