mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 13:28:11 +00:00
22 lines
667 B
TypeScript
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 } });
|
|
}
|
|
}
|