diff --git a/backend/src/modules/contacts/contacts.routes.ts b/backend/src/modules/contacts/contacts.routes.ts index 18e5208..0654d66 100644 --- a/backend/src/modules/contacts/contacts.routes.ts +++ b/backend/src/modules/contacts/contacts.routes.ts @@ -42,7 +42,8 @@ router.post( '/', authorize('contacts', 'contacts', 'create'), [ - body('type').isIn(['INDIVIDUAL', 'COMPANY', 'HOLDING', 'GOVERNMENT']), + body('type').isIn(['INDIVIDUAL', 'COMPANY', 'HOLDING', 'GOVERNMENT','ORGANIZATION', + 'BANK','UNIVERSITY','SCHOOL','UN','NGO','INSTITUTION',]), body('name').notEmpty().trim(), body('email').optional().isEmail(), body('source').notEmpty(), diff --git a/backend/src/modules/contacts/contacts.service.ts b/backend/src/modules/contacts/contacts.service.ts index 9f75003..83ae71f 100644 --- a/backend/src/modules/contacts/contacts.service.ts +++ b/backend/src/modules/contacts/contacts.service.ts @@ -679,7 +679,7 @@ class ContactsService { } // Validate type - if (!['INDIVIDUAL', 'COMPANY', 'HOLDING', 'GOVERNMENT'].includes(row.type)) { + if (!['INDIVIDUAL', 'COMPANY', 'HOLDING', 'GOVERNMENT', 'ORGANIZATION','BANK','UNIVERSITY','SCHOOL','UN','NGO','INSTITUTION',].includes(row.type)) { results.errors.push({ row: rowNumber, field: 'type', diff --git a/frontend/src/app/contacts/[id]/page.tsx b/frontend/src/app/contacts/[id]/page.tsx index 0eed330..bab352f 100644 --- a/frontend/src/app/contacts/[id]/page.tsx +++ b/frontend/src/app/contacts/[id]/page.tsx @@ -98,7 +98,14 @@ function ContactDetailContent() { INDIVIDUAL: 'bg-blue-100 text-blue-700', COMPANY: 'bg-green-100 text-green-700', HOLDING: 'bg-purple-100 text-purple-700', - GOVERNMENT: 'bg-orange-100 text-orange-700' + GOVERNMENT: 'bg-orange-100 text-orange-700', + ORGANIZATION: 'bg-cyan-100 text-cyan-700', + BANK: 'bg-emerald-100 text-emerald-700', + UNIVERSITY: 'bg-indigo-100 text-indigo-700', + SCHOOL: 'bg-yellow-100 text-yellow-700', + UN: 'bg-sky-100 text-sky-700', + NGO: 'bg-pink-100 text-pink-700', + INSTITUTION: 'bg-gray-100 text-gray-700' } return colors[type] || 'bg-gray-100 text-gray-700' } @@ -108,7 +115,14 @@ function ContactDetailContent() { INDIVIDUAL: 'فرد - Individual', COMPANY: 'شركة - Company', HOLDING: 'مجموعة - Holding', - GOVERNMENT: 'حكومي - Government' + GOVERNMENT: 'حكومي - Government', + ORGANIZATION: 'منظمات - Organizations', + BANK: 'بنوك - Banks', + UNIVERSITY: 'جامعات - Universities', + SCHOOL: 'مدارس - Schools', + UN: 'UN - United Nations', + NGO: 'NGO - Non-Governmental Organization', + INSTITUTION: 'مؤسسة - Institution' } return labels[type] || type } diff --git a/frontend/src/app/contacts/page.tsx b/frontend/src/app/contacts/page.tsx index 333e594..e6b20e0 100644 --- a/frontend/src/app/contacts/page.tsx +++ b/frontend/src/app/contacts/page.tsx @@ -195,7 +195,14 @@ function ContactsContent() { INDIVIDUAL: 'bg-blue-100 text-blue-700', COMPANY: 'bg-green-100 text-green-700', HOLDING: 'bg-purple-100 text-purple-700', - GOVERNMENT: 'bg-orange-100 text-orange-700' + GOVERNMENT: 'bg-orange-100 text-orange-700', + ORGANIZATION: 'bg-cyan-100 text-cyan-700', + BANK: 'bg-emerald-100 text-emerald-700', + UNIVERSITY: 'bg-indigo-100 text-indigo-700', + SCHOOL: 'bg-yellow-100 text-yellow-700', + UN: 'bg-sky-100 text-sky-700', + NGO: 'bg-pink-100 text-pink-700', + INSTITUTION: 'bg-gray-100 text-gray-700' } return colors[type] || 'bg-gray-100 text-gray-700' } @@ -209,7 +216,14 @@ function ContactsContent() { INDIVIDUAL: 'فرد', COMPANY: 'شركة', HOLDING: 'مجموعة', - GOVERNMENT: 'حكومي' + GOVERNMENT: 'حكومي', + ORGANIZATION: 'منظمات', + BANK: 'بنوك', + UNIVERSITY: 'جامعات', + SCHOOL: 'مدارس', + UN: 'UN', + NGO: 'NGO', + INSTITUTION: 'مؤسسة' } return labels[type] || type } @@ -372,6 +386,13 @@ function ContactsContent() { + + + + + + + {/* Status Filter */} diff --git a/frontend/src/components/contacts/ContactForm.tsx b/frontend/src/components/contacts/ContactForm.tsx index cb6b85c..fe0eeb8 100644 --- a/frontend/src/components/contacts/ContactForm.tsx +++ b/frontend/src/components/contacts/ContactForm.tsx @@ -175,6 +175,13 @@ export default function ContactForm({ contact, onSubmit, onCancel, submitting = + + + + + + + {formErrors.type &&
{formErrors.type}
}