You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
439 B
19 lines
439 B
import { Model, Table, Column, ForeignKey, BelongsTo, DataType } from 'sequelize-typescript'; |
|
import { Wallet } from './wallet.entity'; |
|
|
|
@Table |
|
export class Transaction extends Model<Transaction> { |
|
@ForeignKey(() => Wallet) |
|
@Column |
|
walletId: number; |
|
|
|
@BelongsTo(() => Wallet, { onDelete: 'CASCADE' }) |
|
wallet: Wallet; |
|
|
|
@Column({ |
|
type: DataType.STRING, |
|
allowNull: false, |
|
defaultValue: "0", |
|
}) |
|
amount: string; |
|
}
|
|
|