// src/entities/wishlist.entity.ts
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
import { User } from '../entity/Users';
import { ProductVariant } from '../entity/product-variant';

@Entity()
export class Wishlist {
  @PrimaryGeneratedColumn()
  wishlist_id?: number;

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  created_at?: Date;

  // Relations
  @ManyToOne(() => User, user => user.wishlists)
  @JoinColumn({ name: 'user_id' })
  user?: User;

  @ManyToOne(() => ProductVariant, variant => variant.wishlists)
  @JoinColumn({ name: 'variant_id' })
  variant?: ProductVariant;
}