added new files abono-ticket, kiosco, pago-kiosco, transaccion, and others EP

This commit is contained in:
2025-10-20 12:14:16 -06:00
parent 351b5c6643
commit 2dc90a4ac8
40 changed files with 757 additions and 12 deletions
+1
View File
@@ -0,0 +1 @@
export class CreateKioscoDto {}
+4
View File
@@ -0,0 +1,4 @@
import { PartialType } from '@nestjs/mapped-types';
import { CreateKioscoDto } from './create-kiosco.dto';
export class UpdateKioscoDto extends PartialType(CreateKioscoDto) {}
+40
View File
@@ -0,0 +1,40 @@
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
@Entity()
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;
}
+20
View File
@@ -0,0 +1,20 @@
import { Test, TestingModule } from '@nestjs/testing';
import { KioscoController } from './kiosco.controller';
import { KioscoService } from './kiosco.service';
describe('KioscoController', () => {
let controller: KioscoController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [KioscoController],
providers: [KioscoService],
}).compile();
controller = module.get<KioscoController>(KioscoController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});
+34
View File
@@ -0,0 +1,34 @@
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { KioscoService } from './kiosco.service';
import { CreateKioscoDto } from './dto/create-kiosco.dto';
import { UpdateKioscoDto } from './dto/update-kiosco.dto';
@Controller('kiosco')
export class KioscoController {
constructor(private readonly kioscoService: KioscoService) {}
@Post()
create(@Body() createKioscoDto: CreateKioscoDto) {
return this.kioscoService.create(createKioscoDto);
}
@Get()
findAll() {
return this.kioscoService.findAll();
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.kioscoService.findOne(+id);
}
@Patch(':id')
update(@Param('id') id: string, @Body() updateKioscoDto: UpdateKioscoDto) {
return this.kioscoService.update(+id, updateKioscoDto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.kioscoService.remove(+id);
}
}
+9
View File
@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { KioscoService } from './kiosco.service';
import { KioscoController } from './kiosco.controller';
@Module({
controllers: [KioscoController],
providers: [KioscoService],
})
export class KioscoModule {}
+18
View File
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { KioscoService } from './kiosco.service';
describe('KioscoService', () => {
let service: KioscoService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [KioscoService],
}).compile();
service = module.get<KioscoService>(KioscoService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
+26
View File
@@ -0,0 +1,26 @@
import { Injectable } from '@nestjs/common';
import { CreateKioscoDto } from './dto/create-kiosco.dto';
import { UpdateKioscoDto } from './dto/update-kiosco.dto';
@Injectable()
export class KioscoService {
create(createKioscoDto: CreateKioscoDto) {
return 'This action adds a new kiosco';
}
findAll() {
return `This action returns all kiosco`;
}
findOne(id: number) {
return `This action returns a #${id} kiosco`;
}
update(id: number, updateKioscoDto: UpdateKioscoDto) {
return `This action updates a #${id} kiosco`;
}
remove(id: number) {
return `This action removes a #${id} kiosco`;
}
}