chore: fmt

This commit is contained in:
Michael Abebe
2026-05-12 16:50:18 +03:00
parent 4540d35215
commit 1c5ee19388
181 changed files with 1492 additions and 1100 deletions

View File

@@ -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 };
}