// Entity representing the external ERP products table (maeplu) - READ ONLY
import { Column, Entity, Index, PrimaryColumn } from "typeorm";

@Entity("maeplu")
export class Producto {
  @PrimaryColumn({ length: 24 })
  plu: string;

  @Column({ length: 255, nullable: true })
  desclarga: string;

  @Column({ length: 100, nullable: true })
  desccorta: string;

  @Column({ length: 50, nullable: true })
  @Index()
  alterno: string;

  @Column({ type: "decimal", precision: 12, scale: 2, default: 0 })
  precio: number;

  @Column({ default: false })
  pagaiva: boolean;

  @Column({ type: "decimal", precision: 5, scale: 2, default: 0 })
  iva: number;

  @Column({ name: "es_servicio", default: false })
  es_servicio: boolean;

  @Column({ name: "usainventario", default: true })
  usainventario: boolean;
}
