1301 lines
23 KiB
JavaScript
1301 lines
23 KiB
JavaScript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const db = require('../models');
|
|
const Users = db.users;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const JobOffers = db.job_offers;
|
|
|
|
const Applications = db.applications;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const JobOffersData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Développeur Backend Django",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference_code": "TF-DEV-2026-001",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"company_name": "TalentForge",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"department": "Engineering",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"city": "Paris",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"country": "France",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workplace_type": "remote",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contract_type": "temporary",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"experience_level": "mid",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_min": 45000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_max": 60000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"currency": "EUR",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Développement d API REST et intégrations internes.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"requirements": "Django, DRF, PostgreSQL, tests automatisés.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"benefits": "Télétravail partiel, mutuelle, budget formation.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"published_at": new Date('2026-01-20T09:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"closing_at": new Date('2026-03-01T18:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "archived",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Développeur Frontend React",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference_code": "TF-DEV-2026-002",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"company_name": "TalentForge",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"department": "Engineering",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"city": "Lyon",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"country": "France",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workplace_type": "hybrid",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contract_type": "temporary",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"experience_level": "lead",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_min": 42000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_max": 58000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"currency": "EUR",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Construction d interfaces React avec hooks et Tailwind.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"requirements": "React, TypeScript, tests, bonnes pratiques UI.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"benefits": "Remote, horaires flexibles, équipement fourni.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"published_at": new Date('2026-01-22T10:30:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"closing_at": new Date('2026-03-05T18:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "draft",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Ingénieur DevOps",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference_code": "TF-OPS-2026-003",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"company_name": "TalentForge",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"department": "Platform",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"city": "Toulouse",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"country": "France",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workplace_type": "remote",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contract_type": "cdi",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"experience_level": "senior",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_min": 55000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_max": 75000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"currency": "EUR",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Automatisation CI CD, infra as code et monitoring.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"requirements": "Kubernetes, Terraform, GitHub Actions, observabilité.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"benefits": "Prime annuelle, budget conférence, RTT.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"published_at": new Date('2026-01-25T08:45:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"closing_at": new Date('2026-03-10T18:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "published",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
"title": "Data Analyst",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"reference_code": "TF-DATA-2026-004",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"company_name": "TalentForge",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"department": "Data",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"city": "Nantes",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"country": "France",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"workplace_type": "on_site",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"contract_type": "apprenticeship",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"experience_level": "mid",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_min": 38000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"salary_max": 48000,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"currency": "EUR",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"description": "Analyse des données produit et reporting KPI.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"requirements": "SQL, BI, rigueur, communication.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"benefits": "Onboarding complet, mentorat, tickets restaurant.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"published_at": new Date('2026-01-28T09:15:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"closing_at": new Date('2026-02-28T18:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "archived",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const ApplicationsData = [
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "rejected",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"applied_at": new Date('2026-01-26T13:05:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status_changed_at": new Date('2026-01-28T09:40:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cover_letter": "Je souhaite rejoindre TalentForge pour contribuer a des interfaces React robustes et accessibles.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Profil solide, bonne communication en entretien ecran.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rating": 4,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "offer",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"applied_at": new Date('2026-02-02T17:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status_changed_at": new Date('2026-02-02T17:20:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cover_letter": "Mon experience Django et DRF me permettra de livrer des APIs fiables et bien testees.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "A verifier sur tests et performance.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rating": 3,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "rejected",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"applied_at": new Date('2026-01-27T08:10:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status_changed_at": new Date('2026-01-30T15:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cover_letter": "DevOps senior, j aide les equipes a industrialiser et securiser leurs pipelines.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Bonne maitrise Kubernetes, a planifier entretien technique.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rating": 5,
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "relation_one" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status": "in_review",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"applied_at": new Date('2026-01-30T10:25:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"status_changed_at": new Date('2026-02-03T11:00:00Z'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"cover_letter": "Je suis motivee pour produire des analyses actionnables et des dashboards clairs.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// type code here for "files" field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"notes": "Entretien planifie, verifier niveau SQL avance.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"rating": 4,
|
|
|
|
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateJobOfferWithEmployer() {
|
|
|
|
const relatedEmployer0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const JobOffer0 = await JobOffers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (JobOffer0?.setEmployer)
|
|
{
|
|
await
|
|
JobOffer0.
|
|
setEmployer(relatedEmployer0);
|
|
}
|
|
|
|
const relatedEmployer1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const JobOffer1 = await JobOffers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (JobOffer1?.setEmployer)
|
|
{
|
|
await
|
|
JobOffer1.
|
|
setEmployer(relatedEmployer1);
|
|
}
|
|
|
|
const relatedEmployer2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const JobOffer2 = await JobOffers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (JobOffer2?.setEmployer)
|
|
{
|
|
await
|
|
JobOffer2.
|
|
setEmployer(relatedEmployer2);
|
|
}
|
|
|
|
const relatedEmployer3 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const JobOffer3 = await JobOffers.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (JobOffer3?.setEmployer)
|
|
{
|
|
await
|
|
JobOffer3.
|
|
setEmployer(relatedEmployer3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function associateApplicationWithJob_offer() {
|
|
|
|
const relatedJob_offer0 = await JobOffers.findOne({
|
|
offset: Math.floor(Math.random() * (await JobOffers.count())),
|
|
});
|
|
const Application0 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Application0?.setJob_offer)
|
|
{
|
|
await
|
|
Application0.
|
|
setJob_offer(relatedJob_offer0);
|
|
}
|
|
|
|
const relatedJob_offer1 = await JobOffers.findOne({
|
|
offset: Math.floor(Math.random() * (await JobOffers.count())),
|
|
});
|
|
const Application1 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Application1?.setJob_offer)
|
|
{
|
|
await
|
|
Application1.
|
|
setJob_offer(relatedJob_offer1);
|
|
}
|
|
|
|
const relatedJob_offer2 = await JobOffers.findOne({
|
|
offset: Math.floor(Math.random() * (await JobOffers.count())),
|
|
});
|
|
const Application2 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Application2?.setJob_offer)
|
|
{
|
|
await
|
|
Application2.
|
|
setJob_offer(relatedJob_offer2);
|
|
}
|
|
|
|
const relatedJob_offer3 = await JobOffers.findOne({
|
|
offset: Math.floor(Math.random() * (await JobOffers.count())),
|
|
});
|
|
const Application3 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Application3?.setJob_offer)
|
|
{
|
|
await
|
|
Application3.
|
|
setJob_offer(relatedJob_offer3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function associateApplicationWithCandidate() {
|
|
|
|
const relatedCandidate0 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Application0 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 0
|
|
});
|
|
if (Application0?.setCandidate)
|
|
{
|
|
await
|
|
Application0.
|
|
setCandidate(relatedCandidate0);
|
|
}
|
|
|
|
const relatedCandidate1 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Application1 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 1
|
|
});
|
|
if (Application1?.setCandidate)
|
|
{
|
|
await
|
|
Application1.
|
|
setCandidate(relatedCandidate1);
|
|
}
|
|
|
|
const relatedCandidate2 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Application2 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 2
|
|
});
|
|
if (Application2?.setCandidate)
|
|
{
|
|
await
|
|
Application2.
|
|
setCandidate(relatedCandidate2);
|
|
}
|
|
|
|
const relatedCandidate3 = await Users.findOne({
|
|
offset: Math.floor(Math.random() * (await Users.count())),
|
|
});
|
|
const Application3 = await Applications.findOne({
|
|
order: [['id', 'ASC']],
|
|
offset: 3
|
|
});
|
|
if (Application3?.setCandidate)
|
|
{
|
|
await
|
|
Application3.
|
|
setCandidate(relatedCandidate3);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await JobOffers.bulkCreate(JobOffersData);
|
|
|
|
|
|
|
|
|
|
await Applications.bulkCreate(ApplicationsData);
|
|
|
|
|
|
await Promise.all([
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Similar logic for "relation_many"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateJobOfferWithEmployer(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await associateApplicationWithJob_offer(),
|
|
|
|
|
|
|
|
|
|
await associateApplicationWithCandidate(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]);
|
|
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await queryInterface.bulkDelete('job_offers', null, {});
|
|
|
|
|
|
await queryInterface.bulkDelete('applications', null, {});
|
|
|
|
|
|
},
|
|
}; |