feat: refs #7119 add Ppe model and establish relationships in Vehicle model
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-12-27 16:55:59 +01:00
parent 0de4ce9b3c
commit 921edb238c
4 changed files with 59 additions and 22 deletions

View File

@ -4051,7 +4051,7 @@ INSERT IGNORE INTO vn.inventoryConfig
supplierFk = 4;
INSERT INTO vn.vehicleState (state, hasToNotify)
VALUES
VALUES
('Operativo', NULL),
('Prestado', NULL),
('Robado', NULL),
@ -4061,13 +4061,13 @@ VALUES
('ITV', NULL);
INSERT INTO vn.vehicleEvent (started, finished, vehicleStateFk, description, vehicleFk, userFk, notified)
VALUES
VALUES
('2000-12-01', '2000-12-02', 4, 'cambio de aceite', 5, 103, NULL),
('2000-12-15', '2000-12-18', 2, 'viaje fin de curso', 5, 103, NULL),
('2000-12-20', '2001-01-01', 3, 'llaves puestas', 2, 103, NULL);
INSERT INTO vn.fuelType (id, name, code)
VALUES
VALUES
(1, 'gasoil', 'gasoil'),
(2, 'gas', 'gas'),
(3, 'adblue', 'adblue'),
@ -4076,6 +4076,11 @@ VALUES
(6, 'electrico', 'electric');
INSERT INTO vn.bankPolicy (id, `ref`, amount, committedFee, nonCommittedFee, annualFee, started, ended, accountingFk, companyFk, supplierFk, description, hasGuarantee, dmsFk, notaryFk, currencyFk, amortizationTypeFk, periodicityTypeFk, insuranceExpired)
VALUES
VALUES
(1, '11112222', 500000.0, 0.028, 0.0, 0.001, '2001-01-01', '2001-02-01', 1, 442, NULL, NULL, 0, NULL, NULL, 1, NULL, NULL, NULL),
(2, '33334444', 100000.0, 0.017, 0.0, 0.0, '2001-01-01', '2001-02-01', 1, 2, NULL, NULL, 0, NULL, NULL, 2, NULL, NULL, NULL);
INSERT INTO vn.ppe (id, amortization, firstAmortizated, lastAmortizated, finished, value, planFk, groupFk, account, endowment, elementAccount, nature, location, discharged, cause, isInvestmentAsset, workerFk, companyFk, description, isDone)
VALUES
(1, 0.00, '2001-01-01', NULL, NULL, 700.95, 16, 4, '3456000000', '4320000000', '12345', 'INMOVILIZADO', 'V02', NULL, NULL, 0, NULL, 442, 'UTILLAJE LASER ROTATIVO AUTONIVELANTE 500M', NULL),
(2, 0.00, '2001-01-01', NULL, NULL, 400.00, 16, 4, '5678000000', '1230000000', '67891', 'INMOVILIZADO', 'V02', NULL, NULL, 0, NULL, 442, 'UTILLAJE BALANZA Z100 150KILOS', NULL);

View File

@ -17,6 +17,9 @@
"FuelType": {
"dataSource": "vn"
},
"Ppe": {
"dataSource": "vn"
},
"RoadmapAddress": {
"dataSource": "vn"
},

View File

@ -0,0 +1,23 @@
{
"name": "Ppe",
"base": "VnModel",
"options": {
"mysql": {
"table": "ppe"
}
},
"properties": {
"id": {
"type": "number",
"id": true
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "delivery",
"permission": "ALLOW"
}
]
}

View File

@ -93,6 +93,12 @@
"type": "belongsTo",
"model": "FuelType",
"foreignKey": "fuelTypeFk"
},
"ppe": {
"type": "hasOne",
"model": "Ppe",
"foreignKey": "id",
"property": "ppeFk"
}
},
"scope": {