Add product price retrieval feature in cities
- Implemented a new endpoint in FalukantController to fetch product prices in various cities based on product ID and current price. - Developed the corresponding service method in FalukantService to calculate and return prices, considering user knowledge and city branches. - Updated frontend components (RevenueSection and SaleSection) to display better prices for products, including loading logic and UI enhancements for price visibility. - Added styling for price indicators based on branch types to improve user experience.
This commit is contained in:
@@ -144,6 +144,14 @@ class FalukantController {
|
||||
this.applyForElections = this._wrapWithUser((userId, req) => this.service.applyForElections(userId, req.body.electionIds));
|
||||
|
||||
this.getRegions = this._wrapWithUser((userId) => this.service.getRegions(userId));
|
||||
this.getProductPricesInCities = this._wrapWithUser((userId, req) => {
|
||||
const productId = parseInt(req.query.productId, 10);
|
||||
const currentPrice = parseFloat(req.query.currentPrice);
|
||||
if (Number.isNaN(productId) || Number.isNaN(currentPrice)) {
|
||||
throw new Error('productId and currentPrice are required');
|
||||
}
|
||||
return this.service.getProductPricesInCities(userId, productId, currentPrice);
|
||||
});
|
||||
this.renovate = this._wrapWithUser((userId, req) => this.service.renovate(userId, req.body.element));
|
||||
this.renovateAll = this._wrapWithUser((userId) => this.service.renovateAll(userId));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user