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