-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e390ccd
commit 25a53cd
Showing
33 changed files
with
523 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,27 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { AppController } from './app.controller'; | ||
import { AppService } from './app.service'; | ||
import { AuthModule } from './auth/auth.module'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { TypeOrmConfigService } from './libs'; | ||
import { NoticeModule } from './module/notice/notice.module'; | ||
import { NoticeMessageModule } from './module/notice-message/notice-message.module'; | ||
import { FeesModule } from './module/fees/fees.module'; | ||
import { StudentModule } from './module/student/student.module'; | ||
import { AttendanceModule } from './module/attendance/attendance.module'; | ||
import { StaffModule } from './module/staff/staff.module'; | ||
import { NotificationModule } from './module/notification/notification.module'; | ||
import { config, TypeOrmConfigService } from './libs'; | ||
import { ConfigModule } from '@nestjs/config'; | ||
import { config } from './libs/config/config'; | ||
import { ForumModule } from './module/forum/forum.module'; | ||
import { StudentModule } from './module/student/student.module'; | ||
import { getConnectionOptions } from 'typeorm'; | ||
|
||
|
||
@Module({ | ||
imports: [ | ||
ConfigModule.forRoot({ | ||
isGlobal: true, | ||
load: [config] | ||
load: [config], | ||
}), | ||
AuthModule, | ||
TypeOrmModule.forRootAsync({ | ||
useClass: TypeOrmConfigService | ||
}), | ||
|
||
StaffModule, | ||
NoticeModule, | ||
NoticeMessageModule, | ||
FeesModule, | ||
StudentModule, | ||
AttendanceModule, | ||
NotificationModule, | ||
ForumModule | ||
|
||
], | ||
controllers: [AppController], | ||
providers: [AppService], | ||
}) | ||
export class AppModule { } | ||
export class AppModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
BaseEntity, | ||
PrimaryGeneratedColumn, | ||
CreateDateColumn, | ||
UpdateDateColumn, | ||
} from 'typeorm'; | ||
|
||
export abstract class AbstractEntity extends BaseEntity { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@CreateDateColumn({ name: 'created_at' }) | ||
createdAt: Date; | ||
|
||
@UpdateDateColumn({ name: 'updated_at' }) | ||
updatedAt: Date; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Column, Entity } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
|
||
@Entity({ name: 'address_type' }) | ||
export class AddressTypeEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { StudentEntity } from './student.entity'; | ||
import { ParentEntity } from './parent.entity'; | ||
import { TutorEntity } from './tutor.entity'; | ||
|
||
@Entity({ name: 'address' }) | ||
export class AddressEntity extends AbstractEntity { | ||
@Column({ default: '' }) | ||
city: string; | ||
|
||
@Column({ default: '' }) | ||
country: string; | ||
|
||
@Column({ default: '' }) | ||
street: string; | ||
|
||
@Column({ default: '' }) | ||
state: string; | ||
|
||
@Column({ default: '' }) | ||
province: string; | ||
|
||
@Column({ default: '' }) | ||
zip_code: string; | ||
|
||
@Column({ default: '' }) | ||
postal_code: string; | ||
|
||
@Column({ default: '' }) | ||
line1: string; | ||
|
||
@Column({ default: '' }) | ||
line2: string; | ||
|
||
@ManyToOne(() => StudentEntity) | ||
@JoinColumn({ name: 'student_id', referencedColumnName: 'id' }) | ||
student: StudentEntity; | ||
|
||
@ManyToOne(() => ParentEntity) | ||
@JoinColumn({ name: 'parent_id', referencedColumnName: 'id' }) | ||
parent: ParentEntity; | ||
|
||
@ManyToOne(() => TutorEntity) | ||
@JoinColumn({ name: 'tutor_id', referencedColumnName: 'id' }) | ||
tutor: TutorEntity; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { Column, Entity, JoinTable, ManyToMany, ManyToOne } from 'typeorm'; | ||
import { SemesterEntity } from './semester.entity'; | ||
import { StudentEntity } from './student.entity'; | ||
import { TutorEntity } from './tutor.entity'; | ||
import { SubjectEntity } from './subject.entity'; | ||
|
||
@Entity({ name: 'attendance' }) | ||
export class AttendanceEntity extends AbstractEntity { | ||
@Column() | ||
status: string; | ||
|
||
@Column() | ||
month: string; | ||
|
||
@ManyToMany(() => SemesterEntity) | ||
@JoinTable({ | ||
name: 'subject_attendance', | ||
joinColumn: { name: 'subject_id', referencedColumnName: 'id' }, | ||
inverseJoinColumn: { name: 'attendance_id', referencedColumnName: 'id' }, | ||
}) | ||
subject: SubjectEntity[]; | ||
|
||
@ManyToMany(() => SemesterEntity) | ||
@JoinTable({ | ||
name: 'semester_attendance', | ||
joinColumn: { name: 'semester_id', referencedColumnName: 'id' }, | ||
inverseJoinColumn: { name: 'attendance_id', referencedColumnName: 'id' }, | ||
}) | ||
semester: SemesterEntity[]; | ||
|
||
@ManyToMany(() => StudentEntity) | ||
@JoinTable({ | ||
name: 'student_attendance', | ||
joinColumn: { name: 'student_id', referencedColumnName: 'id' }, | ||
inverseJoinColumn: { name: 'attendance_id', referencedColumnName: 'id' }, | ||
}) | ||
student: StudentEntity[]; | ||
|
||
@ManyToMany(() => TutorEntity) | ||
@JoinTable({ | ||
name: 'tutor_attendance', | ||
joinColumn: { name: 'tutor_id', referencedColumnName: 'id' }, | ||
inverseJoinColumn: { name: 'attendance_id', referencedColumnName: 'id' }, | ||
}) | ||
tutor: TutorEntity[]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { Column, Entity, JoinColumn, ManyToOne } from 'typeorm'; | ||
import { ClassroomEntity } from './classroom.entity'; | ||
import { SubjectEntity } from './subject.entity'; | ||
import { TutorEntity } from './tutor.entity'; | ||
|
||
@Entity({ name: 'class' }) | ||
export class ClassEntity extends AbstractEntity { | ||
@Column() | ||
period: number; | ||
|
||
@Column() | ||
time: Date; | ||
|
||
@ManyToOne(() => ClassroomEntity) | ||
@JoinColumn({ name: 'classroom_id', referencedColumnName: 'id' }) | ||
classroom: ClassroomEntity; | ||
|
||
@ManyToOne(() => SubjectEntity) | ||
@JoinColumn({ name: 'subject_id', referencedColumnName: 'id' }) | ||
subject: SubjectEntity; | ||
|
||
@ManyToOne(() => TutorEntity) | ||
@JoinColumn({ name: 'tutor_id', referencedColumnName: 'id' }) | ||
tutor: TutorEntity; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { Column, Entity } from 'typeorm'; | ||
|
||
@Entity({ name: 'classroom' }) | ||
export class ClassroomEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
@Column() | ||
capacity: number; | ||
@Column() | ||
type: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { Column, Entity } from 'typeorm'; | ||
|
||
@Entity({ name: 'course' }) | ||
export class CourseEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
|
||
@Column() | ||
code: string; | ||
|
||
@Column() | ||
capacity:number | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Column, Entity } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
|
||
@Entity({ name: 'department' }) | ||
export class DepartmentEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Column, Entity } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
|
||
@Entity({ name: 'exam_type' }) | ||
export class ExamTypeEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
|
||
@Column({ default: '' }) | ||
description?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Column, Entity, JoinColumn, OneToOne } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { YearLevelEntity } from './year-level.entity'; | ||
|
||
@Entity({ name: 'exam' }) | ||
export class ExamEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
|
||
@Column() | ||
start_date: Date; | ||
|
||
@OneToOne(() => YearLevelEntity) | ||
@JoinColumn({ name: 'year_level_id', referencedColumnName: 'id' }) | ||
year: YearLevelEntity; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { Column, Entity } from 'typeorm'; | ||
|
||
@Entity({ name: 'forum_status' }) | ||
export class ForumStatusEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { Column, Entity, JoinColumn, ManyToOne, OneToOne } from 'typeorm'; | ||
import { StudentEntity } from './student.entity'; | ||
import { TutorEntity } from './tutor.entity'; | ||
import { ForumStatusEntity } from './forum-status.entity'; | ||
import { Forum_threadEntity } from './forum_thread.entity'; | ||
|
||
@Entity({ name: 'forum_post' }) | ||
export class Forum_postEntity extends AbstractEntity { | ||
@Column({ type: 'text' }) | ||
content: string; | ||
|
||
@OneToOne(() => ForumStatusEntity) | ||
@JoinColumn({ name: 'forum_status_id', referencedColumnName: 'id' }) | ||
status: ForumStatusEntity; | ||
|
||
@ManyToOne(() => Forum_threadEntity) | ||
@JoinColumn({ name: 'forum_thread_id', referencedColumnName: 'id' }) | ||
thread: Forum_threadEntity; | ||
|
||
@ManyToOne(() => StudentEntity) | ||
@JoinColumn({ name: 'student_id', referencedColumnName: 'id' }) | ||
student: StudentEntity; | ||
|
||
@ManyToOne(() => TutorEntity) | ||
@JoinColumn({ name: 'tutor_id', referencedColumnName: 'id' }) | ||
tutor: TutorEntity; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Column, Entity } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
|
||
@Entity({ name: 'forum_thread' }) | ||
export class Forum_threadEntity extends AbstractEntity { | ||
@Column() | ||
title: string; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Entity } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
|
||
@Entity({ name: 'grade' }) | ||
export class GradesEntity extends AbstractEntity { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Column, Entity, JoinColumn, ManyToOne, OneToMany } from 'typeorm'; | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { AddressEntity } from './address.entity'; | ||
import { StudentEntity } from './student.entity'; | ||
|
||
@Entity({ name: 'parent' }) | ||
export class ParentEntity extends AbstractEntity { | ||
@Column() | ||
first_name: string; | ||
|
||
@Column() | ||
last_name: string; | ||
|
||
@Column() | ||
email: string; | ||
|
||
@Column() | ||
contact: string; | ||
|
||
@Column() | ||
type: string; | ||
|
||
@Column({ default: '' }) | ||
title: string; | ||
|
||
@Column() | ||
gender: string; | ||
|
||
@Column({ default: '' }) | ||
occupation: string; | ||
|
||
@OneToMany(() => AddressEntity, address => address.parent) | ||
addresses: AddressEntity[]; | ||
|
||
@ManyToOne(() => StudentEntity) | ||
@JoinColumn({ name: 'student_id', referencedColumnName: 'id' }) | ||
student: StudentEntity; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { AbstractEntity } from './abstract-entity'; | ||
import { Column, Entity } from 'typeorm'; | ||
|
||
@Entity({ name: 'semester' }) | ||
export class SemesterEntity extends AbstractEntity { | ||
@Column() | ||
name: string; | ||
} |
Oops, something went wrong.