20 lines
523 B
TypeScript
20 lines
523 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
import { ShipmentEntity } from '@/entities/shipment.entity';
|
|
import { Repository } from 'typeorm';
|
|
|
|
@Injectable()
|
|
export class ShipmentsService {
|
|
constructor(
|
|
@InjectRepository(ShipmentEntity)
|
|
private readonly shipmentRepository: Repository<ShipmentEntity>,
|
|
) {}
|
|
|
|
// @todo add pagination
|
|
getShipments() {
|
|
return this.shipmentRepository.find({
|
|
relations: ['liveTracking', 'containers'],
|
|
});
|
|
}
|
|
}
|