Skip to content

OBPIH-6163 Add a bulk endpoint for create/update/delete product attributes#4538

Merged
kchelstowski merged 3 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6163
Mar 12, 2024
Merged

OBPIH-6163 Add a bulk endpoint for create/update/delete product attributes#4538
kchelstowski merged 3 commits intofeature/product-supplier-list-redesignfrom
OBPIH-6163

Conversation

@kchelstowski
Copy link
Collaborator

No description provided.

List<Attribute> requiredAttributes =
Attribute.findAll("from Attribute a where :entityTypeCodes in elements(a.entityTypeCodes) and a.required = 1", [entityTypeCodes: EntityTypeCode.PRODUCT_SUPPLIER])
List<Attribute> missingRequiredAttributes = []
requiredAttributes.each { Attribute requiredAttribute ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this could be done as a simple set difference:

(requiredAttributes*.id - productAttributes*.id)?.size()

@kchelstowski kchelstowski requested a review from awalkowiak March 12, 2024 12:41
@kchelstowski kchelstowski merged commit 43d9772 into feature/product-supplier-list-redesign Mar 12, 2024
@kchelstowski kchelstowski deleted the OBPIH-6163 branch March 12, 2024 13:40
awalkowiak pushed a commit that referenced this pull request Mar 12, 2024
…butes (#4538)

* OBPIH-6163 Add translations for validation messages

* OBPIH-6163 Add a bulk endpoint for create/update/delete product attributes

* OBPIH-6163 Fixes after review
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.

2 participants