feat(workcenter): refs #4988 add workcenter config menu
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Pablo Natek 2024-04-18 09:02:01 +02:00
parent d0dfdc668b
commit 77f7348acb
4 changed files with 60 additions and 0 deletions

View File

@ -180,5 +180,8 @@
},
"AgencyLog": {
"dataSource": "vn"
},
"AgencyWorkCenter": {
"dataSource": "vn"
}
}

View File

@ -0,0 +1,36 @@
{
"name": "AgencyWorkCenter",
"base": "VnModel",
"options": {
"mysql": {
"table": "agencyWorkCenter"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"forceId": false
},
"agencyFk": {
"type": "number",
"required": false
},
"workCenterFk": {
"type": "number",
"required": false
}
},
"relations": {
"agency": {
"type": "belongsTo",
"model": "WorkCenter",
"foreignKey": "agencyFk"
},
"workCenter": {
"type": "belongsTo",
"model": "WorkCenter",
"foreignKey": "workCenterFk"
}
}
}

View File

@ -3,3 +3,7 @@ INSERT INTO salix.ACL (model, property, accessType, permission, principalType, p
VALUES('Agency', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('AgencyLog','*','READ','ALLOW','ROLE','employee');
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('Agency','*','WRITE','ALLOW','ROLE','deliveryAssistant');

View File

@ -0,0 +1,17 @@
CREATE TABLE IF NOT EXISTS vn.agencyWorkCenter (
id INT UNSIGNED auto_increment NOT NULL,
agencyFk smallint(5) unsigned NULL,
workCenterFk int(11) NULL,
CONSTRAINT agencyWorkCenter_pk PRIMARY KEY (id),
CONSTRAINT agencyWorkCenter_agency_FK FOREIGN KEY (agencyFk) REFERENCES vn.agency(id) ON DELETE CASCADE,
CONSTRAINT agencyWorkCenter_workCenter_FK FOREIGN KEY (workCenterFk) REFERENCES vn.workCenter(id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci
COMMENT='refs #4988';
INSERT INTO vn.agencyWorkCenter (agencyFk, workCenterFk)
SELECT id, workCenterFk
FROM vn.agency
WHERE workCenterFk IS NOT NULL;