dorfteich/apps/api/src/trash/trash.module.ts
Claude Fable 5 f4f27cbe78
All checks were successful
CI / Lint, typecheck, test (push) Successful in 3m23s
CI / Build container images (push) Has been skipped
CD / Build and push images (push) Successful in 3m47s
CD / Deploy to Test (push) Successful in 11s
CD / Smoke tests against Test (push) Successful in 1m14s
CD / Promote to Int (push) Successful in 10s
CI / Auth e2e pack (push) Successful in 5m28s
CI / Import/export fidelity gate (push) Successful in 46s
Add watches: follow pages and ponds with auto-watch preferences (#93)
New watches table (polymorphic target, unique per user+target; page purge
removes its rows via the trash service, and the list endpoint drops
targets the user can no longer read). Endpoints: idempotent PUT/DELETE
/watches/{page|pond}/:id gated by read access (404 hides the target),
GET state for the header toggles, and GET /users/me/watches resolving
names and links. Auto-watch hooks: creating a page and commenting
subscribe the actor, each behind a new user preference
(autoWatchOwnPages / autoWatchOnComment, default on) editable via the
profile PATCH and surfaced as checkboxes in the settings. UI: watch
toggle on the page header and the pond settings header, watch list with
unwatch in the account settings; new watches i18n namespace (de+en).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwZ4jR4KFAPvpjWevfUGX1
2026-07-11 22:59:11 +02:00

45 lines
1.3 KiB
TypeScript

import { Module, OnModuleInit } from '@nestjs/common';
import { CommonModule } from '../common/common.module';
import { FilesModule } from '../files/files.module';
import { PagesModule } from '../pages/pages.module';
import { PondsModule } from '../ponds/ponds.module';
import { QuotasModule } from '../quotas/quotas.module';
import { WatchesModule } from '../watches/watches.module';
import { SchedulerModule } from '../scheduler/scheduler.module';
import { SchedulerService } from '../scheduler/scheduler.service';
import { TrashController } from './trash.controller';
import { TrashService } from './trash.service';
/** Daily, per operations.md's maintenance-jobs table (ADR 0013). */
const TRASH_PURGE_CADENCE_SECONDS = 24 * 60 * 60;
@Module({
imports: [
CommonModule,
PondsModule,
QuotasModule,
FilesModule,
PagesModule,
SchedulerModule,
WatchesModule,
],
controllers: [TrashController],
providers: [TrashService],
})
export class TrashModule implements OnModuleInit {
constructor(
private readonly scheduler: SchedulerService,
private readonly trash: TrashService,
) {}
onModuleInit(): void {
this.scheduler.register({
name: 'trash-purge',
cadenceSeconds: TRASH_PURGE_CADENCE_SECONDS,
run: () => this.trash.purgeDuePages(),
});
}
}