expand contant types

This commit is contained in:
yotakii
2026-03-30 13:22:14 +03:00
parent 78aa7c0fb5
commit 3e8985ffe0
5 changed files with 49 additions and 6 deletions

View File

@@ -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(),

View File

@@ -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',