feat: add quotation list endpoint (no query)
This commit is contained in:
parent
fe50a31e08
commit
a2dbaf29fb
1 changed files with 25 additions and 1 deletions
|
|
@ -169,7 +169,31 @@ export class QuotationController extends Controller {
|
|||
|
||||
@Get()
|
||||
@Security("keycloak")
|
||||
async getQuotationList(@Query() page: number = 1, @Query() pageSize: number = 30) {}
|
||||
async getQuotationList(@Query() page: number = 1, @Query() pageSize: number = 30) {
|
||||
const [result, total] = await prisma.$transaction([
|
||||
prisma.quotation.findMany({
|
||||
include: {
|
||||
worker: true,
|
||||
service: {
|
||||
include: {
|
||||
_count: { select: { work: true } },
|
||||
work: {
|
||||
include: {
|
||||
_count: { select: { productOnWork: true } },
|
||||
productOnWork: {
|
||||
include: { product: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
prisma.quotation.count(),
|
||||
]);
|
||||
|
||||
return { result: result, page, pageSize, total };
|
||||
}
|
||||
|
||||
@Post()
|
||||
@Security("keycloak")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue