655 lines
30 KiB
Python
655 lines
30 KiB
Python
"""
|
|
Management command to populate default setting templates.
|
|
|
|
Usage:
|
|
python manage.py populate_setting_templates
|
|
"""
|
|
|
|
from django.core.management.base import BaseCommand
|
|
from django.db import transaction
|
|
from core.models import SettingTemplate
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = 'Populate default setting templates for tenant configuration'
|
|
|
|
def handle(self, *args, **options):
|
|
self.stdout.write('Populating setting templates...')
|
|
|
|
templates_data = self.get_templates_data()
|
|
|
|
created_count = 0
|
|
updated_count = 0
|
|
|
|
with transaction.atomic():
|
|
for template_data in templates_data:
|
|
template, created = SettingTemplate.objects.update_or_create(
|
|
key=template_data['key'],
|
|
defaults=template_data
|
|
)
|
|
|
|
if created:
|
|
created_count += 1
|
|
self.stdout.write(
|
|
self.style.SUCCESS(f' ✓ Created: {template.key}')
|
|
)
|
|
else:
|
|
updated_count += 1
|
|
self.stdout.write(
|
|
self.style.WARNING(f' ↻ Updated: {template.key}')
|
|
)
|
|
|
|
self.stdout.write(
|
|
self.style.SUCCESS(
|
|
f'\nCompleted! Created: {created_count}, Updated: {updated_count}'
|
|
)
|
|
)
|
|
|
|
def get_templates_data(self):
|
|
"""Return list of template definitions."""
|
|
return [
|
|
# ============================================================
|
|
# BASIC INFORMATION
|
|
# ============================================================
|
|
{
|
|
'key': 'basic_clinic_name_en',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Clinic Name (English)',
|
|
'label_ar': 'اسم العيادة (إنجليزي)',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'help_text_en': 'Official clinic name in English',
|
|
'help_text_ar': 'الاسم الرسمي للعيادة بالإنجليزية',
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'basic_clinic_name_ar',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Clinic Name (Arabic)',
|
|
'label_ar': 'اسم العيادة (عربي)',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'help_text_en': 'Official clinic name in Arabic',
|
|
'help_text_ar': 'الاسم الرسمي للعيادة بالعربية',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'basic_clinic_code',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Clinic Code',
|
|
'label_ar': 'رمز العيادة',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'help_text_en': 'Unique identifier code for the clinic',
|
|
'help_text_ar': 'رمز معرف فريد للعيادة',
|
|
'validation_regex': r'^[A-Z0-9]{2,10}$',
|
|
'order': 30,
|
|
},
|
|
{
|
|
'key': 'basic_logo',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Clinic Logo',
|
|
'label_ar': 'شعار العيادة',
|
|
'data_type': SettingTemplate.DataType.FILE,
|
|
'is_required': False,
|
|
'help_text_en': 'Upload clinic logo (PNG, JPG, or SVG)',
|
|
'help_text_ar': 'تحميل شعار العيادة (PNG أو JPG أو SVG)',
|
|
'order': 40,
|
|
},
|
|
{
|
|
'key': 'basic_primary_color',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Primary Brand Color',
|
|
'label_ar': 'اللون الأساسي للعلامة التجارية',
|
|
'data_type': SettingTemplate.DataType.COLOR,
|
|
'is_required': False,
|
|
'default_value': '#007bff',
|
|
'help_text_en': 'Primary color for branding (hex code)',
|
|
'help_text_ar': 'اللون الأساسي للعلامة التجارية (كود hex)',
|
|
'validation_regex': r'^#[0-9A-Fa-f]{6}$',
|
|
'order': 50,
|
|
},
|
|
{
|
|
'key': 'basic_secondary_color',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Secondary Brand Color',
|
|
'label_ar': 'اللون الثانوي للعلامة التجارية',
|
|
'data_type': SettingTemplate.DataType.COLOR,
|
|
'is_required': False,
|
|
'default_value': '#6c757d',
|
|
'help_text_en': 'Secondary color for branding (hex code)',
|
|
'help_text_ar': 'اللون الثانوي للعلامة التجارية (كود hex)',
|
|
'validation_regex': r'^#[0-9A-Fa-f]{6}$',
|
|
'order': 60,
|
|
},
|
|
|
|
# ============================================================
|
|
# VAT REGISTRATION
|
|
# ============================================================
|
|
{
|
|
'key': 'vat_registration_number',
|
|
'category': SettingTemplate.Category.VAT,
|
|
'label_en': 'VAT Registration Number',
|
|
'label_ar': 'رقم التسجيل الضريبي',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'help_text_en': '15-digit VAT number (must start and end with 3)',
|
|
'help_text_ar': 'رقم ضريبة القيمة المضافة المكون من 15 رقمًا (يجب أن يبدأ وينتهي بـ 3)',
|
|
'validation_regex': r'^3\d{13}3$',
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'vat_tax_id',
|
|
'category': SettingTemplate.Category.VAT,
|
|
'label_en': 'Tax ID',
|
|
'label_ar': 'الرقم الضريبي',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'help_text_en': 'Additional tax identification number',
|
|
'help_text_ar': 'رقم التعريف الضريبي الإضافي',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'vat_commercial_registration',
|
|
'category': SettingTemplate.Category.VAT,
|
|
'label_en': 'Commercial Registration Number',
|
|
'label_ar': 'رقم السجل التجاري',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'help_text_en': 'Commercial registration number',
|
|
'help_text_ar': 'رقم السجل التجاري',
|
|
'order': 30,
|
|
},
|
|
|
|
# ============================================================
|
|
# ADDRESS INFORMATION
|
|
# ============================================================
|
|
{
|
|
'key': 'address_street',
|
|
'category': SettingTemplate.Category.ADDRESS,
|
|
'label_en': 'Street Address',
|
|
'label_ar': 'عنوان الشارع',
|
|
'data_type': SettingTemplate.DataType.TEXT,
|
|
'is_required': True,
|
|
'help_text_en': 'Full street address',
|
|
'help_text_ar': 'عنوان الشارع الكامل',
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'address_building_number',
|
|
'category': SettingTemplate.Category.ADDRESS,
|
|
'label_en': 'Building Number',
|
|
'label_ar': 'رقم المبنى',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'help_text_en': 'Building number',
|
|
'help_text_ar': 'رقم المبنى',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'address_city',
|
|
'category': SettingTemplate.Category.ADDRESS,
|
|
'label_en': 'City',
|
|
'label_ar': 'المدينة',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'default_value': 'Riyadh',
|
|
'help_text_en': 'City name',
|
|
'help_text_ar': 'اسم المدينة',
|
|
'order': 30,
|
|
},
|
|
{
|
|
'key': 'address_postal_code',
|
|
'category': SettingTemplate.Category.ADDRESS,
|
|
'label_en': 'Postal Code',
|
|
'label_ar': 'الرمز البريدي',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'help_text_en': '5-digit postal code',
|
|
'help_text_ar': 'الرمز البريدي المكون من 5 أرقام',
|
|
'validation_regex': r'^\d{5}$',
|
|
'order': 40,
|
|
},
|
|
{
|
|
'key': 'address_country_code',
|
|
'category': SettingTemplate.Category.ADDRESS,
|
|
'label_en': 'Country Code',
|
|
'label_ar': 'رمز الدولة',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'default_value': 'SA',
|
|
'help_text_en': 'ISO 2-letter country code',
|
|
'help_text_ar': 'رمز الدولة ISO المكون من حرفين',
|
|
'validation_regex': r'^[A-Z]{2}$',
|
|
'order': 50,
|
|
},
|
|
{
|
|
'key': 'address_additional_number',
|
|
'category': SettingTemplate.Category.ADDRESS,
|
|
'label_en': 'Additional Number',
|
|
'label_ar': 'الرقم الإضافي',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'help_text_en': 'Additional address number',
|
|
'help_text_ar': 'الرقم الإضافي للعنوان',
|
|
'order': 60,
|
|
},
|
|
|
|
# ============================================================
|
|
# ZATCA E-INVOICING
|
|
# ============================================================
|
|
{
|
|
'key': 'zatca_environment',
|
|
'category': SettingTemplate.Category.ZATCA,
|
|
'label_en': 'ZATCA Environment',
|
|
'label_ar': 'بيئة هيئة الزكاة',
|
|
'data_type': SettingTemplate.DataType.CHOICE,
|
|
'is_required': True,
|
|
'default_value': 'SIMULATION',
|
|
'help_text_en': 'Select SIMULATION for testing or PRODUCTION for live',
|
|
'help_text_ar': 'اختر SIMULATION للاختبار أو PRODUCTION للإنتاج',
|
|
'choices': [
|
|
{'value': 'SIMULATION', 'label': 'Simulation (Testing)'},
|
|
{'value': 'PRODUCTION', 'label': 'Production (Live)'},
|
|
],
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'zatca_otp',
|
|
'category': SettingTemplate.Category.ZATCA,
|
|
'label_en': 'ZATCA OTP',
|
|
'label_ar': 'رمز OTP لهيئة الزكاة',
|
|
'data_type': SettingTemplate.DataType.ENCRYPTED,
|
|
'is_required': True,
|
|
'help_text_en': 'One-time password for ZATCA onboarding',
|
|
'help_text_ar': 'كلمة المرور لمرة واحدة للتسجيل في هيئة الزكاة',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'zatca_csid',
|
|
'category': SettingTemplate.Category.ZATCA,
|
|
'label_en': 'CSID (Compliance Security ID)',
|
|
'label_ar': 'معرف أمان الامتثال',
|
|
'data_type': SettingTemplate.DataType.TEXT,
|
|
'is_required': False,
|
|
'help_text_en': 'Auto-generated during onboarding (read-only)',
|
|
'help_text_ar': 'يتم إنشاؤه تلقائيًا أثناء التسجيل (للقراءة فقط)',
|
|
'order': 30,
|
|
},
|
|
{
|
|
'key': 'zatca_certificate',
|
|
'category': SettingTemplate.Category.ZATCA,
|
|
'label_en': 'ZATCA Certificate',
|
|
'label_ar': 'شهادة هيئة الزكاة',
|
|
'data_type': SettingTemplate.DataType.TEXT,
|
|
'is_required': False,
|
|
'help_text_en': 'Auto-generated certificate (read-only)',
|
|
'help_text_ar': 'الشهادة المُنشأة تلقائيًا (للقراءة فقط)',
|
|
'order': 40,
|
|
},
|
|
{
|
|
'key': 'zatca_private_key',
|
|
'category': SettingTemplate.Category.ZATCA,
|
|
'label_en': 'Private Key',
|
|
'label_ar': 'المفتاح الخاص',
|
|
'data_type': SettingTemplate.DataType.ENCRYPTED,
|
|
'is_required': False,
|
|
'help_text_en': 'Auto-generated private key (read-only)',
|
|
'help_text_ar': 'المفتاح الخاص المُنشأ تلقائيًا (للقراءة فقط)',
|
|
'order': 50,
|
|
},
|
|
{
|
|
'key': 'zatca_device_name',
|
|
'category': SettingTemplate.Category.ZATCA,
|
|
'label_en': 'Device Name',
|
|
'label_ar': 'اسم الجهاز',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'default_value': 'POS-001',
|
|
'help_text_en': 'Name of the invoicing device',
|
|
'help_text_ar': 'اسم جهاز الفوترة',
|
|
'order': 60,
|
|
},
|
|
{
|
|
'key': 'zatca_solution_name',
|
|
'category': SettingTemplate.Category.ZATCA,
|
|
'label_en': 'Solution Name',
|
|
'label_ar': 'اسم الحل',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'default_value': 'AgdarCentre ERP',
|
|
'help_text_en': 'Name of the e-invoicing solution',
|
|
'help_text_ar': 'اسم حل الفوترة الإلكترونية',
|
|
'order': 70,
|
|
},
|
|
|
|
# ============================================================
|
|
# NPHIES INTEGRATION
|
|
# ============================================================
|
|
{
|
|
'key': 'nphies_environment',
|
|
'category': SettingTemplate.Category.NPHIES,
|
|
'label_en': 'NPHIES Environment',
|
|
'label_ar': 'بيئة نفيس',
|
|
'data_type': SettingTemplate.DataType.CHOICE,
|
|
'is_required': True,
|
|
'default_value': 'SIMULATION',
|
|
'help_text_en': 'Select SIMULATION for testing or PRODUCTION for live',
|
|
'help_text_ar': 'اختر SIMULATION للاختبار أو PRODUCTION للإنتاج',
|
|
'choices': [
|
|
{'value': 'SIMULATION', 'label': 'Simulation (Testing)'},
|
|
{'value': 'PRODUCTION', 'label': 'Production (Live)'},
|
|
],
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'nphies_client_id',
|
|
'category': SettingTemplate.Category.NPHIES,
|
|
'label_en': 'Client ID',
|
|
'label_ar': 'معرف العميل',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'help_text_en': 'NPHIES client identifier',
|
|
'help_text_ar': 'معرف عميل نفيس',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'nphies_client_secret',
|
|
'category': SettingTemplate.Category.NPHIES,
|
|
'label_en': 'Client Secret',
|
|
'label_ar': 'سر العميل',
|
|
'data_type': SettingTemplate.DataType.ENCRYPTED,
|
|
'is_required': True,
|
|
'help_text_en': 'NPHIES client secret (encrypted)',
|
|
'help_text_ar': 'سر عميل نفيس (مشفر)',
|
|
'order': 30,
|
|
},
|
|
{
|
|
'key': 'nphies_organization_license',
|
|
'category': SettingTemplate.Category.NPHIES,
|
|
'label_en': 'Organization License Number',
|
|
'label_ar': 'رقم ترخيص المنظمة',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'help_text_en': 'Healthcare organization license number',
|
|
'help_text_ar': 'رقم ترخيص المنظمة الصحية',
|
|
'order': 40,
|
|
},
|
|
{
|
|
'key': 'nphies_provider_license',
|
|
'category': SettingTemplate.Category.NPHIES,
|
|
'label_en': 'Provider License Number',
|
|
'label_ar': 'رقم ترخيص مقدم الخدمة',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'help_text_en': 'Healthcare provider license number',
|
|
'help_text_ar': 'رقم ترخيص مقدم الخدمة الصحية',
|
|
'order': 50,
|
|
},
|
|
|
|
# ============================================================
|
|
# SMS/WHATSAPP INTEGRATION
|
|
# ============================================================
|
|
{
|
|
'key': 'sms_provider',
|
|
'category': SettingTemplate.Category.SMS,
|
|
'label_en': 'SMS Provider',
|
|
'label_ar': 'مزود الرسائل القصيرة',
|
|
'data_type': SettingTemplate.DataType.CHOICE,
|
|
'is_required': True,
|
|
'default_value': 'TWILIO',
|
|
'help_text_en': 'Select SMS service provider',
|
|
'help_text_ar': 'اختر مزود خدمة الرسائل القصيرة',
|
|
'choices': [
|
|
{'value': 'TWILIO', 'label': 'Twilio'},
|
|
{'value': 'OTHER', 'label': 'Other'},
|
|
],
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'sms_account_sid',
|
|
'category': SettingTemplate.Category.SMS,
|
|
'label_en': 'Account SID',
|
|
'label_ar': 'معرف الحساب',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': True,
|
|
'help_text_en': 'Twilio Account SID',
|
|
'help_text_ar': 'معرف حساب Twilio',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'sms_auth_token',
|
|
'category': SettingTemplate.Category.SMS,
|
|
'label_en': 'Auth Token',
|
|
'label_ar': 'رمز المصادقة',
|
|
'data_type': SettingTemplate.DataType.ENCRYPTED,
|
|
'is_required': True,
|
|
'help_text_en': 'Twilio authentication token (encrypted)',
|
|
'help_text_ar': 'رمز مصادقة Twilio (مشفر)',
|
|
'order': 30,
|
|
},
|
|
{
|
|
'key': 'sms_phone_number',
|
|
'category': SettingTemplate.Category.SMS,
|
|
'label_en': 'SMS Phone Number',
|
|
'label_ar': 'رقم هاتف الرسائل القصيرة',
|
|
'data_type': SettingTemplate.DataType.PHONE,
|
|
'is_required': True,
|
|
'help_text_en': 'Twilio phone number for sending SMS',
|
|
'help_text_ar': 'رقم هاتف Twilio لإرسال الرسائل القصيرة',
|
|
'order': 40,
|
|
},
|
|
{
|
|
'key': 'sms_whatsapp_number',
|
|
'category': SettingTemplate.Category.SMS,
|
|
'label_en': 'WhatsApp Number',
|
|
'label_ar': 'رقم واتساب',
|
|
'data_type': SettingTemplate.DataType.PHONE,
|
|
'is_required': False,
|
|
'help_text_en': 'Twilio WhatsApp number',
|
|
'help_text_ar': 'رقم واتساب Twilio',
|
|
'order': 50,
|
|
},
|
|
{
|
|
'key': 'sms_enable_notifications',
|
|
'category': SettingTemplate.Category.SMS,
|
|
'label_en': 'Enable SMS Notifications',
|
|
'label_ar': 'تفعيل إشعارات الرسائل القصيرة',
|
|
'data_type': SettingTemplate.DataType.BOOLEAN,
|
|
'is_required': False,
|
|
'default_value': 'true',
|
|
'help_text_en': 'Enable or disable SMS notifications',
|
|
'help_text_ar': 'تفعيل أو تعطيل إشعارات الرسائل القصيرة',
|
|
'order': 60,
|
|
},
|
|
{
|
|
'key': 'sms_enable_whatsapp',
|
|
'category': SettingTemplate.Category.SMS,
|
|
'label_en': 'Enable WhatsApp Notifications',
|
|
'label_ar': 'تفعيل إشعارات واتساب',
|
|
'data_type': SettingTemplate.DataType.BOOLEAN,
|
|
'is_required': False,
|
|
'default_value': 'false',
|
|
'help_text_en': 'Enable or disable WhatsApp notifications',
|
|
'help_text_ar': 'تفعيل أو تعطيل إشعارات واتساب',
|
|
'order': 70,
|
|
},
|
|
|
|
# ============================================================
|
|
# LAB INTEGRATION
|
|
# ============================================================
|
|
{
|
|
'key': 'lab_api_url',
|
|
'category': SettingTemplate.Category.LAB,
|
|
'label_en': 'Lab API URL',
|
|
'label_ar': 'رابط API المختبر',
|
|
'data_type': SettingTemplate.DataType.URL,
|
|
'is_required': False,
|
|
'help_text_en': 'Laboratory integration API endpoint',
|
|
'help_text_ar': 'نقطة نهاية API لتكامل المختبر',
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'lab_api_key',
|
|
'category': SettingTemplate.Category.LAB,
|
|
'label_en': 'Lab API Key',
|
|
'label_ar': 'مفتاح API المختبر',
|
|
'data_type': SettingTemplate.DataType.ENCRYPTED,
|
|
'is_required': False,
|
|
'help_text_en': 'Laboratory API authentication key (encrypted)',
|
|
'help_text_ar': 'مفتاح مصادقة API المختبر (مشفر)',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'lab_enable_integration',
|
|
'category': SettingTemplate.Category.LAB,
|
|
'label_en': 'Enable Lab Integration',
|
|
'label_ar': 'تفعيل تكامل المختبر',
|
|
'data_type': SettingTemplate.DataType.BOOLEAN,
|
|
'is_required': False,
|
|
'default_value': 'false',
|
|
'help_text_en': 'Enable or disable lab integration',
|
|
'help_text_ar': 'تفعيل أو تعطيل تكامل المختبر',
|
|
'order': 30,
|
|
},
|
|
|
|
# ============================================================
|
|
# RADIOLOGY INTEGRATION
|
|
# ============================================================
|
|
{
|
|
'key': 'radiology_api_url',
|
|
'category': SettingTemplate.Category.RADIOLOGY,
|
|
'label_en': 'Radiology API URL',
|
|
'label_ar': 'رابط API الأشعة',
|
|
'data_type': SettingTemplate.DataType.URL,
|
|
'is_required': False,
|
|
'help_text_en': 'Radiology integration API endpoint',
|
|
'help_text_ar': 'نقطة نهاية API لتكامل الأشعة',
|
|
'order': 10,
|
|
},
|
|
{
|
|
'key': 'radiology_api_key',
|
|
'category': SettingTemplate.Category.RADIOLOGY,
|
|
'label_en': 'Radiology API Key',
|
|
'label_ar': 'مفتاح API الأشعة',
|
|
'data_type': SettingTemplate.DataType.ENCRYPTED,
|
|
'is_required': False,
|
|
'help_text_en': 'Radiology API authentication key (encrypted)',
|
|
'help_text_ar': 'مفتاح مصادقة API الأشعة (مشفر)',
|
|
'order': 20,
|
|
},
|
|
{
|
|
'key': 'radiology_enable_integration',
|
|
'category': SettingTemplate.Category.RADIOLOGY,
|
|
'label_en': 'Enable Radiology Integration',
|
|
'label_ar': 'تفعيل تكامل الأشعة',
|
|
'data_type': SettingTemplate.DataType.BOOLEAN,
|
|
'is_required': False,
|
|
'default_value': 'false',
|
|
'help_text_en': 'Enable or disable radiology integration',
|
|
'help_text_ar': 'تفعيل أو تعطيل تكامل الأشعة',
|
|
'order': 30,
|
|
},
|
|
|
|
# ============================================================
|
|
# EMAIL CONFIGURATION
|
|
# ============================================================
|
|
{
|
|
'key': 'email_backend',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Email Backend',
|
|
'label_ar': 'نظام البريد الإلكتروني',
|
|
'data_type': SettingTemplate.DataType.CHOICE,
|
|
'is_required': False,
|
|
'default_value': 'console',
|
|
'help_text_en': 'Email backend type (console for testing, smtp for production)',
|
|
'help_text_ar': 'نوع نظام البريد الإلكتروني (console للاختبار، smtp للإنتاج)',
|
|
'choices': [
|
|
{'value': 'console', 'label': 'Console (Testing)'},
|
|
{'value': 'smtp', 'label': 'SMTP (Production)'},
|
|
],
|
|
'order': 100,
|
|
},
|
|
{
|
|
'key': 'email_host',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'SMTP Host',
|
|
'label_ar': 'خادم SMTP',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'default_value': 'smtp.gmail.com',
|
|
'help_text_en': 'SMTP server hostname (e.g., smtp.gmail.com)',
|
|
'help_text_ar': 'اسم خادم SMTP (مثال: smtp.gmail.com)',
|
|
'order': 110,
|
|
},
|
|
{
|
|
'key': 'email_port',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'SMTP Port',
|
|
'label_ar': 'منفذ SMTP',
|
|
'data_type': SettingTemplate.DataType.INTEGER,
|
|
'is_required': False,
|
|
'default_value': '587',
|
|
'help_text_en': 'SMTP server port (usually 587 for TLS or 465 for SSL)',
|
|
'help_text_ar': 'منفذ خادم SMTP (عادة 587 لـ TLS أو 465 لـ SSL)',
|
|
'order': 120,
|
|
},
|
|
{
|
|
'key': 'email_use_tls',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Use TLS',
|
|
'label_ar': 'استخدام TLS',
|
|
'data_type': SettingTemplate.DataType.BOOLEAN,
|
|
'is_required': False,
|
|
'default_value': 'true',
|
|
'help_text_en': 'Enable TLS encryption for email',
|
|
'help_text_ar': 'تفعيل تشفير TLS للبريد الإلكتروني',
|
|
'order': 130,
|
|
},
|
|
{
|
|
'key': 'email_host_user',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Email Username',
|
|
'label_ar': 'اسم مستخدم البريد الإلكتروني',
|
|
'data_type': SettingTemplate.DataType.EMAIL,
|
|
'is_required': False,
|
|
'help_text_en': 'SMTP authentication username (usually your email address)',
|
|
'help_text_ar': 'اسم مستخدم SMTP (عادة عنوان بريدك الإلكتروني)',
|
|
'order': 140,
|
|
},
|
|
{
|
|
'key': 'email_host_password',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'Email Password',
|
|
'label_ar': 'كلمة مرور البريد الإلكتروني',
|
|
'data_type': SettingTemplate.DataType.ENCRYPTED,
|
|
'is_required': False,
|
|
'help_text_en': 'SMTP authentication password or app password (encrypted)',
|
|
'help_text_ar': 'كلمة مرور SMTP أو كلمة مرور التطبيق (مشفرة)',
|
|
'order': 150,
|
|
},
|
|
{
|
|
'key': 'email_from_address',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'From Email Address',
|
|
'label_ar': 'عنوان البريد الإلكتروني للمرسل',
|
|
'data_type': SettingTemplate.DataType.EMAIL,
|
|
'is_required': False,
|
|
'default_value': 'noreply@agdarcentre.sa',
|
|
'help_text_en': 'Email address that appears as sender',
|
|
'help_text_ar': 'عنوان البريد الإلكتروني الذي يظهر كمرسل',
|
|
'order': 160,
|
|
},
|
|
{
|
|
'key': 'email_from_name',
|
|
'category': SettingTemplate.Category.BASIC,
|
|
'label_en': 'From Name',
|
|
'label_ar': 'اسم المرسل',
|
|
'data_type': SettingTemplate.DataType.STRING,
|
|
'is_required': False,
|
|
'help_text_en': 'Name that appears as sender (e.g., "Agdar Centre")',
|
|
'help_text_ar': 'الاسم الذي يظهر كمرسل (مثال: "مركز أغدار")',
|
|
'order': 170,
|
|
},
|
|
]
|