Skip to content

removed COOPERATION_STARTING

Christian Walgenbach requested to merge 414-remove-COOPERATION_STARTING into master

What does this MR do?

many users, including us in software development, did not know the difference between the cooperation status COOPERATION_STARTING and COOPERATION_ESTABLISHED. this is why COOPERATION_STARTING is removed from the code in this MR. However, since prod still uses the status, database triggers are used to change the status from COOPERATION_STARTING to COOPERATION_ESTABLISHED. When the change in prod is live, the triggers can be removed again.

How confident are you it won't break things if deployed?

Links to related issues

Closes #414 (closed)

How to test

  1. Checkout branch locally
  2. Login as storemanager or bot
  3. execute this sql query
UPDATE fs_betrieb
SET betrieb_status_id = 5
WHERE betrieb_status_id = 3
DELIMITER //

-- Trigger für INSERT
CREATE TRIGGER enforce_cooperation_established_on_insert
BEFORE INSERT ON fs_betrieb
FOR EACH ROW
BEGIN
    IF NEW.betrieb_status_id = 3 THEN
        SET NEW.betrieb_status_id = 5;
    END IF;
END//

-- Trigger für UPDATE
CREATE TRIGGER enforce_cooperation_established_on_update
BEFORE UPDATE ON fs_betrieb
FOR EACH ROW
BEGIN
    IF NEW.betrieb_status_id = 3 THEN
        SET NEW.betrieb_status_id = 5;
    END IF;
END//

DELIMITER ;
  1. change to master branch and choose state COOPERATION_STARTING in store and reload. It should be COOPERATION_ESTABLISHED choosen

Screenshots (if applicable)

Checklist

  • added a test, or explain why one is not needed/possible...
  • no unrelated changes
  • asked someone for a code review
  • set a "for:" label to indicate who will be affected by this change
  • set the "API change" label if changes in the API are not backward compatible
  • added to the next milestone (see https://gitlab.com/foodsharing-dev/foodsharing/-/milestones, unless it has a "for:Dev" label)
  • added an entry to CHANGELOG.md
  • added a short text in the release notes to /release-notes/YYYY-MM.md
  • Once your MR has been merged, you are responsible to create a testing issue in the Beta Testing forum: https://foodsharing.de/region?bid=734&sub=forum. Please change the MRs label to "state:Beta testing".
    • Consider writing a detailed description in German.
    • Describe in a few sentences, what should be tested from a user perspective.
    • Also mention different settings (e.g. different browsers, roles, ...) how this change can be tested.
    • Be aware, that also non technical people should understand.
Edited by Christian Walgenbach

Merge request reports