carrera motivo listo
This commit is contained in:
parent
c4ebe4efcf
commit
b8d2294328
@ -5,14 +5,12 @@ import { CarritoMotivoController } from './carrito-motivo.controller';
|
|||||||
import { CarritoMotivoService } from './carrito-motivo.service';
|
import { CarritoMotivoService } from './carrito-motivo.service';
|
||||||
import { CarritoMotivo } from './entity/carrito-motivo.entity';
|
import { CarritoMotivo } from './entity/carrito-motivo.entity';
|
||||||
import { CarritoModule } from '../carrito/carrito.module';
|
import { CarritoModule } from '../carrito/carrito.module';
|
||||||
import { OperadorModule } from '../operador/operador.module';
|
|
||||||
import { StatusModule } from '../status/status.module';
|
import { StatusModule } from '../status/status.module';
|
||||||
import { ValidarUsuarioModule } from '../validar-usuario/validar-usuario.module';
|
import { ValidarUsuarioModule } from '../validar-usuario/validar-usuario.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
forwardRef(() => CarritoModule),
|
forwardRef(() => CarritoModule),
|
||||||
OperadorModule,
|
|
||||||
StatusModule,
|
StatusModule,
|
||||||
PassportModule.register({ defaultStrategy: 'jwt' }),
|
PassportModule.register({ defaultStrategy: 'jwt' }),
|
||||||
TypeOrmModule.forFeature([CarritoMotivo]),
|
TypeOrmModule.forFeature([CarritoMotivo]),
|
||||||
|
@ -6,7 +6,6 @@ import { Carrito } from '../carrito/entity/carrito.entity';
|
|||||||
import { CarritoMotivo } from './entity/carrito-motivo.entity';
|
import { CarritoMotivo } from './entity/carrito-motivo.entity';
|
||||||
import { Operador } from '../operador/entity/operador.entity';
|
import { Operador } from '../operador/entity/operador.entity';
|
||||||
import { CarritoService } from '../carrito/carrito.service';
|
import { CarritoService } from '../carrito/carrito.service';
|
||||||
import { OperadorService } from '../operador/operador.service';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class CarritoMotivoService {
|
export class CarritoMotivoService {
|
||||||
@ -15,7 +14,6 @@ export class CarritoMotivoService {
|
|||||||
private repository: Repository<CarritoMotivo>,
|
private repository: Repository<CarritoMotivo>,
|
||||||
@Inject(forwardRef(() => CarritoService))
|
@Inject(forwardRef(() => CarritoService))
|
||||||
private carritoService: CarritoService,
|
private carritoService: CarritoService,
|
||||||
private operadorService: OperadorService,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async create(
|
async create(
|
||||||
@ -26,6 +24,7 @@ export class CarritoMotivoService {
|
|||||||
) {
|
) {
|
||||||
const ahora = moment();
|
const ahora = moment();
|
||||||
|
|
||||||
|
// Creo y gurado registro
|
||||||
return this.repository.save(
|
return this.repository.save(
|
||||||
this.repository.create({
|
this.repository.create({
|
||||||
carrito,
|
carrito,
|
||||||
|
@ -22,6 +22,12 @@ export class CarritoMotivo {
|
|||||||
@Column({ type: Boolean, nullable: false })
|
@Column({ type: Boolean, nullable: false })
|
||||||
status: boolean;
|
status: boolean;
|
||||||
|
|
||||||
|
@Column({ type: Number, nullable: true })
|
||||||
|
id_carrito: number;
|
||||||
|
|
||||||
|
@Column({ type: Number, nullable: true })
|
||||||
|
id_operador: number;
|
||||||
|
|
||||||
@ManyToOne(() => Carrito, (carrito) => carrito.motivos)
|
@ManyToOne(() => Carrito, (carrito) => carrito.motivos)
|
||||||
@JoinColumn({ name: 'id_carrito' })
|
@JoinColumn({ name: 'id_carrito' })
|
||||||
carrito: Carrito;
|
carrito: Carrito;
|
||||||
|
Loading…
Reference in New Issue
Block a user