Add product weather effects and regional pricing enhancements
- Introduced a new endpoint in FalukantController to retrieve product prices based on region and product ID. - Implemented logic in FalukantService to calculate product prices considering user knowledge and regional factors. - Added weather-related data models and associations to enhance product pricing accuracy based on weather conditions. - Updated frontend components to cache and display regional product prices effectively, improving user experience.
This commit is contained in:
40
backend/models/falukant/data/weather.js
Normal file
40
backend/models/falukant/data/weather.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../../utils/sequelize.js';
|
||||
import RegionData from './region.js';
|
||||
import WeatherType from '../type/weather.js';
|
||||
|
||||
class Weather extends Model {}
|
||||
|
||||
Weather.init(
|
||||
{
|
||||
regionId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: RegionData,
|
||||
key: 'id',
|
||||
schema: 'falukant_data'
|
||||
},
|
||||
unique: true // Jede Stadt hat nur ein Wetter
|
||||
},
|
||||
weatherTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: WeatherType,
|
||||
key: 'id',
|
||||
schema: 'falukant_type'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
modelName: 'Weather',
|
||||
tableName: 'weather',
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true}
|
||||
);
|
||||
|
||||
export default Weather;
|
||||
|
||||
Reference in New Issue
Block a user