Hello. I have an extension for product price named product price type, but when I use the sync api to update the product prices and add this price type too, I get an error. The problem seems to be that in the commandqueue, getting commands in order sets the insert price type command before the insert price command.
This is the payload:
[{„entity“:„product“,„payload“:[{„id“:„ed31723a61174088acec8c0c4a7d9f9d“,„productNumber“:„xxxxxxxx“,„name“:„xxxxxxxxx“,„stock“:0,„price“:[{„currencyId“:„b7d2554b0ce847cd82f3ac9bd1c0dfca“,„gross“:0.0,„net“:0.0,„linked“:false}],„manufacturer“:{„id“:„795f18243e1f4230b44f61f2ca7b7a2f“},„tax“:{„id“:„1c10ca2e9e424006a018a8821122d7d0“},„visibilities“:[{„salesChannelId“:„7a9b5ca3dfc141edbb568bf9ad97c409“,„visibility“:30}],„prices“:[{„ruleId“:„018bc91cc71f70f0995a9f96d4822550“,„type“:{„type“:„ek“},„price“:[{„currencyId“:„b7d2554b0ce847cd82f3ac9bd1c0dfca“,„gross“:96.35,„net“:80.97,„linked“:true}],„quantityStart“:1},{„ruleId“:„018bc91e2663725e96537951c3a853ea“,„type“:{„type“:„vk“},„price“:[{„currencyId“:„b7d2554b0ce847cd82f3ac9bd1c0dfca“,„gross“:109.67,„net“:92.16,„linked“:true}],„quantityStart“:0}],„ean“:„“}],„action“:„upsert“}]
And this is the error response
{„errors“:[{„code“:„1452“,„status“:„500“,„title“:„Internal Server Error“,„detail“:„An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (database.product_price_type, CONSTRAINT fk.product_price_type.product_price_id FOREIGN KEY (product_price_id) REFERENCES product_price (id) ON DELETE CASCADE ON U)“}]}
On version 6.4 this does not happen.
Thank you for your time and consideration.