diff --git a/backend.zip b/backend.zip new file mode 100644 index 0000000..53d6c33 Binary files /dev/null and b/backend.zip differ diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index 95daa9a..f1c2ffb 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -82,7 +82,7 @@ model Employee { lastName String firstNameAr String? lastNameAr String? - email String @unique + email String phone String? mobile String dateOfBirth DateTime? diff --git a/backend/prisma/seed-prod.js b/backend/prisma/seed-prod.js index fd4b483..9e3542d 100644 --- a/backend/prisma/seed-prod.js +++ b/backend/prisma/seed-prod.js @@ -72,6 +72,40 @@ async function main() { console.log('✅ Created positions'); + // Employee position for ALL departments (added) + const salesEmployeePosition = await prisma.position.create({ + data: { + title: 'Employee', + titleAr: 'موظف', + code: 'SALES_EMPLOYEE', + departmentId: salesDept.id, + level: 5, + description: 'General employee - Sales Department', + }, + }); + + const itEmployeePosition = await prisma.position.create({ + data: { + title: 'Employee', + titleAr: 'موظف', + code: 'IT_EMPLOYEE', + departmentId: itDept.id, + level: 5, + description: 'General employee - IT Department', + }, + }); + + const hrEmployeePosition = await prisma.position.create({ + data: { + title: 'Employee', + titleAr: 'موظف', + code: 'HR_EMPLOYEE', + departmentId: hrDept.id, + level: 5, + description: 'General employee - HR Department', + }, + }); + // Create Permissions for GM (Full Access) const modules = ['contacts', 'crm', 'inventory', 'projects', 'hr', 'marketing']; for (const module of modules) { diff --git a/backend/prisma/seed.ts b/backend/prisma/seed.ts index f624f78..76461f5 100644 --- a/backend/prisma/seed.ts +++ b/backend/prisma/seed.ts @@ -72,6 +72,62 @@ async function main() { console.log('✅ Created positions'); + const itSupportPosition = await prisma.position.create({ + data: { + title: 'IT Support', + titleAr: 'دعم فني', + code: 'IT_SUPPORT', + departmentId: itDept.id, + level: 4, + description: 'IT Support Technician', + }, + }); + + const itDeveloperPosition = await prisma.position.create({ + data: { + title: 'Developer', + titleAr: 'مطور', + code: 'IT_DEV', + departmentId: itDept.id, + level: 4, + description: 'Software Developer', + }, + }); + + // Employee position for ALL departments (added) + const salesEmployeePosition = await prisma.position.create({ + data: { + title: 'Employee', + titleAr: 'موظف', + code: 'SALES_EMPLOYEE', + departmentId: salesDept.id, + level: 5, + description: 'General employee - Sales Department', + }, + }); + + const itEmployeePosition = await prisma.position.create({ + data: { + title: 'Employee', + titleAr: 'موظف', + code: 'IT_EMPLOYEE', + departmentId: itDept.id, + level: 5, + description: 'General employee - IT Department', + }, + }); + + const hrEmployeePosition = await prisma.position.create({ + data: { + title: 'Employee', + titleAr: 'موظف', + code: 'HR_EMPLOYEE', + departmentId: hrDept.id, + level: 5, + description: 'General employee - HR Department', + }, + }); + // Create Permissions for GM (Full Access) const modules = ['contacts', 'crm', 'inventory', 'projects', 'hr', 'marketing']; const resources = ['*'];