#4988 - new-module-agency #2303

Merged
pablone merged 17 commits from 4988-new-module-agency into dev 2024-04-26 07:06:56 +00:00
4 changed files with 60 additions and 0 deletions
Showing only changes of commit 77f7348acb - Show all commits

View File

@ -180,5 +180,8 @@
}, },
"AgencyLog": { "AgencyLog": {
"dataSource": "vn" "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'); VALUES('Agency', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
VALUES ('AgencyLog','*','READ','ALLOW','ROLE','employee'); 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;