- Delete department.entity.ts, user-department.entity.ts - Remove Department/UserDepartment from entities/index.ts - Remove departmentId column from 18 entities (AttendanceRecord, ArchiveAttachment, Bill, ClassSchedule, Classroom, ClassroomRental, Deposit, DepositInstallment, ExamScore, LearningRecord, Occupancy, PersonalExpense, ResultArchive, Room, RoomExpense, Student, StudentEnrollment, StudentProfile, StudentReport) - Remove departments/ module entirely - Delete campus-scope.ts, campus-scope.middleware.ts (request-utils.ts kept — it's just IP extraction) - Simplify common.module.ts to empty module - Remove CampusScopeMiddleware from app.module.ts - Remove all CampusScope injections and filter calls across all services - Remove departmentId from all DTOs and controllers - Simplify dingtalk/wecom sync to only sync users (no dept table) - Update seed module to remove department seeding - Clean frontend compilation
45 lines
918 B
TypeScript
45 lines
918 B
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
} from 'typeorm';
|
|
import { Room } from './room.entity';
|
|
|
|
@Entity('room_expenses')
|
|
export class RoomExpense {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@Column({ name: 'room_id' })
|
|
roomId: number;
|
|
|
|
@Column({ name: 'expense_type', type: 'varchar', length: 20 })
|
|
expenseType: string;
|
|
|
|
@Column({ type: 'decimal', precision: 10, scale: 2 })
|
|
amount: number;
|
|
|
|
@Column({ name: 'period_start', type: 'date' })
|
|
periodStart: string;
|
|
|
|
@Column({ name: 'period_end', type: 'date' })
|
|
periodEnd: string;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
description: string;
|
|
|
|
@Column({ name: 'recorded_by', nullable: true })
|
|
recordedBy: number;
|
|
|
|
@CreateDateColumn({ name: 'created_at' })
|
|
createdAt: Date;
|
|
|
|
@ManyToOne(() => Room, (r) => r.roomExpenses)
|
|
@JoinColumn({ name: 'room_id' })
|
|
room: Room;
|
|
|
|
}
|