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

@Entity('member_points')
export class MemberPoints {
  @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: 'point', type: 'int', default: 0 })
  point: number;

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

  @Column({ name: 'point_desc', type: 'varchar', length: 255 })
  point_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;
} 