mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 08:18:20 +00:00
chore: fmt
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
||||
import { Injectable, NotFoundException } from "@nestjs/common";
|
||||
|
||||
import { ConsignmentsRepository } from './consignments.repository';
|
||||
import { CreateConsignmentDto } from './dto/create-consignment.dto';
|
||||
import { FilterConsignmentDto } from './dto/filter-consignment.dto';
|
||||
import { Consignment } from './entities/consignment.entity';
|
||||
import { ConsignmentsRepository } from "./consignments.repository";
|
||||
import { CreateConsignmentDto } from "./dto/create-consignment.dto";
|
||||
import { FilterConsignmentDto } from "./dto/filter-consignment.dto";
|
||||
import { Consignment } from "./entities/consignment.entity";
|
||||
|
||||
@Injectable()
|
||||
export class ConsignmentsService {
|
||||
constructor(private readonly consignmentsRepository: ConsignmentsRepository) {}
|
||||
constructor(
|
||||
private readonly consignmentsRepository: ConsignmentsRepository,
|
||||
) {}
|
||||
|
||||
/** Create a new consignment for a freight booking. */
|
||||
create(dto: CreateConsignmentDto): Promise<Consignment> {
|
||||
@@ -15,7 +17,9 @@ export class ConsignmentsService {
|
||||
}
|
||||
|
||||
/** Return a paginated list of consignments. */
|
||||
async findAll(filter: FilterConsignmentDto): Promise<{ items: Consignment[]; total: number }> {
|
||||
async findAll(
|
||||
filter: FilterConsignmentDto,
|
||||
): Promise<{ items: Consignment[]; total: number }> {
|
||||
const page = filter.page ?? 1;
|
||||
const pageSize = filter.pageSize ?? 20;
|
||||
const [items, total] = await this.consignmentsRepository.findAndCount({
|
||||
@@ -25,7 +29,7 @@ export class ConsignmentsService {
|
||||
},
|
||||
skip: (page - 1) * pageSize,
|
||||
take: pageSize,
|
||||
order: { createdAt: 'DESC' },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
return { items, total };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user