-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35643 from dimagi/ay/kyc-integration-models
Model for KYC Integration Config
- Loading branch information
Showing
7 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters