Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Add life cycle information to response of plants API calls #880

Open
2 tasks
tschawax opened this issue Aug 29, 2023 · 2 comments
Open
2 tasks

Add life cycle information to response of plants API calls #880

tschawax opened this issue Aug 29, 2023 · 2 comments
Assignees
Labels
backend changes in Rust code enhancement New feature or request low priority

Comments

@tschawax
Copy link
Contributor

Tasks

  • existing model PlantsSummaryDto (backend/src/model/dto.rs) has to be extended with a new list-field life_cycle (backend/src/model/enum/life_cycle.rs), so that the endpoint invocations of /api/plants/{id} and /api/plants also contain a plant's life cycle in the response

  • life_cycle is a list containing any combination of its 3 possible values (annual, biennial, perennial) or just an empty list in case a plant has no life cycle value in the DB

  • endpoint definition of plants endpoints can be found here: backend/src/controller/plants.rs

  • currently, the response when calling /api/plants/{id} (or /api/plants for a list of plants) looks like this:

{
  "id": 2107,
  "unique_name": "Abelia triflora",
  "common_name_en": [
    "indian abelia"
  ],
  "spread": "wide"
}
  • new response should look like this:
{
  "id": <number>,
  "unique_name": <unique_name>,
  "common_name_en": [
    <common_name_en>
  ],
  "spread": <spread>,
  --> "life_cycle": [] || ["annual","biennial","perennial"] <--
}

Use case

plants_layer

Related Pull request

#724

@tschawax tschawax added the enhancement New feature or request label Aug 29, 2023
@markus2330
Copy link
Contributor

@horenso Thx for creating this issue! Please update top post:

Did you look through all UC?
Is it a good idea to stuff everything to PlantsSummaryDto?
For #476 we will need nearly all of plant's data.

@markus2330 markus2330 added the backend changes in Rust code label Sep 2, 2023
@markus2330 markus2330 moved this to Current Sprint in PermaplanT Oct 2, 2023
@markus2330
Copy link
Contributor

markus2330 commented Oct 30, 2023

when creating dates can already be calculated, see #724

This issue will only be needed when cycle information will be made available in plant attributes #476.

@markus2330 markus2330 moved this from Current Sprint to Current Milestone in PermaplanT Oct 30, 2023
@markus2330 markus2330 moved this from Current Milestone to Current Sprint in PermaplanT Mar 22, 2024
@markus2330 markus2330 moved this from Current Sprint to Current Milestone in PermaplanT Apr 2, 2024
@markus2330 markus2330 moved this from Current Milestone to Current Sprint in PermaplanT Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend changes in Rust code enhancement New feature or request low priority
Projects
Status: Current Sprint
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants