Merge branch 'dev' into 4153-supplier.fiscal-data
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Pau 2022-10-25 08:53:01 +00:00
commit d60f6769b4
9 changed files with 64 additions and 5 deletions

View File

@ -0,0 +1,5 @@
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('ClaimRma', '*', 'READ', 'ALLOW', 'ROLE', 'claimManager'),
('ClaimRma', '*', 'WRITE', 'ALLOW', 'ROLE', 'claimManager');

View File

@ -0,0 +1 @@
ALTER TABLE `vn`.`claim` ADD rma varchar(100) NULL ;

View File

@ -0,0 +1,7 @@
CREATE TABLE `vn`.`claimRma` (
id INT UNSIGNED auto_increment NOT NULL PRIMARY KEY,
code varchar(100) NOT NULL,
created timestamp DEFAULT current_timestamp() NOT NULL,
workerFk INTEGER UNSIGNED NOT NULL
)
ENGINE=InnoDB;

View File

@ -47,7 +47,7 @@ module.exports = Self => {
{
relation: 'claimState',
scope: {
fields: ['id', 'description']
fields: ['id', 'code', 'description']
}
},
{

View File

@ -2,6 +2,9 @@
"Claim": {
"dataSource": "vn"
},
"ClaimContainer": {
"dataSource": "claimStorage"
},
"ClaimBeginning": {
"dataSource": "vn"
},
@ -41,7 +44,7 @@
"ClaimObservation": {
"dataSource": "vn"
},
"ClaimContainer": {
"dataSource": "claimStorage"
"ClaimRma": {
"dataSource": "vn"
}
}

View File

@ -0,0 +1,30 @@
{
"name": "ClaimRma",
"base": "VnModel",
"options": {
"mysql": {
"table": "claimRma"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"code": {
"type": "string",
"required": true
},
"created": {
"type": "date"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "worker",
"foreignKey": "workerFk"
}
}
}

View File

@ -46,6 +46,9 @@
},
"packages": {
"type": "number"
},
"rma": {
"type": "string"
}
},
"relations": {
@ -54,6 +57,12 @@
"model": "ClaimState",
"foreignKey": "claimStateFk"
},
"claimRma": {
"type": "belongsTo",
"model": "ClaimRma",
"foreignKey": "rma",
"primaryKey": "code"
},
"client": {
"type": "belongsTo",
"model": "Client",

View File

@ -7,8 +7,12 @@ const componentsPath = path.resolve(__dirname, './core/components');
module.exports = {
async boot(app) {
// Init database instance
// Extended locale intl polyfill
const IntlPolyfill = require('intl');
Intl.NumberFormat = IntlPolyfill.NumberFormat;
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;
// Init database instance
require('./core/database').init(app.dataSources);
require('./core/smtp').init();
require('./core/cluster').init();