Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model for KYC Integration Config #35643

Merged
merged 4 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
24 changes: 24 additions & 0 deletions corehq/apps/integration/kyc/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import jsonfield
from django.db import models
from django.utils.translation import gettext as _

from corehq.motech.models import ConnectionSettings


class UserDataStore(object):
CUSTOM_USER_DATA = 'custom_user_data'
USER_CASE = 'user_case'
OTHER_CASE_TYPE = 'other_case_type'
CHOICES = [
(CUSTOM_USER_DATA, _('Custom User Data')),
(USER_CASE, _('User Case')),
(OTHER_CASE_TYPE, _('Other Case Type')),
]


class KycConfig(models.Model):
domain = models.CharField(max_length=126, db_index=True)
user_data_store = models.CharField(max_length=25, choices=UserDataStore.CHOICES)
other_case_type = models.CharField(max_length=126, null=True)
api_field_to_user_data_map = jsonfield.JSONField(default=dict)
connection_settings = models.ForeignKey(ConnectionSettings, on_delete=models.PROTECT)
27 changes: 27 additions & 0 deletions corehq/apps/integration/migrations/0006_kycconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.17 on 2025-01-21 08:22

from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields


class Migration(migrations.Migration):

dependencies = [
('motech', '0016_connectionsettings_include_client_id_and_more'),
('integration', '0005_gaenotpserversettings_server_type'),
]

operations = [
migrations.CreateModel(
name='KycConfig',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('domain', models.CharField(db_index=True, max_length=126)),
('user_data_store', models.CharField(choices=[('custom_user_data', 'Custom User Data'), ('user_case', 'User Case'), ('other_case_type', 'Other Case Type')], max_length=25)),
('other_case_type', models.CharField(max_length=126, null=True)),
('api_field_to_user_data_map', jsonfield.fields.JSONField(default=dict)),
('connection_settings', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='motech.connectionsettings')),
],
),
]
1 change: 1 addition & 0 deletions corehq/apps/integration/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from memoized import memoized

from corehq import toggles
from corehq.apps.integration.kyc.models import KycConfig # noqa


class DialerSettings(models.Model):
Expand Down
1 change: 1 addition & 0 deletions migrations.lock
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ integration
0003_hmaccalloutsettings
0004_gaenotpserversettings
0005_gaenotpserversettings_server_type
0006_kycconfig
ivr
0001_initial
0002_call_app_id
Expand Down
Loading