fda190f902
- Removed old DTOs for creating and updating purchase receipts. - Updated purchase receipts controller and service to use new DTOs and workflows. - Introduced transaction helper for managing database transactions. - Added new workflows for handling purchase receipt payments and supplier ledgers. - Implemented new logic for managing purchase receipt items and payments. - Enhanced error handling for payment processing in workflows. - Updated supplier ledger management to reflect changes in purchase receipts.
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
|
import { CreatePurchaseReceiptPaymentDto } from './dto/create-purchase-receipt-payment.dto'
|
|
import { UpdatePurchaseReceiptPaymentDto } from './dto/update-purchase-receipt-payment.dto'
|
|
import { PurchaseReceiptPaymentsService } from './purchase-receipt-payments.service'
|
|
|
|
@Controller('purchase-receipt-payments')
|
|
export class PurchaseReceiptPaymentsController {
|
|
constructor(
|
|
private readonly purchaseReceiptPaymentsService: PurchaseReceiptPaymentsService,
|
|
) {}
|
|
|
|
@Post()
|
|
create(@Body() dto: CreatePurchaseReceiptPaymentDto) {
|
|
return this.purchaseReceiptPaymentsService.create(dto)
|
|
}
|
|
|
|
@Get()
|
|
findAll() {
|
|
return this.purchaseReceiptPaymentsService.findAll()
|
|
}
|
|
|
|
@Get(':id')
|
|
findOne(@Param('id') id: string) {
|
|
return this.purchaseReceiptPaymentsService.findOne(Number(id))
|
|
}
|
|
|
|
@Patch(':id')
|
|
update(@Param('id') id: string, @Body() dto: UpdatePurchaseReceiptPaymentDto) {
|
|
return this.purchaseReceiptPaymentsService.update(Number(id), dto)
|
|
}
|
|
|
|
@Delete(':id')
|
|
remove(@Param('id') id: string) {
|
|
return this.purchaseReceiptPaymentsService.remove(Number(id))
|
|
}
|
|
}
|