import { Entity, PrimaryColumn, Column } from "typeorm"; @Entity("usu_usuarios_comercios", { synchronize: false }) export class UsuarioComercios { @PrimaryColumn({ name: "uid", type: "varchar", length: 32 }) id: string; @PrimaryColumn({ name: "id_comercio", type: "int" }) idComercio: number; @Column({ name: "ultima_actualizacion", type: "timestamp" }) ultimaActualizacion: Date; @Column({ name: "puntos_activos", type: "int" }) puntosActivos: number; @Column({ name: "puntos_vencidos", type: "int" }) puntosVencidos: number; @Column({ name: "puntos_usados", type: "int" }) puntosUsados: number; @Column({ name: "puntos_totales", type: "int" }) puntosTotales: number; @Column({ name: "estado", type: "varchar", length: 10 }) estado: string; @Column({ name: "fecha_registro", type: "datetime" }) fechaRegistro: Date; @Column({ name: "email", type: "varchar", length: 2 }) envioEmail: string; @Column({ name: "sms", type: "varchar", length: 2 }) envioSMS: string; @Column({ name: "enviar_push", type: "varchar", length: 10 }) envioPush: string; @Column({ name: "FplusM_rank", type: "int" }) fmRank: number; @Column({ name: "R_rank", type: "int" }) rRank: number; @Column({ name: "id_estatus", type: "int" }) idEstatus: number; @Column({ name: "nota", type: "text" }) nota: string; @Column({ name: "regalos", type: "int" }) regalos: number; @Column({ name: "editado", type: "int" }) editado: number; @Column({ name: "nps", type: "int" }) nps?: number; constructor( id: string, idComercio: number, ultimaActualizacion: Date = new Date(), puntosActivos: number = 0, puntosVencidos: number = 0, puntosUsados: number = 0, puntosTotales: number = 0, estado: string = "activa", fechaRegistro: Date = new Date(), envioEmail: string = "si", envioSMS: string = "si", envioPush: string = "activo", fmRank: number = 0, rRank: number = 0, idEstatus: number = 12, nota: string = "-", regalos: number = 0, editado: number = 0, nps?: number ) { this.id = id; this.idComercio = idComercio; this.ultimaActualizacion = ultimaActualizacion; this.puntosActivos = puntosActivos; this.puntosVencidos = puntosVencidos; this.puntosUsados = puntosUsados; this.puntosTotales = puntosTotales; this.estado = estado; this.fechaRegistro = fechaRegistro; this.envioEmail = envioEmail; this.envioSMS = envioSMS; this.envioPush = envioPush; this.fmRank = fmRank; this.rRank = rRank; this.idEstatus = idEstatus; this.nota = nota; this.regalos = regalos; this.editado = editado; this.nps = nps; } }