1.0.26 • Published 3 years ago

@breedr/animals-filter v1.0.26

Weekly downloads
73
License
MIT
Repository
-
Last release
3 years ago

Animals Filter

Installation

To install the latest version run:

yarn add @breedr/animals-filter

Usage

Package has function animalsFilter which has 2 params: animals and filterOptions. Animal should have:

type Animal = {
  passportNumber: string;
  isRegulatorySynced: boolean;
  isWithdrawal?: boolean;
  isMale: boolean;
  group: {
    id: string;
  };
  field: {
    id: string;
  };
  animalBreeds: {
    id: string;
  }[];
  lastWeight: {
    value: string;
    date: string;
  } | null;
  currentWeight: string | null;
  deliveryDate: string | null;
  dob: string | null;
  estimatedWeightOn: string | null;
  estimatedAgeOn: string | null;
  growthRate: number | null;
  lastRegulatorySyncedDate: string | null;
};

filterOptions has:

type FilterOptions = {
  isSynced: boolean; // Mobile
  sex: "" | "M" | "F";
  groups: string[];
  fields: string[];
  breeds: string[];
  minWeight: string;
  maxWeight: string;
  search?: string;
  deliveryDateTo: string;
  deliveryDateFrom: string;
  minAge: string;
  maxAge: string;
  isMale: boolean;
  isRegulatorySynced?: string; // Web
  isWithdrawal?: string;
  minDeliveryWeight: string;
  maxDeliveryWeight: string;
  maxDeliveryAge: string;
  minDeliveryAge: string;
  minCurrentEstWeight?: string;
  maxCurrentEstWeight?: string;
  daysSinceLastWeightFrom?: string;
  daysSinceLastWeightTo?: string;
  growthRateFrom?: string;
  growthRateTo?: string;
  lastSyncedDateFrom?: string;
  lastSyncedDateTo?: string;
};
1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago