Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animal model update: date of entry/date of leaving #66

Open
fedjo opened this issue Mar 17, 2025 · 1 comment
Open

Animal model update: date of entry/date of leaving #66

fedjo opened this issue Mar 17, 2025 · 1 comment

Comments

@fedjo
Copy link

fedjo commented Mar 17, 2025

We need to add 3 fields in the Animal model

  • entry_date
  • leaving_date
  • previous_owner [optional] (string)

Moreover, this leads to update the animal view on UI using the following columns (detailed views)

Note: Columns ,so far, cannot be modified (hide/show)

| National ID | Sex | Breed | Date of birth | Birth farm number | Date of entry | Date of leaving | Animal group | status |
| FR 35 5172 6473 | F | 43 | 28/07/2022 | FR 56 127 755 | 28/07/2022 |   | Armoricaine | active |
| FR 35 5172 6488 | F | 43 | 02/09/2023 | FR 22 489 775 | 22/04/2024 |   | Armoricaine | active |
| NL 1234569 | M | 56 | 01/02/2024 | NL 0001234567 | 27/02/2024 | 15/06/2024 |   | inactive |

@arruda
Copy link
Contributor

arruda commented Mar 25, 2025

@fedjo I just realized while modeling this changes that we need to first confirm with the user if we want to keep a record of multiple entry/leaves of a single animal, or if there will be only one record for the animal entering/leaving the farm.

I think that if one animal can be lent multiple times to one farm, then it would make sense to keep track of all these movements (entry/exit).

And if that's the case, then I believe this field will only make sense once we have the farm calendar activities for the animals (#67).
Then it could be done as:

  • user registers purchase/lent of caw, from farm X, on day Y.
  • Then this date Y is used to update the entre date field of that animal (while for the user this field entry-date field in the animal is read-only).
  • Later, creating a selling/leaving animal calendar activity will set the leave date in the animal to be the one set in the leave activity.
  • if later on date Z the same is "rented"/lent again, then another activity for this animal entry is created and the the date Z becomes the new entry date in that animal (and leave date is reset do null).
    Alternativelly I can add now the fields, but they won't make much and be of much use until the activities to manage the I/O of animals are ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants