Skip to content
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

Split item status enum CIRC-1416 #1124

Draft
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

marcjohnson-kint
Copy link
Member

Purpose

In order to make it easier to change the way circulation interacts with inventory records, the representation in the domain could be separated more from the underlying representation of the records in inventory storage.

One of the last remaining usages of the JSON representation is the item status. This requires more dedicated changes due to how the current enumeration has state that it should not have (as enumeration instances as shared).

Approach

  • Duplicate the current item status enumeration
  • Use the duplicate to represent the name only
  • Change the existing enumeration to a class (to stop the issues with item status date)
  • Change the loan to respect the new item instance when the state changes (due to the item being intended to have immutable state)

TODOS and Open Questions

  • The call number components constant is the only field left in the item properties class, this needs to be removed however it is used in quite a lot of the API tests. These will need to be changed before this can be removed.

Learning

  • Enumeration values are shared, they should not be allowed mutable state

@marcjohnson-kint marcjohnson-kint changed the title Circ 1416 split item status enum Split item status enum CIRC-1416 May 16, 2022
@marcjohnson-kint marcjohnson-kint force-pushed the CIRC-1416-split-item-status-enum branch from 883caaa to 5773af1 Compare May 16, 2022 10:20
@marcjohnson-kint marcjohnson-kint force-pushed the CIRC-1416-split-item-status-enum branch from 5773af1 to 78d81b9 Compare May 16, 2022 10:28
@marcjohnson-kint marcjohnson-kint force-pushed the CIRC-1416-split-item-status-enum branch from 78d81b9 to dd22a74 Compare June 22, 2022 09:26
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

96.0% 96.0% Coverage
0.0% 0.0% Duplication

@marcjohnson-kint marcjohnson-kint force-pushed the CIRC-1416-split-item-status-enum branch 3 times, most recently from 0a8566a to ec7a307 Compare July 28, 2022 09:32
@marcjohnson-kint marcjohnson-kint marked this pull request as draft July 28, 2022 09:58
@marcjohnson-kint marcjohnson-kint force-pushed the CIRC-1416-split-item-status-enum branch 2 times, most recently from 579bef4 to 162ae6c Compare July 28, 2022 18:35
@marcjohnson-kint marcjohnson-kint force-pushed the CIRC-1416-split-item-status-enum branch from 162ae6c to b870971 Compare August 15, 2022 17:43
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

96.0% 96.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant