Trying to POST to /api/lots returns a referenceData.error.lot.lotCode.mustBeUnique error if the client specifies a preexisting lotCode. Simultaneously, because the message body requires a tradeItemId as well, there’s a 1:1 relationship between TradeItems and LotCodes. This precludes one TradeItem from having a LotCode already associated with another TradeItem which, I believe, is contrary to the necessary business rules.
Regardless of whether or not the current behavior is a bug, OpenLMIS-Angola relies on it. Their stakeholders want a 1:1 relationship between TradeItems and lot codes, and their instance relies on /api/lots to perform this validation. Please notify the Anogola support team prior to making any breaking changes related to the endpoint.