task-l.3.1
This commit is contained in:
@@ -2319,7 +2319,8 @@ export async function listEnquiryQuotationRelations(
|
||||
|
||||
export async function listCustomerQuotationRelations(
|
||||
customerId: string,
|
||||
organizationId: string
|
||||
organizationId: string,
|
||||
accessContext?: QuotationAccessContext
|
||||
): Promise<QuotationRelationItem[]> {
|
||||
const rows = await db
|
||||
.select()
|
||||
@@ -2333,12 +2334,14 @@ export async function listCustomerQuotationRelations(
|
||||
)
|
||||
.orderBy(desc(crmQuotations.updatedAt));
|
||||
|
||||
return rows.map((row) => ({
|
||||
id: row.id,
|
||||
code: row.code,
|
||||
status: row.status,
|
||||
quotationType: row.quotationType,
|
||||
totalAmount: row.totalAmount,
|
||||
updatedAt: row.updatedAt.toISOString()
|
||||
}));
|
||||
return rows
|
||||
.filter((row) => !accessContext || canAccessQuotationRow(row, accessContext))
|
||||
.map((row) => ({
|
||||
id: row.id,
|
||||
code: row.code,
|
||||
status: row.status,
|
||||
quotationType: row.quotationType,
|
||||
totalAmount: row.totalAmount,
|
||||
updatedAt: row.updatedAt.toISOString()
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user