refs #5652 feat:itemTrash_new
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
022d3d08e6
commit
2fffa56d70
|
@ -0,0 +1,21 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('getAddress', {
|
||||||
|
description: 'Get all activated address last year ',
|
||||||
|
accessType: 'READ',
|
||||||
|
accepts: [],
|
||||||
|
returns: {
|
||||||
|
type: ['object'],
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/getAddress`,
|
||||||
|
verb: 'GET'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.getAddress = async() => {
|
||||||
|
const query = `CALL vn.address_getLosesLastYear()`;
|
||||||
|
const [result] = await Self.rawSql(query);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
};
|
|
@ -1,8 +1,8 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
describe('getAddress()', () => {
|
describe('getAddressa()', () => {
|
||||||
fit('return list of address last year', async() => {
|
fit('return list of address last year', async() => {
|
||||||
let response = await models.Collection.getAddress();
|
let response = await models.Addressa.getAddress();
|
||||||
|
|
||||||
expect(response.length).toBeGreaterThan(0);
|
expect(response.length).toBeGreaterThan(0);
|
||||||
expect(response[0].addressFk).toEqual(1);
|
expect(response[0].addressFk).toEqual(1);
|
|
@ -3,6 +3,8 @@ let getFinalState = require('vn-loopback/util/hook').getFinalState;
|
||||||
let isMultiple = require('vn-loopback/util/hook').isMultiple;
|
let isMultiple = require('vn-loopback/util/hook').isMultiple;
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
|
require('../methods/address/getAddress')(Self);
|
||||||
|
|
||||||
Self.validateAsync('isEqualizated', cannotHaveET, {
|
Self.validateAsync('isEqualizated', cannotHaveET, {
|
||||||
message: 'Cannot check Equalization Tax in this NIF/CIF'
|
message: 'Cannot check Equalization Tax in this NIF/CIF'
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue