Seed provenance + inventory: source links and seed lots (#50) (#64)
Build image / build-and-push (push) Successful in 8s
Build image / build-and-push (push) Successful in 8s
Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #64.
This commit is contained in:
@@ -20,13 +20,16 @@ type plantCreateRequest struct {
|
||||
Color string `json:"color" binding:"required"`
|
||||
Icon string `json:"icon" binding:"required"`
|
||||
DaysToMaturity *int `json:"daysToMaturity"`
|
||||
SourceURL string `json:"sourceUrl"`
|
||||
Vendor string `json:"vendor"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
func (r plantCreateRequest) toInput() service.PlantInput {
|
||||
return service.PlantInput{
|
||||
Name: r.Name, Category: r.Category, SpacingCM: r.SpacingCM,
|
||||
Color: r.Color, Icon: r.Icon, DaysToMaturity: r.DaysToMaturity, Notes: r.Notes,
|
||||
Color: r.Color, Icon: r.Icon, DaysToMaturity: r.DaysToMaturity,
|
||||
SourceURL: r.SourceURL, Vendor: r.Vendor, Notes: r.Notes,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +44,8 @@ type plantUpdateRequest struct {
|
||||
Color *string `json:"color"`
|
||||
Icon *string `json:"icon"`
|
||||
DaysToMaturity json.RawMessage `json:"daysToMaturity"`
|
||||
SourceURL *string `json:"sourceUrl"`
|
||||
Vendor *string `json:"vendor"`
|
||||
Notes *string `json:"notes"`
|
||||
Version int64 `json:"version" binding:"required,min=1"`
|
||||
}
|
||||
@@ -53,7 +58,8 @@ func (r plantUpdateRequest) toPatch() (service.PlantPatch, error) {
|
||||
return service.PlantPatch{
|
||||
Name: r.Name, Category: r.Category, SpacingCM: r.SpacingCM,
|
||||
Color: r.Color, Icon: r.Icon,
|
||||
SetDays: setDays, DaysToMaturity: days, Notes: r.Notes,
|
||||
SetDays: setDays, DaysToMaturity: days,
|
||||
SourceURL: r.SourceURL, Vendor: r.Vendor, Notes: r.Notes,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user