Security Scheme Rules - danmarksmiljoeportal/rotter GitHub Wiki
Various rules have been added over the years to ensure that Security Scheme data is dependable and uniform. This page lists the added validations that you may encounter when committing Security Scheme records.
Transformation Rule
R1 Authorization
We will ignore any value specified for exterminationCompany and instead automatically set it to the logged in user's extermination company as identified from his access token.
Authorization Rules
- Municipalities can create, update and delete security schemes within their own borders.
- Municipalities can only retrieve records that belong to their Municipality.
- R1 Extermination Companies can only get, create, update, and delete security schemes where they are registered as exterminationCompany.
- R2 Exterminators cannot retrieve any at all.
- Administration and Read Only can retrieve all.
Avoiding Address Duplicate Security Scheme records
You cannot create more than one Security Scheme on the same address at the same startDate by the same R1 Extermination Company. Same address is in the system interpreted as the same streetName, houseNumber and zipCode.
Restrictions on setting Address or Extermination Company Owner on Security Schemes
Municipalities can only add, update and delete Security Scheme within their own borders. R1 Extermination Companies and R2 Exterminators can only create, update, and delete Security Schemes that belong to themselves.
Address will be validate by DAWA system
The system will validate streetName, streetCode, houseNumber, and zipCode by sending them to the DAWA system. If any errors occur in DAWA, we will throw detail of that exception in response.
Data Rules
- The Property object requires the following data:
- HouseNumber: Must have value
- ZIPCode: Must have value and greater than 0
- StreetCode or StreetName: At least one of them must have a value.
- PropertyType2: It must have a value and be within a specified list: [
Tilsynspligtig ejendom,Beboelsesejendom,Fødevarevirksomhed,Anden industri,Kommunal institution m.v.,Privat-, statslig- eller regional institution m.v.,Andet]
- startDate is required
- if propertyInspection has value, it must be less than now
- if expiryDate has value, it must be greater than startDate