| 36999 |
amit |
1 |
package com.spice.profitmandi.service.pricing;
|
|
|
2 |
|
|
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
|
|
4 |
|
|
|
5 |
/**
|
|
|
6 |
* Price-hike under-charge recovery. Two entry points, sharing one idempotent core:
|
|
|
7 |
*
|
|
|
8 |
* 1. {@link #applyHikeDeductionOnGrn} — called from the partner GRN flow, just before schemes.
|
|
|
9 |
* For the purchase's serialized items whose order was billed at the OLD price inside a hike's
|
|
|
10 |
* [affected_on, created_on] window, writes an APPROVED price_drop_imei row (with the item's real
|
|
|
11 |
* inventory_item_id) and debits the partner. Runs inside the GRN transaction. Drops are ignored.
|
|
|
12 |
*
|
|
|
13 |
* 2. {@link #triggerHikeDeduction} — on-demand for a whole hike: finds the billed partners/IMEIs,
|
|
|
14 |
* then processes each partner in the background executor, one transaction per retailer.
|
|
|
15 |
*
|
|
|
16 |
* Both paths are idempotent per (hike, imei): a re-run, or the two paths overlapping on the same
|
|
|
17 |
* unit, does nothing the second time.
|
|
|
18 |
*/
|
|
|
19 |
public interface PriceHikeService {
|
|
|
20 |
|
|
|
21 |
void applyHikeDeductionOnGrn(int purchaseId, int fofoId) throws ProfitMandiBusinessException;
|
|
|
22 |
|
|
|
23 |
void triggerHikeDeduction(int priceDropId);
|
|
|
24 |
}
|