Skip to content

Commit 619d753

Browse files
Merge pull request eu-digital-identity-wallet#18 from niscy-eudiw/feat/application-state
Feat/application state
2 parents f608103 + 9a6fd11 commit 619d753

File tree

269 files changed

+13222
-4790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

269 files changed

+13222
-4790
lines changed

README.md

Lines changed: 0 additions & 605 deletions
Large diffs are not rendered by default.

docs/flowcharts.md

Lines changed: 0 additions & 730 deletions
Large diffs are not rendered by default.

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default [
4949
},
5050
settings: {
5151
'import/resolver': {
52-
typescripts: true,
52+
typescript: true,
5353
node: true,
5454
},
5555
},

package-lock.json

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"type": "module",
6+
"author": "Paraskevas (Paris) SMYRLAKIS",
67
"scripts": {
78
"dev": "next dev --turbopack",
89
"build": "next build --turbopack",
@@ -33,6 +34,7 @@
3334
"pdf-lib": "^1.17.1",
3435
"qrcode": "^1.5.4",
3536
"react": "19.1.0",
37+
"react-device-detect": "^2.2.3",
3638
"react-dom": "19.1.0",
3739
"react-qr-code": "^2.0.18",
3840
"react-toastify": "^11.0.5",

prisma/schema.prisma

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eudiw-job-board Prisma schema
1+
// eudiw-recruitment-service Prisma schema
22
generator client {
33
provider = "prisma-client-js"
44
}
@@ -9,9 +9,19 @@ datasource db {
99
}
1010

1111
enum ApplicationStatus {
12-
CREATED
13-
VERIFIED
14-
ISSUED
12+
CREATED // Initial state after QR scan
13+
VERIFYING // PID verification in progress
14+
VERIFIED // PID verified
15+
QUALIFYING // Additional qualifications verification in progress
16+
QUALIFIED // Qualifications verified
17+
FINALIZED // Application finalized, ready for contract signing
18+
SIGNING // Contract signing in progress
19+
SIGNED // Contract signed, ready for credential issuance
20+
ISSUING // Employee credential issuance in progress
21+
ISSUED // Employee credential issued and claimed
22+
ERROR // Error occurred during processing
23+
REJECTED // Application rejected
24+
ARCHIVED // Application archived
1525
}
1626

1727
enum CredentialType {
@@ -22,20 +32,20 @@ enum CredentialType {
2232
TAXRESIDENCY
2333
}
2434

25-
model JobPosting {
35+
model Vacancy {
2636
id String @id @default(cuid())
2737
title String
2838
description String
29-
requiredCredentials CredentialType @default(NONE)
39+
requiredCredentials CredentialType[] @default([])
3040
createdAt DateTime @default(now())
3141
applications Application[]
3242
}
3343

3444
// prisma/schema.prisma
3545
model Application {
3646
id String @id @default(cuid())
37-
jobId String
38-
job JobPosting @relation(fields: [jobId], references: [id])
47+
vacancyId String
48+
vacancy Vacancy @relation(fields: [vacancyId], references: [id])
3949
4050
status ApplicationStatus @default(CREATED)
4151
@@ -55,7 +65,7 @@ model Application {
5565
createdAt DateTime @default(now())
5666
updatedAt DateTime @updatedAt
5767
58-
@@index([jobId])
68+
@@index([vacancyId])
5969
}
6070

6171
// Stores credentials ready to be issued to wallets

prisma/seed.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
/* prisma/seed.ts */
2-
import { PrismaClient } from '@prisma/client';
2+
import { PrismaClient, type CredentialType } from '@prisma/client';
33

44
const prisma = new PrismaClient();
55

6-
async function ensureJob(params: { title: string; description: string; requiresDL?: boolean }) {
7-
const existing = await prisma.jobPosting.findFirst({ where: { title: params.title } });
6+
async function ensureVacancy(params: {
7+
title: string;
8+
description: string;
9+
requiredCredentials: CredentialType[];
10+
}) {
11+
const existing = await prisma.vacancy.findFirst({ where: { title: params.title } });
812
if (existing) return existing;
913

10-
return prisma.jobPosting.create({
14+
return prisma.vacancy.create({
1115
data: {
1216
title: params.title,
1317
description: params.description,
18+
requiredCredentials: params.requiredCredentials,
1419
},
1520
});
1621
}
1722

1823
async function main() {
1924
console.log('🌱 Seeding database...');
20-
await ensureJob({
25+
await ensureVacancy({
2126
title: 'Marine Superintendent',
22-
requiresDL: false,
27+
requiredCredentials: ['DIPLOMA', 'SEAFARER'], // Requires seafarer certification
2328
description: [
24-
'SeaFarer S.A., a well-established Shipping Company located in Malta, is seeking to employ a Marine Superintendent.',
29+
'EUDI Demo Company, a well-established Shipping Company located in Malta, is seeking to employ a Marine Superintendent.',
2530
'',
2631
'Key responsibilities include:',
27-
'• Vessels preparation for Rightship inspections',
32+
"• Vessels' preparation for Rightship inspections",
2833
'• Attending Rightship inspections onboard',
2934
'• Cooperating with HSSQE Dept. on the nature of Rightship observations and/or deficiencies noted',
3035
'• Internal Audits onboard',
@@ -36,11 +41,11 @@ async function main() {
3641
].join('\n'),
3742
});
3843

39-
await ensureJob({
44+
await ensureVacancy({
4045
title: 'Captain',
41-
requiresDL: false,
46+
requiredCredentials: ['DIPLOMA', 'SEAFARER'], // Requires both diploma and seafarer
4247
description: [
43-
'SeaFarer S.A. is looking for an experienced Captain to lead vessel operations and ensure safe, compliant voyages. 1',
48+
'EUDI Demo Company is looking for an experienced Captain to lead vessel operations and ensure safe, compliant voyages.',
4449
'',
4550
'Key responsibilities include:',
4651
'• Overall command of vessel navigation and safety management',
@@ -50,7 +55,7 @@ async function main() {
5055
'• Oversight of cargo operations, stability and documentation',
5156
'• Incident reporting and continuous improvement initiatives',
5257
'',
53-
'Diploma and Seafarer Certificate are optional and considered an asset.',
58+
'Diploma and Seafarer Certificate are required.',
5459
'All applications will be treated with confidentiality.',
5560
].join('\n'),
5661
});

scripts/clear-signed-documents.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NextResponse } from 'next/server';
2+
3+
import { Container } from '@/core';
4+
import { GetApplicationDeepLinkUseCase } from '@/core/application/usecases/GetApplicationDeepLinkUseCase';
5+
6+
/**
7+
* GET /api/applications/[id]/deep-link
8+
* Returns the verification deep link URL for same-device flow
9+
*/
10+
export async function GET(_: Request, { params }: { params: Promise<{ id: string }> }) {
11+
const getApplicationDeepLinkUseCase = Container.get(GetApplicationDeepLinkUseCase);
12+
const { id } = await params;
13+
14+
try {
15+
const url = await getApplicationDeepLinkUseCase.execute(id);
16+
return NextResponse.json({ url });
17+
} catch (error) {
18+
console.error('Error getting deep link:', error);
19+
return NextResponse.json({ error: 'Failed to get deep link' }, { status: 500 });
20+
}
21+
}

src/app/api/applications/[id]/extras/route.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)