Skip to content

Commit 1ca2612

Browse files
author
Ambinintsoa
committed
update 2
1 parent 6f47471 commit 1ca2612

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

src/module/contract/entities/contract.entity.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ import {
33
PrimaryGeneratedColumn,
44
Column,
55
CreateDateColumn,
6+
BaseEntity,
67
} from 'typeorm';
78

89
@Entity()
9-
export class Contract {
10+
export class Contract extends BaseEntity {
1011
@PrimaryGeneratedColumn()
1112
id: number;
1213

13-
@Column({ length: 500 })
14+
@Column({ length: 100 })
1415
employerName: string;
1516

16-
@Column({ length: 500 })
17+
@Column({ length: 100 })
1718
employeeName: string;
1819

1920
@Column('text')
@@ -22,7 +23,7 @@ export class Contract {
2223
@Column('date')
2324
dateOfBirth: Date;
2425

25-
@Column({ length: 500 })
26+
@Column({ length: 100 })
2627
jobTitle: string;
2728

2829
@Column('date')

src/module/document-model/document-model.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export class DocumentModelService {
274274
where: { createdAt: MoreThan(oneWeekAgo) },
275275
});
276276
const documents = await this.documentModelRepository.count({
277-
where: { createdAt: MoreThan(oneWeekAgo) },
277+
where: { uploadDate: MoreThan(oneWeekAgo) },
278278
});
279279
const invoices = await this.invoiceRepository.count({
280280
where: { createdAt: MoreThan(oneWeekAgo) },
@@ -297,7 +297,7 @@ export class DocumentModelService {
297297
where: { createdAt: MoreThan(oneMonthAgo) },
298298
});
299299
const documents = await this.documentModelRepository.count({
300-
where: { createdAt: MoreThan(oneMonthAgo) },
300+
where: { uploadDate: MoreThan(oneMonthAgo) },
301301
});
302302
const invoices = await this.invoiceRepository.count({
303303
where: { createdAt: MoreThan(oneMonthAgo) },

src/module/document-model/entities/document-model.entity.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ export class DocumentModel extends BaseEntity {
4242
@Column({ type: 'varchar', length: 255, nullable: false })
4343
documentUrl: string;
4444

45-
@CreateDateColumn()
46-
createdAt: Date;
47-
4845
@ManyToOne(() => User, (user) => user.documents, {
4946
onDelete: 'CASCADE',
5047
nullable: true,

src/module/invoice/entities/invoice.entity.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import {
44
Column,
55
OneToMany,
66
CreateDateColumn,
7+
BaseEntity,
78
} from 'typeorm';
89
import { Product } from '../product/entities/product.entity';
910

1011
@Entity()
11-
export class Invoice {
12+
export class Invoice extends BaseEntity {
1213
@PrimaryGeneratedColumn()
1314
id: number;
1415

src/module/invoice/product/entities/product.entity.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
1+
import {
2+
Entity,
3+
PrimaryGeneratedColumn,
4+
Column,
5+
ManyToOne,
6+
BaseEntity,
7+
} from 'typeorm';
28
import { Invoice } from '../../entities/invoice.entity';
39

410
@Entity()
5-
export class Product {
11+
export class Product extends BaseEntity {
612
@PrimaryGeneratedColumn()
713
id: number;
814

0 commit comments

Comments
 (0)