Mailservice
This commit is contained in:
33
api/src/model/entitites/log/email.log.entity.ts
Normal file
33
api/src/model/entitites/log/email.log.entity.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { KeySystem } from '../system.entity';
|
||||
import { EmailEvent } from 'src/modules/log/log.service';
|
||||
|
||||
@Entity()
|
||||
export class EmailLog {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at' })
|
||||
createdAt: Date;
|
||||
|
||||
@Column({ type: 'text'})
|
||||
to: string;
|
||||
|
||||
@Column({ type: 'text'})
|
||||
message: string;
|
||||
|
||||
@Column({ name: 'type', type: 'text',})
|
||||
type: EmailEvent;
|
||||
|
||||
@ManyToOne(() => KeySystem, { nullable: true })
|
||||
system: KeySystem;
|
||||
|
||||
@Column({type: 'boolean'})
|
||||
success: boolean;
|
||||
}
|
||||
1
api/src/model/entitites/log/index.ts
Normal file
1
api/src/model/entitites/log/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './email.log.entity';
|
||||
10
api/src/model/repositories/log/email.log.repository.ts
Normal file
10
api/src/model/repositories/log/email.log.repository.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Repository, DataSource } from 'typeorm';
|
||||
import { EmailLog } from 'src/model/entitites/log';
|
||||
|
||||
@Injectable()
|
||||
export class EmailLogRepository extends Repository<EmailLog> {
|
||||
constructor(dataSource: DataSource) {
|
||||
super(EmailLog, dataSource.createEntityManager());
|
||||
}
|
||||
}
|
||||
1
api/src/model/repositories/log/index.ts
Normal file
1
api/src/model/repositories/log/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './email.log.repository';
|
||||
Reference in New Issue
Block a user