- In-app reminders: task due (skips rescheduled tasks, catch-up wording) and a per-user morning digest step in the daily job - Frontend: "Als Nächstes" on the colony page, "Heute" on the dashboard, inspection-due card, season chip, apiary overview fields, cleanup sheet for ended colonies - Frontend: plausibility warnings that stay until dismissed, withdrawal spans in the calendar, notification bell with categories and links, notification settings in the profile - ARCHITECTURE.md: T4a sections 11.1-11.10, assumptions 31-41, handler table and daily job step order Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
145 lines
6.0 KiB
TypeScript
145 lines
6.0 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule } from '@nestjs/config';
|
|
import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core';
|
|
import { ThrottlerModule } from '@nestjs/throttler';
|
|
import { ClientIpThrottlerGuard } from './common/throttler/client-ip-throttler.guard';
|
|
import { PrismaThrottlerStorage } from './common/throttler/prisma-throttler.storage';
|
|
import { ThrottlerStorageModule } from './common/throttler/throttler-storage.module';
|
|
import { PrismaModule } from './prisma/prisma.module';
|
|
import { HealthModule } from './health/health.module';
|
|
import { AuditModule } from './audit/audit.module';
|
|
import { DomainEventsModule } from './domain-events/domain-events.module';
|
|
import { UsersModule } from './users/users.module';
|
|
import { AuthModule } from './auth/auth.module';
|
|
import { RolesModule } from './roles/roles.module';
|
|
import { ApiariesModule } from './apiaries/apiaries.module';
|
|
import { ColoniesModule } from './colonies/colonies.module';
|
|
import { QueensModule } from './queens/queens.module';
|
|
import { InspectionsModule } from './inspections/inspections.module';
|
|
import { TasksModule } from './tasks/tasks.module';
|
|
import { VarroaModule } from './varroa/varroa.module';
|
|
import { TreatmentsModule } from './treatments/treatments.module';
|
|
import { FeedingsModule } from './feedings/feedings.module';
|
|
import { HarvestsModule } from './harvests/harvests.module';
|
|
import { ExtractionsModule } from './extractions/extractions.module';
|
|
import { HoneyBatchesModule } from './honey-batches/honey-batches.module';
|
|
import { StorageModule } from './storage/storage.module';
|
|
import { DashboardModule } from './dashboard/dashboard.module';
|
|
import { SearchModule } from './search/search.module';
|
|
import { ExportModule } from './export/export.module';
|
|
import { QrModule } from './qr/qr.module';
|
|
import { RemindersModule } from './reminders/reminders.module';
|
|
import { ProductsModule } from './products/products.module';
|
|
import { BottlingModule } from './bottling/bottling.module';
|
|
import { ProductionBatchesModule } from './production-batches/production-batches.module';
|
|
import { RawMaterialsModule } from './raw-materials/raw-materials.module';
|
|
import { EquipmentModule } from './equipment/equipment.module';
|
|
import { CalendarModule } from './calendar/calendar.module';
|
|
import { CalendarSyncModule } from './calendar-sync/calendar-sync.module';
|
|
import { NotificationsModule } from './notifications/notifications.module';
|
|
import { StatisticsModule } from './statistics/statistics.module';
|
|
import { WebhooksModule } from './webhooks/webhooks.module';
|
|
import { DocumentsModule } from './documents/documents.module';
|
|
import { AutomationModule } from './automation/automation.module';
|
|
import { LabelTemplatesModule } from './label-templates/label-templates.module';
|
|
import { ImportModule } from './import/import.module';
|
|
import { PublicModule } from './public/public.module';
|
|
import { TaskTemplatesModule } from './task-templates/task-templates.module';
|
|
import { SwarmControlModule } from './swarm-control/swarm-control.module';
|
|
import { WinterChecksModule } from './winter-checks/winter-checks.module';
|
|
import { WeatherModule } from './weather/weather.module';
|
|
import { ProfileModule } from './profile/profile.module';
|
|
import { SiteSettingsModule } from './site-settings/site-settings.module';
|
|
import { BackupModule } from './backup/backup.module';
|
|
import { ShopSyncModule } from './shop-sync/shop-sync.module';
|
|
import { ErpExportModule } from './erp-export/erp-export.module';
|
|
import { ApiKeysModule } from './api-keys/api-keys.module';
|
|
import { CleanupModule } from './suggestions/cleanup.module';
|
|
import { SuggestionsModule } from './suggestions/suggestions.module';
|
|
import { AutopilotModule } from './autopilot/autopilot.module';
|
|
import { SystemModule } from './system/system.module';
|
|
import { WithdrawalModule } from './withdrawal/withdrawal.module';
|
|
import { JwtAuthGuard } from './auth/guards/jwt-auth.guard';
|
|
import { PermissionsGuard } from './auth/guards/permissions.guard';
|
|
import { PermissionsModule } from './auth/permissions/permissions.module';
|
|
import { IdempotencyInterceptor } from './common/idempotency/idempotency.interceptor';
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({ isGlobal: true }),
|
|
ThrottlerModule.forRootAsync({
|
|
imports: [ThrottlerStorageModule],
|
|
inject: [PrismaThrottlerStorage],
|
|
useFactory: (storage: PrismaThrottlerStorage) => ({
|
|
throttlers: [{ name: 'default', ttl: 60000, limit: 100 }],
|
|
storage,
|
|
}),
|
|
}),
|
|
PrismaModule,
|
|
PermissionsModule,
|
|
AuditModule,
|
|
DomainEventsModule,
|
|
HealthModule,
|
|
UsersModule,
|
|
AuthModule,
|
|
RolesModule,
|
|
ApiariesModule,
|
|
ColoniesModule,
|
|
QueensModule,
|
|
InspectionsModule,
|
|
TasksModule,
|
|
VarroaModule,
|
|
TreatmentsModule,
|
|
FeedingsModule,
|
|
HarvestsModule,
|
|
ExtractionsModule,
|
|
HoneyBatchesModule,
|
|
StorageModule,
|
|
DashboardModule,
|
|
SearchModule,
|
|
ExportModule,
|
|
QrModule,
|
|
ProductsModule,
|
|
BottlingModule,
|
|
ProductionBatchesModule,
|
|
RawMaterialsModule,
|
|
EquipmentModule,
|
|
CalendarModule,
|
|
CalendarSyncModule,
|
|
NotificationsModule,
|
|
StatisticsModule,
|
|
WebhooksModule,
|
|
DocumentsModule,
|
|
AutomationModule,
|
|
SuggestionsModule,
|
|
CleanupModule,
|
|
AutopilotModule,
|
|
WithdrawalModule,
|
|
RemindersModule,
|
|
LabelTemplatesModule,
|
|
ImportModule,
|
|
PublicModule,
|
|
TaskTemplatesModule,
|
|
SwarmControlModule,
|
|
WinterChecksModule,
|
|
WeatherModule,
|
|
ProfileModule,
|
|
SiteSettingsModule,
|
|
BackupModule,
|
|
ShopSyncModule,
|
|
ErpExportModule,
|
|
ApiKeysModule,
|
|
SystemModule,
|
|
],
|
|
controllers: [],
|
|
providers: [
|
|
// Throttle first: a request with a wrong token or API key must count
|
|
// against the limit too, before any database lookup is spent on it.
|
|
{ provide: APP_GUARD, useClass: ClientIpThrottlerGuard },
|
|
{ provide: APP_GUARD, useClass: JwtAuthGuard },
|
|
{ provide: APP_GUARD, useClass: PermissionsGuard },
|
|
{ provide: APP_INTERCEPTOR, useClass: IdempotencyInterceptor },
|
|
],
|
|
})
|
|
export class AppModule {}
|