Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Lara paper Briefing #4

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c3d7cef
feat: initial commit
Oct 18, 2022
c7e374d
feat: initial commit
Oct 18, 2022
c413952
Merge remote-tracking branch 'origin/lara-paper-nv' into lara-paper-nv
AlexOp1403 Feb 3, 2023
7af5d88
feat: mentor creation
AlexOp1403 Feb 22, 2023
8162b89
fix: fix mentor admin overview
AlexOp1403 Feb 27, 2023
0de6c87
feat: briefing form and illustrations
AlexOp1403 Apr 3, 2023
e32c78e
feat: create Paper
AlexOp1403 May 3, 2023
741fe80
feat: created paper return to trainee
AlexOp1403 May 3, 2023
05d1f11
feat: created paper return to trainer and mentor
AlexOp1403 May 3, 2023
316a288
feat: briefings to paper
AlexOp1403 May 5, 2023
83574a5
feat: init of email and some optimatizations
AlexOp1403 May 5, 2023
4d5eca4
feat: comment bubble
AlexOp1403 May 6, 2023
04b1bb8
feat: add more text lines to briefing and check if user exists and as…
AlexOp1403 May 6, 2023
a1b2989
feat: tests and modal fix
AlexOp1403 May 6, 2023
0310d50
feat: briefing entries can be deleted
AlexOp1403 May 6, 2023
9cf4fa7
feat: export and emal init
AlexOp1403 May 7, 2023
1aaa5b0
feat: some styling and bugfixing
AlexOp1403 May 8, 2023
db64f7d
feat: renaming
AlexOp1403 May 8, 2023
936e78e
feat: email and pdf export for briefing
AlexOp1403 May 15, 2023
0e7e9ef
feat: trainer can be mentor and small fixes
AlexOp1403 May 17, 2023
2d30066
feat: update after paper creation and deletion, english, modal for pa…
AlexOp1403 May 20, 2023
ba249b8
feat: remove paper status
AlexOp1403 May 20, 2023
9bb73ea
feat: fixes in delete modal, resturctured briefing creating form, fix…
AlexOp1403 May 21, 2023
d6e2c28
feat: remove logs
AlexOp1403 May 21, 2023
5b364cf
feat: english translation
AlexOp1403 May 22, 2023
511c860
feat: formatting
AlexOp1403 May 22, 2023
d65dbc5
chore: little cleanuo
AlexOp1403 May 22, 2023
29bfd16
Update package.json
AlexOp1403 May 22, 2023
c8bb137
fix: build fix
AlexOp1403 May 22, 2023
2bdda74
Merge branch 'main' into lara-paper
AlexOp1403 Aug 8, 2023
eb6e38f
Merge branch 'main' into lara-paper
AlexOp1403 Sep 13, 2023
b2c84dc
feat: initial commit
Oct 18, 2022
6389350
feat: mentor creation
AlexOp1403 Feb 22, 2023
3d7d1a6
fix: fix mentor admin overview
AlexOp1403 Feb 27, 2023
0f3ec73
feat: briefing form and illustrations
AlexOp1403 Apr 3, 2023
1084b86
feat: create Paper
AlexOp1403 May 3, 2023
bdbdd58
feat: created paper return to trainee
AlexOp1403 May 3, 2023
0842d46
feat: created paper return to trainer and mentor
AlexOp1403 May 3, 2023
998d379
feat: briefings to paper
AlexOp1403 May 5, 2023
8a80585
feat: init of email and some optimatizations
AlexOp1403 May 5, 2023
3258560
feat: comment bubble
AlexOp1403 May 6, 2023
386f992
feat: add more text lines to briefing and check if user exists and as…
AlexOp1403 May 6, 2023
12922cf
feat: tests and modal fix
AlexOp1403 May 6, 2023
09d32af
feat: briefing entries can be deleted
AlexOp1403 May 6, 2023
1e94cce
feat: export and emal init
AlexOp1403 May 7, 2023
d24bd24
feat: some styling and bugfixing
AlexOp1403 May 8, 2023
cc811e7
feat: renaming
AlexOp1403 May 8, 2023
dfe7696
feat: email and pdf export for briefing
AlexOp1403 May 15, 2023
5087d42
feat: trainer can be mentor and small fixes
AlexOp1403 May 17, 2023
73464ab
feat: update after paper creation and deletion, english, modal for pa…
AlexOp1403 May 20, 2023
4b22aea
feat: remove paper status
AlexOp1403 May 20, 2023
341ec0b
feat: fixes in delete modal, resturctured briefing creating form, fix…
AlexOp1403 May 21, 2023
fd55682
feat: remove logs
AlexOp1403 May 21, 2023
0066547
feat: english translation
AlexOp1403 May 22, 2023
e59d5f3
feat: formatting
AlexOp1403 May 22, 2023
9a81e5e
chore: little cleanuo
AlexOp1403 May 22, 2023
05981a4
fix: build fix
AlexOp1403 May 22, 2023
96eba8e
fix: test fix
AlexOp1403 Nov 16, 2023
4543df7
fix: auth resolver
AlexOp1403 Nov 16, 2023
55fe9a3
Merge branch 'main' into lara-paper
AlexOp1403 Jan 17, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@
"serverless-s3-local": "^0.6.22",
"serverless-s3-sync": "3.1.0",
"sort-package-json": "^1.46.0",
"typescript": "^5.2.2"
"typescript": "^4.7.2"
}
}
2 changes: 2 additions & 0 deletions packages/api/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ generates:
Report: ./models#Report
Trainer: ./models#Trainer
Trainee: ./models#Trainee
Mentor: ./models#Mentor
UserInterface: ./models#UserInterface
Paper: ./models#Paper
189 changes: 189 additions & 0 deletions packages/api/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,62 @@ type UpdateReportPayload {
report: Report!
}

input MentorInput {
name: String
email: String
signature: String
}


input PaperEntryInput {
id: ID!
questionId: ID!
question: String!
answer: String
hint: String
}

type MutatePaperPayload {
papers: [Paper]
}

input PaperInput {
traineeId: ID!
trainerId: ID!
client: String!
mentorId: ID!
periodStart: String
periodEnd: String
schoolPeriodStart: String
schoolPeriodEnd: String
subject: String!
status: PaperStatus!
briefing: [PaperEntryInput!]!
}

input PaperUpdateInput {
id: ID!
traineeId: ID!
trainerId: ID!
client: String!
mentorId: ID!
periodStart: String
periodEnd: String
schoolPeriodStart: String
schoolPeriodEnd: String
subject: String!
status: PaperStatus!
briefing: [PaperEntryInput!]!
}

input AnswerPaperInput {
id: ID!
questionId: ID!
question: String!
answer: String!
hint: String!
}

type Mutation {
"""
[DEV] Login as a user.
Expand Down Expand Up @@ -181,6 +237,16 @@ type Mutation {
"""
createTrainer(input: CreateTrainerInput!): Trainer

"""
Creates Mentor.
"""
createMentor(input: CreateMentorInput!): Mentor

"""
Get a User by Email
"""
getUserByEmail(email: String!): UserInterface

"""
Marks User to be deleted
"""
Expand All @@ -201,6 +267,11 @@ type Mutation {
"""
updateTrainer(input: UpdateTrainerInput!, id: ID!): Trainer

"""
Updates Mentor.
"""
updateMentor(input: UpdateMentorInput!, id: ID!): Mentor

"""
Link Alexa account
"""
Expand All @@ -215,6 +286,36 @@ type Mutation {
Create OAuth Code
"""
createOAuthCode: String!

"""
Create Paper
"""
createPaper(input: PaperInput!): Paper!

"""
Update Paper
"""
updatePaper(input: PaperUpdateInput!): Paper!

"""
Delete Paper
"""
deletePaper(paperId: ID!): [Paper]!

"""
Updates Entry for Lara Paper
"""
updatePaperEntry(input: AnswerPaperInput!): PaperFormData!

"""
Creates Entry for Lara Paper
"""
createPaperEntry(input: AnswerPaperInput!): PaperFormData!

"""
Deletes Entry for Lara Paper
"""
deletePaperEntry(id: ID!): PaperFormData!
}

type LaraConfig {
Expand Down Expand Up @@ -272,11 +373,21 @@ type Query {
"""
trainers: [Trainer!]!

"""
Get all Trainers
"""
mentors: [Mentor!]!

"""
Print single report or report batch
"""
print(ids: [ID!]!): PrintPayload!

"""
Print single paper
"""
printPaper(ids: [ID!]!): PrintPayload!

"""
Get a User by ID
"""
Expand All @@ -291,6 +402,7 @@ type Query {
Get the alexa account linking url
"""
alexaLinkingUrl: String

}

type PrintPayload {
Expand Down Expand Up @@ -353,6 +465,7 @@ type Trainee implements UserInterface {
lastName: String!
notification: Boolean
reports: [Report!]!
papers: [Paper]
signature: String
startDate: String
startOfToolUsage: String
Expand Down Expand Up @@ -396,12 +509,28 @@ input CreateTrainerInput {
lastName: String!
}

input CreateMentorInput {
email: String!
firstName: String!
lastName: String!
startDate: String
endDate: String
}

input UpdateTrainerInput {
email: String
firstName: String
lastName: String
}

input UpdateMentorInput {
email: String
firstName: String
lastName: String
startDate: String
endDate: String
}

type Trainer implements UserInterface {
avatar: String!
createdAt: String!
Expand All @@ -413,7 +542,28 @@ type Trainer implements UserInterface {
signature: String
theme: String
trainees: [Trainee!]!
papers: [Paper]
type: UserTypeEnum!
username: String!
email: String!
deleteAt: String
alexaSkillLinked: Boolean
}

type Mentor implements UserInterface {
avatar: String!
createdAt: String!
firstName: String!
id: ID!
language: String
lastName: String!
notification: Boolean
signature: String
theme: String
type: UserTypeEnum!
papers: [Paper]
startDate: String
endDate: String
username: String!
email: String!
deleteAt: String
Expand Down Expand Up @@ -475,8 +625,47 @@ enum UserTypeEnum {
"""
Trainer

"""
User is a Mentor
"""
Mentor

"""
User is an Admin
"""
Admin
}

enum PaperStatus {
InProgress
TraineeDone
MentorDone
InReview
Archived
}

type PaperFormData {
id: ID!
questionId: ID!
question: String!
answer: String
hint: String
}

type Paper {
id: ID!
traineeId: ID!
trainerId: ID!
status: PaperStatus!
briefing: [PaperFormData!]!
conclusion: String
archivedAt: String
createdAt: String
client: String!
mentorId: ID!
periodStart: String
periodEnd: String
schoolPeriodStart: String
schoolPeriodEnd: String
subject: String!
}
8 changes: 6 additions & 2 deletions packages/api/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { APIGatewayProxyEvent, Context as AWSContext } from 'aws-lambda'
import { Request, Response } from 'express'

import { Trainee, Trainer, Admin, User } from './models'
import { Trainee, Trainer, Admin, Mentor, User } from './models'

type ExpressContext = {
req: Request
res: Response
}

type BaseContext = {
export type BaseContext = {
event: APIGatewayProxyEvent
express: ExpressContext
}
Expand All @@ -29,6 +29,10 @@ export type TraineeContext = BaseContext & {
currentUser: Trainee
}

export type MentorContext = BaseContext & {
currentUser: Mentor
}

export type AdminContext = BaseContext & {
currentUser: Admin
}
Expand Down
18 changes: 17 additions & 1 deletion packages/api/src/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,18 @@ export type ExportMailPayload = BaseEmailPayload & {
]
}

export type PaperBriefingMailPayload = BaseEmailPayload & {
emailType: 'paperBriefing'
userData: BaseMailUserData
attachments: [
{
filename: string
}
]
}

export type SimpleMailPayload = BaseEmailPayload & {
emailType: 'deleteAccount' | 'error' | 'alexa'
emailType: 'deleteAccount' | 'error' | 'alexa' | 'paperBriefingMail'
userData: BaseMailUserData
}

Expand All @@ -59,6 +69,7 @@ export type EmailPayload =
| SimpleMailPayload
| ExportMailPayload
| ReportInReviewPayload
| PaperBriefingMailPayload

export type EmailType = EmailPayload['emailType']

Expand All @@ -76,6 +87,8 @@ export type EmailTranslations = {
deleteUser: string
reportInReview: string
alexa: string
paperBriefing: string
paperBriefingMail: string
}
headline: {
export: string
Expand All @@ -86,6 +99,7 @@ export type EmailTranslations = {
deleteUser: string
handOver: string
alexa: string
paperBriefing: string
}
message: {
error: string
Expand All @@ -97,10 +111,12 @@ export type EmailTranslations = {
deleteUser: string
handOver: string
alexa: string
paperBriefing: string
}
link: {
archive: string
report: string
paperBriefing: string
lara: string
settings: string
}
Expand Down
Loading
Loading