feat: Add floor height criterion
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
07f999aeb2
commit
8a8c24d7ac
@ -3,17 +3,20 @@ const MINIMUM_AREA_THREE_RATS = 1.8;
|
||||
const AREA_PER_ADDITIONAL_RAT = 0.2;
|
||||
const MAXIMUM_FALL_HEIGHT = 0.5;
|
||||
const MINIMUM_LENGTH = 0.8;
|
||||
const MINIMUM_FLOOR_HEIGHT = 0.3;
|
||||
|
||||
const FAILED_BASE_AREA = "base_area";
|
||||
const FAILED_OVERALL_AREA = "overall_area";
|
||||
const FAILED_FALL_HEIGHT = "fall_height";
|
||||
const FAILED_NUM_RATS = "num_rats";
|
||||
const FAILED_LENGTH = "length";
|
||||
const FAILED_FLOOR_HEIGHT = "floor_height"
|
||||
|
||||
const FAIL_CRITERIA = {
|
||||
[FAILED_BASE_AREA]: `Die Mindestgrundfläche des Käfigs muss ${MINIMUM_BASE_AREA}m² (also z.B. 100x50cm) betragen.`,
|
||||
[FAILED_OVERALL_AREA]: "Die Gesamtfläche im Käfig ist zu klein.",
|
||||
[FAILED_FALL_HEIGHT]: `Die mögliche Fallhöhe darf nicht mehr als ${(MAXIMUM_FALL_HEIGHT * 100).toFixed(0)}cm betragen.`,
|
||||
[FAILED_FLOOR_HEIGHT]: `Die der Mindestabstand zwischen Ebenen muss ${(MINIMUM_FLOOR_HEIGHT * 100).toFixed(0)}cm betragen.`,
|
||||
[FAILED_NUM_RATS]: "Es müssen mindestens 3 Ratten zusammenleben, Paarhaltung ist nicht artgerecht.",
|
||||
[FAILED_LENGTH]: `Eine Seite des Käfig muss mindestens ${(MINIMUM_LENGTH * 100).toFixed(0)}cm lang sein um Rennen zu ermöglichen.`,
|
||||
};
|
||||
@ -67,5 +70,9 @@ function cageCheck(dimensions, numRats, numFullFloors) {
|
||||
failedCriteria[FAILED_LENGTH] = FAIL_CRITERIA[FAILED_LENGTH];
|
||||
}
|
||||
|
||||
if (dimensions.height / numFullFloors < MINIMUM_FLOOR_HEIGHT) {
|
||||
failedCriteria[FAILED_FLOOR_HEIGHT] = FAIL_CRITERIA[FAILED_FLOOR_HEIGHT];
|
||||
}
|
||||
|
||||
return failedCriteria;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user