fixed name ticket

This commit is contained in:
2025-10-22 17:30:53 -06:00
parent 9b8221509f
commit 3558605533
5 changed files with 13 additions and 5 deletions
+5 -1
View File
@@ -1,7 +1,6 @@
import { Controller, Get, Post, Body } from '@nestjs/common';
import { AbonoTicketService } from './abono-ticket.service';
import { CreateAbonoTicketDto } from './dto/create-abono-ticket.dto';
import { UpdateAbonoTicketDto } from './dto/update-abono-ticket.dto';
@Controller('abono-ticket')
export class AbonoTicketController {
@@ -11,4 +10,9 @@ export class AbonoTicketController {
create(@Body() createAbonoTicketDto: CreateAbonoTicketDto) {
return this.abonoTicketService.create(createAbonoTicketDto);
}
@Get()
all() {
return this.abonoTicketService.find();
}
}
+4
View File
@@ -12,6 +12,10 @@ export class AbonoTicketService {
private readonly abonoTicketRepository: Repository<AbonoTicket>,
) {}
async find() {
return await this.abonoTicketRepository.find();
}
async findByTransaccion(transaccion: Transaccion): Promise<AbonoTicket> {
const abonoTicket = await this.abonoTicketRepository.findOne({
where: { transaccion },
@@ -9,8 +9,8 @@ import { Transaccion } from 'src/transaccion/entities/transaccion.entity'; // aj
@Entity('AbonoTicket')
export class AbonoTicket {
@PrimaryGeneratedColumn({ name: 'idTicket', type: 'int' })
idTicket: number;
@PrimaryGeneratedColumn({ name: 'idTickect', type: 'int' })
idTickect: number;
@ManyToOne(() => Transaccion, (transaccion) => transaccion.abonos, {
onDelete: 'CASCADE',
+1 -1
View File
@@ -48,7 +48,7 @@ export class OperationsService {
id_cuenta: idPersona,
monto: cantidad,
fecha_recibo: today,
folio_recibo: (await abonoTicket).idTicket,
folio_recibo: (await abonoTicket).idTickect,
},
);
@@ -40,7 +40,7 @@ export class Transaccion {
})
tipoTransaccion: number;
@OneToMany(() => AbonoTicket, (abono) => abono.idTicket)
@OneToMany(() => AbonoTicket, (abono) => abono.transaccion)
abonos: AbonoTicket[];
@OneToMany(() => PagoKiosco, (pago) => pago.kiosco)