Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ jobs:
- run: npm run test
- run: npm run build

ingestion:
name: Ingestion (lint, types, tests)
runs-on: ubuntu-latest
defaults:
run:
working-directory: ingestion
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: ingestion/package-lock.json

- run: npm ci
- run: npm run format:check
- run: npm run lint
- run: npm run typecheck
- run: npm run test
- run: npm run build

database:
name: Database (migrations, RLS, pgTAP, API integration)
runs-on: ubuntu-latest
Expand Down
54 changes: 42 additions & 12 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from 'react-router'
import { RouterProvider } from 'react-router/dom'
import { AuthProvider, useAuth } from './contexts/AuthContext'
import { AppLayout } from './pages/AppLayout'
import { ProfileLayout } from './pages/ProfileLayout'
import { BasicProfilePage } from './pages/BasicProfilePage'
import { EducationEditorPage } from './pages/EducationEditorPage'
Expand All @@ -14,6 +15,12 @@ import { ExperienceEditorPage } from './pages/ExperienceEditorPage'
import { ExperienceListPage } from './pages/ExperienceListPage'
import { ProfilePage } from './pages/ProfilePage'
import { SignInPage } from './pages/SignInPage'
import { OpportunityListPage } from './pages/OpportunityListPage'
import { OpportunityDetailPage } from './pages/OpportunityDetailPage'
import { PrivateOpportunityDetailPage } from './pages/PrivateOpportunityDetailPage'
import { ManualOpportunityFormPage } from './pages/ManualOpportunityFormPage'
import { ApplicationsListPage } from './pages/ApplicationsListPage'
import { ApplicationDetailPage } from './pages/ApplicationDetailPage'

function AuthPending() {
const { initError, loading, retryInit } = useAuth()
Expand Down Expand Up @@ -88,22 +95,45 @@ const router = createBrowserRouter([
errorElement: <RouteErrorPage />,
children: [
{
path: '/profile',
element: <ProfileLayout />,
element: <AppLayout />,
children: [
{ index: true, element: <ProfilePage /> },
{ path: 'basic', element: <BasicProfilePage /> },
{ path: 'education', element: <EducationListPage /> },
{ path: 'education/new', element: <EducationEditorPage /> },
{
path: 'education/:educationId/edit',
element: <EducationEditorPage />,
path: '/profile',
element: <ProfileLayout />,
children: [
{ index: true, element: <ProfilePage /> },
{ path: 'basic', element: <BasicProfilePage /> },
{ path: 'education', element: <EducationListPage /> },
{ path: 'education/new', element: <EducationEditorPage /> },
{
path: 'education/:educationId/edit',
element: <EducationEditorPage />,
},
{ path: 'experience', element: <ExperienceListPage /> },
{ path: 'experience/new', element: <ExperienceEditorPage /> },
{
path: 'experience/:experienceId/edit',
element: <ExperienceEditorPage />,
},
],
},
{ path: 'experience', element: <ExperienceListPage /> },
{ path: 'experience/new', element: <ExperienceEditorPage /> },
{ path: '/opportunities', element: <OpportunityListPage /> },
{
path: 'experience/:experienceId/edit',
element: <ExperienceEditorPage />,
path: '/opportunities/import',
element: <ManualOpportunityFormPage />,
},
{
path: '/opportunities/manual/:privateOpportunityId',
element: <PrivateOpportunityDetailPage />,
},
{
path: '/opportunities/:opportunityId',
element: <OpportunityDetailPage />,
},
{ path: '/applications', element: <ApplicationsListPage /> },
{
path: '/applications/:applicationId',
element: <ApplicationDetailPage />,
},
],
},
Expand Down
90 changes: 90 additions & 0 deletions app/src/lib/applicationRepository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { supabase } from './supabaseClient'
import type { Application, ApplicationStatus } from './opportunityTypes'

const columns =
'id, user_id, shared_opportunity_id, opportunity_version_id, private_opportunity_id, private_opportunity_snapshot, status, applied_at, status_updated_at, next_action, next_action_due_at, notes, contact_note, created_at, updated_at'

export interface ApplicationFieldsInput {
next_action?: string | null
next_action_due_at?: string | null
notes?: string | null
contact_note?: string | null
}

export const applicationRepository = {
async list(userId: string) {
return supabase
.from('applications')
.select(columns)
.eq('user_id', userId)
.order('status_updated_at', { ascending: false })
.returns<Application[]>()
},

async get(id: string) {
return supabase
.from('applications')
.select(columns)
.eq('id', id)
.maybeSingle<Application>()
},

async getByOpportunity(userId: string, sharedOpportunityId: string) {
return supabase
.from('applications')
.select(columns)
.eq('user_id', userId)
.eq('shared_opportunity_id', sharedOpportunityId)
.maybeSingle<Application>()
},

async getByPrivateOpportunity(userId: string, privateOpportunityId: string) {
return supabase
.from('applications')
.select(columns)
.eq('user_id', userId)
.eq('private_opportunity_id', privateOpportunityId)
.maybeSingle<Application>()
},

async createForOpportunity(userId: string, opportunityVersionId: string) {
return supabase
.from('applications')
.insert({ user_id: userId, opportunity_version_id: opportunityVersionId })
.select(columns)
.maybeSingle<Application>()
},

async createForPrivateOpportunity(
userId: string,
privateOpportunityId: string,
) {
return supabase
.from('applications')
.insert({ user_id: userId, private_opportunity_id: privateOpportunityId })
.select(columns)
.maybeSingle<Application>()
},

async updateStatus(id: string, status: ApplicationStatus) {
return supabase
.from('applications')
.update({ status })
.eq('id', id)
.select(columns)
.maybeSingle<Application>()
},

async updateFields(id: string, input: ApplicationFieldsInput) {
return supabase
.from('applications')
.update(input)
.eq('id', id)
.select(columns)
.maybeSingle<Application>()
},

async remove(id: string) {
return supabase.from('applications').delete().eq('id', id).select('id')
},
}
37 changes: 37 additions & 0 deletions app/src/lib/interviewPrepRepository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { supabase } from './supabaseClient'
import type { InterviewPrepNotes } from './opportunityTypes'

const columns =
'id, application_id, responsibilities_to_discuss, required_technologies, topics_to_revise, likely_questions, questions_to_ask, interview_date, interview_format, reflections'

export type InterviewPrepInput = Partial<
Omit<InterviewPrepNotes, 'id' | 'application_id'>
>

export const interviewPrepRepository = {
async get(applicationId: string) {
return supabase
.from('interview_prep_notes')
.select(columns)
.eq('application_id', applicationId)
.maybeSingle<InterviewPrepNotes>()
},

async upsert(applicationId: string, input: InterviewPrepInput) {
const existing = await this.get(applicationId)
if (existing.error) return existing
if (existing.data) {
return supabase
.from('interview_prep_notes')
.update(input)
.eq('application_id', applicationId)
.select(columns)
.maybeSingle<InterviewPrepNotes>()
}
return supabase
.from('interview_prep_notes')
.insert({ application_id: applicationId, ...input })
.select(columns)
.maybeSingle<InterviewPrepNotes>()
},
}
Loading