Feat: Invoice viewing, JoFotara UBL refinements, delete functionality, and tax rate validation

This commit is contained in:
Hamza-Ayed
2026-04-19 15:03:39 +03:00
parent 47d473add5
commit 3acd9f261b
7 changed files with 247 additions and 25 deletions

View File

@@ -84,4 +84,24 @@ export class InvoicesController {
async submit(@CurrentUser() user: any, @Param('id', ParseUUIDPipe) id: string) {
return this.invoicesService.submitToJoFotara(user.tenantId, id);
}
/**
* حذف الفاتورة نهائياً
*/
@Post(':id/delete') // Using POST for delete to match frontend request style or use standard DELETE
@Roles(UserRole.ADMIN, UserRole.ACCOUNTANT)
async remove(@CurrentUser() user: any, @Param('id', ParseUUIDPipe) id: string) {
return this.invoicesService.remove(user.tenantId, id);
}
/**
* الحصول على الملف الأصلي للفاتورة
*/
@Get(':id/file')
async getFile(
@CurrentUser() user: any,
@Param('id', ParseUUIDPipe) id: string,
) {
return this.invoicesService.getFile(user.tenantId, id);
}
}