fix: import paths + dead code cleanup + export ProcessResult
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 43s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 43s
- Fix PrismaService/PrismaModule import paths (infrastructure/database/) - Remove dead upsertFromReadingEvent wrappers in learning-activity/learning-session services - Export ProcessResult interface for controller return type Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
1f678409b5
commit
22ed18404f
@ -130,13 +130,5 @@ export class LearningActivityService {
|
||||
}
|
||||
|
||||
/** M8: Upsert daily activity from a reading event. */
|
||||
async upsertFromReadingEvent(data: {
|
||||
userId: string;
|
||||
activityDate: Date;
|
||||
activeSecondsDelta: number;
|
||||
isNewMaterial?: boolean;
|
||||
isMarkedRead?: boolean;
|
||||
}) {
|
||||
return this.repository.upsertFromReadingEvent(data);
|
||||
}
|
||||
// M8: upsert handled directly by repository in ProcessorService transaction — remove unused wrapper
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PrismaModule } from '../../infrastructure/prisma.module';
|
||||
import { PrismaModule } from '../../infrastructure/database/prisma.module';
|
||||
import { LearningRecordService } from './learning-record.service';
|
||||
|
||||
@Module({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../../infrastructure/prisma.service';
|
||||
import { PrismaService } from '../../infrastructure/database/prisma.service';
|
||||
|
||||
export const LEARNING_RECORD_TYPES = [
|
||||
'reading',
|
||||
|
||||
@ -19,19 +19,4 @@ export class LearningSessionService {
|
||||
return this.repository.findByUserId(userId, opts);
|
||||
}
|
||||
|
||||
/** Upsert a session from a reading event (M8 aggregation). */
|
||||
async upsertFromReadingEvent(data: {
|
||||
userId: string;
|
||||
clientSessionId: string;
|
||||
materialId: string;
|
||||
readingTargetType: string;
|
||||
knowledgeBaseId?: string | null;
|
||||
eventType: string;
|
||||
activeSecondsDelta: number;
|
||||
position?: any;
|
||||
timestampMs: number;
|
||||
startedAt: Date;
|
||||
}) {
|
||||
return this.repository.upsertByClientSession(data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PrismaModule } from '../../infrastructure/prisma.module';
|
||||
import { PrismaModule } from '../../infrastructure/database/prisma.module';
|
||||
import { MaterialReadingProgressService } from './material-reading-progress.service';
|
||||
|
||||
@Module({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../../infrastructure/prisma.service';
|
||||
import { PrismaService } from '../../infrastructure/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
export class MaterialReadingProgressService {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../../infrastructure/prisma.service';
|
||||
import { PrismaService } from '../../infrastructure/database/prisma.service';
|
||||
import { LearningSessionRepository } from '../learning-session/learning-session.repository';
|
||||
import { LearningActivityRepository } from '../learning-activity/learning-activity.repository';
|
||||
import { LearningRecordService } from '../learning-record/learning-record.service';
|
||||
@ -12,7 +12,7 @@ const VALID_EVENT_TYPES = new Set([
|
||||
const VALID_TARGET_TYPES = new Set(['knowledge_source', 'temporary_file']);
|
||||
const MAX_DELTA = 300;
|
||||
|
||||
interface ProcessResult {
|
||||
export interface ProcessResult {
|
||||
processed: number;
|
||||
duplicate: number;
|
||||
failed: number;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Body, Controller, Param, Post, Query, Req, UseGuards, UsePipes, ValidationPipe } from '@nestjs/common';
|
||||
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
|
||||
import { PrismaService } from '../../infrastructure/prisma.service';
|
||||
import { PrismaService } from '../../infrastructure/database/prisma.service';
|
||||
import { BatchUploadReadingEventsDto } from './reading-event.dto';
|
||||
import { ReadingEventProcessorService } from './reading-event-processor.service';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PrismaModule } from '../../infrastructure/prisma.module';
|
||||
import { PrismaModule } from '../../infrastructure/database/prisma.module';
|
||||
import { LearningSessionModule } from '../learning-session/learning-session.module';
|
||||
import { LearningActivityModule } from '../learning-activity/learning-activity.module';
|
||||
import { LearningRecordModule } from '../learning-record/learning-record.module';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../../infrastructure/prisma.service';
|
||||
import { PrismaService } from '../../infrastructure/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
export class ReadingEventService {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Controller, Get, Param, Query, Req, UseGuards } from '@nestjs/common';
|
||||
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
|
||||
import { PrismaService } from '../../infrastructure/prisma.service';
|
||||
import { PrismaService } from '../../infrastructure/database/prisma.service';
|
||||
import { LearningActivityRepository } from '../learning-activity/learning-activity.repository';
|
||||
import { LearningRecordService } from '../learning-record/learning-record.service';
|
||||
import { MaterialReadingProgressService } from '../material-reading-progress/material-reading-progress.service';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PrismaModule } from '../../infrastructure/prisma.module';
|
||||
import { PrismaModule } from '../../infrastructure/database/prisma.module';
|
||||
import { LearningActivityModule } from '../learning-activity/learning-activity.module';
|
||||
import { LearningRecordModule } from '../learning-record/learning-record.module';
|
||||
import { MaterialReadingProgressModule } from '../material-reading-progress/material-reading-progress.module';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PrismaModule } from '../../infrastructure/prisma.module';
|
||||
import { PrismaModule } from '../../infrastructure/database/prisma.module';
|
||||
import { TemporaryReadingMaterialService } from './temporary-reading-material.service';
|
||||
|
||||
@Module({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../../infrastructure/prisma.service';
|
||||
import { PrismaService } from '../../infrastructure/database/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
export class TemporaryReadingMaterialService {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user