@molochko-dev/data 1.4.99 → 1.4.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -39,6 +39,7 @@ class AnimalEventFilter {
|
|
|
39
39
|
fatnessFilter(animals) {
|
|
40
40
|
return animals;
|
|
41
41
|
}
|
|
42
|
+
// TODO удалить
|
|
42
43
|
osemenenieFilter(animals) {
|
|
43
44
|
const result = animals.filter((animal) => {
|
|
44
45
|
const genderOk = this.genderFilter(animal, enums_1.ANIMAL_GENDER_ENUM.cow);
|
|
@@ -55,6 +56,22 @@ class AnimalEventFilter {
|
|
|
55
56
|
});
|
|
56
57
|
return result;
|
|
57
58
|
}
|
|
59
|
+
breedingFilter(animals) {
|
|
60
|
+
const result = animals.filter((animal) => {
|
|
61
|
+
const genderOk = this.genderFilter(animal, enums_1.ANIMAL_GENDER_ENUM.cow);
|
|
62
|
+
const statusOk = this.statusFilter(animal, [
|
|
63
|
+
this.status.HEIFER,
|
|
64
|
+
this.status.BRED,
|
|
65
|
+
this.status.OPEN,
|
|
66
|
+
this.status.FRESH,
|
|
67
|
+
]);
|
|
68
|
+
const ageOk = this.ageFilter(animal, this.defaultCowAge);
|
|
69
|
+
if (genderOk && statusOk && ageOk) {
|
|
70
|
+
return animal;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
58
75
|
otelFilter(animals) {
|
|
59
76
|
const result = animals.filter((animal) => {
|
|
60
77
|
const genderOk = this.genderFilter(animal, enums_1.ANIMAL_GENDER_ENUM.cow);
|
|
@@ -116,7 +133,7 @@ class AnimalEventFilter {
|
|
|
116
133
|
case enums_1.EVENT_TYPES_ENUM.neosem:
|
|
117
134
|
return this.neosemFilter(animals);
|
|
118
135
|
case enums_1.EVENT_TYPES_ENUM.osemenenie:
|
|
119
|
-
return this.
|
|
136
|
+
return this.breedingFilter(animals);
|
|
120
137
|
case enums_1.EVENT_TYPES_ENUM.otel:
|
|
121
138
|
return this.otelFilter(animals);
|
|
122
139
|
case enums_1.EVENT_TYPES_ENUM.recheck:
|
package/dist/event/enums.d.ts
CHANGED
|
@@ -80,7 +80,8 @@ export declare enum EVENT_TYPES_ENUM {
|
|
|
80
80
|
otel = "otel",
|
|
81
81
|
recheck = "recheck",
|
|
82
82
|
ohota = "ohota",
|
|
83
|
-
osemenenie = "
|
|
83
|
+
osemenenie = "breeding",
|
|
84
|
+
breeding = "breeding",
|
|
84
85
|
stelnaya = "stelnaya",
|
|
85
86
|
yalovaya = "yalovaya",
|
|
86
87
|
stelneotpos = "stelneotpos",
|
package/dist/event/enums.js
CHANGED
|
@@ -90,7 +90,9 @@ var EVENT_TYPES_ENUM;
|
|
|
90
90
|
EVENT_TYPES_ENUM["otel"] = "otel";
|
|
91
91
|
EVENT_TYPES_ENUM["recheck"] = "recheck";
|
|
92
92
|
EVENT_TYPES_ENUM["ohota"] = "ohota";
|
|
93
|
-
|
|
93
|
+
// TODO osemenenie - удалить
|
|
94
|
+
EVENT_TYPES_ENUM["osemenenie"] = "breeding";
|
|
95
|
+
EVENT_TYPES_ENUM["breeding"] = "breeding";
|
|
94
96
|
EVENT_TYPES_ENUM["stelnaya"] = "stelnaya";
|
|
95
97
|
EVENT_TYPES_ENUM["yalovaya"] = "yalovaya";
|
|
96
98
|
EVENT_TYPES_ENUM["stelneotpos"] = "stelneotpos";
|