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

Set remove_date when creating plantings according to its life_cycle. #1334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

horenso
Copy link
Contributor

@horenso horenso commented Apr 22, 2024

Summary

Set remove_date automatically according to the plants life cycle. The code is ok but it may be better to change the data type of life_cycles of plants in the db. Option<Vec<Option<LifeCycle>>> is such a ridiculous type, it should be Vec<LifeCycle> if LifeCycle is not enough, or if we prefer nullable (It's a different debate whether nullable strings and lists make sense ever) It can be Option<Vec<LifeCycle>>.

We may want to consider in the database:
ife_cycles life_cycle[] NOT NULL DEFAULT ARRAY[]::life_cycle[]
and
ALTER TABLE plants ADD CONSTRAINT no_null_life_cycles CHECK (NOT ARRAY[NULL] <@ life_cycles);

(If there is no logic reason it be very to create a migration that just the longest life_cycle per plant)

Basics

  • The PR is rebased with current master
  • I added a line to changelog.md
  • Details of what I changed are in the commit messages
  • References to issues, e.g. close #X, are in the commit messages and changelog
  • The buildserver is happy

Checklist

  • I fully described what my PR does in the documentation
  • I fixed all affected documentation
  • I fixed the introduction tour
  • I wrote migrations in a way that they are compatible with already present data
  • I fixed all affected decisions
  • I added automated tests or a manual test protocol
  • I added code comments, logging, and assertions as appropriate
  • I translated all strings visible to the user
  • I mentioned every code or binary not directly written or done by me in reuse syntax
  • I created left-over issues for things that are still to be done
  • Code is conforming to our Architecture
  • Code is conforming to our Guidelines
  • Code is consistent to our Design Decisions
  • Exceptions to any guidelines are documented

First Time Checklist

Review

  • I've tested the code via issue description
  • I've tested the code via requirements
  • I've tested the code with concurrency (several browsers on the same map)
  • I've read through the code
  • I've read through the documentation
  • I've checked conformity to guidelines
  • I've checked conformity to requirements
  • I've checked that the requirements are automatically tested

@horenso horenso linked an issue Apr 22, 2024 that may be closed by this pull request
2 tasks
@horenso horenso force-pushed the feature/horenso/724-set-remove-date-place-non-perennial-planting branch from 236d5c0 to 424a0a5 Compare April 22, 2024 22:10
@horenso horenso requested review from badnames and chr-schr April 24, 2024 11:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

non-perennial plants should be automatically removed
1 participant