Enhance branch selection with weather information and localization updates

- Updated FalukantService to include weather data in branch retrieval, enhancing user context.
- Modified BranchSelection component to display current weather for selected branches, improving user experience.
- Added weather translations in both English and German localization files for better accessibility.
- Improved styling for weather information display in the frontend.
This commit is contained in:
Torsten Schulz (local)
2025-12-02 12:53:02 +01:00
parent ba1a12402d
commit 08e2c87de8
5 changed files with 96 additions and 12 deletions

View File

@@ -485,12 +485,30 @@ class FalukantService extends BaseService {
where: { falukantUserId: u.id },
include: [
{ model: BranchType, as: 'branchType', attributes: ['labelTr'] },
{ model: RegionData, as: 'region', attributes: ['name'] }
{
model: RegionData,
as: 'region',
attributes: ['name'],
include: [
{
model: Weather,
as: 'weather',
include: [
{ model: WeatherType, as: 'weatherType', attributes: ['tr'] }
],
required: false
}
]
}
],
attributes: ['id', 'regionId'],
order: [['branchTypeId', 'ASC']]
});
return bs.map(b => ({ ...b.toJSON(), isMainBranch: u.mainBranchRegionId === b.regionId }));
return bs.map(b => ({
...b.toJSON(),
isMainBranch: u.mainBranchRegionId === b.regionId,
weather: b.region?.weather?.weatherType?.tr || null
}));
}
async createBranch(hashedUserId, cityId, branchTypeId) {