refs #7407 create models #2603

Merged
carlossa merged 7 commits from 7407-workerMedical into dev 2024-09-04 13:07:52 +00:00
6 changed files with 98 additions and 0 deletions

View File

@ -3920,6 +3920,16 @@ INSERT INTO `vn`.`calendarHolidays` (calendarHolidaysTypeFk, dated, calendarHoli
(1, '2001-05-17', 1, 5), (1, '2001-05-17', 1, 5),
(1, '2001-05-18', 1, 5); (1, '2001-05-18', 1, 5);
INSERT INTO vn.medicalReview
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
VALUES(1, 1106, 1, '2000-01-01', '08:10', 1, 200.0, NULL, '');
INSERT INTO vn.medicalReview
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
VALUES(2, 1106, 2, '2001-01-01', '09:10', 0, 10.0, NULL, NULL);
INSERT INTO vn.medicalReview
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
VALUES(3, 9, 2, '2000-01-01', '8:00', 1, 150.0, NULL, NULL);
Review

Los otros 2 inserts tienen 4 dígitos, este 3
El resultado es el mismo...

Los otros 2 inserts tienen 4 dígitos, este 3 El resultado es el mismo...
Review

exacto el resultado es el mismo

exacto el resultado es el mismo
INSERT INTO vn.payrollComponent INSERT INTO vn.payrollComponent
(id, name, isSalaryAgreed, isVariable, isException) (id, name, isSalaryAgreed, isVariable, isException)
VALUES VALUES

View File

@ -0,0 +1,6 @@
-- Place your SQL code here
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES
('MedicalReview', '*', '*', 'ALLOW', 'ROLE', 'hr'),
('MedicalCenter', '*', '*', 'ALLOW', 'ROLE', 'hr'),
('Worker', '__get__medicalReview', '*', 'ALLOW', 'ROLE', 'hr');
Review

Es la primera vez que veo este tipo de ACL, como funciona?
Gracias, de antemano

Es la primera vez que veo este tipo de ACL, como funciona? Gracias, de antemano
Review

por loopback, hay que ponerlos asi

por loopback, hay que ponerlos asi

View File

@ -125,6 +125,12 @@
"Locker": { "Locker": {
"dataSource": "vn" "dataSource": "vn"
}, },
"MedicalReview": {
"dataSource": "vn"
},
"MedicalCenter": {
"dataSource": "vn"
},
"PayrollComponent": { "PayrollComponent": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -0,0 +1,19 @@
{
"name": "MedicalCenter",
"base": "VnModel",
"options": {
"mysql": {
"table": "medicalCenter"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string"
}
}
}

View File

@ -0,0 +1,52 @@
{
"name": "MedicalReview",
"base": "VnModel",
"options": {
"mysql": {
"table": "medicalReview"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"workerFk": {
"type": "number"
},
"centerFk": {
"type": "number"
},
"date": {
"type": "date"
},
"time": {
"type": "string"
},
"isFit": {
"type": "boolean"
},
"amount": {
"type": "number"
},
"invoice": {
"type": "string"
Review

No queremos relación con InvoiceIn?

No queremos relación con InvoiceIn?
Review

nosotros ahi ponemos el numero de factura

nosotros ahi ponemos el numero de factura
},
"remark": {
"type": "string"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"center": {
"type": "belongsTo",
"model": "MedicalCenter",
"foreignKey": "centerFk"
}
}
}

View File

@ -116,6 +116,11 @@
"model": "Locker", "model": "Locker",
"foreignKey": "workerFk" "foreignKey": "workerFk"
}, },
"medicalReview": {
"type": "hasMany",
"model": "MedicalReview",
"foreignKey": "workerFk"
},
"incomes": { "incomes": {
"type": "hasMany", "type": "hasMany",
"model": "WorkerIncome", "model": "WorkerIncome",