|
To test it, when we launch, for example a call to integrate an OTF Generation Rule through API with the table organizations filled , and then relaunch a second time the exact same call, you have this error
ERROR: duplicate key value violates unique constraint "obcpotf_couprl_org_unique"
Detail: Key (ad_client_id, ad_org_id, obcpotf_couponrules_id)=(XXXXXXXXXXXXXXXXXXXXXXXX, YYYYYYYYYYYYYYY, ZZZZZZZZZZZZZZZZ) already exists.
Expected behavior : update the value in the organization tab or do not update if there is no change, but no errors are expected.
JSON EXAMPLE :
[{"client":"Openbravo","organization":"*","searchKey":"testIntegrationviaAPI","active":true,"applicant":"testIntegrationviaAPI","discount":"test otf","description":"test otf","requestDate":"2023-12-05","startingDate":"2023-12-05","endingDate":null,"isOneCouponPerTransaction":true,"isNominalCoupon":true,"amountRule":"Percentage","xUnits":null,"yUnits":null,"applicationRule":null,"discountPercentage":"10","minQuantity":null,"includedOrganizations":"Y","includedBPCategories":"Y","includedProducts":"Y","includedProductCategories":"Y","includedCharacteristics":"Y","excludedCharacteristics":"Y","allDays":true,"startingTime":null,"endingTime":null,"isMonday":true,"isTuesday":true,"isWednesday":true,"isThursday":true,"isFriday":true,"isSaturday":true,"isSunday":true,"validFromUnit":"days","validToUnit":"days","validFromValue":"0","validToValue":"30","organizations":[{"organization":"0000001203"}],"products":[{"product":"366833","minQuantity":2}],"productCategories":[{"productCategory":"062"}],"characteristics":[{"characteristic":"Autonomie","value":"8H","isIncluded":false}],"printTextInformation":[{"language":"French (France)","title":"testABE","text":"testABEtext","description":"testABEdesc"}]}] |
|