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,21 +1,21 @@
import { BaseEntity } from '@edr/api-common';
import { Freight } from '@edr/types';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from "@edr/api-common";
import { Freight } from "@edr/types";
import { Column, Entity } from "typeorm";
@Entity({ name: 'tracking_events' })
@Entity({ name: "tracking_events" })
export class TrackingEvent extends BaseEntity {
@Column({ name: 'consignment_id', type: 'uuid' })
@Column({ name: "consignment_id", type: "uuid" })
consignmentId!: string;
@Column({ name: 'location', type: 'varchar', length: 256 })
@Column({ name: "location", type: "varchar", length: 256 })
location!: string;
@Column({ name: 'status', type: 'enum', enum: Freight.ConsignmentStatus })
@Column({ name: "status", type: "enum", enum: Freight.ConsignmentStatus })
status!: Freight.ConsignmentStatus;
@Column({ name: 'occurred_at', type: 'timestamptz' })
@Column({ name: "occurred_at", type: "timestamptz" })
occurredAt!: Date;
@Column({ name: 'description', type: 'text', nullable: true })
@Column({ name: "description", type: "text", nullable: true })
description?: string | null;
}

View File

@@ -1,17 +1,19 @@
import { Controller, Get, Param, ParseUUIDPipe } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { Controller, Get, Param, ParseUUIDPipe } from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { TrackingService } from './tracking.service';
import { TrackingService } from "./tracking.service";
@ApiTags('tracking')
@ApiTags("tracking")
// @UseGuards(JwtAuthGuard) — TODO: integrate @edr/auth
@Controller('tracking')
@Controller("tracking")
export class TrackingController {
constructor(private readonly trackingService: TrackingService) {}
@Get(':consignmentId')
@ApiOperation({ summary: 'Get the tracking timeline for a consignment' })
findByConsignment(@Param('consignmentId', ParseUUIDPipe) consignmentId: string) {
@Get(":consignmentId")
@ApiOperation({ summary: "Get the tracking timeline for a consignment" })
findByConsignment(
@Param("consignmentId", ParseUUIDPipe) consignmentId: string,
) {
return this.trackingService.findByConsignment(consignmentId);
}
}

View File

@@ -1,9 +1,9 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { TrackingEvent } from './entities/tracking-event.entity';
import { TrackingController } from './tracking.controller';
import { TrackingService } from './tracking.service';
import { TrackingEvent } from "./entities/tracking-event.entity";
import { TrackingController } from "./tracking.controller";
import { TrackingService } from "./tracking.service";
@Module({
imports: [TypeOrmModule.forFeature([TrackingEvent])],

View File

@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Injectable } from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";
import { Repository } from "typeorm";
import { TrackingEvent } from './entities/tracking-event.entity';
import { TrackingEvent } from "./entities/tracking-event.entity";
@Injectable()
export class TrackingService {
@@ -15,7 +15,7 @@ export class TrackingService {
findByConsignment(consignmentId: string): Promise<TrackingEvent[]> {
return this.trackingRepository.find({
where: { consignmentId },
order: { occurredAt: 'ASC' },
order: { occurredAt: "ASC" },
});
}