src/orders/pod/pod.controller.ts
pod
Methods |
|
| Async getPendingPods | ||||||
getPendingPods(orgId: string)
|
||||||
Decorators :
@Get()
|
||||||
|
Defined in src/orders/pod/pod.controller.ts:43
|
||||||
|
Parameters :
Returns :
unknown
|
| Async getPod | ||||||
getPod(orderId: string)
|
||||||
Decorators :
@Get(':orderId')
|
||||||
|
Defined in src/orders/pod/pod.controller.ts:38
|
||||||
|
Parameters :
Returns :
unknown
|
| Async submitPod | |||||||||
submitPod(orderId: string, body: literal type)
|
|||||||||
Decorators :
@Post(':orderId')
|
|||||||||
|
Defined in src/orders/pod/pod.controller.ts:22
|
|||||||||
|
Parameters :
Returns :
unknown
|
import {
Controller,
Post,
Get,
Param,
Body,
UseGuards,
} from '@nestjs/common';
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
import { PodService } from './pod.service';
import { CombinedAuthGuard } from '../../auth/guards/combined-auth.guard';
import { CurrentUser } from '../../auth/decorators/current-user.decorator';
@ApiTags('Proof of Delivery')
@ApiBearerAuth()
@UseGuards(CombinedAuthGuard)
@Controller('pod')
export class PodController {
constructor(private podService: PodService) {}
@Post(':orderId')
async submitPod(
@Param('orderId') orderId: string,
@Body()
body: {
recipientName: string;
recipientSignature?: string;
photos?: string[];
notes?: string;
latitude?: number;
longitude?: number;
},
) {
return this.podService.submitPod(orderId, body);
}
@Get(':orderId')
async getPod(@Param('orderId') orderId: string) {
return this.podService.getPod(orderId);
}
@Get()
async getPendingPods(@CurrentUser('organizationId') orgId: string) {
return this.podService.getPendingPods(orgId);
}
}