update : invoice entity
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class RemoveNotNullFromInvoicePurpose1770032438762 implements MigrationInterface {
|
||||
name = 'RemoveNotNullFromInvoicePurpose1770032438762'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "invoice" ALTER COLUMN "purpose" DROP NOT NULL`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "invoice" ALTER COLUMN "purpose" SET NOT NULL`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -70,9 +70,9 @@ export class Invoice extends BaseEntity {
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: InvoicePurpose,
|
||||
nullable: false,
|
||||
nullable: true,
|
||||
})
|
||||
purpose: InvoicePurpose;
|
||||
purpose?: InvoicePurpose;
|
||||
|
||||
get isOverdue(): boolean {
|
||||
return this.status === InvoiceStatus.PENDING && new Date() > this.dueDate;
|
||||
|
||||
Reference in New Issue
Block a user