Skip to content

Commit bd134e1

Browse files
committed
feat: add onboarding dal
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent 127a96b commit bd134e1

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

services/libs/data-access-layer/src/project-catalog/projectCatalog.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,25 @@ export async function findProjectCatalogPendingEvaluation(
105105
)
106106
}
107107

108+
export async function findProjectCatalogPendingOnboarding(
109+
qx: QueryExecutor,
110+
options: { limit?: number; offset?: number } = {},
111+
): Promise<IDbProjectCatalog[]> {
112+
const { limit, offset } = options
113+
114+
return qx.select(
115+
`
116+
SELECT ${prepareSelectColumns(PROJECT_CATALOG_COLUMNS)}
117+
FROM "projectCatalog"
118+
WHERE action = 'onboard' AND "onboardedAt" IS NULL
119+
ORDER BY "lfCriticalityScore" DESC NULLS LAST, "createdAt" ASC
120+
${limit !== undefined ? 'LIMIT $(limit)' : ''}
121+
${offset !== undefined ? 'OFFSET $(offset)' : ''}
122+
`,
123+
{ limit, offset },
124+
)
125+
}
126+
108127
export async function countProjectCatalog(qx: QueryExecutor): Promise<number> {
109128
const result = await qx.selectOne(
110129
`

0 commit comments

Comments
 (0)