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

OCC-163: PriceVariantsPart doesn't support InventoryPart #315

Merged
merged 37 commits into from
Jul 24, 2023
Merged

Conversation

porgabi
Copy link
Contributor

@porgabi porgabi commented Jul 15, 2023

OCC-163

Fixes #302

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

var inventory = part.Inventory ?? new Dictionary<string, int>();
if (inventory.Any())
{
// Workaround for InventoryPart storing the outdated inventory entries along with the updated ones.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The InventoryKeys list property is used as a workaround to the incorrectly working dictionary property. For some reason, list properties do not retain cleared values (which is working as intended), while dictionaries do.

@github-actions

This comment has been minimized.

@porgabi porgabi marked this pull request as ready for review July 21, 2023 16:52
{
part.CanBeBought.Clear();

var correctInventory = inventoryPart.Inventory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This invertory correction could be extraced into a method and use that in multiple places.

@Psichorex Psichorex merged commit d8bf8f2 into main Jul 24, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PriceVariantsPart doesn't support InventoryPart (OCC-163)
2 participants