import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { Member } from './Member';

@Entity('member_balance')
export class MemberBalance {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ name: 'member_id', type: 'int' })
  member_id: number;

  @Column({ name: 'site_id', type: 'int', default: 1 })
  site_id: number;

  @Column({ name: 'balance', type: 'decimal', precision: 10, scale: 2, default: 0 })
  balance: number;

  @Column({ name: 'balance_type', type: 'varchar', length: 50 })
  balance_type: string;

  @Column({ name: 'balance_desc', type: 'varchar', length: 255 })
  balance_desc: string;

  @Column({ name: 'status', type: 'tinyint', default: 1 })
  status: number;

  @Column({ name: 'delete_time', type: 'datetime', nullable: true })
  delete_time: Date;

  @CreateDateColumn({ name: 'create_time' })
  create_time: Date;

  @UpdateDateColumn({ name: 'update_time' })
  update_time: Date;

  @ManyToOne(() => Member)
  @JoinColumn({ name: 'member_id' })
  member: Member;
} 