Pre-counted items not aggregating
Current behavior
Pre-counted items are not aggregating because their scan event is by SKU and aggregation function is using the "barcode identifier" field to search SOLR which is set to UPCA. So even though the product is found correctly in the pre-counted page, it is not getting aggregated.
The simple solution here is that the pre-count page should create a scan event with the UPCA instead of SKU so that aggregation works. But there may be products that are not barcoded and so don't have a UPCA.
For these products we'll need to find a new way to aggregate.
One is to allow the aggregate function to use keyword match instead of just the selected good id field. This reduces integrity of the scan aggregation process sos I am not in favor.
The other is to have an optional field in the scan event where the creating function can log the good id that the scan event was created on so that the aggregating function can query SOLR for that field.
The last and least preferred option in my opinion is to move the aggregation function to the pre-counted page itself since we are already looking up the product there.
https://jam.dev/c/0b380560-a2a1-45e3-81b3-875d4ded8bf2
We have decided that if an item is precounted, then the scan event that is created will also include the product id since the user has already specified it. This way, no matter the good identification, aggregation will work by first checking product id and then falling back to scanned value.
If a product id is present on a scan event, then system will use it to aggregate product to a count item. If product id does not exist, then it will look at scanned value like it does today.