Add status and errorMessage fields to Payment entity
This commit is contained in:
parent
f7f17a07bd
commit
b6ef03c54d
@ -4,6 +4,7 @@ import {
|
|||||||
Entity,
|
Entity,
|
||||||
PrimaryGeneratedColumn,
|
PrimaryGeneratedColumn,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
|
import { PaymentStatusEnum } from '../enumns/payment-status.enum';
|
||||||
|
|
||||||
@Entity('payments')
|
@Entity('payments')
|
||||||
export class Payment {
|
export class Payment {
|
||||||
@ -13,12 +14,22 @@ export class Payment {
|
|||||||
@Column({ type: 'decimal', precision: 10, scale: 2 })
|
@Column({ type: 'decimal', precision: 10, scale: 2 })
|
||||||
amount: number;
|
amount: number;
|
||||||
|
|
||||||
@Column({ type: 'varchar', name: 'payment_processor' })
|
@Column({
|
||||||
|
type: 'enum',
|
||||||
|
enum: PaymentStatusEnum,
|
||||||
|
default: PaymentStatusEnum.PENDING,
|
||||||
|
})
|
||||||
|
status: PaymentStatusEnum;
|
||||||
|
|
||||||
|
@Column({ type: 'varchar', name: 'payment_processor', nullable: true })
|
||||||
paymentProcessor: string;
|
paymentProcessor: string;
|
||||||
|
|
||||||
@Column({ type: 'uuid', name: 'correlation_id', unique: true })
|
@Column({ type: 'uuid', name: 'correlation_id', unique: true })
|
||||||
correlationId: string;
|
correlationId: string;
|
||||||
|
|
||||||
|
@Column({ type: 'text', nullable: true })
|
||||||
|
errorMessage: string;
|
||||||
|
|
||||||
@CreateDateColumn({ type: 'timestamp', name: 'created_at' })
|
@CreateDateColumn({ type: 'timestamp', name: 'created_at' })
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user