import { Column, DataType, Model, Table } from 'sequelize-typescript'; import { IAddressBlockingData, IAddressBook } from '../utils/interfaces'; import { accountType } from '../utils/enums'; import { Balance } from './balance'; import { Nft } from './legacyNft'; @Table({ defaultScope: { attributes: { exclude: ['blockingData'], }, }, }) export class Address extends Model { @Column({ type: DataType.INTEGER, autoIncrement: true, primaryKey: true }) id: number; @Column({ type: DataType.STRING, allowNull: false }) address: string; @Column(DataType.ENUM({ values: Object.values(accountType) })) type: accountType; @Column({ type: DataType.JSONB, allowNull: false }) balance: Balance[]; @Column({ type: DataType.JSONB, allowNull: false, defaultValue: {} }) balanceNfts: Nft[]; @Column(DataType.INTEGER) nonce: number; @Column(DataType.INTEGER) txes: number; @Column(DataType.DATE) createdAt: Date; @Column(DataType.DATE) updatedAt: Date; @Column({ type: DataType.ARRAY(DataType.INTEGER), allowNull: true, defaultValue: null }) generatedWallets: number[]; @Column({ type: DataType.JSONB, allowNull: true, defaultValue: null }) addressBook: IAddressBook; @Column({ type: DataType.JSONB, allowNull: true, defaultValue: null }) blockingData: IAddressBlockingData; }