new structure whit other database
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
import { Transaccion } from 'src/database/Monedero/entities/transaccion.entity'; // ajusta la ruta según tu estructura
|
||||
|
||||
@Entity('AbonoTicket')
|
||||
export class AbonoTicket {
|
||||
@PrimaryGeneratedColumn({ name: 'idTickect', type: 'int' })
|
||||
idTickect: number;
|
||||
|
||||
@ManyToOne(() => Transaccion, (transaccion) => transaccion.abonos, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
@JoinColumn({ name: 'idTransaccion' })
|
||||
transaccion: Transaccion;
|
||||
|
||||
@Column({ type: 'varchar', length: 100 })
|
||||
folio: string;
|
||||
|
||||
@Column({ type: 'int' })
|
||||
monto: number;
|
||||
|
||||
@Column({ type: 'datetime' })
|
||||
fecha: Date;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { PagoKiosco } from 'src/database/Monedero/entities/pago-kiosco.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm';
|
||||
|
||||
@Entity('Kiosco')
|
||||
export class Kiosco {
|
||||
@PrimaryGeneratedColumn({ type: 'int' })
|
||||
idKiosco: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 100 })
|
||||
responsable: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 100 })
|
||||
lugar: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 20 })
|
||||
token: string;
|
||||
|
||||
@Column({ type: 'tinyint', width: 1, default: 0 })
|
||||
useToken: boolean;
|
||||
|
||||
@Column({ type: 'datetime', nullable: true })
|
||||
dateToken: Date;
|
||||
|
||||
@Column({ type: 'int' })
|
||||
saldo: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 20 })
|
||||
status: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 100 })
|
||||
usuario: string;
|
||||
|
||||
@Column({ type: 'varchar', length: 250 })
|
||||
password: string;
|
||||
|
||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
||||
fechaCreado: Date;
|
||||
|
||||
@Column({ type: 'tinyint', width: 1, default: 0 })
|
||||
activado: boolean;
|
||||
|
||||
@OneToMany(() => PagoKiosco, (pagokiosco) => pagokiosco.kiosco)
|
||||
pagoKiosco: PagoKiosco[];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Transaccion } from 'src/database/Monedero/entities/transaccion.entity';
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('NombreTransaccion')
|
||||
export class NombreTransaccion {
|
||||
@PrimaryGeneratedColumn()
|
||||
idNombreTransaccion: number;
|
||||
|
||||
@Column({ type: 'varchar', length: '50' })
|
||||
nombreTransaccion: string;
|
||||
|
||||
@OneToMany(() => Transaccion, (transaccion) => transaccion.nombreTransaccion)
|
||||
transacciones: Transaccion[];
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
import { Transaccion } from 'src/database/Monedero/entities/transaccion.entity'; // ajusta la ruta
|
||||
import { PagoPatronato } from 'src/database/Monedero/entities/pago-patronato.entity';
|
||||
import { Kiosco } from './kiosco.entity';
|
||||
|
||||
@Entity('PagoKiosco')
|
||||
export class PagoKiosco {
|
||||
@PrimaryGeneratedColumn({ name: 'idPagoKiosco', type: 'int' })
|
||||
idPagoKiosco: number;
|
||||
|
||||
@ManyToOne(() => Transaccion, (transacccion) => transacccion.pagoKiosco, {
|
||||
onDelete: 'CASCADE',
|
||||
eager: true,
|
||||
})
|
||||
@JoinColumn({ name: 'idTransaccion' })
|
||||
transaccion: Transaccion;
|
||||
|
||||
@Column({ type: 'int' })
|
||||
monto: number;
|
||||
|
||||
@Column({ type: 'datetime' })
|
||||
fecha: Date;
|
||||
|
||||
@Column({ type: 'tinyint', width: 1, default: 0 })
|
||||
patronatoCompletado: boolean;
|
||||
|
||||
@Column({ type: 'tinyint', width: 1, default: 0 })
|
||||
pagoPatronatoCreado: boolean;
|
||||
|
||||
@Column({ type: 'tinyint', width: 1, default: 0 })
|
||||
ticketCreado: boolean;
|
||||
|
||||
@Column({ type: 'tinyint', width: 1, default: 0 })
|
||||
ticketEnviado: boolean;
|
||||
|
||||
@ManyToOne(() => PagoPatronato, (pago) => pago.pagoKiosco, {
|
||||
onDelete: 'CASCADE',
|
||||
eager: true,
|
||||
})
|
||||
@JoinColumn({ name: 'idPagoPatronato' })
|
||||
pagoPatronato: PagoPatronato;
|
||||
|
||||
@ManyToOne(() => Kiosco, (kiosco) => kiosco.pagoKiosco, {
|
||||
onDelete: 'CASCADE',
|
||||
eager: true,
|
||||
})
|
||||
@JoinColumn({ name: 'idKiosco' })
|
||||
kiosco: Kiosco;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { PagoKiosco } from 'src/database/Monedero/entities/pago-kiosco.entity';
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm';
|
||||
|
||||
@Entity('PagoPatronato')
|
||||
export class PagoPatronato {
|
||||
@PrimaryGeneratedColumn({ name: 'idPagoPatronato', type: 'int' })
|
||||
idPagoPatronato: number;
|
||||
|
||||
@Column({ name: 'numeroTicket', type: 'varchar', length: 30 })
|
||||
numeroTicket: string;
|
||||
|
||||
@Column({ name: 'folio', type: 'varchar', length: 30 })
|
||||
folio: string;
|
||||
|
||||
@Column({ name: 'importeLetra', type: 'varchar', length: 50 })
|
||||
importeLetra: string;
|
||||
|
||||
@Column({ name: 'fechaPago', type: 'varchar', length: 30 })
|
||||
fechaPago: string;
|
||||
|
||||
@Column({ name: 'fechaEnvio', type: 'datetime' })
|
||||
fechaEnvio: Date;
|
||||
|
||||
@OneToMany(() => PagoKiosco, (pagokiosco) => pagokiosco.pagoPatronato)
|
||||
pagoKiosco: PagoKiosco[];
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { Transaccion } from 'src/database/Monedero/entities/transaccion.entity';
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity({ name: 'Persona' })
|
||||
export class Persona {
|
||||
@PrimaryGeneratedColumn()
|
||||
idPersona: number;
|
||||
|
||||
@Column({ length: 50 })
|
||||
nombre: string;
|
||||
|
||||
@Column({ length: 50 })
|
||||
apellidoP: string;
|
||||
|
||||
@Column({ length: 50 })
|
||||
apellidoM: string;
|
||||
|
||||
@Column({ length: 150 })
|
||||
password: string;
|
||||
|
||||
@Column({ length: 150, nullable: true })
|
||||
passwordTem?: string;
|
||||
|
||||
@Column({ type: 'datetime', nullable: true })
|
||||
fechaPasswordTem?: Date;
|
||||
|
||||
@Column({ length: 100, unique: true })
|
||||
correo: string;
|
||||
|
||||
@Column({ length: 100, nullable: true })
|
||||
carreraAds?: string;
|
||||
|
||||
@Column({ type: 'float', default: 0 })
|
||||
cantidadCuenta: number;
|
||||
|
||||
@Column({ length: 150, unique: true })
|
||||
usuario: string;
|
||||
|
||||
@Column({ length: 50, nullable: true })
|
||||
numeroIdentificar?: string;
|
||||
|
||||
@Column({ length: 50 })
|
||||
tipoUsuario: string;
|
||||
|
||||
@Column({ type: 'boolean', default: false })
|
||||
correoEnviado: boolean;
|
||||
|
||||
@Column({ type: 'datetime', default: () => 'CURRENT_TIMESTAMP' })
|
||||
fechaRegistro: Date;
|
||||
|
||||
@Column({ type: 'boolean', default: false })
|
||||
cambioPasswordReq: boolean;
|
||||
|
||||
@Column({ type: 'boolean', default: false })
|
||||
primerLogin: boolean;
|
||||
|
||||
@OneToMany(() => Transaccion, (transaccion) => transaccion.persona)
|
||||
transacciones: Transaccion[];
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
} from 'typeorm';
|
||||
import { Persona } from 'src/database/Monedero/entities/persona.entity'; // ajusta la ruta según tu estructura
|
||||
import { AbonoTicket } from 'src/database/Monedero/entities/abono-ticket.entity';
|
||||
import { PagoKiosco } from 'src/database/Monedero/entities/pago-kiosco.entity';
|
||||
import { NombreTransaccion } from 'src/database/Monedero/entities/nombre-transaccion.entity';
|
||||
|
||||
@Entity('Transaccion')
|
||||
export class Transaccion {
|
||||
@PrimaryGeneratedColumn({ name: 'idTransaccion', type: 'int' })
|
||||
idTransaccion: number;
|
||||
|
||||
@ManyToOne(
|
||||
() => NombreTransaccion,
|
||||
(nombreTransaccion) => nombreTransaccion.transacciones,
|
||||
{ eager: true },
|
||||
)
|
||||
@JoinColumn({ name: 'idNombreTransaccion' })
|
||||
nombreTransaccion: NombreTransaccion;
|
||||
|
||||
@ManyToOne(() => Persona, (people) => people.transacciones, { eager: true })
|
||||
@JoinColumn({ name: 'idPersona' })
|
||||
persona: Persona;
|
||||
|
||||
@Column({ type: 'datetime' })
|
||||
fecha: Date;
|
||||
|
||||
@Column({ type: 'float' })
|
||||
saldoDespuesTransaccion: number;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: ['Impresion', 'PagoKiosco', 'AbonoTickect', 'Inscripcion'],
|
||||
})
|
||||
tipoTransaccion: number;
|
||||
|
||||
@OneToMany(() => AbonoTicket, (abono) => abono.transaccion)
|
||||
abonos: AbonoTicket[];
|
||||
|
||||
@OneToMany(() => PagoKiosco, (pago) => pago.kiosco)
|
||||
pagoKiosco: PagoKiosco[];
|
||||
}
|
||||
Reference in New Issue
Block a user