Files
edr-platform/apps/edr-freight-api/src/modules/consignments/consignments.repository.ts
Michael Abebe 1c5ee19388 chore: fmt
2026-05-12 16:50:18 +03:00

22 lines
667 B
TypeScript

import { BaseRepository } from "@edr/api-common";
import { Injectable } from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";
import { Repository } from "typeorm";
import { Consignment } from "./entities/consignment.entity";
@Injectable()
export class ConsignmentsRepository extends BaseRepository<Consignment> {
constructor(
@InjectRepository(Consignment)
repository: Repository<Consignment>,
) {
super(repository);
}
/** Look up a consignment by its tracking number. */
findByTrackingNumber(trackingNumber: string): Promise<Consignment | null> {
return this.repository.findOne({ where: { trackingNumber } });
}
}