-
Notifications
You must be signed in to change notification settings - Fork 78
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
LF-4166 (4): Implement end to end animal creation flow #3397
Changes from 13 commits
19eb066
c7e41f8
5f7e8f9
50b9556
6fcb104
1c7b4dc
2582ce0
b694cca
6c9ff30
5260f26
b266c93
8d85441
9f9560b
032ed32
2baba57
9fc8d20
ad2b487
e7e4078
1211b98
f73d909
79566c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,8 @@ export interface Animal { | |
group_ids: number[]; | ||
id: number; | ||
identifier: string | null; | ||
identifier_type_id: number | null; | ||
identifier_type_other: string | null; | ||
identifier_color_id: number | null; | ||
internal_identifier: number; | ||
name: string | null; | ||
|
@@ -39,15 +41,21 @@ export interface Animal { | |
sex_id: number; | ||
sire: string | null; | ||
weaning_date: string | null; | ||
organic_status: 'Non-Organic' | 'Transitional' | 'Organic'; | ||
supplier: string | null; | ||
price: number | null; | ||
animal_removal_reason_id: number | null; | ||
removal_explanation: string | null; | ||
removal_date: string | null; | ||
} | ||
|
||
export interface AnimalBatch { | ||
birth_date: string | null; | ||
brought_in_date: string | null; | ||
count: number; | ||
custom_breed_id: number | null; | ||
custom_type_id: number | null; | ||
dam: string | null; | ||
default_breed_id: number | null; | ||
default_type_id: number | null; | ||
farm_id: string; | ||
|
@@ -56,13 +64,24 @@ export interface AnimalBatch { | |
internal_identifier: number; | ||
name: string | null; | ||
notes: string | null; | ||
origin_id: number; | ||
photo_url: string | null; | ||
sex_detail: { sex_id: number; count: number }[]; | ||
sire: string | null; | ||
organic_status: 'Non-Organic' | 'Transitional' | 'Organic'; | ||
supplier: string | null; | ||
price: number | null; | ||
animal_removal_reason_id: number | null; | ||
removal_explanation: string | null; | ||
removal_date: string | null; | ||
} | ||
|
||
export interface PostBatchSexDetail { | ||
animal_batch_sex_detail?: { sex_id: number; count: number }[]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my only question is if this is to match up a name difference from frontend and backend -- is it possible to fix it to be one name? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's actually a bug...!!! Sex detail will not be added unless the key is |
||
} | ||
|
||
export type PostAnimalBatch = Partial<AnimalBatch> & PostBatchSexDetail; | ||
|
||
export interface AnimalGroup { | ||
farm_id: string; | ||
id: number; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could consider making
'Non-Organic' | 'Transitional' | 'Organic'
a reusable type -- its used twice here and would be useful for any locations that are going to be added like pasture.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely. I got a bit lazy about finding the right place for it, sorry. I'll make sure to add it!