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

Calculate the number of spares within a catalogue item #417

Open
7 tasks done
joelvdavies opened this issue Nov 8, 2024 · 1 comment · May be fixed by #434
Open
7 tasks done

Calculate the number of spares within a catalogue item #417

joelvdavies opened this issue Nov 8, 2024 · 1 comment · May be fixed by #434
Assignees
Labels
enhancement New feature or request

Comments

@joelvdavies
Copy link
Collaborator

joelvdavies commented Nov 8, 2024

Following on from #413 and #416. Update the spares field in the parent catalogue item whenever:

  • An item is created
  • An item is deleted
  • An item's usage status is updated
  • The definition of a spare is updated

It is not currently possible to move items between catalogue items. The calculation itself should:

@joelvdavies
Copy link
Collaborator Author

joelvdavies commented Nov 29, 2024

I believe the issue mentioned about count being inaccurate sometimes is fine with count_documents

https://stackoverflow.com/questions/65282889/mongodb-count-versus-countdocuments

See https://www.mongodb.com/docs/manual/reference/method/db.collection.countDocuments/#mechanics, it uses the aggregation behind the scenes.

@joelvdavies joelvdavies linked a pull request Nov 29, 2024 that will close this issue
3 tasks
joelvdavies added a commit that referenced this issue Dec 2, 2024
joelvdavies added a commit that referenced this issue Dec 2, 2024
joelvdavies added a commit that referenced this issue Dec 3, 2024
joelvdavies added a commit that referenced this issue Dec 5, 2024
joelvdavies added a commit that referenced this issue Dec 5, 2024
joelvdavies added a commit that referenced this issue Dec 5, 2024
joelvdavies added a commit that referenced this issue Dec 5, 2024
joelvdavies added a commit that referenced this issue Dec 6, 2024
joelvdavies added a commit that referenced this issue Dec 6, 2024
joelvdavies added a commit that referenced this issue Dec 6, 2024
@joelvdavies joelvdavies moved this from In Progress to In Review in Inventory Management System Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

1 participant