Openbravo Issue Tracking System - Retail Modules
View Issue Details
0054840Retail ModulesRetail APIpublic2024-03-05 11:332024-03-19 16:01
AgatheBertin 
Rajesh_18 
normalmajoralways
closedfixed 
5
 
 
No
0054840: API OTF Coupon Rule : Missing Identifier for ExternalEntities
Identifier are missing for the following entities (despite an unicity constraint in the datebase for some of them)

OBCPOTF_CouponrulesOrg => should be organization

OBCPOTF_CouponrulesPrint => should be organization + language

OBCPOTF_CouponrulesBPCat => should be businessPartnerCategory

OBCPOTF_CouponrulesChar => should be Characteristic + value
Launch an API call to create an OTF with all the subtabs filled
==> relaunch the exact same call ==> ERROR in the EDLs
OBCPOTF_CouponrulesOrg => should be organization

OBCPOTF_CouponrulesPrint => should be organization + language

OBCPOTF_CouponrulesBPCat => should be businessPartnerCategory

OBCPOTF_CouponrulesChar => should be Characteristic + value
No tags attached.
Issue History
2024-03-05 11:33AgatheBertinNew Issue
2024-03-05 11:33AgatheBertinAssigned To => Triage Platform Conn
2024-03-05 11:33AgatheBertinTriggers an Emergency Pack => No
2024-03-07 10:29adrianromeroAssigned ToTriage Platform Conn => Retail
2024-03-12 10:53AgatheBertinNote Added: 0162009
2024-03-12 11:06jorgewederagoStatusnew => acknowledged
2024-03-13 10:09Rajesh_18Assigned ToRetail => Rajesh_18
2024-03-13 10:09Rajesh_18Statusacknowledged => scheduled
2024-03-14 05:57hgbotNote Added: 0162118
2024-03-19 16:01hgbotResolutionopen => fixed
2024-03-19 16:01hgbotStatusscheduled => closed
2024-03-19 16:01hgbotNote Added: 0162368
2024-03-19 16:01hgbotNote Added: 0162369

Notes
(0162009)
AgatheBertin   
2024-03-12 10:53   
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"}]}]
(0162118)
hgbot   
2024-03-14 05:57   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf.api/-/merge_requests/12 [^]
(0162368)
hgbot   
2024-03-19 16:01   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf.api [^]
Changeset: cab1e9a1801938e8d848fdb64484aa18e74954a1
Author: Rajesh Senthilkumar <rajesh@qualiantech.com>
Date: 13-03-2024 16:46:48
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf.api/-/commit/cab1e9a1801938e8d848fdb64484aa18e74954a1 [^]

Fixed ISSUE-54840: Set Identifiers for organization,businessPartnerCategory,Characteristic and Print

---
M src-db/database/sourcedata/OBEI_PROP_MAP_INSTANCE.xml
---
(0162369)
hgbot   
2024-03-19 16:01   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf.api/-/merge_requests/12 [^]