-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement Proposal Application Acceptance Workflow (#12)
Co-authored-by: Roland Schlaefli <[email protected]>
- Loading branch information
1 parent
b73f12a
commit 3cae829
Showing
8 changed files
with
405 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ async function seed(prisma: PrismaClient) { | |
) | ||
|
||
await new Promise((resolve) => | ||
rl.question('Please sign-in with Azure AD before continuing...', (ans) => { | ||
rl.question('Please sign-in before continuing...', (ans) => { | ||
rl.close() | ||
resolve(ans) | ||
}) | ||
|
@@ -87,177 +87,177 @@ async function seed(prisma: PrismaClient) { | |
}, | ||
}) | ||
|
||
await prisma.proposal.upsert({ | ||
where: { id: '3ef84a3b-cff0-4350-b760-4c5bb3b3c98f' }, | ||
create: { | ||
id: '3ef84a3b-cff0-4350-b760-4c5bb3b3c98f', | ||
title: 'Effects of Interest Rate on Happiness', | ||
description: 'This is a very interesting topic', | ||
language: '["English"]', | ||
studyLevel: 'Master Thesis (30 ECTS)', | ||
topicArea: { | ||
connect: { | ||
slug: 'sustainable_finance', | ||
}, | ||
}, | ||
status: { | ||
connect: { key: ProposalStatus.OPEN }, | ||
}, | ||
type: { | ||
connect: { key: ProposalType.STUDENT }, | ||
}, | ||
applications: { | ||
create: { | ||
email: '[email protected]', | ||
plannedStartAt: new Date(), | ||
fullName: 'Roland Ferdinand', | ||
matriculationNumber: '12-345-678', | ||
motivation: 'I want to', | ||
}, | ||
}, | ||
ownedByStudent: '[email protected]', | ||
ownedByUser: { | ||
connect: { email: user.email }, | ||
}, | ||
receivedFeedbacks: { | ||
create: { | ||
comment: 'Rejected because', | ||
type: { | ||
connect: { key: ProposalFeedbackType.REJECTED_NOT_SCIENTIFIC }, | ||
}, | ||
reason: ProposalFeedbackType.REJECTED_NOT_SCIENTIFIC, | ||
user: { | ||
connect: { email: user.email }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
update: {}, | ||
}) | ||
// await prisma.proposal.upsert({ | ||
// where: { id: '3ef84a3b-cff0-4350-b760-4c5bb3b3c98f' }, | ||
// create: { | ||
// id: '3ef84a3b-cff0-4350-b760-4c5bb3b3c98f', | ||
// title: 'Effects of Interest Rate on Happiness', | ||
// description: 'This is a very interesting topic', | ||
// language: '["English"]', | ||
// studyLevel: 'Master Thesis (30 ECTS)', | ||
// topicArea: { | ||
// connect: { | ||
// slug: 'sustainable_finance', | ||
// }, | ||
// }, | ||
// status: { | ||
// connect: { key: ProposalStatus.OPEN }, | ||
// }, | ||
// type: { | ||
// connect: { key: ProposalType.STUDENT }, | ||
// }, | ||
// applications: { | ||
// create: { | ||
// email: '[email protected]', | ||
// plannedStartAt: new Date(), | ||
// fullName: 'Roland Ferdinand', | ||
// matriculationNumber: '12-345-678', | ||
// motivation: 'I want to', | ||
// }, | ||
// }, | ||
// ownedByStudent: '[email protected]', | ||
// ownedByUser: { | ||
// connect: { email: user.email }, | ||
// }, | ||
// receivedFeedbacks: { | ||
// create: { | ||
// comment: 'Rejected because', | ||
// type: { | ||
// connect: { key: ProposalFeedbackType.REJECTED_NOT_SCIENTIFIC }, | ||
// }, | ||
// reason: ProposalFeedbackType.REJECTED_NOT_SCIENTIFIC, | ||
// user: { | ||
// connect: { email: user.email }, | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
// update: {}, | ||
// }) | ||
|
||
await prisma.proposal.upsert({ | ||
where: { id: '33a9a1b7-cad7-46e7-8b72-cfcbdbaa60d6' }, | ||
create: { | ||
id: '33a9a1b7-cad7-46e7-8b72-cfcbdbaa60d6', | ||
title: | ||
'The role of interest rate expectations for the choice between Fixed-Rate Mortgages and Adjustable-Rate Mortgages', | ||
description: | ||
'The role of interest rate expectations for the choice between Fixed-Rate Mortgages and Adjustable-Rate Mortgages', | ||
language: '["English", "German"]', | ||
studyLevel: 'Master Thesis (30 ECTS)', | ||
timeFrame: 'Sometime next year.', | ||
topicArea: { | ||
connect: { | ||
slug: 'banking_and_insurance', | ||
}, | ||
}, | ||
status: { | ||
connect: { key: ProposalStatus.OPEN }, | ||
}, | ||
type: { | ||
connect: { key: ProposalType.SUPERVISOR }, | ||
}, | ||
supervisedBy: { | ||
create: { | ||
supervisor: { | ||
connect: { email: user.email }, | ||
}, | ||
}, | ||
}, | ||
ownedByUser: { | ||
connect: { email: user.email }, | ||
}, | ||
applications: { | ||
create: { | ||
plannedStartAt: new Date(), | ||
email: '[email protected]', | ||
fullName: 'Roland Ferdinand', | ||
matriculationNumber: '12-345-678', | ||
motivation: | ||
'I want to do this topic as I think it is very interesting.', | ||
attachments: { | ||
createMany: { | ||
data: [ | ||
{ | ||
name: 'CV.pdf', | ||
href: 'https://example.com/cv.pdf', | ||
type: 'application/pdf', | ||
}, | ||
{ | ||
name: 'Transcript.pdf', | ||
href: 'https://example.com/cv.pdf', | ||
type: 'application/pdf', | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
update: {}, | ||
}) | ||
// await prisma.proposal.upsert({ | ||
// where: { id: '33a9a1b7-cad7-46e7-8b72-cfcbdbaa60d6' }, | ||
// create: { | ||
// id: '33a9a1b7-cad7-46e7-8b72-cfcbdbaa60d6', | ||
// title: | ||
// 'The role of interest rate expectations for the choice between Fixed-Rate Mortgages and Adjustable-Rate Mortgages', | ||
// description: | ||
// 'The role of interest rate expectations for the choice between Fixed-Rate Mortgages and Adjustable-Rate Mortgages', | ||
// language: '["English", "German"]', | ||
// studyLevel: 'Master Thesis (30 ECTS)', | ||
// timeFrame: 'Sometime next year.', | ||
// topicArea: { | ||
// connect: { | ||
// slug: 'banking_and_insurance', | ||
// }, | ||
// }, | ||
// status: { | ||
// connect: { key: ProposalStatus.OPEN }, | ||
// }, | ||
// type: { | ||
// connect: { key: ProposalType.SUPERVISOR }, | ||
// }, | ||
// supervisedBy: { | ||
// create: { | ||
// supervisor: { | ||
// connect: { email: user.email }, | ||
// }, | ||
// }, | ||
// }, | ||
// ownedByUser: { | ||
// connect: { email: user.email }, | ||
// }, | ||
// applications: { | ||
// create: { | ||
// plannedStartAt: new Date(), | ||
// email: '[email protected]', | ||
// fullName: 'Roland Ferdinand', | ||
// matriculationNumber: '12-345-678', | ||
// motivation: | ||
// 'I want to do this topic as I think it is very interesting.', | ||
// attachments: { | ||
// createMany: { | ||
// data: [ | ||
// { | ||
// name: 'CV.pdf', | ||
// href: 'https://example.com/cv.pdf', | ||
// type: 'application/pdf', | ||
// }, | ||
// { | ||
// name: 'Transcript.pdf', | ||
// href: 'https://example.com/cv.pdf', | ||
// type: 'application/pdf', | ||
// }, | ||
// ], | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
// update: {}, | ||
// }) | ||
|
||
await prisma.proposal.upsert({ | ||
where: { id: '21140e2e-e630-494a-ab18-374fd11c62c0' }, | ||
create: { | ||
id: '21140e2e-e630-494a-ab18-374fd11c62c0', | ||
title: | ||
'Treiber der Inflation in der Schweiz / Inflationsmessung in der Schweiz', | ||
description: | ||
'Treiber der Inflation in der Schweiz / Inflationsmessung in der Schweiz', | ||
language: '["English"]', | ||
studyLevel: 'Master Thesis (30 ECTS)', | ||
timeFrame: '2023', | ||
topicArea: { | ||
connect: { | ||
slug: 'financial_economics', | ||
}, | ||
}, | ||
status: { | ||
connect: { key: ProposalStatus.OPEN }, | ||
}, | ||
type: { | ||
connect: { key: ProposalType.SUPERVISOR }, | ||
}, | ||
supervisedBy: { | ||
create: { | ||
supervisor: { | ||
connect: { email: user.email }, | ||
}, | ||
}, | ||
}, | ||
ownedByUser: { | ||
connect: { email: user.email }, | ||
}, | ||
applications: { | ||
create: { | ||
plannedStartAt: new Date(), | ||
email: '[email protected]', | ||
fullName: 'Roland Ferdinand', | ||
matriculationNumber: '12-345-678', | ||
motivation: | ||
'I want to do this topic as I think it is very interesting.', | ||
attachments: { | ||
createMany: { | ||
data: [ | ||
{ | ||
name: 'CV.pdf', | ||
href: 'https://example.com/cv.pdf', | ||
type: 'application/pdf', | ||
}, | ||
{ | ||
name: 'Transcript.pdf', | ||
href: 'https://example.com/cv.pdf', | ||
type: 'application/pdf', | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
update: {}, | ||
}) | ||
// await prisma.proposal.upsert({ | ||
// where: { id: '21140e2e-e630-494a-ab18-374fd11c62c0' }, | ||
// create: { | ||
// id: '21140e2e-e630-494a-ab18-374fd11c62c0', | ||
// title: | ||
// 'Treiber der Inflation in der Schweiz / Inflationsmessung in der Schweiz', | ||
// description: | ||
// 'Treiber der Inflation in der Schweiz / Inflationsmessung in der Schweiz', | ||
// language: '["English"]', | ||
// studyLevel: 'Master Thesis (30 ECTS)', | ||
// timeFrame: '2023', | ||
// topicArea: { | ||
// connect: { | ||
// slug: 'financial_economics', | ||
// }, | ||
// }, | ||
// status: { | ||
// connect: { key: ProposalStatus.OPEN }, | ||
// }, | ||
// type: { | ||
// connect: { key: ProposalType.SUPERVISOR }, | ||
// }, | ||
// supervisedBy: { | ||
// create: { | ||
// supervisor: { | ||
// connect: { email: user.email }, | ||
// }, | ||
// }, | ||
// }, | ||
// ownedByUser: { | ||
// connect: { email: user.email }, | ||
// }, | ||
// applications: { | ||
// create: { | ||
// plannedStartAt: new Date(), | ||
// email: '[email protected]', | ||
// fullName: 'Roland Ferdinand', | ||
// matriculationNumber: '12-345-678', | ||
// motivation: | ||
// 'I want to do this topic as I think it is very interesting.', | ||
// attachments: { | ||
// createMany: { | ||
// data: [ | ||
// { | ||
// name: 'CV.pdf', | ||
// href: 'https://example.com/cv.pdf', | ||
// type: 'application/pdf', | ||
// }, | ||
// { | ||
// name: 'Transcript.pdf', | ||
// href: 'https://example.com/cv.pdf', | ||
// type: 'application/pdf', | ||
// }, | ||
// ], | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
// }, | ||
// update: {}, | ||
// }) | ||
} | ||
|
||
seed(prismaClient) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.