diff --git a/src/hct_mis_api/api/migrations/0001_migration_squashed_0003_migration.py b/src/hct_mis_api/api/migrations/0001_migration.py similarity index 86% rename from src/hct_mis_api/api/migrations/0001_migration_squashed_0003_migration.py rename to src/hct_mis_api/api/migrations/0001_migration.py index 822cba7627..6d6f03a4b0 100644 --- a/src/hct_mis_api/api/migrations/0001_migration_squashed_0003_migration.py +++ b/src/hct_mis_api/api/migrations/0001_migration.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.19 on 2023-06-10 13:03 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.conf import settings from django.db import migrations, models @@ -9,12 +9,26 @@ class Migration(migrations.Migration): + initial = True + dependencies = [ - ('core', '0044_migration_squashed_0057_migration'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ + migrations.CreateModel( + name='APILogEntry', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('timestamp', models.DateTimeField(default=django.utils.timezone.now)), + ('url', models.URLField()), + ('method', models.CharField(max_length=10)), + ('status_code', models.IntegerField()), + ], + options={ + 'verbose_name_plural': 'Api Log Entries', + }, + ), migrations.CreateModel( name='APIToken', fields=[ @@ -23,20 +37,8 @@ class Migration(migrations.Migration): ('allowed_ips', models.CharField(blank=True, max_length=200, null=True, verbose_name='IPs')), ('valid_from', models.DateField(default=django.utils.timezone.now)), ('valid_to', models.DateField(blank=True, null=True)), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ('valid_for', models.ManyToManyField(to='core.BusinessArea')), ('grants', hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('API_READ_ONLY', 'API_READ_ONLY'), ('API_RDI_UPLOAD', 'API_RDI_UPLOAD'), ('API_RDI_CREATE', 'API_RDI_CREATE'), ('API_PROGRAM_CREATE', 'API_PROGRAM_CREATE')], max_length=255), size=None)), - ], - ), - migrations.CreateModel( - name='APILogEntry', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('timestamp', models.DateTimeField(default=django.utils.timezone.now)), - ('url', models.URLField()), - ('method', models.CharField(max_length=10)), - ('status_code', models.IntegerField()), - ('token', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.apitoken')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], ), ] diff --git a/src/hct_mis_api/api/migrations/0002_migration.py b/src/hct_mis_api/api/migrations/0002_migration.py index 918e6cf34f..1c620e7529 100644 --- a/src/hct_mis_api/api/migrations/0002_migration.py +++ b/src/hct_mis_api/api/migrations/0002_migration.py @@ -1,17 +1,27 @@ -# Generated by Django 3.2.20 on 2023-09-26 10:13 +# Generated by Django 3.2.25 on 2024-11-07 12:18 -from django.db import migrations +from django.db import migrations, models +import django.db.models.deletion class Migration(migrations.Migration): + initial = True + dependencies = [ - ('api', '0001_migration_squashed_0003_migration'), + ('core', '0001_migration'), + ('api', '0001_migration'), ] operations = [ - migrations.AlterModelOptions( - name='apilogentry', - options={'verbose_name_plural': 'Api Log Entries'}, + migrations.AddField( + model_name='apitoken', + name='valid_for', + field=models.ManyToManyField(to='core.BusinessArea'), + ), + migrations.AddField( + model_name='apilogentry', + name='token', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.apitoken'), ), ] diff --git a/src/hct_mis_api/apps/account/migrations/0001_migration.py b/src/hct_mis_api/apps/account/migrations/0001_migration.py new file mode 100644 index 0000000000..67e014c8fc --- /dev/null +++ b/src/hct_mis_api/apps/account/migrations/0001_migration.py @@ -0,0 +1,113 @@ +# Generated by Django 3.2.25 on 2024-11-07 12:18 +from django.contrib.postgres.operations import CITextExtension +import django.contrib.auth.models +import django.contrib.auth.validators +import django.contrib.postgres.fields.citext +import django.core.validators +from django.db import migrations, models +import django.db.models.manager +import django.utils.timezone +import hct_mis_api.apps.account.fields +import model_utils.fields +import uuid + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + CITextExtension(), + migrations.CreateModel( + name='User', + fields=[ + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), + ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')), + ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('status', models.CharField(choices=[('ACTIVE', 'Active'), ('INACTIVE', 'Inactive'), ('INVITED', 'Invited')], default='INVITED', max_length=10)), + ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')), + ('available_for_export', models.BooleanField(default=True, help_text='Indicating if a User can be exported to CashAssist')), + ('custom_fields', models.JSONField(blank=True, default=dict)), + ('job_title', models.CharField(blank=True, max_length=255)), + ('ad_uuid', models.CharField(blank=True, editable=False, max_length=64, null=True, unique=True)), + ('last_modify_date', models.DateTimeField(auto_now=True, null=True)), + ('last_doap_sync', models.DateTimeField(blank=True, default=None, help_text='Timestamp of last sync with CA', null=True)), + ('doap_hash', models.TextField(default='', editable=False, help_text='System field used to check if changes need to be sent to CA')), + ], + options={ + 'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_upload_to_kobo', 'Can upload CSV file to Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'), ('quick_links', 'Can see quick links in admin'), ('restrict_help_desk', 'Limit fields to be editable for help desk'), ('can_reindex_programs', 'Can reindex programs'), ('can_add_business_area_to_partner', 'Can add business area to partner')), + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + migrations.CreateModel( + name='IncompatibleRoles', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ], + options={ + 'verbose_name': 'incompatible roles', + 'verbose_name_plural': 'incompatible roles', + }, + ), + migrations.CreateModel( + name='Partner', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', django.contrib.postgres.fields.citext.CICharField(max_length=100, unique=True)), + ('is_un', models.BooleanField(default=False, verbose_name='U.N.')), + ('lft', models.PositiveIntegerField(editable=False)), + ('rght', models.PositiveIntegerField(editable=False)), + ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), + ('level', models.PositiveIntegerField(editable=False)), + ], + options={ + 'abstract': False, + }, + managers=[ + ('_tree_manager', django.db.models.manager.Manager()), + ], + ), + migrations.CreateModel( + name='Role', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('name', models.CharField(max_length=250, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()])), + ('subsystem', models.CharField(choices=[('HOPE', 'HOPE'), ('KOBO', 'Kobo'), ('CA', 'CashAssist'), ('API', 'API')], default='HOPE', max_length=30)), + ('permissions', hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('POPULATION_VIEW_INDIVIDUAL_DELIVERY_MECHANISMS_SECTION', 'POPULATION VIEW INDIVIDUAL DELIVERY MECHANISMS SECTION'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_DOWNLOAD_SUPPORTING_DOCUMENT', 'PM DOWNLOAD SUPPORTING DOCUMENT'), ('PM_UPLOAD_SUPPORTING_DOCUMENT', 'PM UPLOAD SUPPORTING DOCUMENT'), ('PM_DELETE_SUPPORTING_DOCUMENT', 'PM DELETE SUPPORTING DOCUMENT'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('PM_PROGRAMME_CYCLE_VIEW_LIST', 'PM PROGRAMME CYCLE VIEW LIST'), ('PM_PROGRAMME_CYCLE_VIEW_DETAILS', 'PM PROGRAMME CYCLE VIEW DETAILS'), ('PM_PROGRAMME_CYCLE_CREATE', 'PM PROGRAMME CYCLE CREATE'), ('PM_PROGRAMME_CYCLE_UPDATE', 'PM PROGRAMME CYCLE UPDATE'), ('PM_PROGRAMME_CYCLE_DELETE', 'PM PROGRAMME CYCLE DELETE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_VIEW_BIOMETRIC_RESULTS', 'GRIEVANCES VIEW BIOMETRIC RESULTS'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('PDU_VIEW_LIST_AND_DETAILS', 'PDU VIEW LIST AND DETAILS'), ('PDU_TEMPLATE_CREATE', 'PDU TEMPLATE CREATE'), ('PDU_TEMPLATE_DOWNLOAD', 'PDU TEMPLATE DOWNLOAD'), ('PDU_UPLOAD', 'PDU UPLOAD'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('GEO_VIEW_LIST', 'GEO VIEW LIST'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None)), + ], + options={ + 'ordering': ('subsystem', 'name'), + }, + ), + migrations.CreateModel( + name='UserGroup', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + ), + migrations.CreateModel( + name='UserRole', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('expiry_date', models.DateField(blank=True, help_text='After expiry date this User Role will be inactive.', null=True)), + ], + ), + ] diff --git a/src/hct_mis_api/apps/account/migrations/0001_migration_squashed_0030_migration.py b/src/hct_mis_api/apps/account/migrations/0001_migration_squashed_0030_migration.py deleted file mode 100644 index 44cb0006b7..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0001_migration_squashed_0030_migration.py +++ /dev/null @@ -1,258 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 18:38 - -from django.conf import settings -import django.contrib.auth.models -import django.contrib.auth.validators -import django.contrib.postgres.fields.citext -import django.contrib.postgres.fields.jsonb -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone -import hct_mis_api.apps.account.fields -import model_utils.fields -import uuid - -def update_permissions(apps, schema_editor): - Role = apps.get_model("account", "Role") - for role in Role.objects.all(): - if "DASHBOARD_VIEW_HQ" in role.permissions: - role.permissions.remove("DASHBOARD_VIEW_HQ") - if "DASHBOARD_VIEW_COUNTRY" not in role.permissions: - role.permissions.append("DASHBOARD_VIEW_COUNTRY") - role.save() - - -def empty_reverse(apps, schema_editor): - pass - - -def create_ca_roles(apps, schema_editor): - Role = apps.get_model('account', 'Role') - for role in ['Planner/Preparer', 'Approver', 'Authorizer', 'Releaser', 'Card Issuer', - 'Reconciler', 'Entitlement Formula ', 'Data Exporter', 'Targeting Reader', - 'Registration Reader Advanced', 'Cash Assistance Reader',]: - Role.objects.create(name=role, subsystem='CA') - - -def remove_ca_roles(apps, schema_editor): - # We can't import the Person model directly as it may be a newer - # version than this migration expects. We use the historical version. - Role = apps.get_model('account', 'Role') - Role.objects.exclude(subsystem='HOPE').delete() - - -def restore_partner(apps, schema_editor): - User = apps.get_model("account", "User") # noqa: F841 - # for user in User.objects.all(): - # user.org = user.partner.name - # user.save() - - -def set_partner(apps, schema_editor): - # We can't import the Person model directly as it may be a newer - # version than this migration expects. We use the historical version. - User = apps.get_model("account", "User") - Partner = apps.get_model("account", "Partner") - names = ( - "UNICEF", - "UNHCR", - "WFP", - ) - for name in names: - partner, __ = Partner.objects.get_or_create(name=name, defaults={'is_un': True}) - User.objects.filter(org=name).update(partner=partner) - - -class Migration(migrations.Migration): - - dependencies = [ - ('steficon', '0002_migration'), - ('auth', '0011_update_proxy_permissions'), - ('core', '0002_migration_squashed_0006_migration'), - ] - - operations = [ - migrations.CreateModel( - name='Role', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=250, unique=True)), - ('permissions', hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD')], max_length=255), blank=True, null=True, size=None)), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='User', - fields=[ - ('password', models.CharField(max_length=128, verbose_name='password')), - ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), - ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), - ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), - ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), - ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), - ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), - ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), - ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), - ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), - ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), - ('partner', models.CharField(choices=[('UNHCR', 'UNHCR'), ('WFP', 'WFP'), ('UNICEF', 'UNICEF')], default='UNICEF', max_length=10)), - ('status', models.CharField(choices=[('INVITED', 'Invited'), ('ACTIVE', 'Active'), ('INACTIVE', 'Inactive')], default='INVITED', max_length=10)), - ('available_for_export', models.BooleanField(default=True, help_text='Indicating if a User can be exported to CashAssist')), - ('job_title', models.CharField(blank='', default='', max_length=255)), - ], - options={ - 'verbose_name': 'user', - 'verbose_name_plural': 'users', - 'abstract': False, - }, - managers=[ - ('objects', django.contrib.auth.models.UserManager()), - ], - ), - migrations.CreateModel( - name='UserRole', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_roles', to='core.businessarea')), - ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_roles', to='account.role')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_roles', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'abstract': False, - 'unique_together': {('business_area', 'user', 'role')}, - }, - ), - migrations.CreateModel( - name='incompatibleroles', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('role_one', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='incompatible_roles_one', to='account.role')), - ('role_two', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='incompatible_roles_two', to='account.role')), - ], - options={ - 'abstract': False, - 'verbose_name': 'incompatible roles', - 'verbose_name_plural': 'incompatible roles', - 'unique_together': {('role_one', 'role_two')}, - }, - ), - migrations.RunPython(update_permissions, empty_reverse), - migrations.AlterField( - model_name='incompatibleroles', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='incompatibleroles', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='role', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='role', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='userrole', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='userrole', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='role', - name='name', - field=models.CharField(max_length=250, unique=True, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - migrations.AddField( - model_name='user', - name='ad_uuid', - field=models.CharField(blank=True, editable=False, max_length=64, null=True, unique=True), - ), - migrations.AlterField( - model_name='user', - name='job_title', - field=models.CharField(blank=True, max_length=255), - ), - migrations.AddField( - model_name='user', - name='custom_fields', - field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict), - ), - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_upload_to_kobo', 'Can upload users to Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'))}, - ), - migrations.AddField( - model_name='user', - name='last_doap_sync', - field=models.DateTimeField(blank=True, default=None, null=True), - ), - migrations.AddField( - model_name='user', - name='last_modify_date', - field=models.DateTimeField(auto_now=True, null=True), - ), - migrations.AddField( - model_name='role', - name='subsystem', - field=models.CharField(choices=[('HOPE', 'HOPE'), ('KOBO', 'Kobo'), ('CA', 'CashAssist')], default='HOPE', max_length=30), - ), - migrations.AlterField( - model_name='role', - name='name', - field=models.CharField(max_length=250, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - migrations.AlterUniqueTogether( - name='role', - unique_together={('name', 'subsystem')}, - ), - migrations.RunPython(create_ca_roles, remove_ca_roles), - migrations.RenameField( - model_name='user', - old_name='partner', - new_name='org', - ), - migrations.CreateModel( - name='Partner', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', django.contrib.postgres.fields.citext.CICharField(max_length=100, unique=True)), - ('is_un', models.BooleanField(default=False, verbose_name='U.N.')), - ], - ), - migrations.AddField( - model_name='user', - name='partner', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='account.partner'), - ), - migrations.RunPython(set_partner, restore_partner), - migrations.RemoveField( - model_name='user', - name='org', - ), - migrations.AddField( - model_name='user', - name='doap_hash', - field=models.TextField(default='', editable=False), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0002_migration.py b/src/hct_mis_api/apps/account/migrations/0002_migration.py new file mode 100644 index 0000000000..d3118ba673 --- /dev/null +++ b/src/hct_mis_api/apps/account/migrations/0002_migration.py @@ -0,0 +1,101 @@ +# Generated by Django 3.2.25 on 2024-11-07 12:18 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('core', '0001_migration'), + ('auth', '0012_alter_user_first_name_max_length'), + ('account', '0001_migration'), + ] + + operations = [ + migrations.AddField( + model_name='userrole', + name='business_area', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_roles', to='core.businessarea'), + ), + migrations.AddField( + model_name='userrole', + name='role', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_roles', to='account.role'), + ), + migrations.AddField( + model_name='userrole', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_roles', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='usergroup', + name='business_area', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_groups', to='core.businessarea'), + ), + migrations.AddField( + model_name='usergroup', + name='group', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_groups', to='auth.group'), + ), + migrations.AddField( + model_name='usergroup', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_groups', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterUniqueTogether( + name='role', + unique_together={('name', 'subsystem')}, + ), + migrations.AddField( + model_name='partner', + name='allowed_business_areas', + field=models.ManyToManyField(blank=True, to='core.BusinessArea'), + ), + migrations.AddField( + model_name='partner', + name='parent', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.partner', verbose_name='Parent'), + ), + migrations.AddField( + model_name='incompatibleroles', + name='role_one', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='incompatible_roles_one', to='account.role'), + ), + migrations.AddField( + model_name='incompatibleroles', + name='role_two', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='incompatible_roles_two', to='account.role'), + ), + migrations.AddField( + model_name='user', + name='groups', + field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'), + ), + migrations.AddField( + model_name='user', + name='partner', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='account.partner'), + ), + migrations.AddField( + model_name='user', + name='user_permissions', + field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'), + ), + migrations.AlterUniqueTogether( + name='userrole', + unique_together={('business_area', 'user', 'role')}, + ), + migrations.AlterUniqueTogether( + name='usergroup', + unique_together={('business_area', 'user', 'group')}, + ), + migrations.AlterUniqueTogether( + name='incompatibleroles', + unique_together={('role_one', 'role_two')}, + ), + ] diff --git a/src/hct_mis_api/apps/account/migrations/0031_migration_squashed_0041_migration.py b/src/hct_mis_api/apps/account/migrations/0031_migration_squashed_0041_migration.py deleted file mode 100644 index 14674669d6..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0031_migration_squashed_0041_migration.py +++ /dev/null @@ -1,106 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 18:42 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0001_migration_squashed_0030_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'))}, - ), - migrations.AlterField( - model_name='user', - name='doap_hash', - field=models.TextField(default='', editable=False, help_text='System field used to check if changes need to be sent to CA'), - ), - migrations.AlterField( - model_name='user', - name='last_doap_sync', - field=models.DateTimeField(blank=True, default=None, help_text='Timestamp of last sync with CA', null=True), - ), - migrations.AlterField( - model_name='user', - name='email', - field=models.EmailField(blank=True, max_length=254, unique=True, verbose_name='email address'), - ), - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'), ('quick_links', 'Can see quick links in admin'))}, - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='user', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('INACTIVE', 'Inactive'), ('INVITED', 'Invited')], default='INVITED', max_length=10), - ), - migrations.AlterField( - model_name='partner', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - migrations.AlterField( - model_name='user', - name='custom_fields', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='user', - name='first_name', - field=models.CharField(blank=True, max_length=150, verbose_name='first name'), - ), - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_upload_to_kobo', 'Can upload CSV file to Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'), ('quick_links', 'Can see quick links in admin'))}, - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('API_UPLOAD_RDI', 'API UPLOAD RDI'), ('API_CREATE_RDI', 'API CREATE RDI'), ('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='subsystem', - field=models.CharField(choices=[('HOPE', 'HOPE'), ('KOBO', 'Kobo'), ('CA', 'CashAssist'), ('API', 'API')], default='HOPE', max_length=30), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('API_UPLOAD_RDI', 'API UPLOAD RDI'), ('API_CREATE_RDI', 'API CREATE RDI'), ('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0042_migration_squashed_0050_migration.py b/src/hct_mis_api/apps/account/migrations/0042_migration_squashed_0050_migration.py deleted file mode 100644 index 660fad58d2..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0042_migration_squashed_0050_migration.py +++ /dev/null @@ -1,69 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 18:36 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0044_migration_squashed_0057_migration'), - ('account', '0031_migration_squashed_0041_migration'), - ('auth', '0012_alter_user_first_name_max_length'), - ] - - operations = [ - migrations.CreateModel( - name='UserGroup', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_groups', to='core.businessarea')), - ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_groups', to='auth.group')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_groups', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'unique_together': {('business_area', 'user', 'group')}, - }, - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PAYMENT MODULE VIEW LIST'), ('PM_CREATE', 'PAYMENT MODULE CREATE'), ('PM_VIEW_DETAILS', 'PAYMENT MODULE VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PAYMENT MODULE IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PAYMENT MODULE APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_FINANCIAL_SERVICE_PROVIDER_VIEW_LIST_AND_DETAILS', 'FINANCIAL SERVICE PROVIDER VIEW LIST AND DETAILS'), ('PM_FINANCIAL_SERVICE_PROVIDER_VIEW_DETAILS', 'FINANCIAL SERVICE PROVIDER VIEW DETAILS'), ('PM_FINANCIAL_SERVICE_PROVIDER_CREATE', 'FINANCIAL SERVICE PROVIDER CREATE'), ('PM_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'FINANCIAL SERVICE PROVIDER UPDATE'), ('PM_FINANCIAL_SERVICE_PROVIDER_REMOVE', 'FINANCIAL SERVICE PROVIDER REMOVE'), ('PM_FINANCIAL_SERVICE_PROVIDER_ACTIVATE', 'FINANCIAL SERVICE PROVIDER ACTIVATE'), ('PM_FINANCIAL_SERVICE_PROVIDER_XLSX_TEMPLATE_VIEW_LIST_AND_DETAILS', 'FINANCIAL SERVICE PROVIDER XLSX TEMPLATE VIEW LIST AND DETAILS'), ('PM_FINANCIAL_SERVICE_PROVIDER_XLSX_TEMPLATE_VIEW_DETAILS', 'FINANCIAL SERVICE PROVIDER XLSX TEMPLATE VIEW DETAILS'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_FINANCIAL_SERVICE_PROVIDER_VIEW_LIST_AND_DETAILS', 'PM FINANCIAL SERVICE PROVIDER VIEW LIST AND DETAILS'), ('PM_FINANCIAL_SERVICE_PROVIDER_VIEW_DETAILS', 'PM FINANCIAL SERVICE PROVIDER VIEW DETAILS'), ('PM_FINANCIAL_SERVICE_PROVIDER_CREATE', 'PM FINANCIAL SERVICE PROVIDER CREATE'), ('PM_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM FINANCIAL SERVICE PROVIDER UPDATE'), ('PM_FINANCIAL_SERVICE_PROVIDER_REMOVE', 'PM FINANCIAL SERVICE PROVIDER REMOVE'), ('PM_FINANCIAL_SERVICE_PROVIDER_ACTIVATE', 'PM FINANCIAL SERVICE PROVIDER ACTIVATE'), ('PM_FINANCIAL_SERVICE_PROVIDER_XLSX_TEMPLATE_VIEW_LIST_AND_DETAILS', 'PM FINANCIAL SERVICE PROVIDER XLSX TEMPLATE VIEW LIST AND DETAILS'), ('PM_FINANCIAL_SERVICE_PROVIDER_XLSX_TEMPLATE_VIEW_DETAILS', 'PM FINANCIAL SERVICE PROVIDER XLSX TEMPLATE VIEW DETAILS'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_SENDING_PAYMENT_PLAN_TO_FSP', 'PM SENDING PAYMENT PLAN TO FSP'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterModelOptions( - name='role', - options={'ordering': ('subsystem', 'name')}, - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0051_migration.py b/src/hct_mis_api/apps/account/migrations/0051_migration.py deleted file mode 100644 index 1869312355..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0051_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-09 11:02 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0042_migration_squashed_0050_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_FEEDBACK_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK VIEW CREATE'), ('ACCOUNTABILITY_FEEDBACK_VIEW_LIST', 'ACCOUNTABILITY FEEDBACK VIEW LIST'), ('ACCOUNTABILITY_FEEDBACK_VIEW_DETAILS', 'ACCOUNTABILITY FEEDBACK VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_VIEW_UPDATE', 'ACCOUNTABILITY FEEDBACK VIEW UPDATE'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK MESSAGE VIEW CREATE')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0051_migration_squashed_0062_migration.py b/src/hct_mis_api/apps/account/migrations/0051_migration_squashed_0062_migration.py deleted file mode 100644 index 02aa1dab73..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0051_migration_squashed_0062_migration.py +++ /dev/null @@ -1,115 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:39 - -from django.db import migrations, models -import django.db.models.deletion -import hct_mis_api.apps.account.fields -import mptt.fields - - -def add_default_partner(apps, schema_editor): - User = apps.get_model("account", "User") - Partner = apps.get_model("account", "Partner") - - default_partner, _ = Partner.objects.get_or_create(name="UNICEF") - User.objects.filter(partner__isnull=True).update(partner=default_partner) - - -class Migration(migrations.Migration): - - replaces = [('account', '0051_migration'), ('account', '0052_migration'), ('account', '0053_migration'), ('account', '0054_migration'), ('account', '0055_migration'), ('account', '0056_migration'), ('account', '0057_migration'), ('account', '0058_migration'), ('account', '0059_migration'), ('account', '0060_migration'), ('account', '0061_migration'), ('account', '0062_migration')] - - dependencies = [ - ('account', '0042_migration_squashed_0050_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_FEEDBACK_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK VIEW CREATE'), ('ACCOUNTABILITY_FEEDBACK_VIEW_LIST', 'ACCOUNTABILITY FEEDBACK VIEW LIST'), ('ACCOUNTABILITY_FEEDBACK_VIEW_DETAILS', 'ACCOUNTABILITY FEEDBACK VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_VIEW_UPDATE', 'ACCOUNTABILITY FEEDBACK VIEW UPDATE'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK MESSAGE VIEW CREATE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_FEEDBACK_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK VIEW CREATE'), ('ACCOUNTABILITY_FEEDBACK_VIEW_LIST', 'ACCOUNTABILITY FEEDBACK VIEW LIST'), ('ACCOUNTABILITY_FEEDBACK_VIEW_DETAILS', 'ACCOUNTABILITY FEEDBACK VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_VIEW_UPDATE', 'ACCOUNTABILITY FEEDBACK VIEW UPDATE'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK MESSAGE VIEW CREATE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_FEEDBACK_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK VIEW CREATE'), ('ACCOUNTABILITY_FEEDBACK_VIEW_LIST', 'ACCOUNTABILITY FEEDBACK VIEW LIST'), ('ACCOUNTABILITY_FEEDBACK_VIEW_DETAILS', 'ACCOUNTABILITY FEEDBACK VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_VIEW_UPDATE', 'ACCOUNTABILITY FEEDBACK VIEW UPDATE'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK MESSAGE VIEW CREATE')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS')], max_length=255), blank=True, null=True, size=None), - ), - migrations.RunPython(add_default_partner, migrations.RunPython.noop), - migrations.AddField( - model_name='partner', - name='permissions', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='user', - name='partner', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='account.partner'), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AddField( - model_name='partner', - name='level', - field=models.PositiveIntegerField(default=0, editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='partner', - name='lft', - field=models.PositiveIntegerField(default=0, editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='partner', - name='parent', - field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.partner', verbose_name='Parent'), - ), - migrations.AddField( - model_name='partner', - name='rght', - field=models.PositiveIntegerField(default=0, editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='partner', - name='tree_id', - field=models.PositiveIntegerField(db_index=True, default=0, editable=False), - preserve_default=False, - ), - migrations.AlterField( - model_name='user', - name='email', - field=models.EmailField(max_length=254, unique=True, verbose_name='email address'), - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_upload_to_kobo', 'Can upload CSV file to Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'), ('quick_links', 'Can see quick links in admin'), ('restrict_help_desk', 'Limit fields to be editable for help desk'))}, - ), - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0052_migration.py b/src/hct_mis_api/apps/account/migrations/0052_migration.py deleted file mode 100644 index e8658b8486..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0052_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.19 on 2023-07-11 13:00 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0051_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_FEEDBACK_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK VIEW CREATE'), ('ACCOUNTABILITY_FEEDBACK_VIEW_LIST', 'ACCOUNTABILITY FEEDBACK VIEW LIST'), ('ACCOUNTABILITY_FEEDBACK_VIEW_DETAILS', 'ACCOUNTABILITY FEEDBACK VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_VIEW_UPDATE', 'ACCOUNTABILITY FEEDBACK VIEW UPDATE'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK MESSAGE VIEW CREATE')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0053_migration.py b/src/hct_mis_api/apps/account/migrations/0053_migration.py deleted file mode 100644 index 42ce695a7c..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0053_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-25 10:46 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0052_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PRORGRAMME_VIEW_LIST_AND_DETAILS', 'PRORGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0054_migration.py b/src/hct_mis_api/apps/account/migrations/0054_migration.py deleted file mode 100644 index ff75aec72e..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0054_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-28 09:37 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0053_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_FEEDBACK_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK VIEW CREATE'), ('ACCOUNTABILITY_FEEDBACK_VIEW_LIST', 'ACCOUNTABILITY FEEDBACK VIEW LIST'), ('ACCOUNTABILITY_FEEDBACK_VIEW_DETAILS', 'ACCOUNTABILITY FEEDBACK VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_VIEW_UPDATE', 'ACCOUNTABILITY FEEDBACK VIEW UPDATE'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('ACCOUNTABILITY_FEEDBACK_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY FEEDBACK MESSAGE VIEW CREATE')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0055_migration.py b/src/hct_mis_api/apps/account/migrations/0055_migration.py deleted file mode 100644 index 40dc7f127f..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0055_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-26 10:13 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0054_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0056_migration.py b/src/hct_mis_api/apps/account/migrations/0056_migration.py deleted file mode 100644 index 42ceaf7053..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0056_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-09 12:43 - -from django.db import migrations, models -import django.db.models.deletion - - -def add_default_partner(apps, schema_editor): - User = apps.get_model("account", "User") - Partner = apps.get_model("account", "Partner") - - default_partner, _ = Partner.objects.get_or_create(name="UNICEF") - User.objects.filter(partner__isnull=True).update(partner=default_partner) - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0055_migration'), - ] - - operations = [ - migrations.RunPython(add_default_partner, migrations.RunPython.noop), - migrations.AddField( - model_name='partner', - name='permissions', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='user', - name='partner', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='account.partner'), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0057_migration.py b/src/hct_mis_api/apps/account/migrations/0057_migration.py deleted file mode 100644 index cfb8edf225..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0057_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-27 09:26 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0056_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0058_migration.py b/src/hct_mis_api/apps/account/migrations/0058_migration.py deleted file mode 100644 index 7badc53d02..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0058_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-28 13:03 - -from django.db import migrations, models -import django.db.models.deletion -import mptt.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0057_migration'), - ] - - operations = [ - migrations.AddField( - model_name='partner', - name='level', - field=models.PositiveIntegerField(default=0, editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='partner', - name='lft', - field=models.PositiveIntegerField(default=0, editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='partner', - name='parent', - field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.partner', verbose_name='Parent'), - ), - migrations.AddField( - model_name='partner', - name='rght', - field=models.PositiveIntegerField(default=0, editable=False), - preserve_default=False, - ), - migrations.AddField( - model_name='partner', - name='tree_id', - field=models.PositiveIntegerField(db_index=True, default=0, editable=False), - preserve_default=False, - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0059_migration.py b/src/hct_mis_api/apps/account/migrations/0059_migration.py deleted file mode 100644 index b63676ffca..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0059_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-08 08:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0058_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='user', - name='email', - field=models.EmailField(max_length=254, unique=True, verbose_name='email address'), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0060_migration.py b/src/hct_mis_api/apps/account/migrations/0060_migration.py deleted file mode 100644 index 7cba33efd1..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0060_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-19 09:42 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0059_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0061_migration.py b/src/hct_mis_api/apps/account/migrations/0061_migration.py deleted file mode 100644 index 30558ebb5a..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0061_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-08 10:48 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0060_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_upload_to_kobo', 'Can upload CSV file to Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'), ('quick_links', 'Can see quick links in admin'), ('restrict_help_desk', 'Limit fields to be editable for help desk'))}, - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0062_migration.py b/src/hct_mis_api/apps/account/migrations/0062_migration.py deleted file mode 100644 index 3c142c6744..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0062_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-17 10:30 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0061_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0063_migration.py b/src/hct_mis_api/apps/account/migrations/0063_migration.py deleted file mode 100644 index 1dc85b4225..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0063_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-20 12:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0062_migration'), - ] - - operations = [ - migrations.AddField( - model_name='userrole', - name='expiry_date', - field=models.DateField(blank=True, help_text='After expiry date this User Role will be ignored.', null=True), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0064_migration.py b/src/hct_mis_api/apps/account/migrations/0064_migration.py deleted file mode 100644 index 0c4e1348ee..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0064_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-19 12:38 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0063_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0065_migration.py b/src/hct_mis_api/apps/account/migrations/0065_migration.py deleted file mode 100644 index 40356d1480..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0065_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-26 16:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0064_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='userrole', - name='expiry_date', - field=models.DateField(blank=True, help_text='After expiry date this User Role will be inactive.', null=True), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0066_migration.py b/src/hct_mis_api/apps/account/migrations/0066_migration.py deleted file mode 100644 index 4a6161ed42..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0066_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.25 on 2024-03-17 00:36 - -from django.db import migrations, models -import django.db.models.manager - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0077_migration'), - ('account', '0065_migration'), - ] - - operations = [ - migrations.AlterModelManagers( - name='partner', - managers=[ - ('_tree_manager', django.db.models.manager.Manager()), - ], - ), - migrations.AddField( - model_name='partner', - name='allowed_business_areas', - field=models.ManyToManyField(to='core.BusinessArea'), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0067_migration.py b/src/hct_mis_api/apps/account/migrations/0067_migration.py deleted file mode 100644 index a459fb129c..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0067_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-04-23 00:03 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0066_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0068_migration.py b/src/hct_mis_api/apps/account/migrations/0068_migration.py deleted file mode 100644 index e464590eb4..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0068_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-15 11:29 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0067_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0069_migration.py b/src/hct_mis_api/apps/account/migrations/0069_migration.py deleted file mode 100644 index 28d75b1031..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0069_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-17 08:53 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0068_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0070_migration.py b/src/hct_mis_api/apps/account/migrations/0070_migration.py deleted file mode 100644 index 9f7dfbcf66..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0070_migration.py +++ /dev/null @@ -1,20 +0,0 @@ - -# Generated by Django 3.2.25 on 2024-04-18 11:54 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0069_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0071_migration.py b/src/hct_mis_api/apps/account/migrations/0071_migration.py deleted file mode 100644 index 3231df7ebc..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0071_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-21 11:03 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0070_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0072_migration.py b/src/hct_mis_api/apps/account/migrations/0072_migration.py deleted file mode 100644 index 2c3a83fdc8..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0072_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-08 15:31 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0071_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('PDU_VIEW_LIST_AND_DETAILS', 'PDU VIEW LIST AND DETAILS'), ('PDU_TEMPLATE_CREATE', 'PDU TEMPLATE CREATE'), ('PDU_TEMPLATE_DOWNLOAD', 'PDU TEMPLATE DOWNLOAD'), ('PDU_UPLOAD', 'PDU UPLOAD'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0073_migration.py b/src/hct_mis_api/apps/account/migrations/0073_migration.py deleted file mode 100644 index ff36c594fe..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0073_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-04 19:39 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0072_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('PDU_VIEW_LIST_AND_DETAILS', 'PDU VIEW LIST AND DETAILS'), ('PDU_TEMPLATE_CREATE', 'PDU TEMPLATE CREATE'), ('PDU_TEMPLATE_DOWNLOAD', 'PDU TEMPLATE DOWNLOAD'), ('PDU_UPLOAD', 'PDU UPLOAD'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('GEO_VIEW_LIST', 'GEO VIEW LIST'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/account/migrations/0074_migration.py b/src/hct_mis_api/apps/account/migrations/0074_migration.py deleted file mode 100644 index fda96075c1..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0074_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-19 19:06 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0073_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_upload_to_kobo', 'Can upload CSV file to Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'), ('quick_links', 'Can see quick links in admin'), ('restrict_help_desk', 'Limit fields to be editable for help desk'), ('can_reindex_programs', 'Can reindex programs'))}, - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0075_migration.py b/src/hct_mis_api/apps/account/migrations/0075_migration.py deleted file mode 100644 index fe0dc714fa..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0075_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-27 07:54 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0074_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('PM_PROGRAMME_CYCLE_VIEW_LIST', 'PM PROGRAMME CYCLE VIEW LIST'), ('PM_PROGRAMME_CYCLE_VIEW_DETAILS', 'PM PROGRAMME CYCLE VIEW DETAILS'), ('PM_PROGRAMME_CYCLE_CREATE', 'PM PROGRAMME CYCLE CREATE'), ('PM_PROGRAMME_CYCLE_UPDATE', 'PM PROGRAMME CYCLE UPDATE'), ('PM_PROGRAMME_CYCLE_DELETE', 'PM PROGRAMME CYCLE DELETE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('PDU_VIEW_LIST_AND_DETAILS', 'PDU VIEW LIST AND DETAILS'), ('PDU_TEMPLATE_CREATE', 'PDU TEMPLATE CREATE'), ('PDU_TEMPLATE_DOWNLOAD', 'PDU TEMPLATE DOWNLOAD'), ('PDU_UPLOAD', 'PDU UPLOAD'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('GEO_VIEW_LIST', 'GEO VIEW LIST'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0076_migration.py b/src/hct_mis_api/apps/account/migrations/0076_migration.py deleted file mode 100644 index bfd5a97461..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0076_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-28 09:52 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0075_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('PM_PROGRAMME_CYCLE_VIEW_LIST', 'PM PROGRAMME CYCLE VIEW LIST'), ('PM_PROGRAMME_CYCLE_VIEW_DETAILS', 'PM PROGRAMME CYCLE VIEW DETAILS'), ('PM_PROGRAMME_CYCLE_CREATE', 'PM PROGRAMME CYCLE CREATE'), ('PM_PROGRAMME_CYCLE_UPDATE', 'PM PROGRAMME CYCLE UPDATE'), ('PM_PROGRAMME_CYCLE_DELETE', 'PM PROGRAMME CYCLE DELETE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_VIEW_BIOMETRIC_RESULTS', 'GRIEVANCES VIEW BIOMETRIC RESULTS'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('PDU_VIEW_LIST_AND_DETAILS', 'PDU VIEW LIST AND DETAILS'), ('PDU_TEMPLATE_CREATE', 'PDU TEMPLATE CREATE'), ('PDU_TEMPLATE_DOWNLOAD', 'PDU TEMPLATE DOWNLOAD'), ('PDU_UPLOAD', 'PDU UPLOAD'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('GEO_VIEW_LIST', 'GEO VIEW LIST'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0077_migration.py b/src/hct_mis_api/apps/account/migrations/0077_migration.py deleted file mode 100644 index 62ad3c9f86..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0077_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-19 23:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0076_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='user', - options={'permissions': (('can_load_from_ad', 'Can load users from ActiveDirectory'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_create_kobo_user', 'Can create users in Kobo'), ('can_import_from_kobo', 'Can import and sync users from Kobo'), ('can_upload_to_kobo', 'Can upload CSV file to Kobo'), ('can_debug', 'Can access debug informations'), ('can_inspect', 'Can inspect objects'), ('quick_links', 'Can see quick links in admin'), ('restrict_help_desk', 'Limit fields to be editable for help desk'), ('can_reindex_programs', 'Can reindex programs'), ('can_add_business_area_to_partner', 'Can add business area to partner'))}, - ), - migrations.RemoveField( - model_name='partner', - name='permissions', - ), - migrations.AlterField( - model_name='partner', - name='allowed_business_areas', - field=models.ManyToManyField(blank=True, to='core.BusinessArea'), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0078_migration.py b/src/hct_mis_api/apps/account/migrations/0078_migration.py deleted file mode 100644 index c901dc6148..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0078_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-02 13:50 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0077_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('POPULATION_VIEW_INDIVIDUAL_DELIVERY_MECHANISMS_SECTION', 'POPULATION VIEW INDIVIDUAL DELIVERY MECHANISMS SECTION'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('PM_PROGRAMME_CYCLE_VIEW_LIST', 'PM PROGRAMME CYCLE VIEW LIST'), ('PM_PROGRAMME_CYCLE_VIEW_DETAILS', 'PM PROGRAMME CYCLE VIEW DETAILS'), ('PM_PROGRAMME_CYCLE_CREATE', 'PM PROGRAMME CYCLE CREATE'), ('PM_PROGRAMME_CYCLE_UPDATE', 'PM PROGRAMME CYCLE UPDATE'), ('PM_PROGRAMME_CYCLE_DELETE', 'PM PROGRAMME CYCLE DELETE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_VIEW_BIOMETRIC_RESULTS', 'GRIEVANCES VIEW BIOMETRIC RESULTS'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('PDU_VIEW_LIST_AND_DETAILS', 'PDU VIEW LIST AND DETAILS'), ('PDU_TEMPLATE_CREATE', 'PDU TEMPLATE CREATE'), ('PDU_TEMPLATE_DOWNLOAD', 'PDU TEMPLATE DOWNLOAD'), ('PDU_UPLOAD', 'PDU UPLOAD'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('GEO_VIEW_LIST', 'GEO VIEW LIST'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/account/migrations/0079_migration.py b/src/hct_mis_api/apps/account/migrations/0079_migration.py deleted file mode 100644 index f89b1b0021..0000000000 --- a/src/hct_mis_api/apps/account/migrations/0079_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-05 18:39 - -from django.db import migrations, models -import hct_mis_api.apps.account.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0078_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='role', - name='permissions', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('RDI_VIEW_LIST', 'RDI VIEW LIST'), ('RDI_VIEW_DETAILS', 'RDI VIEW DETAILS'), ('RDI_IMPORT_DATA', 'RDI IMPORT DATA'), ('RDI_RERUN_DEDUPE', 'RDI RERUN DEDUPE'), ('RDI_MERGE_IMPORT', 'RDI MERGE IMPORT'), ('RDI_REFUSE_IMPORT', 'RDI REFUSE IMPORT'), ('POPULATION_VIEW_HOUSEHOLDS_LIST', 'POPULATION VIEW HOUSEHOLDS LIST'), ('POPULATION_VIEW_HOUSEHOLDS_DETAILS', 'POPULATION VIEW HOUSEHOLDS DETAILS'), ('POPULATION_VIEW_INDIVIDUALS_LIST', 'POPULATION VIEW INDIVIDUALS LIST'), ('POPULATION_VIEW_INDIVIDUALS_DETAILS', 'POPULATION VIEW INDIVIDUALS DETAILS'), ('POPULATION_VIEW_INDIVIDUAL_DELIVERY_MECHANISMS_SECTION', 'POPULATION VIEW INDIVIDUAL DELIVERY MECHANISMS SECTION'), ('PROGRAMME_VIEW_LIST_AND_DETAILS', 'PROGRAMME VIEW LIST AND DETAILS'), ('PROGRAMME_MANAGEMENT_VIEW', 'PROGRAMME MANAGEMENT VIEW'), ('PROGRAMME_VIEW_PAYMENT_RECORD_DETAILS', 'PROGRAMME VIEW PAYMENT RECORD DETAILS'), ('PROGRAMME_CREATE', 'PROGRAMME CREATE'), ('PROGRAMME_UPDATE', 'PROGRAMME UPDATE'), ('PROGRAMME_REMOVE', 'PROGRAMME REMOVE'), ('PROGRAMME_ACTIVATE', 'PROGRAMME ACTIVATE'), ('PROGRAMME_FINISH', 'PROGRAMME FINISH'), ('PROGRAMME_DUPLICATE', 'PROGRAMME DUPLICATE'), ('TARGETING_VIEW_LIST', 'TARGETING VIEW LIST'), ('TARGETING_VIEW_DETAILS', 'TARGETING VIEW DETAILS'), ('TARGETING_CREATE', 'TARGETING CREATE'), ('TARGETING_UPDATE', 'TARGETING UPDATE'), ('TARGETING_DUPLICATE', 'TARGETING DUPLICATE'), ('TARGETING_REMOVE', 'TARGETING REMOVE'), ('TARGETING_LOCK', 'TARGETING LOCK'), ('TARGETING_UNLOCK', 'TARGETING UNLOCK'), ('TARGETING_SEND', 'TARGETING SEND'), ('PAYMENT_VIEW_LIST_MANAGERIAL', 'PAYMENT VIEW LIST MANAGERIAL'), ('PAYMENT_VIEW_LIST_MANAGERIAL_RELEASED', 'PAYMENT VIEW LIST MANAGERIAL RELEASED'), ('PAYMENT_VERIFICATION_VIEW_LIST', 'PAYMENT VERIFICATION VIEW LIST'), ('PAYMENT_VERIFICATION_VIEW_DETAILS', 'PAYMENT VERIFICATION VIEW DETAILS'), ('PAYMENT_VERIFICATION_CREATE', 'PAYMENT VERIFICATION CREATE'), ('PAYMENT_VERIFICATION_UPDATE', 'PAYMENT VERIFICATION UPDATE'), ('PAYMENT_VERIFICATION_ACTIVATE', 'PAYMENT VERIFICATION ACTIVATE'), ('PAYMENT_VERIFICATION_DISCARD', 'PAYMENT VERIFICATION DISCARD'), ('PAYMENT_VERIFICATION_FINISH', 'PAYMENT VERIFICATION FINISH'), ('PAYMENT_VERIFICATION_EXPORT', 'PAYMENT VERIFICATION EXPORT'), ('PAYMENT_VERIFICATION_IMPORT', 'PAYMENT VERIFICATION IMPORT'), ('PAYMENT_VERIFICATION_VERIFY', 'PAYMENT VERIFICATION VERIFY'), ('PAYMENT_VERIFICATION_VIEW_PAYMENT_RECORD_DETAILS', 'PAYMENT VERIFICATION VIEW PAYMENT RECORD DETAILS'), ('PAYMENT_VERIFICATION_DELETE', 'PAYMENT VERIFICATION DELETE'), ('PAYMENT_VERIFICATION_INVALID', 'PAYMENT VERIFICATION INVALID'), ('PAYMENT_VERIFICATION_MARK_AS_FAILED', 'PAYMENT VERIFICATION MARK AS FAILED'), ('PM_VIEW_LIST', 'PM VIEW LIST'), ('PM_CREATE', 'PM CREATE'), ('PM_VIEW_DETAILS', 'PM VIEW DETAILS'), ('PM_IMPORT_XLSX_WITH_ENTITLEMENTS', 'PM IMPORT XLSX WITH ENTITLEMENTS'), ('PM_APPLY_RULE_ENGINE_FORMULA_WITH_ENTITLEMENTS', 'PM APPLY RULE ENGINE FORMULA WITH ENTITLEMENTS'), ('PM_SPLIT', 'PM SPLIT'), ('PM_LOCK_AND_UNLOCK', 'PM LOCK AND UNLOCK'), ('PM_LOCK_AND_UNLOCK_FSP', 'PM LOCK AND UNLOCK FSP'), ('PM_SEND_FOR_APPROVAL', 'PM SEND FOR APPROVAL'), ('PM_EXCLUDE_BENEFICIARIES_FROM_FOLLOW_UP_PP', 'PM EXCLUDE BENEFICIARIES FROM FOLLOW UP PP'), ('PM_ACCEPTANCE_PROCESS_APPROVE', 'PM ACCEPTANCE PROCESS APPROVE'), ('PM_ACCEPTANCE_PROCESS_AUTHORIZE', 'PM ACCEPTANCE PROCESS AUTHORIZE'), ('PM_ACCEPTANCE_PROCESS_FINANCIAL_REVIEW', 'PM ACCEPTANCE PROCESS FINANCIAL REVIEW'), ('PM_IMPORT_XLSX_WITH_RECONCILIATION', 'PM IMPORT XLSX WITH RECONCILIATION'), ('PM_EXPORT_XLSX_FOR_FSP', 'PM EXPORT XLSX FOR FSP'), ('PM_DOWNLOAD_XLSX_FOR_FSP', 'PM DOWNLOAD XLSX FOR FSP'), ('PM_MARK_PAYMENT_AS_FAILED', 'PM MARK PAYMENT AS FAILED'), ('PM_EXPORT_PDF_SUMMARY', 'PM EXPORT PDF SUMMARY'), ('PM_SEND_TO_PAYMENT_GATEWAY', 'PM SEND TO PAYMENT GATEWAY'), ('PM_VIEW_FSP_AUTH_CODE', 'PM VIEW FSP AUTH CODE'), ('PM_DOWNLOAD_SUPPORTING_DOCUMENT', 'PM DOWNLOAD SUPPORTING DOCUMENT'), ('PM_UPLOAD_SUPPORTING_DOCUMENT', 'PM UPLOAD SUPPORTING DOCUMENT'), ('PM_DELETE_SUPPORTING_DOCUMENT', 'PM DELETE SUPPORTING DOCUMENT'), ('PM_ADMIN_FINANCIAL_SERVICE_PROVIDER_UPDATE', 'PM ADMIN FINANCIAL SERVICE PROVIDER UPDATE'), ('PM_PROGRAMME_CYCLE_VIEW_LIST', 'PM PROGRAMME CYCLE VIEW LIST'), ('PM_PROGRAMME_CYCLE_VIEW_DETAILS', 'PM PROGRAMME CYCLE VIEW DETAILS'), ('PM_PROGRAMME_CYCLE_CREATE', 'PM PROGRAMME CYCLE CREATE'), ('PM_PROGRAMME_CYCLE_UPDATE', 'PM PROGRAMME CYCLE UPDATE'), ('PM_PROGRAMME_CYCLE_DELETE', 'PM PROGRAMME CYCLE DELETE'), ('USER_MANAGEMENT_VIEW_LIST', 'USER MANAGEMENT VIEW LIST'), ('DASHBOARD_VIEW_COUNTRY', 'DASHBOARD VIEW COUNTRY'), ('DASHBOARD_EXPORT', 'DASHBOARD EXPORT'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_LIST_SENSITIVE', 'GRIEVANCES VIEW LIST SENSITIVE'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW LIST SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_LIST_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW LIST SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_EXCLUDING_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS EXCLUDING SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE', 'GRIEVANCES VIEW DETAILS SENSITIVE'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_CREATOR', 'GRIEVANCES VIEW DETAILS SENSITIVE AS CREATOR'), ('GRIEVANCES_VIEW_DETAILS_SENSITIVE_AS_OWNER', 'GRIEVANCES VIEW DETAILS SENSITIVE AS OWNER'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS', 'GRIEVANCES VIEW HOUSEHOLD DETAILS'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_HOUSEHOLD_DETAILS_AS_OWNER', 'GRIEVANCES VIEW HOUSEHOLD DETAILS AS OWNER'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS', 'GRIEVANCES VIEW INDIVIDUALS DETAILS'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_CREATOR', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS CREATOR'), ('GRIEVANCES_VIEW_INDIVIDUALS_DETAILS_AS_OWNER', 'GRIEVANCES VIEW INDIVIDUALS DETAILS AS OWNER'), ('GRIEVANCES_CREATE', 'GRIEVANCES CREATE'), ('GRIEVANCES_UPDATE', 'GRIEVANCES UPDATE'), ('GRIEVANCES_UPDATE_AS_CREATOR', 'GRIEVANCES UPDATE AS CREATOR'), ('GRIEVANCES_UPDATE_AS_OWNER', 'GRIEVANCES UPDATE AS OWNER'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS CREATOR'), ('GRIEVANCES_UPDATE_REQUESTED_DATA_CHANGE_AS_OWNER', 'GRIEVANCES UPDATE REQUESTED DATA CHANGE AS OWNER'), ('GRIEVANCES_ADD_NOTE', 'GRIEVANCES ADD NOTE'), ('GRIEVANCES_ADD_NOTE_AS_CREATOR', 'GRIEVANCES ADD NOTE AS CREATOR'), ('GRIEVANCES_ADD_NOTE_AS_OWNER', 'GRIEVANCES ADD NOTE AS OWNER'), ('GRIEVANCES_SET_IN_PROGRESS', 'GRIEVANCES SET IN PROGRESS'), ('GRIEVANCES_SET_IN_PROGRESS_AS_CREATOR', 'GRIEVANCES SET IN PROGRESS AS CREATOR'), ('GRIEVANCES_SET_IN_PROGRESS_AS_OWNER', 'GRIEVANCES SET IN PROGRESS AS OWNER'), ('GRIEVANCES_SET_ON_HOLD', 'GRIEVANCES SET ON HOLD'), ('GRIEVANCES_SET_ON_HOLD_AS_CREATOR', 'GRIEVANCES SET ON HOLD AS CREATOR'), ('GRIEVANCES_SET_ON_HOLD_AS_OWNER', 'GRIEVANCES SET ON HOLD AS OWNER'), ('GRIEVANCES_SEND_FOR_APPROVAL', 'GRIEVANCES SEND FOR APPROVAL'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_CREATOR', 'GRIEVANCES SEND FOR APPROVAL AS CREATOR'), ('GRIEVANCES_SEND_FOR_APPROVAL_AS_OWNER', 'GRIEVANCES SEND FOR APPROVAL AS OWNER'), ('GRIEVANCES_SEND_BACK', 'GRIEVANCES SEND BACK'), ('GRIEVANCES_SEND_BACK_AS_CREATOR', 'GRIEVANCES SEND BACK AS CREATOR'), ('GRIEVANCES_SEND_BACK_AS_OWNER', 'GRIEVANCES SEND BACK AS OWNER'), ('GRIEVANCES_APPROVE_DATA_CHANGE', 'GRIEVANCES APPROVE DATA CHANGE'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_CREATOR', 'GRIEVANCES APPROVE DATA CHANGE AS CREATOR'), ('GRIEVANCES_APPROVE_DATA_CHANGE_AS_OWNER', 'GRIEVANCES APPROVE DATA CHANGE AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_EXCLUDING_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET EXCLUDING FEEDBACK AS OWNER'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK', 'GRIEVANCES CLOSE TICKET FEEDBACK'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_CREATOR', 'GRIEVANCES CLOSE TICKET FEEDBACK AS CREATOR'), ('GRIEVANCES_CLOSE_TICKET_FEEDBACK_AS_OWNER', 'GRIEVANCES CLOSE TICKET FEEDBACK AS OWNER'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE', 'GRIEVANCES APPROVE FLAG AND DEDUPE'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_CREATOR', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS CREATOR'), ('GRIEVANCES_APPROVE_FLAG_AND_DEDUPE_AS_OWNER', 'GRIEVANCES APPROVE FLAG AND DEDUPE AS OWNER'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION', 'GRIEVANCES APPROVE PAYMENT VERIFICATION'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_CREATOR', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS CREATOR'), ('GRIEVANCES_APPROVE_PAYMENT_VERIFICATION_AS_OWNER', 'GRIEVANCES APPROVE PAYMENT VERIFICATION AS OWNER'), ('GRIEVANCE_ASSIGN', 'GRIEVANCE ASSIGN'), ('GRIEVANCE_DOCUMENTS_UPLOAD', 'GRIEVANCE DOCUMENTS UPLOAD'), ('GRIEVANCES_CROSS_AREA_FILTER', 'GRIEVANCES CROSS AREA FILTER'), ('GRIEVANCES_VIEW_BIOMETRIC_RESULTS', 'GRIEVANCES VIEW BIOMETRIC RESULTS'), ('GRIEVANCES_FEEDBACK_VIEW_CREATE', 'GRIEVANCES FEEDBACK VIEW CREATE'), ('GRIEVANCES_FEEDBACK_VIEW_LIST', 'GRIEVANCES FEEDBACK VIEW LIST'), ('GRIEVANCES_FEEDBACK_VIEW_DETAILS', 'GRIEVANCES FEEDBACK VIEW DETAILS'), ('GRIEVANCES_FEEDBACK_VIEW_UPDATE', 'GRIEVANCES FEEDBACK VIEW UPDATE'), ('GRIEVANCES_FEEDBACK_MESSAGE_VIEW_CREATE', 'GRIEVANCES FEEDBACK MESSAGE VIEW CREATE'), ('REPORTING_EXPORT', 'REPORTING EXPORT'), ('PDU_VIEW_LIST_AND_DETAILS', 'PDU VIEW LIST AND DETAILS'), ('PDU_TEMPLATE_CREATE', 'PDU TEMPLATE CREATE'), ('PDU_TEMPLATE_DOWNLOAD', 'PDU TEMPLATE DOWNLOAD'), ('PDU_UPLOAD', 'PDU UPLOAD'), ('ALL_VIEW_PII_DATA_ON_LISTS', 'ALL VIEW PII DATA ON LISTS'), ('ACTIVITY_LOG_VIEW', 'ACTIVITY LOG VIEW'), ('ACTIVITY_LOG_DOWNLOAD', 'ACTIVITY LOG DOWNLOAD'), ('UPLOAD_STORAGE_FILE', 'UPLOAD STORAGE FILE'), ('DOWNLOAD_STORAGE_FILE', 'DOWNLOAD STORAGE FILE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_LIST', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW LIST'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_CREATE', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW CREATE'), ('ACCOUNTABILITY_COMMUNICATION_MESSAGE_VIEW_DETAILS_AS_CREATOR', 'ACCOUNTABILITY COMMUNICATION MESSAGE VIEW DETAILS AS CREATOR'), ('ACCOUNTABILITY_SURVEY_VIEW_CREATE', 'ACCOUNTABILITY SURVEY VIEW CREATE'), ('ACCOUNTABILITY_SURVEY_VIEW_LIST', 'ACCOUNTABILITY SURVEY VIEW LIST'), ('ACCOUNTABILITY_SURVEY_VIEW_DETAILS', 'ACCOUNTABILITY SURVEY VIEW DETAILS'), ('GEO_VIEW_LIST', 'GEO VIEW LIST'), ('CAN_ADD_BUSINESS_AREA_TO_PARTNER', 'CAN ADD BUSINESS AREA TO PARTNER')], max_length=255), blank=True, null=True, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0001_migration.py b/src/hct_mis_api/apps/accountability/migrations/0001_migration.py index 4b57f0beb1..c4b4f61284 100644 --- a/src/hct_mis_api/apps/accountability/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/accountability/migrations/0001_migration.py @@ -1,8 +1,8 @@ -# Generated by Django 3.2.13 on 2022-09-19 17:28 +# Generated by Django 3.2.25 on 2024-11-07 12:18 -from django.conf import settings +import django.contrib.postgres.fields from django.db import migrations, models -import django.db.models.deletion +import hct_mis_api.apps.utils.models import model_utils.fields import uuid @@ -12,21 +12,52 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('targeting', '0031_migration'), - ('registration_data', '0022_migration'), - ('household', '0119_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('core', '0044_migration_squashed_0057_migration'), ] operations = [ + migrations.CreateModel( + name='Feedback', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('issue_type', models.CharField(choices=[('POSITIVE_FEEDBACK', 'Positive feedback'), ('NEGATIVE_FEEDBACK', 'Negative feedback')], max_length=20, verbose_name='Issue type')), + ('description', models.TextField()), + ('comments', models.TextField(blank=True, null=True)), + ('area', models.CharField(blank=True, max_length=250)), + ('language', models.TextField(blank=True)), + ('consent', models.BooleanField(default=True)), + ('is_original', models.BooleanField(db_index=True, default=False)), + ('is_migration_handled', models.BooleanField(default=False)), + ('migrated_at', models.DateTimeField(blank=True, null=True)), + ], + options={ + 'verbose_name': 'Feedback', + 'ordering': ('created_at',), + }, + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), + ), + migrations.CreateModel( + name='FeedbackMessage', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('description', models.TextField(help_text='The content of the feedback message.', verbose_name='Description')), + ], + options={ + 'verbose_name': 'Feedback message', + 'ordering': ('created_at',), + }, + ), migrations.CreateModel( name='Message', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('unicef_id', models.CharField(blank=True, max_length=255, null=True)), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), ('title', models.CharField(max_length=60)), ('body', models.TextField(max_length=1000)), ('number_of_recipients', models.PositiveIntegerField(default=0)), @@ -34,41 +65,40 @@ class Migration(migrations.Migration): ('full_list_arguments', models.JSONField(blank=True, null=True)), ('random_sampling_arguments', models.JSONField(blank=True, null=True)), ('sample_size', models.PositiveIntegerField(default=0)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='messages', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('households', models.ManyToManyField(blank=True, related_name='messages', to='household.Household')), - ('registration_data_import', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='messages', to='registration_data.registrationdataimport')), - ('target_population', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='messages', to='targeting.targetpopulation')), + ('is_original', models.BooleanField(db_index=True, default=False)), + ('is_migration_handled', models.BooleanField(default=False)), + ('migrated_at', models.DateTimeField(blank=True, null=True)), ], options={ - 'abstract': False, + 'verbose_name': 'Message', + 'ordering': ('created_at',), }, + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), ), - # - migrations.RunSQL( - sql="ALTER TABLE accountability_message ADD unicef_id_index SERIAL;", - reverse_sql="ALTER TABLE accountability_message DROP unicef_id_index;", - ), - migrations.RunSQL( - sql=""" - CREATE OR REPLACE FUNCTION create_accountability_communication_message_unicef_id() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - NEW.unicef_id := format('MSG-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END)); - return NEW; - END - $$; - - CREATE TRIGGER create_accountability_communication_message_unicef_id BEFORE INSERT ON accountability_message FOR EACH ROW EXECUTE PROCEDURE create_accountability_communication_message_unicef_id(); - """, - reverse_sql=""" - DROP TRIGGER create_accountability_communication_message_unicef_id ON accountability_message; - DROP FUNCTION create_accountability_communication_message_unicef_id(); - """, + migrations.CreateModel( + name='Survey', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('title', models.CharField(max_length=60)), + ('body', models.TextField(blank=True, default='', max_length=1000)), + ('category', models.CharField(choices=[('RAPID_PRO', 'Survey with RapidPro'), ('SMS', 'Survey with SMS'), ('MANUAL', 'Survey with manual process')], max_length=16)), + ('number_of_recipients', models.PositiveIntegerField(default=0)), + ('sample_file', models.FileField(blank=True, null=True, upload_to='')), + ('sample_file_generated_at', models.DateTimeField(blank=True, null=True)), + ('sampling_type', models.CharField(choices=[('FULL_LIST', 'Full list'), ('RANDOM', 'Random')], default='FULL_LIST', max_length=50)), + ('full_list_arguments', models.JSONField(default=dict)), + ('random_sampling_arguments', models.JSONField(default=dict)), + ('sample_size', models.PositiveIntegerField(default=0)), + ('flow_id', models.CharField(blank=True, max_length=255, null=True)), + ('successful_rapid_pro_calls', django.contrib.postgres.fields.ArrayField(base_field=models.JSONField(), default=list, size=None)), + ], + options={ + 'verbose_name': 'Survey', + 'ordering': ('created_at',), + }, + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), ), - migrations.RunSQL( - sql="UPDATE accountability_message SET unicef_id = format('MSG-%s-%s', to_char(created_at, 'yy'), TRIM(CASE WHEN unicef_id_index > 9999 THEN unicef_id_index::varchar(64) ELSE to_char(unicef_id_index, '0000') END));", - reverse_sql="UPDATE accountability_message SET unicef_id = NULL;", - ) ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0001_migration_squashed_0011_migration.py b/src/hct_mis_api/apps/accountability/migrations/0001_migration_squashed_0011_migration.py deleted file mode 100644 index 47b2585efd..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0001_migration_squashed_0011_migration.py +++ /dev/null @@ -1,248 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 04:49 - -from django.conf import settings -import django.contrib.postgres.fields -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - replaces = [('accountability', '0001_migration'), ('accountability', '0002_migration'), ('accountability', '0003_migration'), ('accountability', '0004_migration'), ('accountability', '0005_migration'), ('accountability', '0006_migration'), ('accountability', '0007_migration'), ('accountability', '0008_migration'), ('accountability', '0009_migration'), ('accountability', '0010_migration'), ('accountability', '0011_migration')] - - dependencies = [ - ('core', '0044_migration_squashed_0057_migration'), - ('household', '0124_migration'), - ('program', '0038_migration'), - ('targeting', '0031_migration'), - ('targeting', '0034_migration'), - ('targeting', '0039_migration'), - ('registration_data', '0022_migration'), - ('program', '0034_migration'), - ('geo', '0007_migration'), - ('household', '0119_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('grievance', '0054_migration'), - ] - - operations = [ - migrations.CreateModel( - name='Message', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('unicef_id', models.CharField(blank=True, max_length=255, null=True)), - ('title', models.CharField(max_length=60)), - ('body', models.TextField(max_length=1000)), - ('number_of_recipients', models.PositiveIntegerField(default=0)), - ('sampling_type', models.CharField(choices=[('FULL_LIST', 'Full list'), ('RANDOM', 'Random sampling')], default='FULL_LIST', max_length=50)), - ('full_list_arguments', models.JSONField(blank=True, null=True)), - ('random_sampling_arguments', models.JSONField(blank=True, null=True)), - ('sample_size', models.PositiveIntegerField(default=0)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='messages', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('households', models.ManyToManyField(blank=True, related_name='messages', to='household.Household')), - ('registration_data_import', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='messages', to='registration_data.registrationdataimport')), - ('target_population', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='messages', to='targeting.targetpopulation')), - ], - options={ - 'abstract': False, - }, - ), - migrations.RunSQL( - sql='ALTER TABLE accountability_message ADD unicef_id_index SERIAL;', - reverse_sql='ALTER TABLE accountability_message DROP unicef_id_index;', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_accountability_communication_message_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n BEGIN\n NEW.unicef_id := format('MSG-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END));\n return NEW;\n END\n $$;\n \n CREATE TRIGGER create_accountability_communication_message_unicef_id BEFORE INSERT ON accountability_message FOR EACH ROW EXECUTE PROCEDURE create_accountability_communication_message_unicef_id();\n ", - reverse_sql='\n DROP TRIGGER create_accountability_communication_message_unicef_id ON accountability_message;\n DROP FUNCTION create_accountability_communication_message_unicef_id();\n ', - ), - migrations.RunSQL( - sql="UPDATE accountability_message SET unicef_id = format('MSG-%s-%s', to_char(created_at, 'yy'), TRIM(CASE WHEN unicef_id_index > 9999 THEN unicef_id_index::varchar(64) ELSE to_char(unicef_id_index, '0000') END));", - reverse_sql='UPDATE accountability_message SET unicef_id = NULL;', - ), - migrations.CreateModel( - name='Feedback', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('unicef_id', models.CharField(blank=True, max_length=255, null=True)), - ('issue_type', models.IntegerField(choices=[(1, 'Positive feedback'), (2, 'Negative feedback')], verbose_name='Issue type')), - ('description', models.TextField()), - ('comments', models.TextField(blank=True, null=True)), - ('area', models.CharField(blank=True, max_length=250)), - ('language', models.TextField(blank=True)), - ('consent', models.BooleanField(default=True)), - ('admin2', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='geo.area')), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feedbacks', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('household_lookup', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feedbacks', to='household.household', verbose_name='Household lookup')), - ('individual_lookup', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feedbacks', to='household.individual', verbose_name='Individual lookup')), - ('linked_grievance', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feedback', to='grievance.grievanceticket', verbose_name='Linked grievance')), - ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='program.program')), - ], - options={ - 'abstract': False, - }, - ), - migrations.RunSQL( - sql='ALTER TABLE accountability_feedback ADD unicef_id_index SERIAL;', - reverse_sql='ALTER TABLE accountability_feedback DROP unicef_id_index;', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_accountability_communication_feedback_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n BEGIN\n NEW.unicef_id := format('FED-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END));\n return NEW;\n END\n $$;\n \n CREATE TRIGGER create_accountability_communication_feedback_unicef_id BEFORE INSERT ON accountability_feedback FOR EACH ROW EXECUTE PROCEDURE create_accountability_communication_feedback_unicef_id();\n ", - reverse_sql='\n DROP TRIGGER create_accountability_communication_feedback_unicef_id ON accountability_feedback;\n DROP FUNCTION create_accountability_communication_feedback_unicef_id();\n ', - ), - migrations.RunSQL( - sql="UPDATE accountability_feedback SET unicef_id = format('FED-%s-%s', to_char(created_at, 'yy'), TRIM(CASE WHEN unicef_id_index > 9999 THEN unicef_id_index::varchar(64) ELSE to_char(unicef_id_index, '0000') END));", - reverse_sql='UPDATE accountability_feedback SET unicef_id = NULL;', - ), - migrations.CreateModel( - name='FeedbackMessage', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('description', models.TextField(help_text='The content of the feedback message.', verbose_name='Description')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feedback_messages', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('feedback', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feedback_messages', to='accountability.feedback')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AlterField( - model_name='feedback', - name='issue_type', - field=models.CharField(choices=[('POSITIVE_FEEDBACK', 'Positive feedback'), ('NEGATIVE_FEEDBACK', 'Negative feedback')], max_length=20, verbose_name='Issue type'), - ), - migrations.CreateModel( - name='Survey', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('unicef_id', models.CharField(blank=True, max_length=255, null=True)), - ('title', models.CharField(max_length=60)), - ('body', models.TextField(blank=True, default='', max_length=1000)), - ('category', models.CharField(choices=[('RAPID_PRO', 'Survey with RapidPro'), ('SMS', 'Survey with SMS'), ('MANUAL', 'Survey with manual process')], max_length=16)), - ('number_of_recipients', models.PositiveIntegerField(default=0)), - ('sampling_type', models.CharField(choices=[('FULL_LIST', 'Full list'), ('RANDOM', 'Random')], default='FULL_LIST', max_length=50)), - ('full_list_arguments', models.JSONField(default=dict)), - ('random_sampling_arguments', models.JSONField(default=dict)), - ('sample_size', models.PositiveIntegerField(default=0)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to='program.program')), - ('recipients', models.ManyToManyField(blank=True, related_name='surveys', to='household.Household')), - ('target_population', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to='targeting.targetpopulation')), - ('sample_file', models.FileField(blank=True, null=True, upload_to='')), - ('sample_file_generated_at', models.DateTimeField(blank=True, null=True)), - ], - options={ - 'abstract': False, - }, - ), - migrations.RunSQL( - sql='ALTER TABLE accountability_survey ADD unicef_id_index SERIAL;', - reverse_sql='ALTER TABLE accountability_survey DROP unicef_id_index;', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_accountability_survey_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n BEGIN\n NEW.unicef_id := format('SUR-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END));\n return NEW;\n END\n $$;\n\n CREATE TRIGGER create_accountability_survey_unicef_id BEFORE INSERT ON accountability_survey FOR EACH ROW EXECUTE PROCEDURE create_accountability_survey_unicef_id();\n ", - reverse_sql='\n DROP TRIGGER create_accountability_survey_unicef_id ON accountability_survey;\n DROP FUNCTION create_accountability_survey_unicef_id();\n ', - ), - migrations.RunSQL( - sql="UPDATE accountability_survey SET unicef_id = format('SUR-%s-%s', to_char(created_at, 'yy'), TRIM(CASE WHEN unicef_id_index > 9999 THEN unicef_id_index::varchar(64) ELSE to_char(unicef_id_index, '0000') END));", - reverse_sql='UPDATE accountability_survey SET unicef_id = NULL;', - ), - migrations.AlterModelOptions( - name='feedback', - options={'ordering': ('created_at',), 'verbose_name': 'Feedback'}, - ), - migrations.AlterModelOptions( - name='feedbackmessage', - options={'ordering': ('created_at',), 'verbose_name': 'Feedback message'}, - ), - migrations.AlterModelOptions( - name='message', - options={'ordering': ('created_at',), 'verbose_name': 'Message'}, - ), - migrations.AlterModelOptions( - name='survey', - options={'ordering': ('created_at',), 'verbose_name': 'Survey'}, - ), - migrations.AddField( - model_name='survey', - name='successful_rapid_pro_calls', - field=django.contrib.postgres.fields.ArrayField(base_field=models.JSONField(), default=list, size=None), - ), - migrations.AlterField( - model_name='feedback', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='message', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='survey', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AddField( - model_name='survey', - name='flow_id', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AddField( - model_name='message', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='program.program'), - ), - migrations.AddField( - model_name='feedback', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='accountability.feedback'), - ), - migrations.AddField( - model_name='feedback', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='message', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='accountability.message'), - ), - migrations.AddField( - model_name='message', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='feedback', - name='migrated_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name='message', - name='migrated_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name='feedback', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='message', - name='is_original', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0002_migration.py b/src/hct_mis_api/apps/accountability/migrations/0002_migration.py index 029f5d484a..8e88b392c7 100644 --- a/src/hct_mis_api/apps/accountability/migrations/0002_migration.py +++ b/src/hct_mis_api/apps/accountability/migrations/0002_migration.py @@ -1,135 +1,35 @@ -# Generated by Django 3.2.13 on 2022-09-23 12:10 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.conf import settings from django.db import migrations, models import django.db.models.deletion -import model_utils.fields -import uuid class Migration(migrations.Migration): + initial = True + dependencies = [ - ("geo", "0007_migration"), - ("core", "0044_migration_squashed_0057_migration"), - ("program", "0034_migration"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("grievance", "0054_migration"), - ("household", "0119_migration"), - ("accountability", "0001_migration"), + ('core', '0001_migration'), + ('accountability', '0001_migration'), + ('program', '0001_migration'), ] operations = [ - migrations.CreateModel( - name="Feedback", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("unicef_id", models.CharField(blank=True, max_length=255, null=True)), - ( - "issue_type", - models.IntegerField( - choices=[(1, "Positive feedback"), (2, "Negative feedback")], verbose_name="Issue type" - ), - ), - ("description", models.TextField()), - ("comments", models.TextField(blank=True, null=True)), - ("area", models.CharField(blank=True, max_length=250)), - ("language", models.TextField(blank=True)), - ("consent", models.BooleanField(default=True)), - ( - "admin2", - models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="geo.area" - ), - ), - ( - "business_area", - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="core.businessarea"), - ), - ( - "created_by", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="feedbacks", - to=settings.AUTH_USER_MODEL, - verbose_name="Created by", - ), - ), - ( - "household_lookup", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="feedbacks", - to="household.household", - verbose_name="Household lookup", - ), - ), - ( - "individual_lookup", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="feedbacks", - to="household.individual", - verbose_name="Individual lookup", - ), - ), - ( - "linked_grievance", - models.OneToOneField( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="feedback", - to="grievance.grievanceticket", - verbose_name="Linked grievance", - ), - ), - ( - "program", - models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to="program.program" - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.RunSQL( - sql="ALTER TABLE accountability_feedback ADD unicef_id_index SERIAL;", - reverse_sql="ALTER TABLE accountability_feedback DROP unicef_id_index;", + migrations.AddField( + model_name='survey', + name='business_area', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea'), ), - migrations.RunSQL( - sql=""" - CREATE OR REPLACE FUNCTION create_accountability_communication_feedback_unicef_id() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - NEW.unicef_id := format('FED-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END)); - return NEW; - END - $$; - - CREATE TRIGGER create_accountability_communication_feedback_unicef_id BEFORE INSERT ON accountability_feedback FOR EACH ROW EXECUTE PROCEDURE create_accountability_communication_feedback_unicef_id(); - """, - reverse_sql=""" - DROP TRIGGER create_accountability_communication_feedback_unicef_id ON accountability_feedback; - DROP FUNCTION create_accountability_communication_feedback_unicef_id(); - """, + migrations.AddField( + model_name='survey', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to=settings.AUTH_USER_MODEL, verbose_name='Created by'), ), - migrations.RunSQL( - sql="UPDATE accountability_feedback SET unicef_id = format('FED-%s-%s', to_char(created_at, 'yy'), TRIM(CASE WHEN unicef_id_index > 9999 THEN unicef_id_index::varchar(64) ELSE to_char(unicef_id_index, '0000') END));", - reverse_sql="UPDATE accountability_feedback SET unicef_id = NULL;", + migrations.AddField( + model_name='survey', + name='program', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to='program.program'), ), ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0003_migration.py b/src/hct_mis_api/apps/accountability/migrations/0003_migration.py index d31ba634b2..26a860e3fc 100644 --- a/src/hct_mis_api/apps/accountability/migrations/0003_migration.py +++ b/src/hct_mis_api/apps/accountability/migrations/0003_migration.py @@ -1,32 +1,274 @@ -# Generated by Django 3.2.15 on 2022-09-29 14:29 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.conf import settings from django.db import migrations, models import django.db.models.deletion -import model_utils.fields -import uuid class Migration(migrations.Migration): + initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('accountability', '0002_migration'), + ("grievance", "0001_migration"), + ("program", "0001_migration"), + ("geo", "0001_migration"), + ("targeting", "0001_migration"), + ("accountability", "0002_migration"), + ("household", "0001_migration"), + ("core", "0002_migration"), + ("registration_data", "0001_migration"), ] operations = [ - migrations.CreateModel( - name='FeedbackMessage', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('description', models.TextField(help_text='The content of the feedback message.', verbose_name='Description')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feedback_messages', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('feedback', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feedback_messages', to='accountability.feedback')), - ], - options={ - 'abstract': False, - }, + migrations.AddField( + model_name="survey", + name="recipients", + field=models.ManyToManyField(blank=True, related_name="surveys", to="household.Household"), + ), + migrations.AddField( + model_name="survey", + name="target_population", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="surveys", + to="targeting.targetpopulation", + ), + ), + migrations.AddField( + model_name="message", + name="business_area", + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="core.businessarea"), + ), + migrations.AddField( + model_name="message", + name="copied_from", + field=models.ForeignKey( + blank=True, + help_text="If this object was copied from another, this field will contain the object it was copied from.", + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="copied_to", + to="accountability.message", + ), + ), + migrations.AddField( + model_name="message", + name="created_by", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="messages", + to=settings.AUTH_USER_MODEL, + verbose_name="Created by", + ), + ), + migrations.AddField( + model_name="message", + name="households", + field=models.ManyToManyField(blank=True, related_name="messages", to="household.Household"), + ), + migrations.AddField( + model_name="message", + name="program", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="messages", + to="program.program", + ), + ), + migrations.AddField( + model_name="message", + name="registration_data_import", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="messages", + to="registration_data.registrationdataimport", + ), + ), + migrations.AddField( + model_name="message", + name="target_population", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="messages", + to="targeting.targetpopulation", + ), + ), + migrations.AddField( + model_name="feedbackmessage", + name="created_by", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="feedback_messages", + to=settings.AUTH_USER_MODEL, + verbose_name="Created by", + ), + ), + migrations.AddField( + model_name="feedbackmessage", + name="feedback", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="feedback_messages", + to="accountability.feedback", + ), + ), + migrations.AddField( + model_name="feedback", + name="admin2", + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to="geo.area"), + ), + migrations.AddField( + model_name="feedback", + name="business_area", + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="core.businessarea"), + ), + migrations.AddField( + model_name="feedback", + name="copied_from", + field=models.ForeignKey( + blank=True, + help_text="If this object was copied from another, this field will contain the object it was copied from.", + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="copied_to", + to="accountability.feedback", + ), + ), + migrations.AddField( + model_name="feedback", + name="created_by", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="feedbacks", + to=settings.AUTH_USER_MODEL, + verbose_name="Created by", + ), + ), + migrations.AddField( + model_name="feedback", + name="household_lookup", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="feedbacks", + to="household.household", + verbose_name="Household lookup", + ), + ), + migrations.AddField( + model_name="feedback", + name="individual_lookup", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="feedbacks", + to="household.individual", + verbose_name="Individual lookup", + ), + ), + migrations.AddField( + model_name="feedback", + name="linked_grievance", + field=models.OneToOneField( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="feedback", + to="grievance.grievanceticket", + verbose_name="Linked grievance", + ), + ), + migrations.AddField( + model_name="feedback", + name="program", + field=models.ForeignKey( + blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to="program.program" + ), + ), + # message + migrations.RunSQL( + sql="ALTER TABLE accountability_message ADD unicef_id_index SERIAL;", + reverse_sql="ALTER TABLE accountability_message DROP unicef_id_index;", + ), + migrations.RunSQL( + sql=""" + CREATE OR REPLACE FUNCTION create_accountability_communication_message_unicef_id() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + NEW.unicef_id := format('MSG-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END)); + return NEW; + END + $$; + + CREATE TRIGGER create_accountability_communication_message_unicef_id BEFORE INSERT ON accountability_message FOR EACH ROW EXECUTE PROCEDURE create_accountability_communication_message_unicef_id(); + """, + reverse_sql=""" + DROP TRIGGER create_accountability_communication_message_unicef_id ON accountability_message; + DROP FUNCTION create_accountability_communication_message_unicef_id(); + """, + ), + # survey + migrations.RunSQL( + sql="ALTER TABLE accountability_survey ADD unicef_id_index SERIAL;", + reverse_sql="ALTER TABLE accountability_survey DROP unicef_id_index;", + ), + migrations.RunSQL( + sql=""" + CREATE OR REPLACE FUNCTION create_accountability_survey_unicef_id() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + NEW.unicef_id := format('SUR-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END)); + return NEW; + END + $$; + + CREATE TRIGGER create_accountability_survey_unicef_id BEFORE INSERT ON accountability_survey FOR EACH ROW EXECUTE PROCEDURE create_accountability_survey_unicef_id(); + """, + reverse_sql=""" + DROP TRIGGER create_accountability_survey_unicef_id ON accountability_survey; + DROP FUNCTION create_accountability_survey_unicef_id(); + """, + ), + # feedback + migrations.RunSQL( + sql="ALTER TABLE accountability_feedback ADD unicef_id_index SERIAL;", + reverse_sql="ALTER TABLE accountability_feedback DROP unicef_id_index;", + ), + migrations.RunSQL( + sql=""" + CREATE OR REPLACE FUNCTION create_accountability_communication_feedback_unicef_id() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + NEW.unicef_id := format('FED-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END)); + return NEW; + END + $$; + + CREATE TRIGGER create_accountability_communication_feedback_unicef_id BEFORE INSERT ON accountability_feedback FOR EACH ROW EXECUTE PROCEDURE create_accountability_communication_feedback_unicef_id(); + """, + reverse_sql=""" + DROP TRIGGER create_accountability_communication_feedback_unicef_id ON accountability_feedback; + DROP FUNCTION create_accountability_communication_feedback_unicef_id(); + """, ), ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0004_migration.py b/src/hct_mis_api/apps/accountability/migrations/0004_migration.py deleted file mode 100644 index c114768591..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0004_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.13 on 2022-10-05 07:24 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('accountability', '0003_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='feedback', - name='issue_type', - field=models.CharField(choices=[('POSITIVE_FEEDBACK', 'Positive feedback'), ('NEGATIVE_FEEDBACK', 'Negative feedback')], max_length=20, verbose_name='Issue type'), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0005_migration.py b/src/hct_mis_api/apps/accountability/migrations/0005_migration.py deleted file mode 100644 index b0bb1509e0..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0005_migration.py +++ /dev/null @@ -1,75 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-24 10:26 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0034_migration'), - ('core', '0044_migration_squashed_0057_migration'), - ('targeting', '0034_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('household', '0124_migration'), - ('accountability', '0004_migration'), - ] - - operations = [ - migrations.CreateModel( - name='Survey', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('unicef_id', models.CharField(blank=True, max_length=255, null=True)), - ('title', models.CharField(max_length=60)), - ('body', models.TextField(max_length=1000, blank=True, default='')), - ('category', models.CharField(choices=[('RAPID_PRO', 'Survey with RapidPro'), ('SMS', 'Survey with SMS'), ('MANUAL', 'Survey with manual process')], max_length=16)), - ('number_of_recipients', models.PositiveIntegerField(default=0)), - ('sampling_type', models.CharField(choices=[('FULL_LIST', 'Full list'), ('RANDOM', 'Random')], default='FULL_LIST', max_length=50)), - ('full_list_arguments', models.JSONField(default=dict)), - ('random_sampling_arguments', models.JSONField(default=dict)), - ('sample_size', models.PositiveIntegerField(default=0)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to='program.program')), - ('recipients', models.ManyToManyField(blank=True, related_name='surveys', to='household.Household')), - ('target_population', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='surveys', to='targeting.targetpopulation')), - ('sample_file', models.FileField(blank=True, null=True, upload_to='')), - ('sample_file_generated_at', models.DateTimeField(blank=True, null=True)), - ], - options={ - 'abstract': False, - }, - ), - migrations.RunSQL( - sql="ALTER TABLE accountability_survey ADD unicef_id_index SERIAL;", - reverse_sql="ALTER TABLE accountability_survey DROP unicef_id_index;", - ), - migrations.RunSQL( - sql=""" - CREATE OR REPLACE FUNCTION create_accountability_survey_unicef_id() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - NEW.unicef_id := format('SUR-%s-%s', to_char(NEW.created_at, 'yy'), TRIM(CASE WHEN NEW.unicef_id_index > 9999 THEN NEW.unicef_id_index::varchar(64) ELSE to_char(NEW.unicef_id_index, '0000') END)); - return NEW; - END - $$; - - CREATE TRIGGER create_accountability_survey_unicef_id BEFORE INSERT ON accountability_survey FOR EACH ROW EXECUTE PROCEDURE create_accountability_survey_unicef_id(); - """, - reverse_sql=""" - DROP TRIGGER create_accountability_survey_unicef_id ON accountability_survey; - DROP FUNCTION create_accountability_survey_unicef_id(); - """, - ), - migrations.RunSQL( - sql="UPDATE accountability_survey SET unicef_id = format('SUR-%s-%s', to_char(created_at, 'yy'), TRIM(CASE WHEN unicef_id_index > 9999 THEN unicef_id_index::varchar(64) ELSE to_char(unicef_id_index, '0000') END));", - reverse_sql="UPDATE accountability_survey SET unicef_id = NULL;", - ) - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0006_migration.py b/src/hct_mis_api/apps/accountability/migrations/0006_migration.py deleted file mode 100644 index b41bc07f15..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0006_migration.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by Django 3.2.15 on 2022-12-16 09:10 - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('accountability', '0005_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='feedback', - options={'ordering': ('created_at',), 'verbose_name': 'Feedback'}, - ), - migrations.AlterModelOptions( - name='feedbackmessage', - options={'ordering': ('created_at',), 'verbose_name': 'Feedback message'}, - ), - migrations.AlterModelOptions( - name='message', - options={'ordering': ('created_at',), 'verbose_name': 'Message'}, - ), - migrations.AlterModelOptions( - name='survey', - options={'ordering': ('created_at',), 'verbose_name': 'Survey'}, - ), - migrations.AddField( - model_name='survey', - name='successful_rapid_pro_calls', - field=django.contrib.postgres.fields.ArrayField(base_field=models.JSONField(), default=list, size=None), - ), - migrations.AlterField( - model_name='feedback', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='message', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='survey', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0007_migration.py b/src/hct_mis_api/apps/accountability/migrations/0007_migration.py deleted file mode 100644 index c4105e8914..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0007_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2023-01-05 12:48 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('accountability', '0006_migration'), - ] - - operations = [ - migrations.AddField( - model_name='survey', - name='flow_id', - field=models.CharField(blank=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0008_migration.py b/src/hct_mis_api/apps/accountability/migrations/0008_migration.py deleted file mode 100644 index e022519bdc..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0008_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-04 16:08 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0038_migration'), - ('accountability', '0007_migration'), - ('targeting', '0039_migration'), - ] - - operations = [ - migrations.AddField( - model_name='message', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='program.program'), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0009_migration.py b/src/hct_mis_api/apps/accountability/migrations/0009_migration.py deleted file mode 100644 index 480554f4e5..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0009_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-24 16:25 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('accountability', '0008_migration'), - ] - - operations = [ - migrations.AddField( - model_name='feedback', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='accountability.feedback'), - ), - migrations.AddField( - model_name='feedback', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='feedback', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='message', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='accountability.message'), - ), - migrations.AddField( - model_name='message', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='message', - name='is_original', - field=models.BooleanField(default=True), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0010_migration.py b/src/hct_mis_api/apps/accountability/migrations/0010_migration.py deleted file mode 100644 index 696e61b6cb..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0010_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-05 08:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("accountability", "0009_migration"), - ] - - operations = [ - migrations.AddField( - model_name="feedback", - name="migrated_at", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="message", - name="migrated_at", - field=models.DateTimeField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0011_migration.py b/src/hct_mis_api/apps/accountability/migrations/0011_migration.py deleted file mode 100644 index 68c9bd7aa4..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0011_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2023-12-12 14:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('accountability', '0010_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='feedback', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='message', - name='is_original', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/accountability/migrations/0012_migration.py b/src/hct_mis_api/apps/accountability/migrations/0012_migration.py deleted file mode 100644 index b6eaa1998b..0000000000 --- a/src/hct_mis_api/apps/accountability/migrations/0012_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-26 17:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('accountability', '0001_migration_squashed_0011_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='feedback', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='message', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - ] diff --git a/src/hct_mis_api/apps/activity_log/migrations/0001_migration_squashed_0004_migration.py b/src/hct_mis_api/apps/activity_log/migrations/0001_migration.py similarity index 58% rename from src/hct_mis_api/apps/activity_log/migrations/0001_migration_squashed_0004_migration.py rename to src/hct_mis_api/apps/activity_log/migrations/0001_migration.py index fa23737567..e7baf96690 100644 --- a/src/hct_mis_api/apps/activity_log/migrations/0001_migration_squashed_0004_migration.py +++ b/src/hct_mis_api/apps/activity_log/migrations/0001_migration.py @@ -1,16 +1,13 @@ -# Generated by Django 3.2.19 on 2023-06-19 10:40 +# Generated by Django 3.2.25 on 2024-11-07 12:18 -from django.conf import settings from django.db import migrations, models -import django.db.models.deletion class Migration(migrations.Migration): + initial = True + dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('core', '0002_migration_squashed_0006_migration'), ] operations = [ @@ -20,12 +17,9 @@ class Migration(migrations.Migration): ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('object_id', models.UUIDField(db_index=True, null=True)), ('action', models.CharField(choices=[('CREATE', 'Create'), ('UPDATE', 'Update'), ('DELETE', 'Delete'), ('SOFT_DELETE', 'Soft Delete')], db_index=True, max_length=100, verbose_name='action')), + ('object_repr', models.TextField(blank=True)), ('changes', models.JSONField(null=True, verbose_name='change message')), ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='timestamp')), - ('business_area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea')), - ('content_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='log_entries', to='contenttypes.contenttype')), - ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='logs', to=settings.AUTH_USER_MODEL, verbose_name='actor')), - ('object_repr', models.TextField(blank=True)), ], options={ 'verbose_name': 'log entry', diff --git a/src/hct_mis_api/apps/activity_log/migrations/0002_migration.py b/src/hct_mis_api/apps/activity_log/migrations/0002_migration.py new file mode 100644 index 0000000000..d5efbd3918 --- /dev/null +++ b/src/hct_mis_api/apps/activity_log/migrations/0002_migration.py @@ -0,0 +1,41 @@ +# Generated by Django 3.2.25 on 2024-11-07 12:18 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('program', '0001_migration'), + ('activity_log', '0001_migration'), + ('core', '0001_migration'), + ('contenttypes', '0002_remove_content_type_name'), + ] + + operations = [ + migrations.AddField( + model_name='logentry', + name='business_area', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea'), + ), + migrations.AddField( + model_name='logentry', + name='content_type', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='log_entries', to='contenttypes.contenttype'), + ), + migrations.AddField( + model_name='logentry', + name='programs', + field=models.ManyToManyField(blank=True, related_name='activity_logs', to='program.Program'), + ), + migrations.AddField( + model_name='logentry', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='logs', to=settings.AUTH_USER_MODEL, verbose_name='actor'), + ), + ] diff --git a/src/hct_mis_api/apps/activity_log/migrations/0005_migration.py b/src/hct_mis_api/apps/activity_log/migrations/0005_migration.py deleted file mode 100644 index dbc11e2317..0000000000 --- a/src/hct_mis_api/apps/activity_log/migrations/0005_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-04 16:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0038_migration'), - ('activity_log', '0001_migration_squashed_0004_migration'), - ] - - operations = [ - migrations.AddField( - model_name='logentry', - name='programs', - field=models.ManyToManyField(blank=True, related_name='activity_logs', to='program.Program'), - ), - ] diff --git a/src/hct_mis_api/apps/changelog/migrations/0001_migration_squashed_0002_migration.py b/src/hct_mis_api/apps/changelog/migrations/0001_migration.py similarity index 91% rename from src/hct_mis_api/apps/changelog/migrations/0001_migration_squashed_0002_migration.py rename to src/hct_mis_api/apps/changelog/migrations/0001_migration.py index 77fca6022d..991cb6765c 100644 --- a/src/hct_mis_api/apps/changelog/migrations/0001_migration_squashed_0002_migration.py +++ b/src/hct_mis_api/apps/changelog/migrations/0001_migration.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.19 on 2023-06-10 12:49 +# Generated by Django 3.2.25 on 2024-11-07 12:18 import datetime from django.db import migrations, models @@ -6,6 +6,8 @@ class Migration(migrations.Migration): + initial = True + dependencies = [ ] diff --git a/src/hct_mis_api/apps/changelog/migrations/0003_migration.py b/src/hct_mis_api/apps/changelog/migrations/0003_migration.py deleted file mode 100644 index 5da138f06e..0000000000 --- a/src/hct_mis_api/apps/changelog/migrations/0003_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.18 on 2023-03-28 13:25 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('changelog', '0001_migration_squashed_0002_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='changelog', - options={'ordering': ('date',)}, - ), - ] diff --git a/src/hct_mis_api/apps/changelog/migrations/0003_migration_squashed_0004_migration.py b/src/hct_mis_api/apps/changelog/migrations/0003_migration_squashed_0004_migration.py deleted file mode 100644 index 3dc48cdafb..0000000000 --- a/src/hct_mis_api/apps/changelog/migrations/0003_migration_squashed_0004_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:13 - -from django.db import migrations - - -class Migration(migrations.Migration): - - replaces = [('changelog', '0003_migration'), ('changelog', '0004_migration')] - - dependencies = [ - ('changelog', '0001_migration_squashed_0002_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='changelog', - options={'ordering': ('-date',)}, - ), - ] diff --git a/src/hct_mis_api/apps/changelog/migrations/0004_migration.py b/src/hct_mis_api/apps/changelog/migrations/0004_migration.py deleted file mode 100644 index 2b02d96b1f..0000000000 --- a/src/hct_mis_api/apps/changelog/migrations/0004_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-04 16:08 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('changelog', '0003_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='changelog', - options={'ordering': ('-date',)}, - ), - ] diff --git a/src/hct_mis_api/apps/core/management/commands/initdemo.py b/src/hct_mis_api/apps/core/management/commands/initdemo.py index 53400a9d27..45b8660fc6 100644 --- a/src/hct_mis_api/apps/core/management/commands/initdemo.py +++ b/src/hct_mis_api/apps/core/management/commands/initdemo.py @@ -59,7 +59,6 @@ from django.utils import timezone import elasticsearch - from hct_mis_api.apps.account.models import Partner, Role, User, UserRole from hct_mis_api.apps.core.models import BusinessArea from hct_mis_api.apps.payment.fixtures import ( diff --git a/src/hct_mis_api/apps/core/migrations/0001_migration.py b/src/hct_mis_api/apps/core/migrations/0001_migration.py index 1795d1f6ca..559dd9e36a 100644 --- a/src/hct_mis_api/apps/core/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/core/migrations/0001_migration.py @@ -1,138 +1,457 @@ -# Generated by Django 2.2.8 on 2020-04-29 08:18 +# Generated by Django 3.2.25 on 2024-11-07 12:18 -import uuid - -import django.contrib.gis.db.models.fields -import django.contrib.postgres.fields.jsonb -import django.db.models.deletion -from django.contrib.postgres.operations import CITextExtension +from django.conf import settings +import django.contrib.postgres.fields +import django.core.validators from django.db import migrations, models +import django.db.models.deletion +import hct_mis_api.apps.core.models +import django.utils.timezone import model_utils.fields - import mptt.fields +import uuid class Migration(migrations.Migration): - initial = True dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ - CITextExtension(), migrations.CreateModel( - name='BusinessArea', + name="BusinessArea", fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('code', models.CharField(max_length=10)), - ('name', models.CharField(max_length=255)), - ('long_name', models.CharField(max_length=255)), - ('region_code', models.CharField(max_length=8)), - ('region_name', models.CharField(max_length=8)), - ('kobo_token', models.CharField(blank=True, max_length=255, null=True)), - ('slug', models.CharField(db_index=True, max_length=250, unique=True)), + ( + "id", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("code", models.CharField(max_length=10, unique=True)), + ("name", models.CharField(max_length=255)), + ("long_name", models.CharField(max_length=255)), + ("region_code", models.CharField(max_length=8)), + ("region_name", models.CharField(max_length=8)), + ("kobo_username", models.CharField(blank=True, max_length=255, null=True)), + ("kobo_token", models.CharField(blank=True, max_length=255, null=True)), + ("kobo_url", models.URLField(blank=True, max_length=255, null=True)), + ("rapid_pro_host", models.URLField(blank=True, null=True)), + ("rapid_pro_payment_verification_token", models.CharField(blank=True, max_length=40, null=True)), + ("rapid_pro_messages_token", models.CharField(blank=True, max_length=40, null=True)), + ("rapid_pro_survey_token", models.CharField(blank=True, max_length=40, null=True)), + ("slug", models.CharField(db_index=True, max_length=250, unique=True)), + ("custom_fields", models.JSONField(blank=True, default=dict)), + ("has_data_sharing_agreement", models.BooleanField(default=False)), + ("is_split", models.BooleanField(default=False)), + ("postpone_deduplication", models.BooleanField(default=False)), + ( + "deduplication_duplicate_score", + models.FloatField( + default=6.0, + help_text="Results equal or above this score are considered duplicates", + validators=[django.core.validators.MinValueValidator(0.0)], + ), + ), + ( + "deduplication_possible_duplicate_score", + models.FloatField( + default=6.0, + help_text="Results equal or above this score are considered possible duplicates (needs adjudication) must be lower than deduplication_duplicate_score", + validators=[django.core.validators.MinValueValidator(0.0)], + ), + ), + ( + "deduplication_batch_duplicates_percentage", + models.IntegerField( + default=50, + help_text="If percentage of duplicates is higher or equal to this setting, deduplication is aborted", + ), + ), + ( + "deduplication_batch_duplicates_allowed", + models.IntegerField( + default=5, + help_text="If amount of duplicates for single individual exceeds this limit deduplication is aborted", + ), + ), + ( + "deduplication_golden_record_duplicates_percentage", + models.IntegerField( + default=50, + help_text="If percentage of duplicates is higher or equal to this setting, deduplication is aborted", + ), + ), + ( + "deduplication_golden_record_duplicates_allowed", + models.IntegerField( + default=5, + help_text="If amount of duplicates for single individual exceeds this limit deduplication is aborted", + ), + ), + ( + "screen_beneficiary", + models.BooleanField(default=False, help_text="Enable screen beneficiary against sanction list"), + ), + ("deduplication_ignore_withdraw", models.BooleanField(default=False)), + ( + "biometric_deduplication_threshold", + models.FloatField( + default=0.0, + help_text="Threshold for Face Image Deduplication", + validators=[ + django.core.validators.MinValueValidator(0.0), + django.core.validators.MaxValueValidator(100.0), + ], + ), + ), + ("is_payment_plan_applicable", models.BooleanField(default=False)), + ("is_accountability_applicable", models.BooleanField(default=False)), + ("active", models.BooleanField(default=False)), + ( + "enable_email_notification", + models.BooleanField(default=True, verbose_name="Automatic Email notifications enabled"), + ), ], options={ - 'ordering': ['name'], + "ordering": ["name"], + "permissions": ( + ("can_split", "Can split BusinessArea"), + ("can_send_doap", "Can send DOAP matrix"), + ("can_reset_doap", "Can force sync DOAP matrix"), + ("can_export_doap", "Can export DOAP matrix"), + ), }, ), migrations.CreateModel( - name='FlexibleAttributeGroup', + name="BusinessAreaPartnerThrough", + fields=[ + ( + "id", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ], + ), + migrations.CreateModel( + name="CountryCodeMap", fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('is_removed', models.BooleanField(default=False)), - ('name', models.CharField(max_length=255, unique=True)), - ('label', django.contrib.postgres.fields.jsonb.JSONField(default=dict)), - ('required', models.BooleanField(default=False)), - ('repeatable', models.BooleanField(default=False)), - ('lft', models.PositiveIntegerField(editable=False)), - ('rght', models.PositiveIntegerField(editable=False)), - ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), - ('level', models.PositiveIntegerField(editable=False)), - ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='core.FlexibleAttributeGroup', verbose_name='Parent')), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("ca_code", models.CharField(max_length=5, unique=True)), ], options={ - 'abstract': False, + "ordering": ("country",), }, ), migrations.CreateModel( - name='FlexibleAttribute', + name="DataCollectingType", fields=[ - ('is_removed', models.BooleanField(default=False)), - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('type', models.CharField(choices=[('STRING', 'String'), ('IMAGE', 'Image'), ('INTEGER', 'Integer'), ('DECIMAL', 'Decimal'), ('SELECT_ONE', 'Select One'), ('SELECT_MANY', 'Select Many'), ('DATETIME', 'Datetime'), ('GEOPOINT', 'Geopoint')], max_length=16)), - ('name', models.CharField(max_length=255, unique=True)), - ('required', models.BooleanField(default=False)), - ('label', django.contrib.postgres.fields.jsonb.JSONField(default=dict)), - ('hint', django.contrib.postgres.fields.jsonb.JSONField(default=dict)), - ('associated_with', models.SmallIntegerField(choices=[(0, 'Household'), (1, 'Individual')])), - ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='flex_attributes', to='core.FlexibleAttributeGroup')), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ( + "created", + model_utils.fields.AutoCreatedField( + default=django.utils.timezone.now, editable=False, verbose_name="created" + ), + ), + ( + "modified", + model_utils.fields.AutoLastModifiedField( + default=django.utils.timezone.now, editable=False, verbose_name="modified" + ), + ), + ("label", models.CharField(blank=True, max_length=32)), + ("code", models.CharField(max_length=32)), + ( + "type", + models.CharField( + blank=True, + choices=[("STANDARD", "Standard"), ("SOCIAL", "Social Workers")], + max_length=32, + null=True, + ), + ), + ("description", models.TextField(blank=True)), + ("active", models.BooleanField(default=True)), + ( + "deprecated", + models.BooleanField( + default=False, + help_text="Cannot be used in new programs, totally hidden in UI, only admin have access", + ), + ), + ("individual_filters_available", models.BooleanField(default=False)), + ("household_filters_available", models.BooleanField(default=True)), + ("recalculate_composition", models.BooleanField(default=False)), + ("weight", models.PositiveSmallIntegerField(default=0)), ], options={ - 'abstract': False, + "ordering": ("-weight",), }, ), migrations.CreateModel( - name='AdminAreaType', + name="FileTemp", fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=64, unique=True, verbose_name='Name')), - ('display_name', models.CharField(blank=True, max_length=64, null=True, verbose_name='Display Name')), - ('admin_level', models.PositiveSmallIntegerField(verbose_name='Admin Level')), - ('business_area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='admin_area_types', to='core.BusinessArea')), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ( + "created", + model_utils.fields.AutoCreatedField( + default=django.utils.timezone.now, editable=False, verbose_name="created" + ), + ), + ( + "modified", + model_utils.fields.AutoLastModifiedField( + default=django.utils.timezone.now, editable=False, verbose_name="modified" + ), + ), + ("object_id", models.CharField(max_length=120, null=True)), + ("file", models.FileField(upload_to="")), + ("was_downloaded", models.BooleanField(default=False)), ], options={ - 'verbose_name': 'AdminAreaType type', - 'ordering': ['name'], - 'unique_together': {('business_area', 'admin_level')}, + "abstract": False, }, ), migrations.CreateModel( - name='FlexibleAttributeChoice', + name="FlexibleAttribute", + fields=[ + ("is_removed", models.BooleanField(default=False)), + ( + "id", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ( + "type", + models.CharField( + choices=[ + ("DATE", "Date"), + ("DECIMAL", "Decimal"), + ("IMAGE", "Image"), + ("INTEGER", "Integer"), + ("GEOPOINT", "Geopoint"), + ("SELECT_ONE", "Select One"), + ("SELECT_MANY", "Select Many"), + ("STRING", "String"), + ("PDU", "PDU"), + ], + max_length=16, + ), + ), + ("name", models.CharField(max_length=255)), + ("required", models.BooleanField(default=False)), + ( + "label", + models.JSONField( + default=dict, validators=[hct_mis_api.apps.core.models.label_contains_english_en_validator] + ), + ), + ("hint", models.JSONField(default=dict)), + ("associated_with", models.SmallIntegerField(choices=[(0, "Household"), (1, "Individual")])), + ], + ), + migrations.CreateModel( + name="MigrationStatus", fields=[ - ('is_removed', models.BooleanField(default=False)), - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('list_name', models.CharField(max_length=255)), - ('name', models.CharField(max_length=255)), - ('label', django.contrib.postgres.fields.jsonb.JSONField(default=dict)), - ('admin', models.CharField(max_length=255)), - ('flex_attributes', models.ManyToManyField(related_name='choices', to='core.FlexibleAttribute')), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ( + "created", + model_utils.fields.AutoCreatedField( + default=django.utils.timezone.now, editable=False, verbose_name="created" + ), + ), + ( + "modified", + model_utils.fields.AutoLastModifiedField( + default=django.utils.timezone.now, editable=False, verbose_name="modified" + ), + ), + ("is_running", models.BooleanField()), ], options={ - 'unique_together': {('list_name', 'name')}, + "verbose_name_plural": "Migration Status", }, ), migrations.CreateModel( - name='AdminArea', + name="PeriodicFieldData", fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('title', models.CharField(max_length=255)), - ('geom', django.contrib.gis.db.models.fields.MultiPolygonField(blank=True, null=True, srid=4326)), - ('point', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)), - ('lft', models.PositiveIntegerField(editable=False)), - ('rght', models.PositiveIntegerField(editable=False)), - ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), - ('level', models.PositiveIntegerField(editable=False)), - ('admin_area_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='core.AdminAreaType')), - ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='core.AdminArea', verbose_name='Parent')), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ( + "subtype", + models.CharField( + choices=[ + ("DATE", "Date"), + ("DECIMAL", "Number"), + ("STRING", "Text"), + ("BOOL", "Boolean (true/false)"), + ], + max_length=16, + ), + ), + ("number_of_rounds", models.IntegerField()), + ( + "rounds_names", + django.contrib.postgres.fields.ArrayField( + base_field=models.CharField(max_length=255), default=list, size=None + ), + ), ], options={ - 'ordering': ['title'], - 'unique_together': {('title', 'admin_area_type')}, + "verbose_name": "Periodic Field Data", + "verbose_name_plural": "Periodic Fields Data", }, ), + migrations.CreateModel( + name="XLSXKoboTemplate", + fields=[ + ("is_removed", models.BooleanField(default=False)), + ( + "id", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("file_name", models.CharField(max_length=255)), + ("file", models.FileField(upload_to="")), + ("error_description", models.TextField(blank=True)), + ( + "status", + models.CharField( + choices=[ + ("CONNECTION_FAILED", "Connection failed"), + ("PROCESSING", "Processing"), + ("SUCCESSFUL", "Successful"), + ("UNSUCCESSFUL", "Unsuccessful"), + ("UPLOADED", "Uploaded"), + ], + max_length=200, + ), + ), + ("template_id", models.CharField(blank=True, max_length=200)), + ("first_connection_failed_time", models.DateTimeField(blank=True, null=True)), + ( + "uploaded_by", + models.ForeignKey( + null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL + ), + ), + ], + options={ + "ordering": ("-created_at",), + }, + ), + migrations.CreateModel( + name="StorageFile", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("created_at", models.DateTimeField(auto_now_add=True)), + ("file", models.FileField(upload_to="files")), + ( + "status", + models.CharField( + choices=[ + ("Not processed", "Not processed"), + ("Processing", "Processing"), + ("Finished", "Finished"), + ("Failed", "Failed"), + ], + default="Not processed", + max_length=25, + ), + ), + ( + "business_area", + models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to="core.businessarea"), + ), + ( + "created_by", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to=settings.AUTH_USER_MODEL, + verbose_name="Created by", + ), + ), + ], + ), + migrations.CreateModel( + name="FlexibleAttributeGroup", + fields=[ + ( + "id", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("is_removed", models.BooleanField(default=False)), + ("name", models.CharField(max_length=255, unique=True)), + ("label", models.JSONField(default=dict)), + ("required", models.BooleanField(default=False)), + ("repeatable", models.BooleanField(default=False)), + ("lft", models.PositiveIntegerField(editable=False)), + ("rght", models.PositiveIntegerField(editable=False)), + ("tree_id", models.PositiveIntegerField(db_index=True, editable=False)), + ("level", models.PositiveIntegerField(editable=False)), + ( + "parent", + mptt.fields.TreeForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="children", + to="core.flexibleattributegroup", + verbose_name="Parent", + ), + ), + ], + options={ + "abstract": False, + }, + ), + migrations.CreateModel( + name="FlexibleAttributeChoice", + fields=[ + ("is_removed", models.BooleanField(default=False)), + ( + "id", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("list_name", models.CharField(max_length=255)), + ("name", models.CharField(max_length=255)), + ("label", models.JSONField(default=dict)), + ("flex_attributes", models.ManyToManyField(related_name="choices", to="core.FlexibleAttribute")), + ], + options={ + "ordering": ("name",), + }, + ), + migrations.AddField( + model_name="flexibleattribute", + name="group", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="flex_attributes", + to="core.flexibleattributegroup", + ), + ), + migrations.AddField( + model_name="flexibleattribute", + name="pdu_data", + field=models.OneToOneField( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="flex_field", + to="core.periodicfielddata", + ), + ), ] diff --git a/src/hct_mis_api/apps/core/migrations/0002_migration.py b/src/hct_mis_api/apps/core/migrations/0002_migration.py new file mode 100644 index 0000000000..1adc9c2818 --- /dev/null +++ b/src/hct_mis_api/apps/core/migrations/0002_migration.py @@ -0,0 +1,162 @@ +# Generated by Django 3.2.25 on 2024-11-07 12:18 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ("program", "0001_migration"), + ("account", "0002_migration"), + ("geo", "0001_migration"), + ("core", "0001_migration"), + ("contenttypes", "0002_remove_content_type_name"), + ] + + operations = [ + migrations.AddField( + model_name="flexibleattribute", + name="program", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="pdu_fields", + to="program.program", + ), + ), + migrations.AddField( + model_name="filetemp", + name="content_type", + field=models.ForeignKey( + null=True, on_delete=django.db.models.deletion.CASCADE, to="contenttypes.contenttype" + ), + ), + migrations.AddField( + model_name="filetemp", + name="created_by", + field=models.ForeignKey( + null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="+", to=settings.AUTH_USER_MODEL + ), + ), + migrations.AddField( + model_name="datacollectingtype", + name="compatible_types", + field=models.ManyToManyField(blank=True, to="core.DataCollectingType"), + ), + migrations.AddField( + model_name="datacollectingtype", + name="limit_to", + field=models.ManyToManyField(blank=True, related_name="data_collecting_types", to="core.BusinessArea"), + ), + migrations.AddField( + model_name="countrycodemap", + name="country", + field=models.OneToOneField( + blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to="geo.country" + ), + ), + migrations.AddField( + model_name="businessareapartnerthrough", + name="business_area", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="business_area_partner_through", + to="core.businessarea", + ), + ), + migrations.AddField( + model_name="businessareapartnerthrough", + name="partner", + field=models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="business_area_partner_through", + to="account.partner", + ), + ), + migrations.AddField( + model_name="businessareapartnerthrough", + name="roles", + field=models.ManyToManyField(related_name="business_area_partner_through", to="account.Role"), + ), + migrations.AddField( + model_name="businessarea", + name="countries", + field=models.ManyToManyField(related_name="business_areas", to="geo.Country"), + ), + migrations.AddField( + model_name="businessarea", + name="parent", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="children", + to="core.businessarea", + ), + ), + migrations.AddField( + model_name="businessarea", + name="partners", + field=models.ManyToManyField( + related_name="business_areas", through="core.BusinessAreaPartnerThrough", to="account.Partner" + ), + ), + migrations.AlterUniqueTogether( + name="flexibleattributechoice", + unique_together={("list_name", "name")}, + ), + migrations.AddConstraint( + model_name="flexibleattribute", + constraint=models.UniqueConstraint(fields=("name", "program"), name="unique_name_program"), + ), + migrations.AddConstraint( + model_name="flexibleattribute", + constraint=models.UniqueConstraint( + condition=models.Q(("program__isnull", True)), fields=("name",), name="unique_name_without_program" + ), + ), + migrations.AddConstraint( + model_name="datacollectingtype", + constraint=models.UniqueConstraint(fields=("label", "code"), name="unique_label_code_data_collecting_type"), + ), + migrations.AddConstraint( + model_name="businessareapartnerthrough", + constraint=models.UniqueConstraint( + fields=("business_area", "partner"), name="unique_business_area_partner" + ), + ), + migrations.RunSQL( + sql="\n CREATE OR REPLACE FUNCTION payment_plan_business_area_seq() RETURNS trigger \n LANGUAGE plpgsql\n AS $$\n begin\n execute format('create sequence if not exists payment_plan_business_area_seq_%s', translate(NEW.id::text, '-','_'));\n return NEW;\n end\n $$;\n\n ", + ), + migrations.RunSQL( + sql='CREATE TRIGGER payment_plan_business_area_seq AFTER INSERT ON core_businessarea FOR EACH ROW EXECUTE PROCEDURE payment_plan_business_area_seq();', + ), + migrations.RunSQL( + sql="\n CREATE OR REPLACE FUNCTION payment_business_area_seq() RETURNS trigger \n LANGUAGE plpgsql\n AS $$\n begin\n execute format('create sequence if not exists payment_business_area_seq_%s', translate(NEW.id::text, '-','_'));\n return NEW;\n end\n $$;\n\n ", + ), + migrations.RunSQL( + sql='CREATE TRIGGER payment_business_area_seq AFTER INSERT ON core_businessarea FOR EACH ROW EXECUTE PROCEDURE payment_business_area_seq();', + ), + migrations.RunSQL( + sql=""" + CREATE OR REPLACE FUNCTION program_cycle_business_area_seq() RETURNS trigger + LANGUAGE plpgsql + AS $$ + BEGIN + EXECUTE format('CREATE SEQUENCE IF NOT EXISTS program_cycle_business_area_seq_%s', translate(NEW.id::text, '-', '_')); + RETURN NEW; + END + $$; + """, + ), + migrations.RunSQL( + sql=""" + CREATE TRIGGER program_cycle_business_area_seq AFTER INSERT ON core_businessarea FOR EACH ROW EXECUTE PROCEDURE program_cycle_business_area_seq(); + """, + ), + ] diff --git a/src/hct_mis_api/apps/core/migrations/0002_migration_squashed_0006_migration.py b/src/hct_mis_api/apps/core/migrations/0002_migration_squashed_0006_migration.py deleted file mode 100644 index 7b16bdef45..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0002_migration_squashed_0006_migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-09 07:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0001_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='flexibleattributechoice', - name='admin', - ), - migrations.AddField( - model_name='businessarea', - name='rapid_pro_host', - field=models.URLField(null=True), - ), - migrations.AddField( - model_name='businessarea', - name='has_data_sharing_agreement', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='businessarea', - name='rapid_pro_api_key', - field=models.CharField(max_length=40, null=True), - ), - migrations.AlterModelOptions( - name='flexibleattributechoice', - options={'ordering': ('name',)}, - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0007_migration_squashed_0016_migration.py b/src/hct_mis_api/apps/core/migrations/0007_migration_squashed_0016_migration.py deleted file mode 100644 index 221a46748e..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0007_migration_squashed_0016_migration.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-09 07:14 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django_countries.fields -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0002_migration_squashed_0006_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='XLSXKoboTemplate', - fields=[ - ('is_removed', models.BooleanField(default=False)), - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('file_name', models.CharField(max_length=255)), - ('file', models.FileField(upload_to='')), - ('uploaded_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), - ('error_description', models.TextField(blank=True)), - ('status', models.CharField(choices=[('SUCCESSFUL', 'Successful'), ('UNSUCCESSFUL', 'Unsuccessful'), ('PROCESSING', 'Processing')], default='SUCCESSFUL', max_length=200)), - ('template_id', models.CharField(blank=True, max_length=200)), - ], - options={ - 'ordering': ('-created_at',), - }, - ), - migrations.RenameField( - model_name='businessarea', - old_name='kobo_token', - new_name='kobo_username', - ), - migrations.RenameModel( - old_name='AdminAreaType', - new_name='AdminAreaLevel', - ), - migrations.AddField( - model_name='adminarea', - name='external_id', - field=models.CharField(blank=True, help_text='An ID representing this instance in datamart', max_length=32, null=True), - ), - migrations.AddField( - model_name='adminarea', - name='p_code', - field=models.CharField(blank=True, max_length=32, null=True, verbose_name='Postal Code'), - ), - migrations.AlterUniqueTogether( - name='adminarea', - unique_together={('title', 'p_code')}, - ), - migrations.RenameField( - model_name='adminarea', - old_name='admin_area_type', - new_name='admin_area_level', - ), - migrations.AlterField( - model_name='adminarea', - name='admin_area_level', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='core.adminarealevel', verbose_name='Location Type'), - ), - migrations.AlterField( - model_name='adminarea', - name='admin_area_level', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='admin_areas', to='core.adminarealevel', verbose_name='Location Type'), - ), - migrations.AlterModelOptions( - name='adminarealevel', - options={'ordering': ['name'], 'verbose_name': 'Admin Area Level'}, - ), - migrations.AddField( - model_name='adminarealevel', - name='real_admin_level', - field=models.PositiveSmallIntegerField(null=True, verbose_name='Real Admin Level'), - ), - migrations.AlterField( - model_name='adminarealevel', - name='business_area', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='admin_area_level', to='core.businessarea'), - ), - migrations.AlterField( - model_name='businessarea', - name='code', - field=models.CharField(max_length=10, unique=True), - ), - migrations.CreateModel( - name='CountryCodeMap', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('country', django_countries.fields.CountryField(max_length=2, unique=True)), - ('ca_code', models.CharField(max_length=5, unique=True)), - ], - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0017_migration_squashed_0040_migration.py b/src/hct_mis_api/apps/core/migrations/0017_migration_squashed_0040_migration.py deleted file mode 100644 index 8f8da1f538..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0017_migration_squashed_0040_migration.py +++ /dev/null @@ -1,292 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-11 10:42 - -import django.contrib.postgres.fields.jsonb -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -def empty_reverse(apps, schema_editor): - pass -def remove_duplicates(apps, schema_editor): - AdminAreaLevel = apps.get_model("core", "AdminAreaLevel") - levels_without_ids = AdminAreaLevel.objects.filter(datamart_id__isnull=True) - for level in levels_without_ids: - new_datamart_id = level.admin_level - duplicated = AdminAreaLevel.objects.filter(datamart_id=new_datamart_id) - duplicated.delete() - level.datamart_id=new_datamart_id - level.save() - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0007_migration_squashed_0016_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='countrycodemap', - options={'ordering': ('country',)}, - ), - migrations.AlterField( - model_name='adminarea', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='adminarea', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='adminarealevel', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='adminarealevel', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='businessarea', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='businessarea', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='flexibleattribute', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='flexibleattribute', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='flexibleattributechoice', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='flexibleattributechoice', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='flexibleattributegroup', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='flexibleattributegroup', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='xlsxkobotemplate', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='xlsxkobotemplate', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AddField( - model_name='xlsxkobotemplate', - name='first_connection_failed_time', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name='businessarea', - name='rapid_pro_api_key', - field=models.CharField(blank=True, max_length=40, null=True), - ), - migrations.AlterField( - model_name='businessarea', - name='rapid_pro_host', - field=models.URLField(blank=True, null=True), - ), - migrations.AlterField( - model_name='xlsxkobotemplate', - name='status', - field=models.CharField(choices=[('SUCCESSFUL', 'Successful'), ('UPLOADED', 'Successful'), ('UNSUCCESSFUL', 'Unsuccessful'), ('PROCESSING', 'Processing'), ('CONNECTION_FAILED', 'Connection failed')], max_length=200), - ), - migrations.AlterField( - model_name='flexibleattribute', - name='type', - field=models.CharField(choices=[('STRING', 'String'), ('IMAGE', 'Image'), ('INTEGER', 'Integer'), ('DECIMAL', 'Decimal'), ('SELECT_ONE', 'Select One'), ('SELECT_MANY', 'Select Many'), ('DATE', 'Date'), ('GEOPOINT', 'Geopoint')], max_length=16), - ), - migrations.AddField( - model_name='businessarea', - name='is_split', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='businessarea', - name='parent', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='children', to='core.businessarea'), - ), - migrations.AddField( - model_name='adminarealevel', - name='area_code', - field=models.CharField(blank=True, max_length=8, null=True), - ), - migrations.AlterField( - model_name='adminarea', - name='p_code', - field=models.CharField(blank=True, max_length=32, null=True, verbose_name='P Code'), - ), - migrations.AlterUniqueTogether( - name='adminarealevel', - unique_together={('area_code', 'admin_level')}, - ), - migrations.RemoveField( - model_name='adminarealevel', - name='business_area', - ), - migrations.AddField( - model_name='adminarealevel', - name='datamart_id', - field=models.CharField(blank=True, max_length=8, null=True, unique=True), - ), - migrations.RemoveField( - model_name='adminarealevel', - name='real_admin_level', - ), - migrations.AddField( - model_name='adminarealevel', - name='country_name', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AlterField( - model_name='adminarealevel', - name='name', - field=models.CharField(max_length=64, verbose_name='Name'), - ), - migrations.AlterField( - model_name='adminarealevel', - name='admin_level', - field=models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Admin Level'), - ), - migrations.AlterUniqueTogether( - name='adminarealevel', - unique_together={('country_name', 'admin_level')}, - ), - migrations.AddField( - model_name='businessarea', - name='countries', - field=models.ManyToManyField(blank=True, limit_choices_to={'admin_level': 0}, to='core.AdminAreaLevel'), - ), - migrations.AddField( - model_name='adminarealevel', - name='business_area', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='admin_area_level', to='core.businessarea'), - ), - migrations.AddField( - model_name='adminarealevel', - name='country', - field=models.ForeignKey(blank=True, limit_choices_to={'admin_level': 0}, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.adminarealevel'), - ), - migrations.AlterField( - model_name='businessarea', - name='countries', - field=models.ManyToManyField(blank=True, limit_choices_to={'admin_level': 0}, related_name='business_areas', to='core.AdminAreaLevel'), - ), - migrations.AlterUniqueTogether( - name='adminarealevel', - unique_together={('country', 'admin_level')}, - ), - migrations.RunPython(remove_duplicates, empty_reverse), - migrations.AlterModelOptions( - name='adminarea', - options={'ordering': ['title'], 'permissions': (('import_from_csv', 'Import AdminAreas from CSV file'), ('load_from_datamart', 'Load data from Datamart'))}, - ), - migrations.AlterModelOptions( - name='adminarealevel', - options={'ordering': ['name'], 'permissions': (('load_from_datamart', 'Load data from Datamart'), ('can_sync_with_ad', 'Can synchronise user with ActiveDirectory'), ('can_upload_to_kobo', 'Can upload users to Kobo')), 'verbose_name': 'Admin Area Level'}, - ), - migrations.AlterModelOptions( - name='businessarea', - options={'ordering': ['name'], 'permissions': (('can_split', 'Can split BusinessArea'),)}, - ), - migrations.AlterField( - model_name='adminarealevel', - name='business_area', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='admin_area_level', to='core.businessarea'), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_batch_duplicate_score', - field=models.FloatField(default=6.0, help_text='Results equal or above this score are considered duplicates', validators=[django.core.validators.MinValueValidator(0.0)]), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_batch_duplicates_allowed', - field=models.IntegerField(default=5, help_text='If amount of duplicates for single individual exceeds this limit deduplication is aborted'), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_batch_duplicates_percentage', - field=models.IntegerField(default=50, help_text='If percentage of duplicates is higher or equal to this setting, deduplication is aborted'), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_golden_record_duplicate_score', - field=models.FloatField(default=6.0, help_text='Results equal or above this score are considered duplicates', validators=[django.core.validators.MinValueValidator(0.0)]), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_golden_record_duplicates_allowed', - field=models.IntegerField(default=5, help_text='If amount of duplicates for single individual exceeds this limit deduplication is aborted'), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_golden_record_duplicates_percentage', - field=models.IntegerField(default=50, help_text='If percentage of duplicates is higher or equal to this setting, deduplication is aborted'), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_golden_record_min_score', - field=models.FloatField(default=11.0, help_text='Results below the minimum score will not be taken into account', validators=[django.core.validators.MinValueValidator(0.0)]), - ), - migrations.AddField( - model_name='businessarea', - name='custom_fields', - field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict), - ), - migrations.AlterModelOptions( - name='businessarea', - options={'ordering': ['name'], 'permissions': (('can_split', 'Can split BusinessArea'), ('can_send_doap', 'Can send DOAP matrix'), ('can_reset_doap', 'Can force sync DOAP matrix'), ('can_export_doap', 'Can export DOAP matrix'))}, - ), - migrations.RenameField( - model_name='businessarea', - old_name='deduplication_batch_duplicate_score', - new_name='deduplication_duplicate_score', - ), - migrations.RemoveField( - model_name='businessarea', - name='deduplication_golden_record_duplicate_score', - ), - migrations.RemoveField( - model_name='businessarea', - name='deduplication_golden_record_min_score', - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_possible_duplicate_score', - field=models.FloatField(default=6.0, help_text='Results equal or above this score are considered possible duplicates (needs adjudication) must be lower than deduplication_duplicate_score', validators=[django.core.validators.MinValueValidator(0.0)]), - ), - migrations.AddField( - model_name='businessarea', - name='screen_beneficiary', - field=models.BooleanField(default=False, help_text='Enable screen beneficiary against sanction list'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0041_migration.py b/src/hct_mis_api/apps/core/migrations/0041_migration.py deleted file mode 100644 index 3b20c80f8c..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0041_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-16 17:12 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0003_migration'), - ('core', '0017_migration_squashed_0040_migration'), - ] - - operations = [ - migrations.AddField( - model_name='countrycodemap', - name='country_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.Country', unique=True), - ), - migrations.AddField( - model_name='businessarea', - name='countries_new', - field=models.ManyToManyField(related_name='business_areas', to='geo.Country'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0042_migration_squashed_0043_migration.py b/src/hct_mis_api/apps/core/migrations/0042_migration_squashed_0043_migration.py deleted file mode 100644 index 10480e8cf9..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0042_migration_squashed_0043_migration.py +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 13:14 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0004_migration'), - ('core', '0041_migration'), - ] - - operations = [ - ] diff --git a/src/hct_mis_api/apps/core/migrations/0044_migration_squashed_0057_migration.py b/src/hct_mis_api/apps/core/migrations/0044_migration_squashed_0057_migration.py deleted file mode 100644 index b394412703..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0044_migration_squashed_0057_migration.py +++ /dev/null @@ -1,143 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 13:04 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.db.models.manager - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0034_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('geo', '0007_migration'), - ('core', '0042_migration_squashed_0043_migration'), - ('reporting', '0008_migration_squashed_0014_migration'), - ('grievance', '0035_migration_squashed_0049_migration'), - ('household', '0119_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='businessarea', - name='custom_fields', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='countrycodemap', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - migrations.AlterField( - model_name='flexibleattribute', - name='hint', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='flexibleattribute', - name='label', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='flexibleattributechoice', - name='label', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='flexibleattributegroup', - name='label', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='flexibleattribute', - name='type', - field=models.CharField(choices=[('DATE', 'Date'), ('DECIMAL', 'Decimal'), ('IMAGE', 'Image'), ('INTEGER', 'Integer'), ('GEOPOINT', 'Geopoint'), ('SELECT_ONE', 'Select One'), ('SELECT_MANY', 'Select Many'), ('STRING', 'String')], max_length=16), - ), - migrations.AlterField( - model_name='xlsxkobotemplate', - name='status', - field=models.CharField(choices=[('CONNECTION_FAILED', 'Connection failed'), ('PROCESSING', 'Processing'), ('SUCCESSFUL', 'Successful'), ('UNSUCCESSFUL', 'Unsuccessful'), ('UPLOADED', 'Uploaded')], max_length=200), - ), - migrations.AlterField( - model_name='countrycodemap', - name='country_new', - field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country'), - ), - migrations.AddField( - model_name='businessarea', - name='postpone_deduplication', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='businessarea', - name='deduplication_ignore_withdraw', - field=models.BooleanField(default=False), - ), - migrations.CreateModel( - name='StorageFile', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('file', models.FileField(upload_to='files')), - ('business_area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('status', models.CharField(choices=[('Not processed', 'Not processed'), ('Processing', 'Processing'), ('Finished', 'Finished'), ('Failed', 'Failed')], default='Not processed', max_length=25)), - ], - ), - migrations.RemoveField( - model_name='businessarea', - name='countries', - ), - migrations.RenameField( - model_name='businessarea', - old_name='countries_new', - new_name='countries', - ), - migrations.AlterModelOptions( - name='countrycodemap', - options={'ordering': ('country_new',)}, - ), - migrations.RemoveField( - model_name='countrycodemap', - name='country', - ), - migrations.AlterModelOptions( - name='countrycodemap', - options={'ordering': ('country',)}, - ), - migrations.RenameField( - model_name='countrycodemap', - old_name='country_new', - new_name='country', - ), - migrations.AlterUniqueTogether( - name='adminarealevel', - unique_together=None, - ), - migrations.RemoveField( - model_name='adminarealevel', - name='business_area', - ), - migrations.RemoveField( - model_name='adminarealevel', - name='country', - ), - migrations.DeleteModel( - name='AdminArea', - ), - migrations.DeleteModel( - name='AdminAreaLevel', - ), - migrations.AddField( - model_name='businessarea', - name='active', - field=models.BooleanField(default=False), - ), - migrations.AlterModelManagers( - name='flexibleattributegroup', - managers=[ - ('_tree_manager', django.db.models.manager.Manager()), - ], - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0058_migration.py b/src/hct_mis_api/apps/core/migrations/0058_migration.py deleted file mode 100644 index 9256e1ba13..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0058_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-11 18:07 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0044_migration_squashed_0057_migration'), - ] - - operations = [ - migrations.AlterModelManagers( - name='flexibleattributegroup', - managers=[ - ], - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0058_migration_squashed_0059_migration.py b/src/hct_mis_api/apps/core/migrations/0058_migration_squashed_0059_migration.py deleted file mode 100644 index f319b0f94d..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0058_migration_squashed_0059_migration.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - replaces = [('core', '0058_migration'), ('core', '0059_migration')] - - dependencies = [ - ('core', '0044_migration_squashed_0057_migration'), - ] - - operations = [ - migrations.AlterModelManagers( - name='flexibleattributegroup', - managers=[ - ], - ), - migrations.AddField( - model_name='businessarea', - name='kobo_token', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AddField( - model_name='businessarea', - name='kobo_url', - field=models.URLField(blank=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0059_migration.py b/src/hct_mis_api/apps/core/migrations/0059_migration.py deleted file mode 100644 index 9179dda43f..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0059_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.15 on 2022-12-15 08:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0058_migration'), - ] - - operations = [ - migrations.AddField( - model_name='businessarea', - name='kobo_token', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AddField( - model_name='businessarea', - name='kobo_url', - field=models.URLField(blank=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0060_migration_squashed_0064_migration.py b/src/hct_mis_api/apps/core/migrations/0060_migration_squashed_0064_migration.py deleted file mode 100644 index 4a237bc5a1..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0060_migration_squashed_0064_migration.py +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 12:49 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone -import model_utils.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('core', '0059_migration'), - ] - - operations = [ - migrations.CreateModel( - name='FileTemp', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), - ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), - ('object_id', models.CharField(max_length=120, null=True)), - ('file', models.FileField(upload_to='')), - ('content_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')), - ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), - ('was_downloaded', models.BooleanField(default=False)), - ], - options={ - 'abstract': False, - }, - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION payment_plan_business_area_seq() RETURNS trigger \n LANGUAGE plpgsql\n AS $$\n begin\n execute format('create sequence if not exists payment_plan_business_area_seq_%s', translate(NEW.id::text, '-','_'));\n return NEW;\n end\n $$;\n\n ", - ), - migrations.RunSQL( - sql='CREATE TRIGGER payment_plan_business_area_seq AFTER INSERT ON core_businessarea FOR EACH ROW EXECUTE PROCEDURE payment_plan_business_area_seq();', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION payment_business_area_seq() RETURNS trigger \n LANGUAGE plpgsql\n AS $$\n begin\n execute format('create sequence if not exists payment_business_area_seq_%s', translate(NEW.id::text, '-','_'));\n return NEW;\n end\n $$;\n\n ", - ), - migrations.RunSQL( - sql='CREATE TRIGGER payment_business_area_seq AFTER INSERT ON core_businessarea FOR EACH ROW EXECUTE PROCEDURE payment_business_area_seq();', - ), - migrations.AddField( - model_name='businessarea', - name='is_payment_plan_applicable', - field=models.BooleanField(default=False), - ), - migrations.RunSQL( - sql="\n create or replace function payment_plan_business_area_for_old_ba(id text)\n returns text \n language plpgsql\n as\n $$\n declare \n -- variable declaration\n begin\n execute format('create sequence if not exists payment_plan_business_area_seq_%s', translate(id::text, '-','_'));\n RETURN id;\n end;\n $$\n ", - ), - migrations.RunSQL( - sql='SELECT id, payment_plan_business_area_for_old_ba(id::text) AS result FROM core_businessarea;', - ), - migrations.RunSQL( - sql="\n create or replace function payment_business_area_for_old_ba(id text)\n returns text \n language plpgsql\n as\n $$\n declare \n -- variable declaration\n begin\n execute format('create sequence if not exists payment_business_area_seq_%s', translate(id::text, '-','_'));\n RETURN id;\n end;\n $$\n ", - ), - migrations.RunSQL( - sql='SELECT id, payment_business_area_for_old_ba(id::text) AS result FROM core_businessarea;', - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0065_migration_squashed_0067_migration.py b/src/hct_mis_api/apps/core/migrations/0065_migration_squashed_0067_migration.py deleted file mode 100644 index 8814be922c..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0065_migration_squashed_0067_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-28 13:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0060_migration_squashed_0064_migration'), - ] - replaces = [('core', '0065_migration'), ('core', '0066_migration'), ('core', '0067_migration')] - operations = [ - migrations.AddField( - model_name='businessarea', - name='is_accountability_applicable', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0068_migration.py b/src/hct_mis_api/apps/core/migrations/0068_migration.py deleted file mode 100644 index e662b858ed..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0068_migration.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.2.19 on 2023-07-19 08:56 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0065_migration_squashed_0067_migration'), - ] - - operations = [ - migrations.RenameField( - model_name='businessarea', - old_name='rapid_pro_api_key', - new_name='rapid_pro_payment_verification_token', - ), - migrations.AddField( - model_name='businessarea', - name='rapid_pro_messages_token', - field=models.CharField(blank=True, max_length=40, null=True), - ), - migrations.AddField( - model_name='businessarea', - name='rapid_pro_survey_token', - field=models.CharField(blank=True, max_length=40, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0068_migration_squashed_0076_migration.py b/src/hct_mis_api/apps/core/migrations/0068_migration_squashed_0076_migration.py deleted file mode 100644 index 83b8f87439..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0068_migration_squashed_0076_migration.py +++ /dev/null @@ -1,93 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:13 - -from django.db import migrations, models -import django.utils.timezone -import model_utils.fields - - -class Migration(migrations.Migration): - - replaces = [('core', '0068_migration'), ('core', '0069_migration'), ('core', '0070_migration'), ('core', '0071_migration'), ('core', '0072_migration'), ('core', '0073_migration'), ('core', '0074_migration'), ('core', '0075_migration'), ('core', '0076_migration')] - - dependencies = [ - ('core', '0065_migration_squashed_0067_migration'), - ] - - operations = [ - migrations.RenameField( - model_name='businessarea', - old_name='rapid_pro_api_key', - new_name='rapid_pro_payment_verification_token', - ), - migrations.AddField( - model_name='businessarea', - name='rapid_pro_messages_token', - field=models.CharField(blank=True, max_length=40, null=True), - ), - migrations.AddField( - model_name='businessarea', - name='rapid_pro_survey_token', - field=models.CharField(blank=True, max_length=40, null=True), - ), - migrations.CreateModel( - name='MigrationStatus', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), - ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), - ('is_running', models.BooleanField()), - ], - options={ - 'abstract': False, - 'verbose_name_plural': 'Migration Status', - }, - ), - migrations.CreateModel( - name='DataCollectingType', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), - ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), - ('code', models.CharField(max_length=32)), - ('description', models.TextField(blank=True)), - ('compatible_types', models.ManyToManyField(blank=True, to='core.DataCollectingType')), - ('active', models.BooleanField(default=True)), - ('individual_filters_available', models.BooleanField(default=False)), - ('limit_to', models.ManyToManyField(blank=True, related_name='data_collecting_types', to='core.BusinessArea')), - ('household_filters_available', models.BooleanField(default=True)), - ('label', models.CharField(blank=True, max_length=32)), - ('recalculate_composition', models.BooleanField(default=False)), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddConstraint( - model_name='datacollectingtype', - constraint=models.UniqueConstraint(fields=('label', 'code'), name='unique_label_code_data_collecting_type'), - ), - migrations.AlterField( - model_name='datacollectingtype', - name='compatible_types', - field=models.ManyToManyField(blank=True, to='core.DataCollectingType'), - ), - migrations.AddField( - model_name='datacollectingtype', - name='deprecated', - field=models.BooleanField(default=False, help_text='Cannot be used in new programs, totally hidden in UI, only admin have access'), - ), - migrations.AddField( - model_name='datacollectingtype', - name='type', - field=models.CharField(blank=True, choices=[('STANDARD', 'Standard'), ('SOCIAL', 'Social Workers')], max_length=32, null=True), - ), - migrations.AlterModelOptions( - name='datacollectingtype', - options={'ordering': ('-weight',)}, - ), - migrations.AddField( - model_name='datacollectingtype', - name='weight', - field=models.PositiveSmallIntegerField(default=0), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0069_migration.py b/src/hct_mis_api/apps/core/migrations/0069_migration.py deleted file mode 100644 index 1de6d0df5c..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0069_migration.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.2.20 on 2023-08-02 10:34 - -from django.db import migrations, models -import django.utils.timezone -import model_utils.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0068_migration'), - ] - - operations = [ - migrations.CreateModel( - name='MigrationStatus', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), - ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), - ('is_running', models.BooleanField()), - ], - options={ - 'abstract': False, - }, - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0070_migration.py b/src/hct_mis_api/apps/core/migrations/0070_migration.py deleted file mode 100644 index 690007af0b..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0070_migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-18 11:23 - -from django.db import migrations, models -import django.utils.timezone -import model_utils.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0069_migration'), - ] - - operations = [ - migrations.CreateModel( - name='DataCollectingType', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), - ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), - ('code', models.CharField(max_length=60, unique=True)), - ('description', models.TextField(blank=True)), - ('compatible_types', models.ManyToManyField(blank=True, related_name='_core_datacollectingtype_compatible_types_+', to='core.DataCollectingType')), - ], - options={ - 'abstract': False, - }, - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0071_migration.py b/src/hct_mis_api/apps/core/migrations/0071_migration.py deleted file mode 100644 index 0cd2de4e85..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0071_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.20 on 2023-10-02 01:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0070_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='datacollectingtype', - name='compatible_types', - field=models.ManyToManyField(blank=True, to='core.DataCollectingType'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0072_migration.py b/src/hct_mis_api/apps/core/migrations/0072_migration.py deleted file mode 100644 index ea3c636cea..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0072_migration.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-23 20:21 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0071_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='migrationstatus', - options={'verbose_name_plural': 'Migration Status'}, - ), - migrations.AddField( - model_name='datacollectingtype', - name='active', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='datacollectingtype', - name='individual_filters_available', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='datacollectingtype', - name='limit_to', - field=models.ManyToManyField(related_name='data_collecting_types', to='core.BusinessArea'), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/core/migrations/0073_migration.py b/src/hct_mis_api/apps/core/migrations/0073_migration.py deleted file mode 100644 index b1b823a07d..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0073_migration.py +++ /dev/null @@ -1,42 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-26 07:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0072_migration'), - ] - - operations = [ - migrations.AddField( - model_name='datacollectingtype', - name='household_filters_available', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='datacollectingtype', - name='label', - field=models.CharField(blank=True, max_length=32), - ), - migrations.AddField( - model_name='datacollectingtype', - name='recalculate_composition', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='datacollectingtype', - name='code', - field=models.CharField(max_length=32), - ), - migrations.AlterField( - model_name='datacollectingtype', - name='limit_to', - field=models.ManyToManyField(blank=True, related_name='data_collecting_types', to='core.BusinessArea'), - ), - migrations.AddConstraint( - model_name='datacollectingtype', - constraint=models.UniqueConstraint(fields=('label', 'code'), name='unique_label_code_data_collecting_type'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0074_migration.py b/src/hct_mis_api/apps/core/migrations/0074_migration.py deleted file mode 100644 index 496d778484..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0074_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.20 on 2023-10-01 18:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0073_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='datacollectingtype', - name='compatible_types', - field=models.ManyToManyField(blank=True, to='core.DataCollectingType'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0075_migration.py b/src/hct_mis_api/apps/core/migrations/0075_migration.py deleted file mode 100644 index 3e7d517422..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0075_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.22 on 2023-10-23 07:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0074_migration'), - ] - - operations = [ - migrations.AddField( - model_name='datacollectingtype', - name='deprecated', - field=models.BooleanField(default=False, help_text='Cannot be used in new programs, totally hidden in UI, only admin have access'), - ), - migrations.AddField( - model_name='datacollectingtype', - name='type', - field=models.CharField(blank=True, choices=[('STANDARD', 'Standard'), ('SOCIAL', 'Social Workers')], max_length=32, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0076_migration.py b/src/hct_mis_api/apps/core/migrations/0076_migration.py deleted file mode 100644 index aa7f9aecfa..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0076_migration.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.20 on 2023-11-19 12:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0075_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='datacollectingtype', - options={'ordering': ('-weight',)}, - ), - migrations.AddField( - model_name='datacollectingtype', - name='weight', - field=models.PositiveSmallIntegerField(default=0), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0077_migration.py b/src/hct_mis_api/apps/core/migrations/0077_migration.py deleted file mode 100644 index 403682e619..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0077_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-21 13:10 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0076_migration'), - ] - - operations = [ - migrations.AddField( - model_name='businessarea', - name='enable_email_notification', - field=models.BooleanField(default=True, verbose_name='Automatic Email notifications enabled'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0078_migration.py b/src/hct_mis_api/apps/core/migrations/0078_migration.py deleted file mode 100644 index 258160c8bd..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0078_migration.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 3.2.25 on 2024-04-07 21:43 - -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('account', '0066_migration'), - ('core', '0077_migration'), - ] - - operations = [ - migrations.CreateModel( - name='BusinessAreaPartnerThrough', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='business_area_partner_through', to='core.businessarea')), - ('partner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='business_area_partner_through', to='account.partner')), - ('roles', models.ManyToManyField(related_name='business_area_partner_through', to='account.Role')), - ], - ), - migrations.AddField( - model_name='businessarea', - name='partners', - field=models.ManyToManyField(related_name='business_areas', through='core.BusinessAreaPartnerThrough', to='account.Partner'), - ), - migrations.AddConstraint( - model_name='businessareapartnerthrough', - constraint=models.UniqueConstraint(fields=('business_area', 'partner'), name='unique_business_area_partner'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0079_migration.py b/src/hct_mis_api/apps/core/migrations/0079_migration.py deleted file mode 100644 index 60c34bfe03..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0079_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-10 23:53 - -import django.contrib.postgres.fields -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0047_migration'), - ('core', '0078_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PeriodicFieldData', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('subtype', models.CharField(choices=[('DATE', 'Date'), ('DECIMAL', 'Number'), ('STRING', 'Text')], max_length=16)), - ('number_of_rounds', models.IntegerField()), - ('rounds_names', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)), - ], - options={ - 'verbose_name': 'Periodic Field Data', - 'verbose_name_plural': 'Periodic Fields Data', - }, - ), - migrations.AddField( - model_name='flexibleattribute', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pdu_fields', to='program.program'), - ), - migrations.AlterField( - model_name='flexibleattribute', - name='type', - field=models.CharField(choices=[('DATE', 'Date'), ('DECIMAL', 'Decimal'), ('IMAGE', 'Image'), ('INTEGER', 'Integer'), ('GEOPOINT', 'Geopoint'), ('SELECT_ONE', 'Select One'), ('SELECT_MANY', 'Select Many'), ('STRING', 'String'), ('PDU', 'PDU')], max_length=16), - ), - migrations.AddField( - model_name='flexibleattribute', - name='pdu_data', - field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='flex_field', to='core.periodicfielddata'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0080_migration.py b/src/hct_mis_api/apps/core/migrations/0080_migration.py deleted file mode 100644 index 24ffc93902..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0080_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-15 23:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0079_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='periodicfielddata', - name='subtype', - field=models.CharField(choices=[('DATE', 'Date'), ('DECIMAL', 'Number'), ('STRING', 'Text'), ('BOOLEAN', 'Yes/No')], max_length=16), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0081_migration.py b/src/hct_mis_api/apps/core/migrations/0081_migration.py deleted file mode 100644 index d582afb9fe..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0081_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-18 14:15 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0080_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='flexibleattribute', - name='group', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='flex_attributes', to='core.flexibleattributegroup'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0082_migration.py b/src/hct_mis_api/apps/core/migrations/0082_migration.py deleted file mode 100644 index 5dfe63d8f6..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0082_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-01 20:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0081_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='flexibleattribute', - name='name', - field=models.CharField(max_length=255), - ), - migrations.AddConstraint( - model_name='flexibleattribute', - constraint=models.UniqueConstraint(fields=('name', 'program'), name='unique_name_program'), - ), - migrations.AddConstraint( - model_name='flexibleattribute', - constraint=models.UniqueConstraint(condition=models.Q(('program__isnull', True)), fields=('name',), name='unique_name_without_program'), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0083_migration.py b/src/hct_mis_api/apps/core/migrations/0083_migration.py deleted file mode 100644 index a4aaf7bcfd..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0083_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-17 10:18 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0082_migration'), - ] - - operations = [ - migrations.RunSQL( - sql=""" - CREATE OR REPLACE FUNCTION program_cycle_business_area_seq() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - EXECUTE format('CREATE SEQUENCE IF NOT EXISTS program_cycle_business_area_seq_%s', translate(NEW.id::text, '-', '_')); - RETURN NEW; - END - $$; - """, - ), - migrations.RunSQL( - sql=""" - CREATE TRIGGER program_cycle_business_area_seq AFTER INSERT ON core_businessarea FOR EACH ROW EXECUTE PROCEDURE program_cycle_business_area_seq(); - """, - ), - migrations.RunSQL( - sql=""" - CREATE OR REPLACE FUNCTION program_cycle_business_area_for_old_ba(id text) - RETURNS text - LANGUAGE plpgsql - AS $$ - BEGIN - EXECUTE format('CREATE SEQUENCE IF NOT EXISTS program_cycle_business_area_seq_%s', translate(id::text, '-', '_')); - RETURN id; - END; - $$; - SELECT id, program_cycle_business_area_for_old_ba(id::text) AS result FROM core_businessarea; - """, - ) - ] diff --git a/src/hct_mis_api/apps/core/migrations/0084_migration.py b/src/hct_mis_api/apps/core/migrations/0084_migration.py deleted file mode 100644 index e119fd912c..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0084_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-19 10:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0083_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='periodicfielddata', - name='subtype', - field=models.CharField(choices=[('DATE', 'Date'), ('DECIMAL', 'Number'), ('STRING', 'Text'), ('BOOLEAN', 'Boolean (true/false)')], max_length=16), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0085_migration.py b/src/hct_mis_api/apps/core/migrations/0085_migration.py deleted file mode 100644 index e13e9a19c0..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0085_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-19 15:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0084_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='periodicfielddata', - name='subtype', - field=models.CharField(choices=[('DATE', 'Date'), ('DECIMAL', 'Number'), ('STRING', 'Text'), ('BOOL', 'Boolean (true/false)')], max_length=16), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/core/migrations/0086_migration.py b/src/hct_mis_api/apps/core/migrations/0086_migration.py deleted file mode 100644 index 0143413d96..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0086_migration.py +++ /dev/null @@ -1,15 +0,0 @@ -from django.db import migrations - -def migrate_subtype_boolean_to_bool(apps, schema_editor): - PeriodicFieldData = apps.get_model('core', 'PeriodicFieldData') - PeriodicFieldData.objects.filter(subtype='BOOLEAN').update(subtype='BOOL') - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0085_migration'), - ] - - operations = [ - migrations.RunPython(migrate_subtype_boolean_to_bool, reverse_code=migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0087_migration.py b/src/hct_mis_api/apps/core/migrations/0087_migration.py deleted file mode 100644 index 02afe0bd32..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0087_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-27 10:26 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0086_migration'), - ] - - operations = [ - migrations.AddField( - model_name='businessarea', - name='biometric_deduplication_threshold', - field=models.FloatField(default=0.0, help_text='Threshold for Face Image Deduplication', validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(100.0)]), - ), - ] diff --git a/src/hct_mis_api/apps/core/migrations/0088_migration.py b/src/hct_mis_api/apps/core/migrations/0088_migration.py deleted file mode 100644 index 8a42e11705..0000000000 --- a/src/hct_mis_api/apps/core/migrations/0088_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-15 17:18 - -from django.db import migrations, models -import hct_mis_api.apps.core.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0087_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='flexibleattribute', - name='label', - field=models.JSONField(default=dict, validators=[hct_mis_api.apps.core.models.label_contains_english_en_validator]), - ), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0001_migration.py b/src/hct_mis_api/apps/geo/migrations/0001_migration.py index dbd36961e5..d6c3d38c70 100644 --- a/src/hct_mis_api/apps/geo/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/geo/migrations/0001_migration.py @@ -1,8 +1,7 @@ -# Generated by Django 2.2.16 on 2021-09-16 11:48 +# Generated by Django 3.2.25 on 2024-11-07 12:18 import django.contrib.gis.db.models.fields import django.contrib.postgres.fields.citext -import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion import model_utils.fields @@ -32,12 +31,12 @@ class Migration(migrations.Migration): ('iso_num', models.CharField(max_length=4, unique=True)), ('valid_from', models.DateTimeField(auto_now_add=True, null=True)), ('valid_until', models.DateTimeField(blank=True, null=True)), - ('extras', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict)), + ('extras', models.JSONField(blank=True, default=dict)), ('lft', models.PositiveIntegerField(editable=False)), ('rght', models.PositiveIntegerField(editable=False)), ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), ('level', models.PositiveIntegerField(editable=False)), - ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='geo.Country', verbose_name='Parent')), + ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='geo.country', verbose_name='Parent')), ], options={ 'verbose_name_plural': 'Countries', @@ -55,13 +54,13 @@ class Migration(migrations.Migration): ('area_level', models.PositiveIntegerField(default=1)), ('valid_from', models.DateTimeField(auto_now_add=True, null=True)), ('valid_until', models.DateTimeField(blank=True, null=True)), - ('extras', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict)), + ('extras', models.JSONField(blank=True, default=dict)), ('lft', models.PositiveIntegerField(editable=False)), ('rght', models.PositiveIntegerField(editable=False)), ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), ('level', models.PositiveIntegerField(editable=False)), - ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geo.Country')), - ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='geo.AreaType', verbose_name='Parent')), + ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geo.country')), + ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='geo.areatype', verbose_name='Parent')), ], options={ 'verbose_name_plural': 'Area Types', @@ -81,17 +80,21 @@ class Migration(migrations.Migration): ('point', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)), ('valid_from', models.DateTimeField(auto_now_add=True, null=True)), ('valid_until', models.DateTimeField(blank=True, null=True)), - ('extras', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict)), + ('extras', models.JSONField(blank=True, default=dict)), ('lft', models.PositiveIntegerField(editable=False)), ('rght', models.PositiveIntegerField(editable=False)), ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), ('level', models.PositiveIntegerField(editable=False)), - ('area_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geo.AreaType')), - ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='geo.Area', verbose_name='Parent')), + ('area_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geo.areatype')), + ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='geo.area', verbose_name='Parent')), ], options={ 'verbose_name_plural': 'Areas', - 'unique_together': {('area_type', 'name')}, + 'ordering': ('name',), }, ), + migrations.AddConstraint( + model_name='area', + constraint=models.UniqueConstraint(condition=models.Q(('p_code', ''), _negated=True), fields=('p_code',), name='unique_area_p_code_not_blank'), + ), ] diff --git a/src/hct_mis_api/apps/geo/migrations/0002_migration.py b/src/hct_mis_api/apps/geo/migrations/0002_migration.py deleted file mode 100644 index 0955f16b56..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0002_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-16 09:26 - -from django.db import migrations - - -def initialise_geo(apps, schema_editor): - pass - - -def rebuild(apps, schema_editor): - pass - - -def empty_reverse(apps, schema_editor): - pass - - -class Migration(migrations.Migration): - dependencies = [ - ("geo", "0001_migration") - ] - - operations = [ - migrations.RunPython(initialise_geo, empty_reverse), - migrations.RunPython(rebuild, empty_reverse), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0003_migration.py b/src/hct_mis_api/apps/geo/migrations/0003_migration.py deleted file mode 100644 index b00ff89d46..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0003_migration.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-16 09:26 - -from django.db import migrations - - -def preload_areas(apps, schema_editor): - pass - - -def rebuild(apps, schema_editor): - pass - - -def empty_reverse(apps, schema_editor): - pass - - -class Migration(migrations.Migration): - dependencies = [ - ("geo", "0002_migration"), - ("core", "0017_migration_squashed_0040_migration"), - ] - - operations = [ - migrations.RunPython(preload_areas, empty_reverse), - migrations.RunPython(rebuild, empty_reverse), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0004_migration.py b/src/hct_mis_api/apps/geo/migrations/0004_migration.py deleted file mode 100644 index f8347d6a80..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0004_migration.py +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-16 17:14 - -from django.db import migrations -from django.db.models import ForeignKey - - -# UPDATE table SET columnB = columnA; -class DeferredForwardRunSQL(migrations.RunSQL): - def database_forwards(self, app_label, schema_editor, from_state, to_state): - schema_editor.deferred_sql.append(self.sql[0]) - - -MODELS = ( - "core.CountryCodeMap", - "household.Household", - "household.DocumentType", - "household.Agency", - "sanction_list.SanctionListIndividualCountries", - "sanction_list.SanctionListIndividualNationalities", - "sanction_list.SanctionListIndividualDocument", - "sanction_list.SanctionListIndividual", -) - - -def copy_country_data(apps, schema_editor): - Country = apps.get_model("geo", "Country") - - countries = {} - for model in MODELS: - Model = apps.get_model(*model.split(".")) - try: - for field in Model._meta.get_fields(): - if type(field) == ForeignKey: - opts = field.related_model._meta - if opts.app_label == "geo" and opts.model_name == "country": - old_field_name = field.name[:-4] - geo_name = field.name - records = Model.objects.all() - for record in records: - source = getattr(record, old_field_name).code - if source: - if source not in countries: - countries[source] = Country.objects.get(iso_code2=source) - setattr(record, geo_name, countries[source]) - Model.objects.bulk_update(records, [geo_name]) - except Exception: - raise - - -def empty_reverse(apps, schema_editor): - pass - - -class Migration(migrations.Migration): - dependencies = [ - ("geo", "0003_migration"), - ("core", "0041_migration"), - ("household", "0003_migration_squashed_0086_migration"), - ("sanction_list", "0010_migration"), - ] - - operations = [ - migrations.RunPython(copy_country_data, empty_reverse), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0005_migration.py b/src/hct_mis_api/apps/geo/migrations/0005_migration.py deleted file mode 100644 index 272eaaf41f..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0005_migration.py +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-27 14:07 - -from django.db import migrations, models - -MODELS = ( - "grievance.GrievanceTicket", - "household.Household", - "program.Program", - "reporting.DashboardReport", - "reporting.Report", -) - - -def copy_admin_area_data(apps, schema_editor): - Area = apps.get_model("geo", "Area") - areas = {} - - for model in MODELS: - Model = apps.get_model(*model.split(".")) - try: - for field in Model._meta.get_fields(): - if type(field) == models.ForeignKey: - opts = field.related_model._meta - if opts.app_label == "geo" and opts.model_name == "area": - old_field_name = field.name[:-4] - geo_name = field.name - records = Model.objects.all() - for record in records: - source = getattr(record, old_field_name) - if source: - p_code = source.p_code - if p_code not in areas.keys(): - areas[p_code] = Area.objects.get(p_code=p_code) - setattr(record, geo_name, areas[p_code]) - Model.objects.bulk_update(records, [geo_name]) - except Exception: - raise - - -class Migration(migrations.Migration): - dependencies = [ - ("geo", "0004_migration"), - ("grievance", "0001_migration_squashed_0034_migration"), - ("household", "0087_migration"), - ("program", "0029_migration"), - ("reporting", "0008_migration_squashed_0014_migration"), - ] - - operations = [migrations.RunPython(copy_admin_area_data, migrations.RunPython.noop)] diff --git a/src/hct_mis_api/apps/geo/migrations/0005_migration_squashed_0007_migration.py b/src/hct_mis_api/apps/geo/migrations/0005_migration_squashed_0007_migration.py deleted file mode 100644 index 19a68f5c9f..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0005_migration_squashed_0007_migration.py +++ /dev/null @@ -1,75 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 06:42 - -from django.db import migrations, models -import django.db.migrations.operations.special - - -MODELS = ( - "grievance.GrievanceTicket", - "household.Household", - "program.Program", - "reporting.DashboardReport", - "reporting.Report", -) - - -def copy_admin_area_data(apps, schema_editor): - Area = apps.get_model("geo", "Area") - areas = {} - - for model in MODELS: - Model = apps.get_model(*model.split(".")) - try: - for field in Model._meta.get_fields(): - if type(field) == models.ForeignKey: - opts = field.related_model._meta - if opts.app_label == "geo" and opts.model_name == "area": - old_field_name = field.name[:-4] - geo_name = field.name - records = Model.objects.all() - for record in records: - source = getattr(record, old_field_name) - if source: - p_code = source.p_code - if p_code not in areas.keys(): - areas[p_code] = Area.objects.get(p_code=p_code) - setattr(record, geo_name, areas[p_code]) - Model.objects.bulk_update(records, [geo_name]) - except Exception: - raise - - -class Migration(migrations.Migration): - - replaces = [('geo', '0005_migration'), ('geo', '0006_migration'), ('geo', '0007_migration')] - - dependencies = [ - ('program', '0029_migration'), - ('reporting', '0008_migration_squashed_0014_migration'), - ('geo', '0004_migration'), - ('grievance', '0001_migration_squashed_0034_migration'), - ('household', '0087_migration'), - ] - - operations = [ - migrations.RunPython(copy_admin_area_data, migrations.RunPython.noop), - migrations.AlterUniqueTogether( - name='area', - unique_together={('name', 'p_code')}, - ), - migrations.AlterField( - model_name='area', - name='extras', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='areatype', - name='extras', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='country', - name='extras', - field=models.JSONField(blank=True, default=dict), - ), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0006_migration.py b/src/hct_mis_api/apps/geo/migrations/0006_migration.py deleted file mode 100644 index 118f57b9ab..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0006_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 2.2.16 on 2021-10-28 11:07 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0005_migration'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='area', - unique_together={('name', 'p_code')}, - ), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0007_migration.py b/src/hct_mis_api/apps/geo/migrations/0007_migration.py deleted file mode 100644 index 54fbd29d18..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0007_migration.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.2 on 2022-02-11 19:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0006_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='area', - name='extras', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='areatype', - name='extras', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='country', - name='extras', - field=models.JSONField(blank=True, default=dict), - ), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0008_migration.py b/src/hct_mis_api/apps/geo/migrations/0008_migration.py deleted file mode 100644 index 7b340cf518..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0008_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-09 14:26 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0007_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='area', - options={'ordering': ('name',), 'verbose_name_plural': 'Areas'}, - ), - ] diff --git a/src/hct_mis_api/apps/geo/migrations/0009_migration.py b/src/hct_mis_api/apps/geo/migrations/0009_migration.py deleted file mode 100644 index 484ea74c39..0000000000 --- a/src/hct_mis_api/apps/geo/migrations/0009_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-31 12:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0008_migration'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='area', - unique_together=set(), - ), - migrations.AddConstraint( - model_name='area', - constraint=models.UniqueConstraint(condition=models.Q(('p_code', ''), _negated=True), fields=('p_code',), name='unique_area_p_code_not_blank'), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/documents.py b/src/hct_mis_api/apps/grievance/documents.py index 126085b940..9b8d29b4be 100644 --- a/src/hct_mis_api/apps/grievance/documents.py +++ b/src/hct_mis_api/apps/grievance/documents.py @@ -6,8 +6,8 @@ from django_elasticsearch_dsl import Document, fields from django_elasticsearch_dsl.registries import registry -from elasticsearch import Elasticsearch +from elasticsearch import Elasticsearch from hct_mis_api.apps.account.models import User from hct_mis_api.apps.core.models import BusinessArea from hct_mis_api.apps.geo.models import Area diff --git a/src/hct_mis_api/apps/grievance/migrations/0001_migration.py b/src/hct_mis_api/apps/grievance/migrations/0001_migration.py new file mode 100644 index 0000000000..332aee08c3 --- /dev/null +++ b/src/hct_mis_api/apps/grievance/migrations/0001_migration.py @@ -0,0 +1,255 @@ +# Generated by Django 3.2.25 on 2024-11-07 12:18 + +import concurrency.fields +from decimal import Decimal +import django.core.validators +from django.db import migrations, models +import hct_mis_api.apps.utils.models +import model_utils.fields +import uuid + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='GrievanceDocument', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ('name', models.CharField(max_length=100, null=True)), + ('file', models.FileField(blank=True, null=True, upload_to='')), + ('file_size', models.IntegerField(null=True)), + ('content_type', models.CharField(max_length=100)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='GrievanceTicket', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('user_modified', models.DateTimeField(blank=True, db_index=True, help_text='Date this ticket was most recently changed.', null=True, verbose_name='Modified')), + ('last_notification_sent', models.DateTimeField(blank=True, db_index=True, help_text='Date this ticket was most recently changed.', null=True, verbose_name='Modified')), + ('status', models.IntegerField(choices=[(1, 'New'), (2, 'Assigned'), (6, 'Closed'), (5, 'For Approval'), (3, 'In Progress'), (4, 'On Hold')], default=1, verbose_name='Status')), + ('category', models.IntegerField(choices=[(8, 'Needs Adjudication'), (1, 'Payment Verification'), (9, 'System Flagging'), (2, 'Data Change'), (4, 'Grievance Complaint'), (5, 'Negative Feedback'), (7, 'Positive Feedback'), (6, 'Referral'), (3, 'Sensitive Grievance')], verbose_name='Category')), + ('issue_type', models.IntegerField(blank=True, null=True, verbose_name='Type')), + ('description', models.TextField(blank=True, help_text='The content of the customers query.', verbose_name='Description')), + ('area', models.CharField(blank=True, max_length=250)), + ('language', models.TextField(blank=True)), + ('consent', models.BooleanField(default=True)), + ('extras', models.JSONField(blank=True, default=dict)), + ('ignored', models.BooleanField(db_index=True, default=False)), + ('household_unicef_id', models.CharField(blank=True, db_index=True, max_length=250, null=True)), + ('priority', models.IntegerField(choices=[(0, 'Not set'), (1, 'High'), (2, 'Medium'), (3, 'Low')], default=0, verbose_name='Priority')), + ('urgency', models.IntegerField(choices=[(0, 'Not set'), (1, 'Very urgent'), (2, 'Urgent'), (3, 'Not urgent')], default=0, verbose_name='Urgency')), + ('comments', models.TextField(blank=True, null=True)), + ('is_original', models.BooleanField(db_index=True, default=False)), + ('is_migration_handled', models.BooleanField(default=False)), + ('migrated_at', models.DateTimeField(blank=True, null=True)), + ], + options={ + 'verbose_name': 'Grievance Ticket', + 'ordering': ('status', 'created_at'), + }, + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), + ), + migrations.CreateModel( + name='GrievanceTicketThrough', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ], + ), + migrations.CreateModel( + name='TicketAddIndividualDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('individual_data', models.JSONField(null=True)), + ('approve_status', models.BooleanField(default=False)), + ], + options={ + 'verbose_name_plural': 'Ticket Add Individual Details', + }, + ), + migrations.CreateModel( + name='TicketComplaintDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('payment_object_id', models.UUIDField(null=True)), + ], + options={ + 'verbose_name_plural': 'Ticket Complaint Details', + }, + ), + migrations.CreateModel( + name='TicketDeleteHouseholdDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('role_reassign_data', models.JSONField(default=dict)), + ('approve_status', models.BooleanField(default=False)), + ], + options={ + 'verbose_name_plural': 'Ticket Delete Household Details', + }, + ), + migrations.CreateModel( + name='TicketDeleteIndividualDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('role_reassign_data', models.JSONField(default=dict)), + ('approve_status', models.BooleanField(default=False)), + ], + options={ + 'verbose_name_plural': 'Ticket Delete Individual Details', + }, + ), + migrations.CreateModel( + name='TicketHouseholdDataUpdateDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('household_data', models.JSONField(null=True)), + ], + options={ + 'verbose_name_plural': 'Ticket Household Data Update Details', + }, + ), + migrations.CreateModel( + name='TicketIndividualDataUpdateDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('individual_data', models.JSONField(null=True)), + ('role_reassign_data', models.JSONField(default=dict)), + ], + options={ + 'verbose_name_plural': 'Ticket Individual Data Update Details', + }, + ), + migrations.CreateModel( + name='TicketNeedsAdjudicationDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('is_multiple_duplicates_version', models.BooleanField(default=False)), + ('role_reassign_data', models.JSONField(default=dict)), + ('extra_data', models.JSONField(default=dict)), + ('score_min', models.FloatField(default=0.0)), + ('score_max', models.FloatField(default=0.0)), + ('is_cross_area', models.BooleanField(default=False)), + ], + options={ + 'verbose_name_plural': 'Ticket Needs Adjudication Details', + }, + ), + migrations.CreateModel( + name='TicketNegativeFeedbackDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ], + options={ + 'verbose_name_plural': 'Ticket Negative Feedback Details', + }, + ), + migrations.CreateModel( + name='TicketNote', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('description', models.TextField(help_text='The content of the customers query.', verbose_name='Description')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='TicketPaymentVerificationDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('payment_verification_status', models.CharField(choices=[('NOT_RECEIVED', 'NOT RECEIVED'), ('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], max_length=50)), + ('new_status', models.CharField(choices=[('NOT_RECEIVED', 'NOT RECEIVED'), ('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], default=None, max_length=50, null=True)), + ('old_received_amount', models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), + ('new_received_amount', models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), + ('approve_status', models.BooleanField(default=False)), + ], + options={ + 'verbose_name_plural': 'Ticket Payment Verification Details', + }, + ), + migrations.CreateModel( + name='TicketPositiveFeedbackDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ], + options={ + 'verbose_name_plural': 'Ticket Positive Feedback Details', + }, + ), + migrations.CreateModel( + name='TicketReferralDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ], + options={ + 'verbose_name_plural': 'Ticket Referral Details', + }, + ), + migrations.CreateModel( + name='TicketSensitiveDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('payment_object_id', models.UUIDField(null=True)), + ], + options={ + 'verbose_name_plural': 'Ticket Sensitive Details', + }, + ), + migrations.CreateModel( + name='TicketSystemFlaggingDetails', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('approve_status', models.BooleanField(default=False)), + ('role_reassign_data', models.JSONField(default=dict)), + ], + options={ + 'verbose_name_plural': 'Ticket System Flagging Details', + }, + ), + ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0001_migration_squashed_0034_migration.py b/src/hct_mis_api/apps/grievance/migrations/0001_migration_squashed_0034_migration.py deleted file mode 100644 index c7fc02d6e4..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0001_migration_squashed_0034_migration.py +++ /dev/null @@ -1,381 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 13:10 - -import concurrency.fields -from django.conf import settings -import django.contrib.postgres.fields.jsonb -from django.db import migrations, models -import django.db.migrations.operations.special -import django.db.models.deletion -import model_utils.fields -import uuid -from django.db import migrations - -from hct_mis_api.apps.grievance.models import GrievanceTicket -from hct_mis_api.apps.household.models import DUPLICATE - - -def get_deduplication_golden_record(individual): - status_key = "duplicates" if individual.deduplication_golden_record_status == DUPLICATE else "possible_duplicates" - return individual.deduplication_golden_record_results.get(status_key, []) - - -def fill_extra_data(apps, schema_editor): - TicketNeedsAdjudicationDetails = apps.get_model("grievance", "TicketNeedsAdjudicationDetails") - - db_alias = schema_editor.connection.alias - tickets = TicketNeedsAdjudicationDetails.objects.using(db_alias).exclude(ticket__status=GrievanceTicket.STATUS_CLOSED) - for ticket in tickets: - extra_data = { - "golden_records": get_deduplication_golden_record(ticket.golden_records_individual), - "possible_duplicate": get_deduplication_golden_record(ticket.possible_duplicate), - } - ticket.extra_data = extra_data - - TicketNeedsAdjudicationDetails.objects.bulk_update(tickets, ["extra_data"]) - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0003_migration_squashed_0086_migration'), - ('core', '0017_migration_squashed_0040_migration'), - ('sanction_list', '0001_migration_squashed_0009_migration'), - ('geo', '0004_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('registration_data', '0013_migration'), - ('payment', '0010_migration_squashed_0029_migration'), - ] - - operations = [ - migrations.CreateModel( - name='GrievanceTicket', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('user_modified', models.DateTimeField(blank=True, help_text='Date this ticket was most recently changed.', null=True, verbose_name='Modified')), - ('status', models.IntegerField(choices=[(1, 'New'), (2, 'Assigned'), (3, 'In Progress'), (4, 'On Hold'), (5, 'For Approval'), (6, 'Closed')], default=1, verbose_name='Status')), - ('category', models.IntegerField(choices=[(1, 'Payment Verification'), (2, 'Data Change'), (3, 'Sensitive Grievance'), (4, 'Grievance Complaint'), (5, 'Negative Feedback'), (6, 'Referral'), (7, 'Positive Feedback'), (8, 'Deduplication')], verbose_name='Category')), - ('issue_type', models.IntegerField(blank=True, null=True, verbose_name='Type')), - ('description', models.TextField(blank=True, help_text='The content of the customers query.', verbose_name='Description')), - ('admin', models.CharField(blank=True, max_length=250)), - ('area', models.CharField(blank=True, max_length=250)), - ('language', models.TextField()), - ('consent', models.BooleanField(default=True)), - ('assigned_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assigned_tickets', to=settings.AUTH_USER_MODEL, verbose_name='Assigned to')), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to='core.businessarea')), - ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_tickets', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ], - options={ - 'ordering': ('status', 'created_at'), - }, - ), - migrations.CreateModel( - name='TicketSensitiveDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sensitive_ticket_details', to='household.household')), - ('individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sensitive_ticket_details', to='household.individual')), - ('payment_record', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sensitive_ticket_details', to='payment.paymentrecord')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='sensitive_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='GrievanceTicketThrough', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('linked_ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='grievance_tickets_through_linked', to='grievance.grievanceticket')), - ('main_ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='grievance_tickets_through_main', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='grievanceticket', - name='linked_tickets', - field=models.ManyToManyField(related_name='linked_tickets_related', through='grievance.GrievanceTicketThrough', to='grievance.GrievanceTicket'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='category', - field=models.IntegerField(choices=[(1, 'Payment Verification'), (2, 'Data Change'), (3, 'Sensitive Grievance'), (4, 'Grievance Complaint'), (5, 'Negative Feedback'), (6, 'Referral'), (7, 'Positive Feedback'), (8, 'Needs Adjudication'), (9, 'System Flagging')], verbose_name='Category'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='assigned_to', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assigned_tickets', to=settings.AUTH_USER_MODEL, verbose_name='Assigned to'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='created_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_tickets', to=settings.AUTH_USER_MODEL, verbose_name='Created by'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='language', - field=models.TextField(blank=True), - ), - migrations.AlterModelOptions( - name='grievanceticket', - options={'ordering': ('status', 'created_at'), 'verbose_name': 'Grievance Ticket'}, - ), - migrations.AddField( - model_name='grievanceticket', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='grievanceticket', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.CreateModel( - name='TicketAddIndividualDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('individual_data', django.contrib.postgres.fields.jsonb.JSONField(null=True)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='add_individual_ticket_details', to='household.household')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='add_individual_ticket_details', to='grievance.grievanceticket')), - ('approve_status', models.BooleanField(default=False)), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketComplaintDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='complaint_ticket_details', to='household.household')), - ('individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='complaint_ticket_details', to='household.individual')), - ('payment_record', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='complaint_ticket_details', to='payment.paymentrecord')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='complaint_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketDeleteIndividualDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='delete_individual_ticket_details', to='household.individual')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='delete_individual_ticket_details', to='grievance.grievanceticket')), - ('approve_status', models.BooleanField(default=False)), - ('role_reassign_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict)), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketHouseholdDataUpdateDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('household_data', django.contrib.postgres.fields.jsonb.JSONField(null=True)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='household_data_update_ticket_details', to='household.household')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='household_data_update_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketIndividualDataUpdateDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('individual_data', django.contrib.postgres.fields.jsonb.JSONField(null=True)), - ('individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='individual_data_update_ticket_details', to='household.individual')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='individual_data_update_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketNeedsAdjudicationDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('selected_individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='household.individual')), - ('role_reassign_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict)), - ('golden_records_individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='household.individual')), - ('possible_duplicate', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='household.individual')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='needs_adjudication_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketNote', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('description', models.TextField(help_text='The content of the customers query.', verbose_name='Description')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ticket_notes', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('ticket', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_notes', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketPaymentVerificationDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('payment_verification_status', models.CharField(choices=[('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('NOT_RECEIVED', 'NOT RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], max_length=50)), - ('payment_verifications', models.ManyToManyField(related_name='ticket_details', to='payment.PaymentVerification')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='payment_verification_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketSystemFlaggingDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('approve_status', models.BooleanField(default=False)), - ('role_reassign_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict)), - ('golden_records_individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='household.individual')), - ('sanction_list_individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='sanction_list.sanctionlistindividual')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='system_flagging_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AlterField( - model_name='grievanceticket', - name='user_modified', - field=models.DateTimeField(blank=True, db_index=True, help_text='Date this ticket was most recently changed.', null=True, verbose_name='Modified'), - ), - migrations.RemoveField( - model_name='grievanceticket', - name='admin', - ), - migrations.AddField( - model_name='grievanceticket', - name='admin2', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.adminarea'), - ), - migrations.AddField( - model_name='grievanceticket', - name='registration_data_import', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='registration_data.registrationdataimport'), - ), - migrations.AddField( - model_name='grievanceticket', - name='last_notification_sent', - field=models.DateTimeField(blank=True, db_index=True, help_text='Date this ticket was most recently changed.', null=True, verbose_name='Modified'), - ), - migrations.AddField( - model_name='grievanceticket', - name='unicef_id', - field=models.CharField(blank=True, default='', max_length=250), - ), - migrations.RunSQL( - sql='ALTER TABLE grievance_grievanceticket ADD unicef_id_index SERIAL', - reverse_sql='ALTER TABLE grievance_grievanceticket DROP unicef_id_index', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_gt_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('GRV-%s', trim(to_char(NEW.unicef_id_index,'000000')));\n return NEW;\n end\n $$;\n \n CREATE TRIGGER create_gt_unicef_id \n BEFORE INSERT \n ON grievance_grievanceticket \n FOR EACH ROW \n EXECUTE PROCEDURE create_gt_unicef_id();\n ", - reverse_sql='\n DROP TRIGGER IF EXISTS create_gt_unicef_id ON grievance_grievanceticket\n ', - ), - migrations.RunSQL( - sql="\n UPDATE grievance_grievanceticket \n SET unicef_id = format('GRV-%s', trim(to_char(unicef_id_index,'000000')));\n ", - reverse_sql='', - ), - migrations.AddField( - model_name='ticketindividualdataupdatedetails', - name='role_reassign_data', - field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - migrations.CreateModel( - name='TicketPositiveFeedbackDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='positive_feedback_ticket_details', to='household.household')), - ('individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='positive_feedback_ticket_details', to='household.individual')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='positive_feedback_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketNegativeFeedbackDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='negative_feedback_ticket_details', to='household.household')), - ('individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='negative_feedback_ticket_details', to='household.individual')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='negative_feedback_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='TicketReferralDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='referral_ticket_details', to='household.household')), - ('individual', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='referral_ticket_details', to='household.individual')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='referral_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='extra_data', - field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - migrations.RunPython(fill_extra_data, migrations.RunPython.noop), - migrations.AddField( - model_name='grievanceticket', - name='extras', - field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict), - ), - migrations.AddField( - model_name='grievanceticket', - name='admin2_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='geo.area'), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0002_migration.py b/src/hct_mis_api/apps/grievance/migrations/0002_migration.py new file mode 100644 index 0000000000..b92634ddb9 --- /dev/null +++ b/src/hct_mis_api/apps/grievance/migrations/0002_migration.py @@ -0,0 +1,84 @@ +# Generated by Django 3.2.25 on 2024-11-07 12:18 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('grievance', '0001_migration'), + ('contenttypes', '0002_remove_content_type_name'), + ('sanction_list', '0001_migration'), + ('household', '0002_migration'), + ] + + operations = [ + migrations.AddField( + model_name='ticketsystemflaggingdetails', + name='golden_records_individual', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='household.individual'), + ), + migrations.AddField( + model_name='ticketsystemflaggingdetails', + name='sanction_list_individual', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='sanction_list.sanctionlistindividual'), + ), + migrations.AddField( + model_name='ticketsystemflaggingdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='system_flagging_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketsensitivedetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sensitive_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='ticketsensitivedetails', + name='individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sensitive_ticket_details', to='household.individual'), + ), + migrations.AddField( + model_name='ticketsensitivedetails', + name='payment_content_type', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), + ), + migrations.AddField( + model_name='ticketsensitivedetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='sensitive_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketreferraldetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='referral_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='ticketreferraldetails', + name='individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='referral_ticket_details', to='household.individual'), + ), + migrations.AddField( + model_name='ticketreferraldetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='referral_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketpositivefeedbackdetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='positive_feedback_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='ticketpositivefeedbackdetails', + name='individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='positive_feedback_ticket_details', to='household.individual'), + ), + migrations.AddField( + model_name='ticketpositivefeedbackdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='positive_feedback_ticket_details', to='grievance.grievanceticket'), + ), + ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0003_migration.py b/src/hct_mis_api/apps/grievance/migrations/0003_migration.py new file mode 100644 index 0000000000..595b772dc5 --- /dev/null +++ b/src/hct_mis_api/apps/grievance/migrations/0003_migration.py @@ -0,0 +1,256 @@ +# Generated by Django 3.2.25 on 2024-11-07 12:18 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('contenttypes', '0002_remove_content_type_name'), + ('grievance', '0002_migration'), + ('program', '0001_migration'), + ('core', '0002_migration'), + ('payment', '0001_migration'), + ('account', '0002_migration'), + ('geo', '0001_migration'), + ('household', '0002_migration'), + ('registration_data', '0001_migration'), + ] + + operations = [ + migrations.AddField( + model_name='ticketpaymentverificationdetails', + name='payment_verification', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ticket_detail', to='payment.paymentverification'), + ), + migrations.AddField( + model_name='ticketpaymentverificationdetails', + name='payment_verifications', + field=models.ManyToManyField(related_name='ticket_details', to='payment.PaymentVerification'), + ), + migrations.AddField( + model_name='ticketpaymentverificationdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='payment_verification_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketnote', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ticket_notes', to=settings.AUTH_USER_MODEL, verbose_name='Created by'), + ), + migrations.AddField( + model_name='ticketnote', + name='ticket', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_notes', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketnegativefeedbackdetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='negative_feedback_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='ticketnegativefeedbackdetails', + name='individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='negative_feedback_ticket_details', to='household.individual'), + ), + migrations.AddField( + model_name='ticketnegativefeedbackdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='negative_feedback_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketneedsadjudicationdetails', + name='golden_records_individual', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_golden_records', to='household.individual'), + ), + migrations.AddField( + model_name='ticketneedsadjudicationdetails', + name='possible_duplicate', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='household.individual'), + ), + migrations.AddField( + model_name='ticketneedsadjudicationdetails', + name='possible_duplicates', + field=models.ManyToManyField(related_name='ticket_duplicates', to='household.Individual'), + ), + migrations.AddField( + model_name='ticketneedsadjudicationdetails', + name='selected_distinct', + field=models.ManyToManyField(related_name='selected_distinct', to='household.Individual'), + ), + migrations.AddField( + model_name='ticketneedsadjudicationdetails', + name='selected_individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='household.individual'), + ), + migrations.AddField( + model_name='ticketneedsadjudicationdetails', + name='selected_individuals', + field=models.ManyToManyField(related_name='ticket_selected', to='household.Individual'), + ), + migrations.AddField( + model_name='ticketneedsadjudicationdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='needs_adjudication_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketindividualdataupdatedetails', + name='individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='individual_data_update_ticket_details', to='household.individual'), + ), + migrations.AddField( + model_name='ticketindividualdataupdatedetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='individual_data_update_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='tickethouseholddataupdatedetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='household_data_update_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='tickethouseholddataupdatedetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='household_data_update_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketdeleteindividualdetails', + name='individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='delete_individual_ticket_details', to='household.individual'), + ), + migrations.AddField( + model_name='ticketdeleteindividualdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='delete_individual_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketdeletehouseholddetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='delete_household_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='ticketdeletehouseholddetails', + name='reason_household', + field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='household.household'), + ), + migrations.AddField( + model_name='ticketdeletehouseholddetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='delete_household_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketcomplaintdetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='complaint_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='ticketcomplaintdetails', + name='individual', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='complaint_ticket_details', to='household.individual'), + ), + migrations.AddField( + model_name='ticketcomplaintdetails', + name='payment_content_type', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), + ), + migrations.AddField( + model_name='ticketcomplaintdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='complaint_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='ticketaddindividualdetails', + name='household', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='add_individual_ticket_details', to='household.household'), + ), + migrations.AddField( + model_name='ticketaddindividualdetails', + name='ticket', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='add_individual_ticket_details', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='grievanceticketthrough', + name='linked_ticket', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='grievance_tickets_through_linked', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='grievanceticketthrough', + name='main_ticket', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='grievance_tickets_through_main', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='grievanceticket', + name='admin2', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='geo.area'), + ), + migrations.AddField( + model_name='grievanceticket', + name='assigned_to', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assigned_tickets', to=settings.AUTH_USER_MODEL, verbose_name='Assigned to'), + ), + migrations.AddField( + model_name='grievanceticket', + name='business_area', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to='core.businessarea'), + ), + migrations.AddField( + model_name='grievanceticket', + name='copied_from', + field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='grievance.grievanceticket'), + ), + migrations.AddField( + model_name='grievanceticket', + name='created_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_tickets', to=settings.AUTH_USER_MODEL, verbose_name='Created by'), + ), + migrations.AddField( + model_name='grievanceticket', + name='linked_tickets', + field=models.ManyToManyField(related_name='_grievance_grievanceticket_linked_tickets_+', through='grievance.GrievanceTicketThrough', to='grievance.GrievanceTicket'), + ), + migrations.AddField( + model_name='grievanceticket', + name='partner', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='account.partner'), + ), + migrations.AddField( + model_name='grievanceticket', + name='programs', + field=models.ManyToManyField(blank=True, related_name='grievance_tickets', to='program.Program'), + ), + migrations.AddField( + model_name='grievanceticket', + name='registration_data_import', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='registration_data.registrationdataimport'), + ), + migrations.AddField( + model_name='grievancedocument', + name='created_by', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='grievancedocument', + name='grievance_ticket', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='support_documents', to='grievance.grievanceticket'), + ), + migrations.AddConstraint( + model_name='grievanceticketthrough', + constraint=models.UniqueConstraint(fields=('main_ticket', 'linked_ticket'), name='unique_main_linked_ticket'), + ), + migrations.RunSQL( + sql='ALTER TABLE grievance_grievanceticket ADD unicef_id_index SERIAL', + reverse_sql='ALTER TABLE grievance_grievanceticket DROP unicef_id_index', + ), + migrations.RunSQL( + sql="\n CREATE OR REPLACE FUNCTION create_gt_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('GRV-%s', trim(to_char(NEW.unicef_id_index,'0000000')));\n return NEW;\n end\n $$;\n ", + ), + migrations.RunSQL(sql=""" + CREATE TRIGGER create_gt_unicef_id + BEFORE INSERT ON grievance_grievanceticket FOR EACH ROW EXECUTE PROCEDURE create_gt_unicef_id(); + """), + ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0035_migration_squashed_0049_migration.py b/src/hct_mis_api/apps/grievance/migrations/0035_migration_squashed_0049_migration.py deleted file mode 100644 index 7b4ebc3cbd..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0035_migration_squashed_0049_migration.py +++ /dev/null @@ -1,229 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 13:05 - -from decimal import Decimal -from typing import List, Dict, Any, Tuple - -import django.core.validators -from django.db import migrations, models -import django.db.migrations.operations.special -import django.db.models.deletion -import model_utils.fields -import uuid - - -def _get_min_max_score(golden_records: List[Dict[str, Any]]) -> Tuple[float, float]: - items = [item.get("score", 0.0) for item in golden_records] - - return min(items, default=0.0), max(items, default=0.0) - - -def update_min_max_score(apps, schema_editor): - TicketNeedsAdjudicationDetails = apps.get_model("grievance", "TicketNeedsAdjudicationDetails") - - db_alias = schema_editor.connection.alias - index = 0 - for ticket in TicketNeedsAdjudicationDetails.objects.using(db_alias).only("extra_data").iterator(1000): - index += 1 - if index % 100 == 0: - print(index) - score_min, score_max = _get_min_max_score(ticket.extra_data.get("golden_records", [])) - ticket.score_min = score_min - ticket.score_max = score_max - ticket.save(update_fields=("score_min", "score_max")) - -def set_household_unicef_id(apps, schema_editor): - GrievanceTicket = apps.get_model("grievance", "GrievanceTicket") - start = 10_000 - grievance_tickets = [] - i, count = 0, GrievanceTicket.objects.all().count() // start + 1 - while i <= count: - batch = GrievanceTicket.objects.all().order_by("created_at")[start * i: start * (i + 1)] - for grv in batch: - ticket_details = getattr(grv, "ticket_details", None) - if ticket_details: - household = getattr(ticket_details, "household", None) - if household: - grv.household_unicef_id = ticket_details.household.unicef_id - grievance_tickets.append(grv) - GrievanceTicket.objects.bulk_update(grievance_tickets, ["household_unicef_id"]) - grievance_tickets = [] - i += 1 - - -def delete_household_unicef_id(apps, schema_editor): - GrievanceTicket = apps.get_model("grievance", "GrievanceTicket") - start = 10_000 - grievance_tickets = [] - i, count = 0, GrievanceTicket.objects.all().count() // start + 1 - while i <= count: - batch = GrievanceTicket.objects.all().order_by("created_at")[start * i: start * (i + 1)] - for grv in batch: - grv.household_unicef_id = None - grievance_tickets.append(grv) - GrievanceTicket.objects.bulk_update(grievance_tickets, ["household_unicef_id"]) - grievance_tickets = [] - i += 1 - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0001_migration_squashed_0034_migration'), - ('household', '0111_migration'), - ('payment', '0030_migration_squashed_0051_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='grievanceticket', - name='extras', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='ticketaddindividualdetails', - name='individual_data', - field=models.JSONField(null=True), - ), - migrations.AlterField( - model_name='ticketdeleteindividualdetails', - name='role_reassign_data', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='tickethouseholddataupdatedetails', - name='household_data', - field=models.JSONField(null=True), - ), - migrations.AlterField( - model_name='ticketindividualdataupdatedetails', - name='individual_data', - field=models.JSONField(null=True), - ), - migrations.AlterField( - model_name='ticketindividualdataupdatedetails', - name='role_reassign_data', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='ticketneedsadjudicationdetails', - name='extra_data', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='ticketneedsadjudicationdetails', - name='role_reassign_data', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='ticketsystemflaggingdetails', - name='role_reassign_data', - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name='grievanceticket', - name='category', - field=models.IntegerField(choices=[(2, 'Data Change'), (4, 'Grievance Complaint'), (8, 'Needs Adjudication'), (5, 'Negative Feedback'), (1, 'Payment Verification'), (7, 'Positive Feedback'), (6, 'Referral'), (3, 'Sensitive Grievance'), (9, 'System Flagging')], verbose_name='Category'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='status', - field=models.IntegerField(choices=[(1, 'New'), (2, 'Assigned'), (6, 'Closed'), (5, 'For Approval'), (3, 'In Progress'), (4, 'On Hold')], default=1, verbose_name='Status'), - ), - migrations.CreateModel( - name='TicketDeleteHouseholdDetails', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('role_reassign_data', models.JSONField(default=dict)), - ('approve_status', models.BooleanField(default=False)), - ('household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='delete_household_ticket_details', to='household.household')), - ('ticket', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='delete_household_ticket_details', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='ticketpaymentverificationdetails', - name='approve_status', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='ticketpaymentverificationdetails', - name='new_received_amount', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AddField( - model_name='ticketpaymentverificationdetails', - name='payment_verification', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ticket_detail', to='payment.paymentverification'), - ), - migrations.AddField( - model_name='ticketpaymentverificationdetails', - name='new_status', - field=models.CharField(choices=[('NOT_RECEIVED', 'NOT RECEIVED'), ('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], default=None, max_length=50, null=True), - ), - migrations.AlterField( - model_name='ticketpaymentverificationdetails', - name='payment_verification_status', - field=models.CharField(choices=[('NOT_RECEIVED', 'NOT RECEIVED'), ('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], max_length=50), - ), - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='score_max', - field=models.FloatField(default=0.0), - ), - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='score_min', - field=models.FloatField(default=0.0), - ), - migrations.RunPython(update_min_max_score, migrations.RunPython.noop), - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='is_multiple_duplicates_version', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='possible_duplicates', - field=models.ManyToManyField(related_name='ticket_duplicates', to='household.Individual'), - ), - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='selected_individuals', - field=models.ManyToManyField(related_name='ticket_selected', to='household.Individual'), - ), - migrations.AddField( - model_name='grievanceticket', - name='ignored', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AddField( - model_name='grievanceticket', - name='household_unicef_id', - field=models.CharField(blank=True, max_length=250, null=True), - ), - migrations.AlterField( - model_name='grievanceticket', - name='unicef_id', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_gt_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('GRV-%s', trim(to_char(NEW.unicef_id_index,'0000000')));\n return NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="\n UPDATE grievance_grievanceticket \n SET unicef_id = format('GRV-%s', trim(to_char(unicef_id_index,'0000000')));\n ", - reverse_sql='', - ), - migrations.RunPython(set_household_unicef_id, delete_household_unicef_id), - migrations.RemoveField( - model_name='grievanceticket', - name='admin2', - ), - migrations.RenameField( - model_name='grievanceticket', - old_name='admin2_new', - new_name='admin2', - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0050_migration.py b/src/hct_mis_api/apps/grievance/migrations/0050_migration.py deleted file mode 100644 index cfb90a41ba..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0050_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.13 on 2022-09-01 14:51 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0119_migration'), - ('grievance', '0035_migration_squashed_0049_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='ticketneedsadjudicationdetails', - name='possible_duplicate', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='household.individual'), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0050_migration_squashed_0054_migration.py b/src/hct_mis_api/apps/grievance/migrations/0050_migration_squashed_0054_migration.py deleted file mode 100644 index eb9ce008f8..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0050_migration_squashed_0054_migration.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:15 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - replaces = [('grievance', '0050_migration'), ('grievance', '0051_migration'), ('grievance', '0052_migration'), ('grievance', '0053_migration'), ('grievance', '0054_migration')] - - dependencies = [ - ('household', '0126_migration'), - ('grievance', '0035_migration_squashed_0049_migration'), - ('household', '0119_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='ticketneedsadjudicationdetails', - name='possible_duplicate', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='household.individual'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='grievanceticket', - name='linked_tickets', - field=models.ManyToManyField(related_name='_grievance_grievanceticket_linked_tickets_+', through='grievance.GrievanceTicketThrough', to='grievance.GrievanceTicket'), - ), - migrations.AddConstraint( - model_name='grievanceticketthrough', - constraint=models.UniqueConstraint(fields=('main_ticket', 'linked_ticket'), name='unique_main_linked_ticket'), - ), - migrations.AddField( - model_name='ticketdeletehouseholddetails', - name='reason_household', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='household.household'), - ), - migrations.AlterField( - model_name='grievanceticket', - name='category', - field=models.IntegerField(choices=[(8, 'Needs Adjudication'), (1, 'Payment Verification'), (9, 'System Flagging'), (2, 'Data Change'), (4, 'Grievance Complaint'), (5, 'Negative Feedback'), (7, 'Positive Feedback'), (6, 'Referral'), (3, 'Sensitive Grievance')], verbose_name='Category'), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0051_migration.py b/src/hct_mis_api/apps/grievance/migrations/0051_migration.py deleted file mode 100644 index 85b22b3682..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0051_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-21 09:14 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0050_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='grievanceticket', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0052_migration.py b/src/hct_mis_api/apps/grievance/migrations/0052_migration.py deleted file mode 100644 index 025f5765f7..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0052_migration.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.2.15 on 2022-11-25 10:52 -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("grievance", "0051_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="grievanceticket", - name="linked_tickets", - field=models.ManyToManyField( - related_name="_grievance_grievanceticket_linked_tickets_+", - through="grievance.GrievanceTicketThrough", - to="grievance.GrievanceTicket", - ), - ), - migrations.AddConstraint( - model_name="grievanceticketthrough", - constraint=models.UniqueConstraint( - fields=("main_ticket", "linked_ticket"), name="unique_main_linked_ticket" - ), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0053_migration.py b/src/hct_mis_api/apps/grievance/migrations/0053_migration.py deleted file mode 100644 index c75da57af4..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0053_migration.py +++ /dev/null @@ -1,27 +0,0 @@ -# Generated by Django 3.2.15 on 2022-11-14 13:29 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("household", "0126_migration"), - ("grievance", "0052_migration"), - ] - - operations = [ - migrations.AddField( - model_name="ticketdeletehouseholddetails", - name="reason_household", - field=models.ForeignKey( - blank=True, - default=None, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="household.household", - ), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0054_migration.py b/src/hct_mis_api/apps/grievance/migrations/0054_migration.py deleted file mode 100644 index c5823c2505..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0054_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2023-01-12 18:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0053_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='grievanceticket', - name='category', - field=models.IntegerField(choices=[(8, 'Needs Adjudication'), (1, 'Payment Verification'), (9, 'System Flagging'), (2, 'Data Change'), (4, 'Grievance Complaint'), (5, 'Negative Feedback'), (7, 'Positive Feedback'), (6, 'Referral'), (3, 'Sensitive Grievance')], verbose_name='Category'), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0055_migration_squashed_0061_migration.py b/src/hct_mis_api/apps/grievance/migrations/0055_migration_squashed_0061_migration.py deleted file mode 100644 index 095b95db1a..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0055_migration_squashed_0061_migration.py +++ /dev/null @@ -1,211 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-28 13:30 -from django.contrib.contenttypes.models import ContentType -from decimal import Decimal -from django.conf import settings -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -def do_ticket_complaints_migration(apps, schema_editor): - from hct_mis_api.apps.payment.models import PaymentRecord - - ticket_complaint_details = apps.get_model("grievance", "TicketComplaintDetails") - start = 1_000 - tickets_to_update = [] - i, count = 0, ticket_complaint_details.objects.all().count() // start + 1 - - while i <= count: - batch = ticket_complaint_details.objects.all().order_by("created_at")[start * i: start * (i + 1)] - for ticket in batch: - payment_record = getattr(ticket, "payment_record", None) - if payment_record: - payment_record_id = payment_record.id - ticket.payment_object_id = payment_record_id - ticket.payment_content_type_id = ContentType.objects.get_for_model(PaymentRecord).id - ticket.payment_record_id = None - tickets_to_update.append(ticket) - - ticket_complaint_details.objects.bulk_update( - tickets_to_update, - ["payment_record_id", "payment_object_id", "payment_content_type_id"] - ) - tickets_to_update = [] - i += 1 - - -def undo_ticket_complaints_migration(apps, schema_editor): - ticket_complaint_details = apps.get_model("grievance", "TicketComplaintDetails") - start = 1_000 - tickets_to_update = [] - i, count = 0, ticket_complaint_details.objects.all().count() // start + 1 - - while i <= count: - batch = ticket_complaint_details.objects.all().order_by("created_at")[start * i: start * (i + 1)] - for ticket in batch: - ticket.payment_record_id = ticket.payment_object_id - ticket.payment_object_id = None - ticket.payment_content_type_id = None - tickets_to_update.append(ticket) - - ticket_complaint_details.objects.bulk_update( - tickets_to_update, - ["payment_record_id", "payment_object_id", "payment_content_type_id"] - ) - tickets_to_update = [] - i += 1 - - -def do_ticket_sensitive_migration(apps, schema_editor): - from hct_mis_api.apps.payment.models import PaymentRecord - - ticket_sensitive_details = apps.get_model("grievance", "TicketSensitiveDetails") - start = 1_000 - tickets_to_update = [] - i, count = 0, ticket_sensitive_details.objects.all().count() // start + 1 - - while i <= count: - batch = ticket_sensitive_details.objects.all().order_by("created_at")[start * i: start * (i + 1)] - for ticket in batch: - payment_record = getattr(ticket, "payment_record", None) - if payment_record: - payment_record_id = payment_record.id - ticket.payment_object_id = payment_record_id - ticket.payment_content_type_id = ContentType.objects.get_for_model(PaymentRecord).id - ticket.payment_record_id = None - tickets_to_update.append(ticket) - - ticket_sensitive_details.objects.bulk_update( - tickets_to_update, - ["payment_record_id", "payment_object_id", "payment_content_type_id"] - ) - tickets_to_update = [] - i += 1 - - -def undo_ticket_sensitive_migration(apps, schema_editor): - ticket_sensitive_details = apps.get_model("grievance", "TicketSensitiveDetails") - start = 1_000 - tickets_to_update = [] - i, count = 0, ticket_sensitive_details.objects.all().count() // start + 1 - - while i <= count: - batch = ticket_sensitive_details.objects.all().order_by("created_at")[start * i: start * (i + 1)] - for ticket in batch: - ticket.payment_record_id = ticket.payment_object_id - ticket.payment_object_id = None - ticket.payment_content_type_id = None - tickets_to_update.append(ticket) - - ticket_sensitive_details.objects.bulk_update( - tickets_to_update, - ["payment_record_id", "payment_object_id", "payment_content_type_id"] - ) - tickets_to_update = [] - i += 1 - - -class Migration(migrations.Migration): - replaces = [('grievance', '0055_migration'), ('grievance', '0056_migration'), ('grievance', '0057_migration'), - ('grievance', '0058_migration'), ('grievance', '0059_migration'), ('grievance', '0060_migration'), - ('grievance', '0061_migration')] - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - ('grievance', '0054_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('account', '0042_migration_squashed_0050_migration'), - ('program', '0035_migration'), - ('household', '0147_migration'), - ] - - operations = [ - migrations.AddField( - model_name='ticketpaymentverificationdetails', - name='old_received_amount', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='grievanceticket', - name='household_unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=250, null=True), - ), - migrations.AddField( - model_name='ticketcomplaintdetails', - name='payment_content_type', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), - ), - migrations.AddField( - model_name='ticketcomplaintdetails', - name='payment_object_id', - field=models.UUIDField(null=True), - ), - migrations.RunPython(do_ticket_complaints_migration, undo_ticket_complaints_migration,), - migrations.RemoveField( - model_name='ticketcomplaintdetails', - name='payment_record', - ), - migrations.AddField( - model_name='ticketsensitivedetails', - name='payment_content_type', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), - ), - migrations.AddField( - model_name='ticketsensitivedetails', - name='payment_object_id', - field=models.UUIDField(null=True), - ), - migrations.RunPython(do_ticket_sensitive_migration, undo_ticket_sensitive_migration), - migrations.RemoveField( - model_name='ticketsensitivedetails', - name='payment_record', - ), - migrations.AlterField( - model_name='ticketneedsadjudicationdetails', - name='golden_records_individual', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_golden_records', to='household.individual'), - ), - migrations.AddField( - model_name='grievanceticket', - name='comments', - field=models.TextField(blank=True, null=True), - ), - migrations.AddField( - model_name='grievanceticket', - name='partner', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='account.partner'), - ), - migrations.AddField( - model_name='grievanceticket', - name='priority', - field=models.IntegerField(choices=[(0, 'Not set'), (1, 'High'), (2, 'Medium'), (3, 'Low')], default=0, verbose_name='Priority'), - ), - migrations.AddField( - model_name='grievanceticket', - name='programme', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), - ), - migrations.AddField( - model_name='grievanceticket', - name='urgency', - field=models.IntegerField(choices=[(0, 'Not set'), (1, 'Very urgent'), (2, 'Urgent'), (3, 'Not urgent')], default=0, verbose_name='Urgency'), - ), - migrations.CreateModel( - name='GrievanceDocument', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=100, null=True)), - ('file', models.FileField(blank=True, null=True, upload_to='')), - ('file_size', models.IntegerField(null=True)), - ('content_type', models.CharField(max_length=100)), - ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), - ('grievance_ticket', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='support_documents', to='grievance.grievanceticket')), - ], - options={ - 'abstract': False, - }, - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0062_migration.py b/src/hct_mis_api/apps/grievance/migrations/0062_migration.py deleted file mode 100644 index 67bf7671be..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0062_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-21 10:45 - -from django.db import migrations - -def update_status_for_not_assigned_tickets(apps, schema_editor): - from hct_mis_api.apps.grievance.models import GrievanceTicket - - GrievanceTicket.default_for_migrations_fix.filter(status=GrievanceTicket.STATUS_ASSIGNED, assigned_to=None).update(status=GrievanceTicket.STATUS_NEW) - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0055_migration_squashed_0061_migration'), - ] - - operations = [ - migrations.RunPython(update_status_for_not_assigned_tickets, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0062_migration_squashed_0069_migration.py b/src/hct_mis_api/apps/grievance/migrations/0062_migration_squashed_0069_migration.py deleted file mode 100644 index 1ea4f559c0..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0062_migration_squashed_0069_migration.py +++ /dev/null @@ -1,128 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 06:13 - -from django.db import migrations, models -from django.core.paginator import Paginator -import django.db.models.deletion - - -def update_status_for_not_assigned_tickets(apps, schema_editor): - from hct_mis_api.apps.grievance.models import GrievanceTicket - - GrievanceTicket.default_for_migrations_fix.filter(status=GrievanceTicket.STATUS_ASSIGNED, assigned_to=None).update(status=GrievanceTicket.STATUS_NEW) - - -def migrate_old_tickets_m2m_program(apps, schema_editor): - GrievanceTicket = apps.get_model("grievance", "GrievanceTicket") - - qs_tickets = GrievanceTicket.objects.filter(programme__isnull=False) - - paginator = Paginator(qs_tickets, 500) - for page in paginator.page_range: - for ticket in paginator.page(page).object_list: - ticket.programs.add(ticket.programme) - - -class Migration(migrations.Migration): - - replaces = [('grievance', '0062_migration'), ('grievance', '0063_migration'), ('grievance', '0064_migration'), ('grievance', '0065_migration'), ('grievance', '0066_migration'), ('grievance', '0067_migration'), ('grievance', '0068_migration'), ('grievance', '0069_migration')] - - dependencies = [ - ('grievance', '0055_migration_squashed_0061_migration'), - ('program', '0038_migration'), - ] - - operations = [ - migrations.RunPython(update_status_for_not_assigned_tickets, migrations.RunPython.noop), - migrations.AddField( - model_name='grievanceticket', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='grievance.grievanceticket'), - ), - migrations.AddField( - model_name='grievanceticket', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='grievanceticket', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='grievanceticket', - name='programs', - field=models.ManyToManyField(blank=True, related_name='grievance_tickets', to='program.Program'), - ), - migrations.AlterModelOptions( - name='ticketaddindividualdetails', - options={'verbose_name_plural': 'Ticket Add Individual Details'}, - ), - migrations.AlterModelOptions( - name='ticketcomplaintdetails', - options={'verbose_name_plural': 'Ticket Complaint Details'}, - ), - migrations.AlterModelOptions( - name='ticketdeletehouseholddetails', - options={'verbose_name_plural': 'Ticket Delete Household Details'}, - ), - migrations.AlterModelOptions( - name='ticketdeleteindividualdetails', - options={'verbose_name_plural': 'Ticket Delete Individual Details'}, - ), - migrations.AlterModelOptions( - name='tickethouseholddataupdatedetails', - options={'verbose_name_plural': 'Ticket Household Data Update Details'}, - ), - migrations.AlterModelOptions( - name='ticketindividualdataupdatedetails', - options={'verbose_name_plural': 'Ticket Individual Data Update Details'}, - ), - migrations.AlterModelOptions( - name='ticketneedsadjudicationdetails', - options={'verbose_name_plural': 'Ticket Needs Adjudication Details'}, - ), - migrations.AlterModelOptions( - name='ticketnegativefeedbackdetails', - options={'verbose_name_plural': 'Ticket Negative Feedback Details'}, - ), - migrations.AlterModelOptions( - name='ticketpaymentverificationdetails', - options={'verbose_name_plural': 'Ticket Payment Verification Details'}, - ), - migrations.AlterModelOptions( - name='ticketpositivefeedbackdetails', - options={'verbose_name_plural': 'Ticket Positive Feedback Details'}, - ), - migrations.AlterModelOptions( - name='ticketreferraldetails', - options={'verbose_name_plural': 'Ticket Referral Details'}, - ), - migrations.AlterModelOptions( - name='ticketsensitivedetails', - options={'verbose_name_plural': 'Ticket Sensitive Details'}, - ), - migrations.AlterModelOptions( - name='ticketsystemflaggingdetails', - options={'verbose_name_plural': 'Ticket System Flagging Details'}, - ), - migrations.AddField( - model_name='grievanceticket', - name='migrated_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.RunPython(migrate_old_tickets_m2m_program, migrations.RunPython.noop), - migrations.RemoveField( - model_name='grievanceticket', - name='programme', - ), - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='is_cross_area', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='grievanceticket', - name='is_original', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0063_migration.py b/src/hct_mis_api/apps/grievance/migrations/0063_migration.py deleted file mode 100644 index 76ca054be6..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0063_migration.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-04 16:08 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0038_migration'), - ('grievance', '0062_migration'), - ] - - operations = [ - migrations.AddField( - model_name='grievanceticket', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='grievance.grievanceticket'), - ), - migrations.AddField( - model_name='grievanceticket', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='grievanceticket', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='grievanceticket', - name='programs', - field=models.ManyToManyField(blank=True, related_name='grievance_tickets', to='program.Program'), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0064_migration.py b/src/hct_mis_api/apps/grievance/migrations/0064_migration.py deleted file mode 100644 index c20db1f960..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0064_migration.py +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by Django 3.2.20 on 2023-10-03 12:15 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0063_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='ticketaddindividualdetails', - options={'verbose_name_plural': 'Ticket Add Individual Details'}, - ), - migrations.AlterModelOptions( - name='ticketcomplaintdetails', - options={'verbose_name_plural': 'Ticket Complaint Details'}, - ), - migrations.AlterModelOptions( - name='ticketdeletehouseholddetails', - options={'verbose_name_plural': 'Ticket Delete Household Details'}, - ), - migrations.AlterModelOptions( - name='ticketdeleteindividualdetails', - options={'verbose_name_plural': 'Ticket Delete Individual Details'}, - ), - migrations.AlterModelOptions( - name='tickethouseholddataupdatedetails', - options={'verbose_name_plural': 'Ticket Household Data Update Details'}, - ), - migrations.AlterModelOptions( - name='ticketindividualdataupdatedetails', - options={'verbose_name_plural': 'Ticket Individual Data Update Details'}, - ), - migrations.AlterModelOptions( - name='ticketneedsadjudicationdetails', - options={'verbose_name_plural': 'Ticket Needs Adjudication Details'}, - ), - migrations.AlterModelOptions( - name='ticketnegativefeedbackdetails', - options={'verbose_name_plural': 'Ticket Negative Feedback Details'}, - ), - migrations.AlterModelOptions( - name='ticketpaymentverificationdetails', - options={'verbose_name_plural': 'Ticket Payment Verification Details'}, - ), - migrations.AlterModelOptions( - name='ticketpositivefeedbackdetails', - options={'verbose_name_plural': 'Ticket Positive Feedback Details'}, - ), - migrations.AlterModelOptions( - name='ticketreferraldetails', - options={'verbose_name_plural': 'Ticket Referral Details'}, - ), - migrations.AlterModelOptions( - name='ticketsensitivedetails', - options={'verbose_name_plural': 'Ticket Sensitive Details'}, - ), - migrations.AlterModelOptions( - name='ticketsystemflaggingdetails', - options={'verbose_name_plural': 'Ticket System Flagging Details'}, - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0065_migration.py b/src/hct_mis_api/apps/grievance/migrations/0065_migration.py deleted file mode 100644 index 1109ab4e9b..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0065_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-05 08:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("grievance", "0064_migration"), - ] - - operations = [ - migrations.AddField( - model_name="grievanceticket", - name="migrated_at", - field=models.DateTimeField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0066_migration.py b/src/hct_mis_api/apps/grievance/migrations/0066_migration.py deleted file mode 100644 index 7ddda2de51..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0066_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.19 on 2023-07-05 07:02 -from django.core.paginator import Paginator -from django.db import migrations - - -def migrate_old_tickets_m2m_program(apps, schema_editor): - GrievanceTicket = apps.get_model("grievance", "GrievanceTicket") - - qs_tickets = GrievanceTicket.objects.filter(programme__isnull=False) - - paginator = Paginator(qs_tickets, 500) - for page in paginator.page_range: - for ticket in paginator.page(page).object_list: - ticket.programs.add(ticket.programme) - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0038_migration'), - ('grievance', '0065_migration'), - ] - - operations = [ - migrations.RunPython(migrate_old_tickets_m2m_program, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0067_migration.py b/src/hct_mis_api/apps/grievance/migrations/0067_migration.py deleted file mode 100644 index 8a8ed46f92..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0067_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.19 on 2023-07-05 12:28 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0066_migration'), - - ] - - operations = [ - migrations.RemoveField( - model_name='grievanceticket', - name='programme', - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0068_migration.py b/src/hct_mis_api/apps/grievance/migrations/0068_migration.py deleted file mode 100644 index f5cff82e36..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0068_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-28 12:48 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0067_migration'), - ] - - operations = [ - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='is_cross_area', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0069_migration.py b/src/hct_mis_api/apps/grievance/migrations/0069_migration.py deleted file mode 100644 index 2488e32a87..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0069_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2023-12-12 14:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0068_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='grievanceticket', - name='is_original', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0070_migration.py b/src/hct_mis_api/apps/grievance/migrations/0070_migration.py deleted file mode 100644 index de7ea505c2..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0070_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-26 16:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0062_migration_squashed_0069_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='grievanceticket', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0071_migration.py b/src/hct_mis_api/apps/grievance/migrations/0071_migration.py deleted file mode 100644 index 5d62386c5a..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0071_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-10 11:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0183_migration'), - ('grievance', '0070_migration'), - ] - - operations = [ - migrations.AddField( - model_name='ticketneedsadjudicationdetails', - name='selected_distinct', - field=models.ManyToManyField(related_name='selected_distinct', to='household.Individual'), - ), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0072_migration.py b/src/hct_mis_api/apps/grievance/migrations/0072_migration.py deleted file mode 100644 index d9f814d97e..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0072_migration.py +++ /dev/null @@ -1,34 +0,0 @@ -from django.db import migrations, models -import django.db.models.deletion - - -def migrate_needs_adjudication_tickets_issue_type(apps, schema_editor): - GrievanceTicket = apps.get_model("grievance", "GrievanceTicket") - - CATEGORY_NEEDS_ADJUDICATION = 8 - ISSUE_TYPE_BIOGRAPHICAL_DATA_SIMILARITY = 24 - - GrievanceTicket.objects.filter(category=CATEGORY_NEEDS_ADJUDICATION).update( - issue_type=ISSUE_TYPE_BIOGRAPHICAL_DATA_SIMILARITY - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("registration_data", "0038_migration"), - ("grievance", "0071_migration"), - ] - - operations = [ - migrations.AddField( - model_name="ticketneedsadjudicationdetails", - name="dedup_engine_similarity_pair", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="registration_data.deduplicationenginesimilaritypair", - ), - ), - migrations.RunPython(migrate_needs_adjudication_tickets_issue_type, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/grievance/migrations/0073_migration.py b/src/hct_mis_api/apps/grievance/migrations/0073_migration.py deleted file mode 100644 index 568caaf704..0000000000 --- a/src/hct_mis_api/apps/grievance/migrations/0073_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-25 17:16 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('grievance', '0072_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='ticketneedsadjudicationdetails', - name='dedup_engine_similarity_pair', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0001_migration.py b/src/hct_mis_api/apps/household/migrations/0001_migration.py index 2635a89182..c12db92974 100644 --- a/src/hct_mis_api/apps/household/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/household/migrations/0001_migration.py @@ -1,12 +1,18 @@ -# Generated by Django 2.2.8 on 2020-04-29 08:18 +# Generated by Django 3.2.25 on 2024-11-07 12:18 +import concurrency.fields import django.contrib.gis.db.models.fields -import django.contrib.postgres.fields.jsonb +import django.contrib.postgres.fields +import django.contrib.postgres.fields.citext +import django.contrib.postgres.search import django.core.validators from django.db import migrations, models import django.db.models.deletion -import django_countries.fields +import django.utils.timezone +import hct_mis_api.apps.core.utils +import hct_mis_api.apps.utils.models import model_utils.fields +import multiselectfield.db.fields import phonenumber_field.modelfields import sorl.thumbnail.fields import uuid @@ -16,43 +22,94 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ("core", "0001_migration"), - ("registration_data", "0001_migration"), + ("core", "0002_migration"), + ("program", "0001_migration"), ] operations = [ + migrations.RunSQL( + """ + create or replace function check_unique_document_for_individual(uuid, boolean) + returns boolean + language plpgsql + immutable + as + $$ + begin + return(select exists(select 1 from household_documenttype where id = $1 and unique_for_individual = $2)); + end; + $$ + """, + migrations.RunSQL.noop, + ), migrations.CreateModel( - name="Agency", + name="BankAccountInfo", fields=[ ( "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ( + "rdi_merge_status", + models.CharField( + choices=[("PENDING", "Pending"), ("MERGED", "Merged")], default="PENDING", max_length=10 ), ), - ("type", models.CharField(max_length=100)), - ("label", models.CharField(max_length=100)), + ("is_original", models.BooleanField(db_index=True, default=False)), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("is_removed", models.BooleanField(db_index=True, default=False)), + ("removed_date", models.DateTimeField(blank=True, null=True)), + ("last_sync_at", models.DateTimeField(blank=True, null=True)), + ("bank_name", models.CharField(max_length=255)), + ("bank_account_number", models.CharField(max_length=64)), + ("debit_card_number", models.CharField(blank=True, default="", max_length=255)), + ("bank_branch_name", models.CharField(blank=True, default="", max_length=255)), + ("account_holder_name", models.CharField(blank=True, default="", max_length=255)), + ("is_migration_handled", models.BooleanField(default=False)), ], + options={ + "abstract": False, + }, ), migrations.CreateModel( name="Document", fields=[ ( "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ( + "rdi_merge_status", + models.CharField( + choices=[("PENDING", "Pending"), ("MERGED", "Merged")], default="PENDING", max_length=10 ), ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("document_number", models.CharField(blank=True, max_length=255)), + ("is_removed", models.BooleanField(default=False)), + ("is_original", models.BooleanField(db_index=True, default=False)), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("last_sync_at", models.DateTimeField(blank=True, null=True)), + ("document_number", models.CharField(blank=True, db_index=True, max_length=255)), ("photo", models.ImageField(blank=True, upload_to="")), + ( + "status", + models.CharField( + choices=[ + ("PENDING", "Pending"), + ("VALID", "Valid"), + ("NEED_INVESTIGATION", "Need Investigation"), + ("INVALID", "Invalid"), + ], + default="PENDING", + max_length=20, + ), + ), + ("cleared", models.BooleanField(default=False)), + ("cleared_date", models.DateTimeField(default=django.utils.timezone.now)), + ("issuance_date", models.DateTimeField(blank=True, null=True)), + ("expiry_date", models.DateTimeField(blank=True, db_index=True, null=True)), + ("is_migration_handled", models.BooleanField(default=False)), ], ), migrations.CreateModel( @@ -60,23 +117,18 @@ class Migration(migrations.Migration): fields=[ ( "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ( - "country", - django_countries.fields.CountryField(blank=True, max_length=2), + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), ("label", models.CharField(max_length=100)), + ("key", models.CharField(max_length=50, unique=True)), + ("is_identity_document", models.BooleanField(default=True)), + ("unique_for_individual", models.BooleanField(default=False)), + ("valid_for_deduplication", models.BooleanField(default=False)), ], options={ - "abstract": False, + "ordering": ["label"], }, ), migrations.CreateModel( @@ -84,15 +136,10 @@ class Migration(migrations.Migration): fields=[ ( "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), ("regex", models.CharField(default=".*", max_length=100)), ], options={ @@ -104,24 +151,15 @@ class Migration(migrations.Migration): fields=[ ( "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), ("card_number", models.CharField(max_length=255)), ( "status", models.CharField( - choices=[ - ("ACTIVE", "Active"), - ("ERRONEOUS", "Erroneous"), - ("CLOSED", "Closed"), - ], + choices=[("ACTIVE", "Active"), ("ERRONEOUS", "Erroneous"), ("CLOSED", "Closed")], default="ACTIVE", max_length=10, ), @@ -130,6 +168,7 @@ class Migration(migrations.Migration): ("current_card_size", models.CharField(max_length=255)), ("card_custodian", models.CharField(max_length=255)), ("service_provider", models.CharField(max_length=255)), + ("is_original", models.BooleanField(db_index=True, default=False)), ], options={ "abstract": False, @@ -140,108 +179,365 @@ class Migration(migrations.Migration): fields=[ ( "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ( + "rdi_merge_status", + models.CharField( + choices=[("PENDING", "Pending"), ("MERGED", "Merged")], default="PENDING", max_length=10 ), ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), + ("is_original", models.BooleanField(db_index=True, default=False)), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("is_removed", models.BooleanField(db_index=True, default=False)), + ("removed_date", models.DateTimeField(blank=True, null=True)), + ("last_sync_at", models.DateTimeField(blank=True, null=True)), + ("version", concurrency.fields.IntegerVersionField(default=0, help_text="record revision number")), + ("unicef_id", models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ("withdrawn", models.BooleanField(db_index=True, default=False)), + ("withdrawn_date", models.DateTimeField(blank=True, db_index=True, null=True)), ( - "consent", + "consent_sign", sorl.thumbnail.fields.ImageField( - upload_to="", - validators=[ - django.core.validators.validate_image_file_extension + blank=True, upload_to="", validators=[django.core.validators.validate_image_file_extension] + ), + ), + ("consent", models.BooleanField(null=True)), + ( + "consent_sharing", + multiselectfield.db.fields.MultiSelectField( + choices=[ + ("", "None"), + ("GOVERNMENT_PARTNER", "Government partners"), + ("HUMANITARIAN_PARTNER", "Humanitarian partners"), + ("PRIVATE_PARTNER", "Private partners"), + ("UNICEF", "UNICEF"), ], + default="", + max_length=63, ), ), ( "residence_status", models.CharField( + blank=True, choices=[ - ("REFUGEE", "Refugee"), - ("MIGRANT", "Migrant"), - ("CITIZEN", "Citizen"), - ("IDP", "IDP"), - ("OTHER", "Other"), + ("", "None"), + ("IDP", "Displaced | Internally Displaced People"), + ("REFUGEE", "Displaced | Refugee / Asylum Seeker"), + ("OTHERS_OF_CONCERN", "Displaced | Others of Concern"), + ("HOST", "Non-displaced | Host"), + ("NON_HOST", "Non-displaced | Non-host"), + ("RETURNEE", "Displaced | Returnee"), ], - max_length=255, + max_length=254, ), ), + ("address", django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=1024)), + ("zip_code", models.CharField(blank=True, max_length=12, null=True)), + ("geopoint", django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)), + ("size", models.PositiveIntegerField(blank=True, db_index=True, null=True)), + ("female_age_group_0_5_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_6_11_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_12_17_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_18_59_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_60_count", models.PositiveIntegerField(default=None, null=True)), + ("pregnant_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_0_5_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_6_11_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_12_17_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_18_59_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_60_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_0_5_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_6_11_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_12_17_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_18_59_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("female_age_group_60_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_0_5_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_6_11_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_12_17_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_18_59_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("male_age_group_60_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("children_count", models.PositiveIntegerField(default=None, null=True)), + ("male_children_count", models.PositiveIntegerField(default=None, null=True)), + ("female_children_count", models.PositiveIntegerField(default=None, null=True)), + ("children_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("male_children_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("female_children_disabled_count", models.PositiveIntegerField(default=None, null=True)), + ("returnee", models.BooleanField(null=True)), + ("flex_fields", models.JSONField(blank=True, default=dict)), + ("first_registration_date", models.DateTimeField()), + ("last_registration_date", models.DateTimeField()), + ("fchild_hoh", models.BooleanField(null=True)), + ("child_hoh", models.BooleanField(null=True)), + ("start", models.DateTimeField(blank=True, null=True)), + ("deviceid", models.CharField(blank=True, default="", max_length=250)), + ("name_enumerator", models.CharField(blank=True, default="", max_length=250)), ( - "country_origin", - django_countries.fields.CountryField(blank=True, max_length=2), - ), - ( - "country", - django_countries.fields.CountryField(blank=True, max_length=2), - ), - ("size", models.PositiveIntegerField()), - ("address", models.CharField(blank=True, max_length=255)), - ( - "geopoint", - django.contrib.gis.db.models.fields.PointField( - blank=True, null=True, srid=4326 + "org_enumerator", + models.CharField( + choices=[("", "None"), ("PARTNER", "Partner"), ("UNICEF", "UNICEF")], default="", max_length=250 ), ), - ("female_age_group_0_5_count", models.PositiveIntegerField(default=0)), - ("female_age_group_6_11_count", models.PositiveIntegerField(default=0)), - ( - "female_age_group_12_17_count", - models.PositiveIntegerField(default=0), - ), - ("female_adults_count", models.PositiveIntegerField(default=0)), - ("pregnant_count", models.PositiveIntegerField(default=0)), - ("male_age_group_0_5_count", models.PositiveIntegerField(default=0)), - ("male_age_group_6_11_count", models.PositiveIntegerField(default=0)), - ("male_age_group_12_17_count", models.PositiveIntegerField(default=0)), - ("male_adults_count", models.PositiveIntegerField(default=0)), + ("org_name_enumerator", models.CharField(blank=True, default="", max_length=250)), + ("village", models.CharField(blank=True, default="", max_length=250)), ( - "female_age_group_0_5_disabled_count", - models.PositiveIntegerField(default=0), - ), - ( - "female_age_group_6_11_disabled_count", - models.PositiveIntegerField(default=0), + "registration_method", + models.CharField( + choices=[ + ("", "None"), + ("COMMUNITY", "Community-level Registration"), + ("HH_REGISTRATION", "Household Registration"), + ], + default="", + max_length=250, + ), ), ( - "female_age_group_12_17_disabled_count", - models.PositiveIntegerField(default=0), + "collect_individual_data", + models.CharField( + choices=[ + ("", "Unknown"), + ("2", "Partial individuals collected"), + ("1", "Full individual collected"), + ("3", "Size only collected"), + ("0", "No individual data"), + ], + default="", + max_length=250, + ), ), ( - "female_adults_disabled_count", - models.PositiveIntegerField(default=0), + "currency", + models.CharField( + choices=[ + ("", "None"), + ("AED", "United Arab Emirates dirham"), + ("AFN", "Afghan afghani"), + ("ALL", "Albanian lek"), + ("AMD", "Armenian dram"), + ("ANG", "Netherlands Antillean guilder"), + ("AOA", "Angolan kwanza"), + ("ARS", "Argentine peso"), + ("AUD", "Australian dollar"), + ("AWG", "Aruban florin"), + ("AZN", "Azerbaijani manat"), + ("BAM", "Bosnia and Herzegovina convertible mark"), + ("BBD", "Barbados dollar"), + ("BDT", "Bangladeshi taka"), + ("BGN", "Bulgarian lev"), + ("BHD", "Bahraini dinar"), + ("BIF", "Burundian franc"), + ("BMD", "Bermudian dollar"), + ("BND", "Brunei dollar"), + ("BOB", "Boliviano"), + ("BOV", "Bolivian Mvdol (funds code)"), + ("BRL", "Brazilian real"), + ("BSD", "Bahamian dollar"), + ("BTN", "Bhutanese ngultrum"), + ("BWP", "Botswana pula"), + ("BYN", "Belarusian ruble"), + ("BZD", "Belize dollar"), + ("CAD", "Canadian dollar"), + ("CDF", "Congolese franc"), + ("CHF", "Swiss franc"), + ("CLP", "Chilean peso"), + ("CNY", "Chinese yuan"), + ("COP", "Colombian peso"), + ("CRC", "Costa Rican colon"), + ("CUC", "Cuban convertible peso"), + ("CUP", "Cuban peso"), + ("CVE", "Cape Verdean escudo"), + ("CZK", "Czech koruna"), + ("DJF", "Djiboutian franc"), + ("DKK", "Danish krone"), + ("DOP", "Dominican peso"), + ("DZD", "Algerian dinar"), + ("EGP", "Egyptian pound"), + ("ERN", "Eritrean nakfa"), + ("ETB", "Ethiopian birr"), + ("EUR", "Euro"), + ("FJD", "Fiji dollar"), + ("FKP", "Falkland Islands pound"), + ("GBP", "Pound sterling"), + ("GEL", "Georgian lari"), + ("GHS", "Ghanaian cedi"), + ("GIP", "Gibraltar pound"), + ("GMD", "Gambian dalasi"), + ("GNF", "Guinean franc"), + ("GTQ", "Guatemalan quetzal"), + ("GYD", "Guyanese dollar"), + ("HKD", "Hong Kong dollar"), + ("HNL", "Honduran lempira"), + ("HRK", "Croatian kuna"), + ("HTG", "Haitian gourde"), + ("HUF", "Hungarian forint"), + ("IDR", "Indonesian rupiah"), + ("ILS", "Israeli new shekel"), + ("INR", "Indian rupee"), + ("IQD", "Iraqi dinar"), + ("IRR", "Iranian rial"), + ("ISK", "Icelandic króna"), + ("JMD", "Jamaican dollar"), + ("JOD", "Jordanian dinar"), + ("JPY", "Japanese yen"), + ("KES", "Kenyan shilling"), + ("KGS", "Kyrgyzstani som"), + ("KHR", "Cambodian riel"), + ("KMF", "Comoro franc"), + ("KPW", "North Korean won"), + ("KRW", "South Korean won"), + ("KWD", "Kuwaiti dinar"), + ("KYD", "Cayman Islands dollar"), + ("KZT", "Kazakhstani tenge"), + ("LAK", "Lao kip"), + ("LBP", "Lebanese pound"), + ("LKR", "Sri Lankan rupee"), + ("LRD", "Liberian dollar"), + ("LSL", "Lesotho loti"), + ("LYD", "Libyan dinar"), + ("MAD", "Moroccan dirham"), + ("MDL", "Moldovan leu"), + ("MGA", "Malagasy ariary"), + ("MKD", "Macedonian denar"), + ("MMK", "Myanmar kyat"), + ("MNT", "Mongolian tögrög"), + ("MOP", "Macanese pataca"), + ("MRU", "Mauritanian ouguiya"), + ("MUR", "Mauritian rupee"), + ("MVR", "Maldivian rufiyaa"), + ("MWK", "Malawian kwacha"), + ("MXN", "Mexican peso"), + ("MYR", "Malaysian ringgit"), + ("MZN", "Mozambican metical"), + ("NAD", "Namibian dollar"), + ("NGN", "Nigerian naira"), + ("NIO", "Nicaraguan córdoba"), + ("NOK", "Norwegian krone"), + ("NPR", "Nepalese rupee"), + ("NZD", "New Zealand dollar"), + ("OMR", "Omani rial"), + ("PAB", "Panamanian balboa"), + ("PEN", "Peruvian sol"), + ("PGK", "Papua New Guinean kina"), + ("PHP", "Philippine peso"), + ("PKR", "Pakistani rupee"), + ("PLN", "Polish złoty"), + ("PYG", "Paraguayan guaraní"), + ("QAR", "Qatari riyal"), + ("RON", "Romanian leu"), + ("RSD", "Serbian dinar"), + ("RUB", "Russian ruble"), + ("RWF", "Rwandan franc"), + ("SAR", "Saudi riyal"), + ("SBD", "Solomon Islands dollar"), + ("SCR", "Seychelles rupee"), + ("SDG", "Sudanese pound"), + ("SEK", "Swedish krona/kronor"), + ("SGD", "Singapore dollar"), + ("SHP", "Saint Helena pound"), + ("SLL", "Sierra Leonean leone"), + ("SOS", "Somali shilling"), + ("SRD", "Surinamese dollar"), + ("SSP", "South Sudanese pound"), + ("STN", "São Tomé and Príncipe dobra"), + ("SVC", "Salvadoran colón"), + ("SYP", "Syrian pound"), + ("SZL", "Swazi lilangeni"), + ("THB", "Thai baht"), + ("TJS", "Tajikistani somoni"), + ("TMT", "Turkmenistan manat"), + ("TND", "Tunisian dinar"), + ("TOP", "Tongan paʻanga"), + ("TRY", "Turkish lira"), + ("TTD", "Trinidad and Tobago dollar"), + ("TWD", "New Taiwan dollar"), + ("TZS", "Tanzanian shilling"), + ("UAH", "Ukrainian hryvnia"), + ("UGX", "Ugandan shilling"), + ("USD", "United States dollar"), + ("UYU", "Uruguayan peso"), + ("UYW", "Unidad previsional[14]"), + ("UZS", "Uzbekistan som"), + ("VES", "Venezuelan bolívar soberano"), + ("VND", "Vietnamese đồng"), + ("VUV", "Vanuatu vatu"), + ("WST", "Samoan tala"), + ("XAF", "CFA franc BEAC"), + ("XAG", "Silver (one troy ounce)"), + ("XAU", "Gold (one troy ounce)"), + ("XCD", "East Caribbean dollar"), + ("XOF", "CFA franc BCEAO"), + ("XPF", "CFP franc (franc Pacifique)"), + ("YER", "Yemeni rial"), + ("ZAR", "South African rand"), + ("ZMW", "Zambian kwacha"), + ("ZWL", "Zimbabwean dollar"), + ("USDC", "USD Coin"), + ], + default="", + max_length=250, + ), ), + ("unhcr_id", models.CharField(blank=True, db_index=True, default="", max_length=250)), + ("user_fields", models.JSONField(blank=True, default=dict)), ( - "male_age_group_0_5_disabled_count", - models.PositiveIntegerField(default=0), + "detail_id", + models.CharField( + blank=True, help_text="Kobo asset ID, Xlsx row ID, Aurora source ID", max_length=150, null=True + ), ), ( - "male_age_group_6_11_disabled_count", - models.PositiveIntegerField(default=0), + "registration_id", + django.contrib.postgres.fields.citext.CICharField( + blank=True, db_index=True, max_length=100, null=True, verbose_name="Aurora Registration Id" + ), ), ( - "male_age_group_12_17_disabled_count", - models.PositiveIntegerField(default=0), + "program_registration_id", + django.contrib.postgres.fields.citext.CICharField( + blank=True, + db_index=True, + max_length=100, + null=True, + unique=True, + verbose_name="Beneficiary Program Registration Id", + ), ), - ("male_adults_disabled_count", models.PositiveIntegerField(default=0)), - ("returnee", models.BooleanField(default=False, null=True)), ( - "flex_fields", - django.contrib.postgres.fields.jsonb.JSONField(default=dict), + "total_cash_received_usd", + models.DecimalField(blank=True, decimal_places=2, max_digits=64, null=True), ), - ("registration_date", models.DateField(null=True)), + ("total_cash_received", models.DecimalField(blank=True, decimal_places=2, max_digits=64, null=True)), + ("family_id", models.CharField(blank=True, max_length=100, null=True)), + ("origin_unicef_id", models.CharField(blank=True, max_length=100, null=True)), + ("is_migration_handled", models.BooleanField(default=False)), + ("migrated_at", models.DateTimeField(blank=True, null=True)), + ("is_recalculated_group_ages", models.BooleanField(default=False)), ( - "admin_area", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="core.AdminArea", + "collect_type", + models.CharField( + choices=[("STANDARD", "Standard"), ("SINGLE", "Single")], default="STANDARD", max_length=8 ), ), + ("kobo_submission_uuid", models.UUIDField(default=None, null=True)), + ("kobo_submission_time", models.DateTimeField(blank=True, max_length=150, null=True)), + ("enumerator_rec_id", models.PositiveIntegerField(blank=True, null=True)), + ("mis_unicef_id", models.CharField(max_length=255, null=True)), + ("flex_registrations_record_id", models.PositiveIntegerField(blank=True, null=True)), + ], + options={ + "verbose_name": "Household", + "permissions": (("can_withdrawn", "Can withdrawn Household"),), + }, + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), + migrations.CreateModel( + name="HouseholdCollection", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("unicef_id", models.CharField(blank=True, db_index=True, max_length=255, null=True)), ], options={ "abstract": False, @@ -252,128 +548,340 @@ class Migration(migrations.Migration): fields=[ ( "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ( + "rdi_merge_status", + models.CharField( + choices=[("PENDING", "Pending"), ("MERGED", "Merged")], default="PENDING", max_length=10 ), ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), + ("is_original", models.BooleanField(db_index=True, default=False)), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("is_removed", models.BooleanField(db_index=True, default=False)), + ("removed_date", models.DateTimeField(blank=True, null=True)), + ("last_sync_at", models.DateTimeField(blank=True, null=True)), + ("version", concurrency.fields.IntegerVersionField(default=0, help_text="record revision number")), + ("unicef_id", models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ("duplicate", models.BooleanField(db_index=True, default=False)), + ("duplicate_date", models.DateTimeField(blank=True, null=True)), + ("withdrawn", models.BooleanField(db_index=True, default=False)), + ("withdrawn_date", models.DateTimeField(blank=True, null=True)), ("individual_id", models.CharField(blank=True, max_length=255)), ("photo", models.ImageField(blank=True, upload_to="")), ( "full_name", + django.contrib.postgres.fields.citext.CICharField( + db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(2)] + ), + ), + ( + "given_name", + django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=85), + ), + ( + "middle_name", + django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=85), + ), + ( + "family_name", + django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=85), + ), + ( + "sex", + models.CharField(choices=[("MALE", "Male"), ("FEMALE", "Female")], db_index=True, max_length=255), + ), + ("birth_date", models.DateField(db_index=True)), + ("estimated_birth_date", models.BooleanField(default=False)), + ( + "marital_status", models.CharField( - max_length=255, - validators=[ - django.core.validators.MinLengthValidator(3), - django.core.validators.MaxLengthValidator(255), + choices=[ + ("", "None"), + ("DIVORCED", "Divorced"), + ("MARRIED", "Married"), + ("SEPARATED", "Separated"), + ("SINGLE", "Single"), + ("WIDOWED", "Widowed"), ], + db_index=True, + default="", + max_length=255, + ), + ), + ( + "phone_no", + phonenumber_field.modelfields.PhoneNumberField( + blank=True, db_index=True, max_length=128, region=None ), ), - ("given_name", models.CharField(blank=True, max_length=85)), - ("middle_name", models.CharField(blank=True, max_length=85)), - ("family_name", models.CharField(blank=True, max_length=85)), + ("phone_no_valid", models.BooleanField(db_index=True, null=True)), + ( + "phone_no_alternative", + phonenumber_field.modelfields.PhoneNumberField( + blank=True, db_index=True, max_length=128, region=None + ), + ), + ("phone_no_alternative_valid", models.BooleanField(db_index=True, null=True)), + ("email", models.CharField(blank=True, max_length=255)), + ( + "payment_delivery_phone_no", + phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, null=True, region=None), + ), ( "relationship", models.CharField( blank=True, choices=[ - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("HEAD", "Head of household (self)"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("BROTHER_SISTER", "Brother / Sister"), - ("MOTHER_FATHER", "Mother / Father"), + ("UNKNOWN", "Unknown"), ("AUNT_UNCLE", "Aunt / Uncle"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ( - "MOTHERINLAW_FATHERINLAW", - "Mother-in-law / Father-in-law", - ), + ("BROTHER_SISTER", "Brother / Sister"), + ("COUSIN", "Cousin"), ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ( - "SISTERINLAW_BROTHERINLAW", - "Sister-in-law / Brother-in-law", - ), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), + ("GRANDDAUGHER_GRANDSON", "Granddaughter / Grandson"), + ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), + ("HEAD", "Head of household (self)"), + ("MOTHER_FATHER", "Mother / Father"), + ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), ("NEPHEW_NIECE", "Nephew / Niece"), - ("COUSIN", "Cousin"), + ("NON_BENEFICIARY", "Not a Family Member. Can only act as a recipient."), + ("OTHER", "Other"), + ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), + ("SON_DAUGHTER", "Son / Daughter"), + ("WIFE_HUSBAND", "Wife / Husband"), + ("FOSTER_CHILD", "Foster child"), + ("FREE_UNION", "Free union"), ], + help_text="This represents the MEMBER relationship. can be blank\n as well if household is null!", max_length=255, ), ), ( - "role", + "work_status", models.CharField( blank=True, + choices=[("1", "Yes"), ("0", "No"), ("NOT_PROVIDED", "Not provided")], + default="NOT_PROVIDED", + max_length=20, + ), + ), + ("first_registration_date", models.DateField()), + ("last_registration_date", models.DateField()), + ( + "flex_fields", + models.JSONField(blank=True, default=dict, encoder=hct_mis_api.apps.core.utils.FlexFieldsEncoder), + ), + ("user_fields", models.JSONField(blank=True, default=dict)), + ("enrolled_in_nutrition_programme", models.BooleanField(null=True)), + ("administration_of_rutf", models.BooleanField(null=True)), + ( + "deduplication_golden_record_status", + models.CharField( choices=[ - ("PRIMARY", "Primary collector"), - ("ALTERNATE", "Alternate collector"), - ("NO_ROLE", "None"), + ("DUPLICATE", "Duplicate"), + ("NEEDS_ADJUDICATION", "Needs Adjudication"), + ("NOT_PROCESSED", "Not Processed"), + ("POSTPONE", "Postpone"), + ("UNIQUE", "Unique"), ], - max_length=255, + db_index=True, + default="UNIQUE", + max_length=50, ), ), ( - "sex", + "deduplication_batch_status", models.CharField( - choices=[("MALE", "Male"), ("FEMALE", "Female")], max_length=255 + choices=[ + ("DUPLICATE_IN_BATCH", "Duplicate in batch"), + ("NOT_PROCESSED", "Not Processed"), + ("SIMILAR_IN_BATCH", "Similar in batch"), + ("UNIQUE_IN_BATCH", "Unique in batch"), + ], + db_index=True, + default="UNIQUE_IN_BATCH", + max_length=50, ), ), - ("birth_date", models.DateField()), - ("estimated_birth_date", models.BooleanField(default=False)), + ("deduplication_golden_record_results", models.JSONField(blank=True, default=dict)), + ("deduplication_batch_results", models.JSONField(blank=True, default=dict)), + ("imported_individual_id", models.UUIDField(blank=True, null=True)), + ("sanction_list_possible_match", models.BooleanField(db_index=True, default=False)), + ("sanction_list_confirmed_match", models.BooleanField(db_index=True, default=False)), + ("pregnant", models.BooleanField(null=True)), ( - "marital_status", + "disability", models.CharField( + choices=[("disabled", "disabled"), ("not disabled", "not disabled")], + default="not disabled", + max_length=20, + ), + ), + ( + "observed_disability", + multiselectfield.db.fields.MultiSelectField( choices=[ - ("SINGLE", "SINGLE"), - ("MARRIED", "Married"), - ("WIDOW", "Widow"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), + ("NONE", "None"), + ("SEEING", "Difficulty seeing (even if wearing glasses)"), + ("HEARING", "Difficulty hearing (even if using a hearing aid)"), + ("WALKING", "Difficulty walking or climbing steps"), + ("MEMORY", "Difficulty remembering or concentrating"), + ("SELF_CARE", "Difficulty with self care (washing, dressing)"), + ("COMMUNICATING", "Difficulty communicating (e.g understanding or being understood)"), ], - max_length=255, + default="NONE", + max_length=58, ), ), + ("disability_certificate_picture", models.ImageField(blank=True, null=True, upload_to="")), ( - "phone_no", - phonenumber_field.modelfields.PhoneNumberField( - blank=True, max_length=128, region=None + "seeing_disability", + models.CharField( + blank=True, + choices=[ + ("", "None"), + ("LOT_DIFFICULTY", "A lot of difficulty"), + ("CANNOT_DO", "Cannot do at all"), + ("SOME_DIFFICULTY", "Some difficulty"), + ], + max_length=50, ), ), ( - "phone_no_alternative", - phonenumber_field.modelfields.PhoneNumberField( - blank=True, max_length=128, region=None + "hearing_disability", + models.CharField( + blank=True, + choices=[ + ("", "None"), + ("LOT_DIFFICULTY", "A lot of difficulty"), + ("CANNOT_DO", "Cannot do at all"), + ("SOME_DIFFICULTY", "Some difficulty"), + ], + max_length=50, ), ), - ("disability", models.BooleanField(default=False)), ( - "flex_fields", - django.contrib.postgres.fields.jsonb.JSONField(default=dict), + "physical_disability", + models.CharField( + blank=True, + choices=[ + ("", "None"), + ("LOT_DIFFICULTY", "A lot of difficulty"), + ("CANNOT_DO", "Cannot do at all"), + ("SOME_DIFFICULTY", "Some difficulty"), + ], + max_length=50, + ), ), ( - "household", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="household.Household", + "memory_disability", + models.CharField( + blank=True, + choices=[ + ("", "None"), + ("LOT_DIFFICULTY", "A lot of difficulty"), + ("CANNOT_DO", "Cannot do at all"), + ("SOME_DIFFICULTY", "Some difficulty"), + ], + max_length=50, ), ), ( - "registration_data_import", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="registration_data.RegistrationDataImport", + "selfcare_disability", + models.CharField( + blank=True, + choices=[ + ("", "None"), + ("LOT_DIFFICULTY", "A lot of difficulty"), + ("CANNOT_DO", "Cannot do at all"), + ("SOME_DIFFICULTY", "Some difficulty"), + ], + max_length=50, ), ), + ( + "comms_disability", + models.CharField( + blank=True, + choices=[ + ("", "None"), + ("LOT_DIFFICULTY", "A lot of difficulty"), + ("CANNOT_DO", "Cannot do at all"), + ("SOME_DIFFICULTY", "Some difficulty"), + ], + max_length=50, + ), + ), + ("who_answers_phone", models.CharField(blank=True, max_length=150)), + ("who_answers_alt_phone", models.CharField(blank=True, max_length=150)), + ("fchild_hoh", models.BooleanField(default=False)), + ("child_hoh", models.BooleanField(default=False)), + ( + "detail_id", + models.CharField( + blank=True, help_text="Kobo asset ID, Xlsx row ID, Aurora source ID", max_length=150, null=True + ), + ), + ( + "registration_id", + django.contrib.postgres.fields.citext.CICharField( + blank=True, max_length=100, null=True, verbose_name="Aurora Registration Id" + ), + ), + ( + "program_registration_id", + django.contrib.postgres.fields.citext.CICharField( + blank=True, max_length=100, null=True, verbose_name="Beneficiary Program Registration Id" + ), + ), + ( + "preferred_language", + models.CharField( + blank=True, + choices=[ + ("en-us", "English | English"), + ("ar-ae", " | عربيArabic"), + ("cs-cz", "čeština | Czech"), + ("de-de", "Deutsch"), + ("es-es", "Español | Spanish"), + ("fr-fr", "Français | French"), + ("hu-hu", "Magyar | Hungarian"), + ("it-it", "Italiano"), + ("pl-pl", "Polskie | Polish"), + ("pt-pt", "Português"), + ("ro-ro", "Română"), + ("ru-ru", "Русский | Russian"), + ("si-si", "සිංහල | Sinhala"), + ("ta-ta", "தமிழ் | Tamil"), + ("uk-ua", "український | Ukrainian"), + ("hi-hi", "हिंदी"), + ], + max_length=6, + null=True, + ), + ), + ("relationship_confirmed", models.BooleanField(default=False)), + ("age_at_registration", models.PositiveSmallIntegerField(blank=True, null=True)), + ("wallet_name", models.CharField(blank=True, default="", max_length=64)), + ("blockchain_name", models.CharField(blank=True, default="", max_length=64)), + ("wallet_address", models.CharField(blank=True, default="", max_length=128)), + ("origin_unicef_id", models.CharField(blank=True, max_length=100, null=True)), + ("is_migration_handled", models.BooleanField(default=False)), + ("migrated_at", models.DateTimeField(blank=True, null=True)), + ("mis_unicef_id", models.CharField(max_length=255, null=True)), + ("vector_column", django.contrib.postgres.search.SearchVectorField(null=True)), + ], + options={ + "verbose_name": "Individual", + }, + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), + migrations.CreateModel( + name="IndividualCollection", + fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("unicef_id", models.CharField(blank=True, db_index=True, max_length=255, null=True)), ], options={ "abstract": False, @@ -382,72 +890,233 @@ class Migration(migrations.Migration): migrations.CreateModel( name="IndividualIdentity", fields=[ + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", + "created", + model_utils.fields.AutoCreatedField( + default=django.utils.timezone.now, editable=False, verbose_name="created" ), ), - ("number", models.CharField(max_length=255)), ( - "agency", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individual_identities", - to="household.Agency", + "modified", + model_utils.fields.AutoLastModifiedField( + default=django.utils.timezone.now, editable=False, verbose_name="modified" ), ), ( - "individual", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="identities", - to="household.Individual", + "rdi_merge_status", + models.CharField( + choices=[("PENDING", "Pending"), ("MERGED", "Merged")], default="PENDING", max_length=10 ), ), + ("is_removed", models.BooleanField(default=False)), + ("is_original", models.BooleanField(db_index=True, default=False)), + ("number", models.CharField(max_length=255)), + ("is_migration_handled", models.BooleanField(default=False)), ], + options={ + "verbose_name_plural": "Individual Identities", + }, ), migrations.CreateModel( - name="HouseholdIdentity", + name="IndividualRoleInHousehold", fields=[ ( "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ( + "rdi_merge_status", + models.CharField( + choices=[("PENDING", "Pending"), ("MERGED", "Merged")], default="PENDING", max_length=10 ), ), - ("document_number", models.CharField(max_length=255)), + ("is_removed", models.BooleanField(default=False)), + ("is_original", models.BooleanField(db_index=True, default=False)), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("last_sync_at", models.DateTimeField(blank=True, null=True)), ( - "agency", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="households_identities", - to="household.Agency", + "role", + models.CharField( + blank=True, + choices=[ + ("NO_ROLE", "None"), + ("ALTERNATE", "Alternate collector"), + ("PRIMARY", "Primary collector"), + ], + max_length=255, ), ), + ("is_migration_handled", models.BooleanField(default=False)), + ("migrated_at", models.DateTimeField(blank=True, null=True)), + ], + ), + migrations.CreateModel( + name="XlsxUpdateFile", + fields=[ + ( + "id", + model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), + ), + ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), + ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), + ("file", models.FileField(upload_to="")), ( - "household", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="identities", - to="household.Household", + "xlsx_match_columns", + django.contrib.postgres.fields.ArrayField( + base_field=models.CharField(max_length=32), null=True, size=None ), ), + ( + "business_area", + models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="core.businessarea"), + ), + ( + "program", + models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to="program.program"), + ), ], + options={ + "abstract": False, + }, + ), + migrations.RunSQL( + sql="ALTER TABLE household_householdcollection ADD unicef_id_index SERIAL", + ), + migrations.RunSQL( + sql="ALTER TABLE household_individualcollection ADD unicef_id_index SERIAL", + ), + migrations.RunSQL( + sql=""" + CREATE TRIGGER vector_column_trigger + BEFORE INSERT OR UPDATE OF observed_disability, full_name, vector_column + ON household_individual + FOR EACH ROW EXECUTE PROCEDURE + tsvector_update_trigger( + vector_column, 'pg_catalog.english', observed_disability, full_name + ); + + UPDATE household_individual SET vector_column = NULL; + """, + reverse_sql=""" + DROP TRIGGER IF EXISTS vector_column_trigger + ON household_individual; + """, + ), + migrations.RunSQL( + """ + CREATE OR REPLACE FUNCTION generate_unique_program_registration_id() + RETURNS TRIGGER AS $$ + DECLARE + new_id TEXT; + count INT := 0; + BEGIN + -- Check if program_registration_id is empty + IF NEW.program_registration_id IS NULL OR NEW.program_registration_id = '' THEN + NEW.program_registration_id := NULL; -- Convert empty string to NULL + RETURN NEW; -- Do not modify with increasing number + END IF; + new_id := NEW.program_registration_id || '#0'; -- Initial attempt with #0 + LOOP + IF NOT EXISTS (SELECT 1 FROM household_household WHERE program_registration_id = new_id) THEN + EXIT; + END IF; + count := count + 1; + new_id := NEW.program_registration_id || '#' || count; + END LOOP; + NEW.program_registration_id := new_id; + RETURN NEW; + END; + $$ LANGUAGE plpgsql; + + CREATE TRIGGER unique_program_registration_id_trigger + BEFORE INSERT OR UPDATE ON household_household + FOR EACH ROW + EXECUTE FUNCTION generate_unique_program_registration_id(); + """, + reverse_sql=""" + DROP TRIGGER IF EXISTS unique_program_registration_id_trigger ON household_household; + DROP FUNCTION IF EXISTS generate_unique_program_registration_id(); + """, + ), + migrations.RunSQL( + """ + CREATE OR REPLACE FUNCTION create_hhc_unicef_id() RETURNS trigger + LANGUAGE plpgsql + AS $$ + begin + IF NEW.unicef_id IS NULL THEN + NEW.unicef_id := format('HHC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); + END IF; + return NEW; + end + $$; + CREATE TRIGGER create_hhc_unicef_id BEFORE INSERT ON household_householdcollection + FOR EACH ROW EXECUTE PROCEDURE create_hhc_unicef_id(); + """, + reverse_sql=""" + DROP TRIGGER IF EXISTS create_hhc_unicef_id + ON household_householdcollection; + """, + ), + migrations.RunSQL( + """ + CREATE OR REPLACE FUNCTION create_indc_unicef_id() RETURNS trigger + LANGUAGE plpgsql + AS $$ + begin + IF NEW.unicef_id IS NULL THEN + NEW.unicef_id := format('INDC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); + END IF; + return NEW; + end + $$; + CREATE TRIGGER create_indc_unicef_id BEFORE INSERT ON household_individualcollection + FOR EACH ROW EXECUTE PROCEDURE create_indc_unicef_id(); + """, + reverse_sql=""" + DROP TRIGGER IF EXISTS create_indc_unicef_id + ON household_individualcollection; + """, + ), + # Create triggers for unicef_id generation houeshold individual + migrations.RunSQL( + sql="ALTER TABLE household_household ADD unicef_id_index SERIAL", + ), + migrations.RunSQL( + sql="ALTER TABLE household_individual ADD unicef_id_index SERIAL", + ), + migrations.RunSQL( + """ + CREATE OR REPLACE FUNCTION create_hh_unicef_id() RETURNS trigger + LANGUAGE plpgsql + AS $$ + begin + IF NEW.unicef_id IS NULL THEN + NEW.unicef_id := format('HH-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); + END IF; + return NEW; + end + $$; + CREATE TRIGGER create_hh_unicef_id BEFORE INSERT ON household_household FOR EACH ROW EXECUTE PROCEDURE create_hh_unicef_id(); + """, + reverse_sql=migrations.RunSQL.noop, ), - migrations.AddField( - model_name="household", - name="head_of_household", - field=models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, - related_name="heading_household", - to="household.Individual", - ), + migrations.RunSQL( + """ + CREATE OR REPLACE FUNCTION create_ii_unicef_id() RETURNS trigger + LANGUAGE plpgsql + AS $$ + begin + IF NEW.unicef_id IS NULL THEN + NEW.unicef_id := format('IND-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); + END IF; + return NEW; + end + $$; + CREATE TRIGGER create_ii_unicef_id BEFORE INSERT ON household_individual FOR EACH ROW EXECUTE PROCEDURE create_ii_unicef_id(); + """, + reverse_sql=migrations.RunSQL.noop, ), ] diff --git a/src/hct_mis_api/apps/household/migrations/0002_migration.py b/src/hct_mis_api/apps/household/migrations/0002_migration.py index 66c19093f6..859d6b2a6d 100644 --- a/src/hct_mis_api/apps/household/migrations/0002_migration.py +++ b/src/hct_mis_api/apps/household/migrations/0002_migration.py @@ -1,7 +1,10 @@ -# Generated by Django 2.2.8 on 2020-04-29 08:18 +# Generated by Django 3.2.25 on 2024-11-07 12:18 +from django.conf import settings +import django.contrib.postgres.indexes from django.db import migrations, models import django.db.models.deletion +import django.db.models.expressions class Migration(migrations.Migration): @@ -9,12 +12,151 @@ class Migration(migrations.Migration): initial = True dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('program', '0001_migration'), + ('account', '0002_migration'), + ('geo', '0001_migration'), ('household', '0001_migration'), + ('core', '0002_migration'), ('registration_data', '0001_migration'), - ('program', '0001_migration'), ] operations = [ + migrations.AddField( + model_name='xlsxupdatefile', + name='rdi', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='registration_data.registrationdataimport'), + ), + migrations.AddField( + model_name='xlsxupdatefile', + name='uploaded_by', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='individualroleinhousehold', + name='copied_from', + field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individualroleinhousehold'), + ), + migrations.AddField( + model_name='individualroleinhousehold', + name='household', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='individuals_and_roles', to='household.household'), + ), + migrations.AddField( + model_name='individualroleinhousehold', + name='individual', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='households_and_roles', to='household.individual'), + ), + migrations.AddField( + model_name='individualidentity', + name='copied_from', + field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individualidentity'), + ), + migrations.AddField( + model_name='individualidentity', + name='country', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country'), + ), + migrations.AddField( + model_name='individualidentity', + name='individual', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='identities', to='household.individual'), + ), + migrations.AddField( + model_name='individualidentity', + name='partner', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='individual_identities', to='account.partner'), + ), + migrations.AddField( + model_name='individual', + name='business_area', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea'), + ), + migrations.AddField( + model_name='individual', + name='copied_from', + field=models.ForeignKey(blank=True, help_text='If this individual was copied from another individual, this field will contain the individual it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individual'), + ), + migrations.AddField( + model_name='individual', + name='household', + field=models.ForeignKey(blank=True, help_text='This represents the household this person is a MEMBER,\n and if null then relationship is NON_BENEFICIARY and that\n simply means they are a representative of one or more households\n and not a member of one.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='individuals', to='household.household'), + ), + migrations.AddField( + model_name='individual', + name='individual_collection', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='individuals', to='household.individualcollection'), + ), + migrations.AddField( + model_name='individual', + name='program', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='individuals', to='program.program'), + ), + migrations.AddField( + model_name='individual', + name='registration_data_import', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='individuals', to='registration_data.registrationdataimport'), + ), + migrations.AddField( + model_name='household', + name='admin1', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='geo.area'), + ), + migrations.AddField( + model_name='household', + name='admin2', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='geo.area'), + ), + migrations.AddField( + model_name='household', + name='admin3', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='geo.area'), + ), + migrations.AddField( + model_name='household', + name='admin4', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='geo.area'), + ), + migrations.AddField( + model_name='household', + name='admin_area', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='geo.area'), + ), + migrations.AddField( + model_name='household', + name='business_area', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea'), + ), + migrations.AddField( + model_name='household', + name='copied_from', + field=models.ForeignKey(blank=True, help_text='If this household was copied from another household, this field will contain the household it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.household'), + ), + migrations.AddField( + model_name='household', + name='country', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='geo.country'), + ), + migrations.AddField( + model_name='household', + name='country_origin', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='geo.country'), + ), + migrations.AddField( + model_name='household', + name='head_of_household', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='heading_household', to='household.individual'), + ), + migrations.AddField( + model_name='household', + name='household_collection', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='households', to='household.householdcollection'), + ), + migrations.AddField( + model_name='household', + name='program', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), + ), migrations.AddField( model_name='household', name='programs', @@ -23,34 +165,164 @@ class Migration(migrations.Migration): migrations.AddField( model_name='household', name='registration_data_import', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='households', to='registration_data.RegistrationDataImport'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='households', to='registration_data.registrationdataimport'), + ), + migrations.AddField( + model_name='household', + name='representatives', + field=models.ManyToManyField(help_text='This is only used to track collector (primary or secondary) of a household.\n They may still be a HOH of this household or any other household.\n Through model will contain the role (ROLE_CHOICE) they are connected with on.', related_name='represented_households', through='household.IndividualRoleInHousehold', to='household.Individual'), + ), + migrations.AddField( + model_name='household', + name='storage_obj', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.storagefile'), ), migrations.AddField( model_name='entitlementcard', name='household', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='entitlement_cards', to='household.Household'), + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='entitlement_cards', to='household.household'), ), migrations.AddField( model_name='documentvalidator', name='type', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='validators', to='household.DocumentType'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='validators', to='household.documenttype'), + ), + migrations.AddField( + model_name='document', + name='cleared_by', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='document', + name='copied_from', + field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.document'), + ), + migrations.AddField( + model_name='document', + name='country', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country'), ), migrations.AddField( model_name='document', name='individual', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='household.Individual'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='household.individual'), + ), + migrations.AddField( + model_name='document', + name='program', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='program.program'), ), migrations.AddField( model_name='document', name='type', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='household.DocumentType'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='household.documenttype'), ), - migrations.AlterUniqueTogether( - name='individualidentity', - unique_together={('agency', 'number')}, + migrations.AddField( + model_name='bankaccountinfo', + name='copied_from', + field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.bankaccountinfo'), + ), + migrations.AddField( + model_name='bankaccountinfo', + name='individual', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bank_account_info', to='household.individual'), + ), + migrations.CreateModel( + name='PendingBankAccountInfo', + fields=[ + ], + options={ + 'verbose_name': 'Imported Bank Account Info', + 'verbose_name_plural': 'Imported Bank Account Infos', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('household.bankaccountinfo',), + ), + migrations.CreateModel( + name='PendingDocument', + fields=[ + ], + options={ + 'verbose_name': 'Imported Document', + 'verbose_name_plural': 'Imported Documents', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('household.document',), + ), + migrations.CreateModel( + name='PendingHousehold', + fields=[ + ], + options={ + 'verbose_name': 'Imported Household', + 'verbose_name_plural': 'Imported Households', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('household.household',), + ), + migrations.CreateModel( + name='PendingIndividual', + fields=[ + ], + options={ + 'verbose_name': 'Imported Individual', + 'verbose_name_plural': 'Imported Individuals', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('household.individual',), + ), + migrations.CreateModel( + name='PendingIndividualIdentity', + fields=[ + ], + options={ + 'verbose_name': 'Imported Individual Identity', + 'verbose_name_plural': 'Imported Individual Identities', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('household.individualidentity',), + ), + migrations.CreateModel( + name='PendingIndividualRoleInHousehold', + fields=[ + ], + options={ + 'verbose_name': 'Imported Individual Role In Household', + 'verbose_name_plural': 'Imported Individual Roles In Household', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('household.individualroleinhousehold',), ), migrations.AlterUniqueTogether( - name='document', - unique_together={('type', 'document_number')}, + name='individualroleinhousehold', + unique_together={('household', 'individual'), ('role', 'household')}, + ), + migrations.AddIndex( + model_name='individual', + index=django.contrib.postgres.indexes.GinIndex(fields=['vector_column'], name='household_i_vector__4c5828_gin'), + ), + migrations.AddConstraint( + model_name='document', + constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'), django.db.models.expressions.Func(django.db.models.expressions.F('type_id'), django.db.models.expressions.Value(True), function='check_unique_document_for_individual', output_field=models.BooleanField()))), fields=('individual', 'type', 'country', 'program'), name='unique_for_individual_if_not_removed_and_valid'), + ), + migrations.AddConstraint( + model_name='document', + constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'), ('rdi_merge_status', 'MERGED'))), fields=('document_number', 'type', 'country', 'program', 'is_original'), name='unique_if_not_removed_and_valid_for_representations'), + ), + migrations.RunSQL( + "CREATE INDEX IF NOT EXISTS household_household_default_page_index ON public.household_household USING btree (created_at, business_area_id, is_removed) WHERE NOT is_removed;", + "DROP INDEX IF EXISTS household_household_default_page_index;", ), ] diff --git a/src/hct_mis_api/apps/household/migrations/0188_migration.py b/src/hct_mis_api/apps/household/migrations/0003_migration.py similarity index 97% rename from src/hct_mis_api/apps/household/migrations/0188_migration.py rename to src/hct_mis_api/apps/household/migrations/0003_migration.py index d0028206ad..a83ee7d9eb 100644 --- a/src/hct_mis_api/apps/household/migrations/0188_migration.py +++ b/src/hct_mis_api/apps/household/migrations/0003_migration.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): atomic = False dependencies = [ - ('household', '0187_migration'), + ('household', '0002_migration'), ] operations = [ @@ -49,4 +49,4 @@ class Migration(migrations.Migration): ), ] ) - ] + ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/household/migrations/0003_migration_squashed_0086_migration.py b/src/hct_mis_api/apps/household/migrations/0003_migration_squashed_0086_migration.py deleted file mode 100644 index b1e046b172..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0003_migration_squashed_0086_migration.py +++ /dev/null @@ -1,2218 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 20:37 - -import concurrency.fields -import datetime -import django.contrib.postgres.fields.citext -import django.contrib.postgres.fields.jsonb -import django.core.validators -from django.db import migrations, models -import django.db.migrations.operations.special -import django.db.models.deletion -import django.db.models.manager -import django_countries.fields -import model_utils.fields -import multiselectfield.db.fields -import sorl.thumbnail.fields -import uuid -from itertools import zip_longest - -from django.db.models import F -from django.db.models.functions import Concat -from hct_mis_api.apps.core.field_attributes.fields_types import TYPE_DECIMAL -from hct_mis_api.apps.core.utils import serialize_flex_attributes, fix_flex_type_fields - - -def set_document_types(apps, schema_editor): - choices = { - "Driving License": "DRIVERS_LICENSE", - "Birth Certificate": "BIRTH_CERTIFICATE", - "National ID": "NATIONAL_ID", - "National Passport": "NATIONAL_PASSPORT", - } - DocumentType = apps.get_model("household", "DocumentType") - doc_types = DocumentType.objects.all() - for obj in doc_types: - obj.type = choices.get(obj.label) - obj.save() - - -def empty_reverse(apps, schema_editor): - pass - - -def cast_single_flex_field(value): - if isinstance(value, float) and value.is_integer(): - value = int(value) - return str(value) - - -def cast_flex_fields(flex_fields, flex_attrs_name_list): - for key, value in flex_fields.items(): - if key not in flex_attrs_name_list: - continue - flex_fields[key] = cast_single_flex_field(value) - - -def cast_flex_field_values(apps, schema_editor): - Individual = apps.get_model("household", "Individual") - Household = apps.get_model("household", "Household") - FlexibleAttribute = apps.get_model("core", "FlexibleAttribute") - flex_attrs_name_list = FlexibleAttribute.objects.filter( - type="SELECT_ONE" - ).values_list("name", flat=True) - individuals = Individual.objects.all() - households = Household.objects.all() - for individual, household in zip_longest(individuals, households): - if individual is not None: - cast_flex_fields(individual.flex_fields, flex_attrs_name_list) - if household is not None: - cast_flex_fields(household.flex_fields, flex_attrs_name_list) - - Individual.objects.bulk_update(individuals, ("flex_fields",)) - Household.objects.bulk_update(households, ("flex_fields",)) - - -def cast_flex_fields_2nd( - flex_fields, decimals_flex_attrs_name_list, integer_flex_attrs_name_list -): - for key, value in flex_fields.items(): - try: - if key in decimals_flex_attrs_name_list: - flex_fields[key] = float(value) - if key in integer_flex_attrs_name_list: - flex_fields[key] = int(value) - except TypeError: - pass - except ValueError: - pass - - -def cast_flex_field_values_2nd(apps, schema_editor): - Individual = apps.get_model("household", "Individual") - Household = apps.get_model("household", "Household") - FlexibleAttribute = apps.get_model("core", "FlexibleAttribute") - decimals_flex_attrs_name_list = FlexibleAttribute.objects.filter( - type="DECIMAL" - ).values_list("name", flat=True) - integer_flex_attrs_name_list = FlexibleAttribute.objects.filter( - type="INTEGER" - ).values_list("name", flat=True) - individuals = Individual.objects.all() - households = Household.objects.all() - for individual, household in zip_longest(individuals, households): - if individual is not None: - cast_flex_fields_2nd( - individual.flex_fields, - decimals_flex_attrs_name_list, - integer_flex_attrs_name_list, - ) - if household is not None: - cast_flex_fields_2nd( - household.flex_fields, - decimals_flex_attrs_name_list, - integer_flex_attrs_name_list, - ) - - Individual.objects.bulk_update(individuals, ("flex_fields",)) - Household.objects.bulk_update(households, ("flex_fields",)) - - -def round_muac(apps, schema_editor): - Individual = apps.get_model("household", "Individual") - individuals_with_muac = Individual.objects.filter( - flex_fields__muac_i_f__isnull=False - ) - - for individual in individuals_with_muac: - individual.flex_fields["muac_i_f"] = "{:.2f}".format( - float(individual.flex_fields["muac_i_f"]) - ) - - Individual.objects.bulk_update(individuals_with_muac, ("flex_fields",), 1000) - - -from django.db.models import Case, When, Q, Value - -from hct_mis_api.apps.household.models import ( - NOT_DISABLED, - DISABLED, - LOT_DIFFICULTY, - CANNOT_DO, -) - - -def set_disability(apps, schema_editor): - Individual = apps.get_model("household", "Individual") - - Individual.objects.all().update( - disability=Case( - When( - Q(seeing_disability=LOT_DIFFICULTY) | Q(seeing_disability=CANNOT_DO), - then=Value(DISABLED), - ), - When( - Q(hearing_disability=LOT_DIFFICULTY) | Q(hearing_disability=CANNOT_DO), - then=Value(DISABLED), - ), - When( - Q(physical_disability=LOT_DIFFICULTY) - | Q(physical_disability=CANNOT_DO), - then=Value(DISABLED), - ), - When( - Q(memory_disability=LOT_DIFFICULTY) | Q(memory_disability=CANNOT_DO), - then=Value(DISABLED), - ), - When( - Q(selfcare_disability=LOT_DIFFICULTY) - | Q(selfcare_disability=CANNOT_DO), - then=Value(DISABLED), - ), - When( - Q(comms_disability=LOT_DIFFICULTY) | Q(comms_disability=CANNOT_DO), - then=Value(DISABLED), - ), - default=Value(NOT_DISABLED), - ) - ) - - -class Migration(migrations.Migration): - dependencies = [ - ("steficon", "0002_migration"), - ("geo", "0003_migration"), - ("core", "0002_migration_squashed_0006_migration"), - ("household", "0002_migration"), - ] - - operations = [ - migrations.AddField( - model_name="documenttype", - name="type", - field=models.CharField( - blank=True, - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("ELECTORAL_CARD", "Electoral Card"), - ("OTHER", "Other"), - ], - default="", - max_length=50, - ), - preserve_default=False, - ), - migrations.RunPython(set_document_types, empty_reverse), - migrations.AlterField( - model_name="documenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("ELECTORAL_CARD", "Electoral Card"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - migrations.AlterUniqueTogether( - name="documenttype", - unique_together={("country", "type")}, - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField(max_length=100, unique=True), - ), - migrations.AddField( - model_name="household", - name="status", - field=models.CharField( - choices=[("ACTIVE", "Active"), ("INACTIVE", "Inactive")], - default="ACTIVE", - max_length=20, - ), - ), - migrations.AddField( - model_name="individual", - name="status", - field=models.CharField( - choices=[("ACTIVE", "Active"), ("INACTIVE", "Inactive")], - default="ACTIVE", - max_length=20, - ), - ), - migrations.AddField( - model_name="household", - name="last_sync_at", - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name="individual", - name="last_sync_at", - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name="individual", - name="administration_of_rutf", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="individual", - name="enrolled_in_nutrition_programme", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="individual", - name="work_status", - field=models.CharField( - blank=True, - choices=[ - ("YES", "Yes"), - ("NO", "No"), - ("NOT_PROVIDED", "Not provided"), - ], - default="NOT_PROVIDED", - max_length=20, - ), - ), - migrations.RemoveField( - model_name="household", - name="registration_date", - ), - migrations.AddField( - model_name="household", - name="first_registration_date", - field=models.DateField( - default=datetime.datetime(2020, 7, 14, 13, 42, 33, 98340) - ), - preserve_default=False, - ), - migrations.AddField( - model_name="household", - name="last_registration_date", - field=models.DateField( - default=datetime.datetime(2020, 7, 14, 13, 42, 42, 836944) - ), - preserve_default=False, - ), - migrations.AddField( - model_name="individual", - name="first_registration_date", - field=models.DateField( - default=datetime.datetime(2020, 7, 14, 13, 42, 49, 586301) - ), - preserve_default=False, - ), - migrations.AddField( - model_name="individual", - name="last_registration_date", - field=models.DateField( - default=datetime.datetime(2020, 7, 14, 13, 42, 54, 763979) - ), - preserve_default=False, - ), - migrations.AddField( - model_name="household", - name="unicef_id", - field=models.CharField(blank=True, max_length=250), - ), - migrations.AddField( - model_name="individual", - name="unicef_id", - field=models.CharField(blank=True, max_length=250), - ), - migrations.RunSQL( - sql="ALTER TABLE household_household ADD unicef_id_index SERIAL", - ), - migrations.RunSQL( - sql="ALTER TABLE household_individual ADD unicef_id_index SERIAL", - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_hh_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('HH-%s-%s',NEW.country, trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n return NEW;\n end\n $$;\n\n CREATE TRIGGER create_hh_unicef_id BEFORE INSERT ON household_household FOR EACH ROW EXECUTE PROCEDURE create_hh_unicef_id();\n ", - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_ii_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin \n NEW.unicef_id := format('IND-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n return NEW;\n end\n $$;\n\n CREATE TRIGGER create_ii_unicef_id BEFORE INSERT ON household_individual FOR EACH ROW EXECUTE PROCEDURE create_ii_unicef_id();\n ", - ), - migrations.RunSQL( - sql="UPDATE household_household SET unicef_id = format('HH-%s-%s',country ,trim(replace(to_char(unicef_id_index,'0000,0000'),',','.')))", - ), - migrations.RunSQL( - sql="UPDATE household_individual SET unicef_id = format('IND-%s-%s',TO_CHAR(first_registration_date, 'yy'), trim(replace(to_char(unicef_id_index,'0000,0000'),',','.')))", - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_hh_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('HH-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n return NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="UPDATE household_household SET unicef_id = format('HH-%s-%s',TO_CHAR(first_registration_date, 'yy') ,trim(replace(to_char(unicef_id_index,'0000,0000'),',','.')))", - ), - migrations.RemoveField( - model_name="individual", - name="role", - ), - migrations.AlterField( - model_name="individual", - name="household", - field=models.ForeignKey( - blank=True, - help_text="This represents the household this person is a MEMBER,\n and if null then relationship is NON_BENEFICIARY and that\n simply means they are a representative of one or more households\n and not a member of one.", - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="household.household", - ), - ), - migrations.AlterField( - model_name="individual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("HEAD", "Head of household (self)"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("BROTHER_SISTER", "Brother / Sister"), - ("MOTHER_FATHER", "Mother / Father"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ("COUSIN", "Cousin"), - ], - help_text="This represents the MEMBER relationship. can be blank\n as well if household is null!", - max_length=255, - ), - ), - migrations.AlterUniqueTogether( - name="document", - unique_together=set(), - ), - migrations.CreateModel( - name="IndividualRoleInHousehold", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("last_sync_at", models.DateTimeField(null=True)), - ( - "role", - models.CharField( - blank=True, - choices=[ - ("PRIMARY", "Primary collector"), - ("ALTERNATE", "Alternate collector"), - ("NO_ROLE", "None"), - ], - max_length=255, - ), - ), - ( - "household", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals_and_roles", - to="household.household", - ), - ), - ( - "individual", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="households_and_roles", - to="household.individual", - ), - ), - ], - options={ - "unique_together": {("role", "household")}, - }, - ), - migrations.AddField( - model_name="household", - name="representatives", - field=models.ManyToManyField( - help_text="This is only used to track collector (primary or secondary) of a household.\n They may still be a HOH of this household or any other household.\n Through model will contain the role (ROLE_CHOICE) they are connected with on.", - related_name="represented_households", - through="household.IndividualRoleInHousehold", - to="household.Individual", - ), - ), - migrations.AddField( - model_name="household", - name="business_area", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="core.businessarea", - ), - ), - migrations.AlterField( - model_name="household", - name="business_area", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="core.businessarea" - ), - ), - migrations.AlterUniqueTogether( - name="individualidentity", - unique_together=set(), - ), - migrations.AddField( - model_name="individual", - name="sanction_list_possible_match", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="individual", - name="pregnant", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="individual", - name="deduplication_golden_record_results", - field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - migrations.AddField( - model_name="individual", - name="deduplication_golden_record_status", - field=models.CharField( - choices=[ - ("UNIQUE", "Unique"), - ("DUPLICATE", "Duplicate"), - ("NEEDS_ADJUDICATION", "Needs Adjudication"), - ("NOT_PROCESSED", "Not Processed"), - ], - default="UNIQUE", - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="deduplication_batch_results", - field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - migrations.AddField( - model_name="individual", - name="deduplication_batch_status", - field=models.CharField( - choices=[ - ("SIMILAR_IN_BATCH", "Similar in batch"), - ("DUPLICATE_IN_BATCH", "Duplicate in batch"), - ("UNIQUE_IN_BATCH", "Unique in batch"), - ("NOT_PROCESSED", "Not Processed"), - ], - default="UNIQUE_IN_BATCH", - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="imported_individual_id", - field=models.UUIDField(null=True), - ), - migrations.AddField( - model_name="individual", - name="sanction_list_last_check", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.RemoveField( - model_name="household", - name="consent", - ), - migrations.AddField( - model_name="household", - name="child_hoh", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="household", - name="consent_sharing", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("UNICEF", "UNICEF"), - ("HUMANITARIAN_PARTNER", "Humanitarian partners"), - ("PRIVATE_PARTNER", "Private partners"), - ("GOVERNMENT_PARTNER", "Government partners"), - ], - default="UNICEF", - max_length=62, - ), - preserve_default=False, - ), - migrations.AddField( - model_name="household", - name="consent_sign", - field=sorl.thumbnail.fields.ImageField( - blank=True, - upload_to="", - validators=[django.core.validators.validate_image_file_extension], - ), - ), - migrations.AddField( - model_name="household", - name="deviceid", - field=models.CharField(blank=True, max_length=250), - ), - migrations.AddField( - model_name="household", - name="end", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="household", - name="fchild_hoh", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="household", - name="name_enumerator", - field=models.CharField(default="Test", max_length=250), - preserve_default=False, - ), - migrations.AddField( - model_name="household", - name="org_enumerator", - field=models.CharField( - choices=[("UNICEF", "UNICEF"), ("PARTNER", "Partner")], - default="UNICEF", - max_length=250, - ), - preserve_default=False, - ), - migrations.AddField( - model_name="household", - name="org_name_enumerator", - field=models.CharField(default="Test", max_length=250), - preserve_default=False, - ), - migrations.AddField( - model_name="household", - name="start", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="household", - name="village", - field=models.CharField(blank=True, max_length=250), - ), - migrations.AddField( - model_name="individual", - name="comms_disability", - field=models.CharField( - blank=True, - choices=[ - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="hearing_disability", - field=models.CharField( - blank=True, - choices=[ - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="memory_disability", - field=models.CharField( - blank=True, - choices=[ - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="observed_disability", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("NONE", "None"), - ("SEEING", "Difficulty seeing (even if wearing glasses)"), - ("HEARING", "Difficulty hearing (even if using a hearing aid)"), - ("WALKING", "Difficulty walking or climbing steps"), - ("MEMORY", "Difficulty remembering or concentrating"), - ("SELF_CARE", "Difficulty with self care (washing, dressing)"), - ( - "COMMUNICATING", - "Difficulty communicating (e.g understanding or being understood)", - ), - ], - default="NONE", - max_length=58, - ), - ), - migrations.AddField( - model_name="individual", - name="physical_disability", - field=models.CharField( - blank=True, - choices=[ - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="seeing_disability", - field=models.CharField( - blank=True, - choices=[ - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="selfcare_disability", - field=models.CharField( - blank=True, - choices=[ - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="who_answers_alt_phone", - field=models.CharField(blank=True, max_length=150), - ), - migrations.AddField( - model_name="individual", - name="who_answers_phone", - field=models.CharField(blank=True, max_length=150), - ), - migrations.AlterField( - model_name="household", - name="residence_status", - field=models.CharField( - choices=[ - ("IDP", "Displaced | Internally Displaced People"), - ("REFUGEE", "Displaced | Refugee / Asylum Seeker"), - ("OTHERS_OF_CONCERN", "Displaced | Others of Concern"), - ("HOST", "Non-displaced | Host"), - ("NON_HOST", "Non-displaced | Non-host"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="individual", - name="marital_status", - field=models.CharField( - choices=[ - ("SINGLE", "SINGLE"), - ("MARRIED", "Married"), - ("WIDOWED", "Widowed"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - max_length=255, - ), - ), - migrations.AddField( - model_name="household", - name="consent", - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name="individual", - name="marital_status", - field=models.CharField( - choices=[ - ("SINGLE", "Single"), - ("MARRIED", "Married"), - ("WIDOWED", "Widowed"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="individual", - name="registration_data_import", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="registration_data.registrationdataimport", - ), - ), - migrations.AddField( - model_name="document", - name="is_removed", - field=models.BooleanField(default=False), - ), - migrations.AddConstraint( - model_name="document", - constraint=models.UniqueConstraint( - condition=models.Q(("is_removed", False)), - fields=("document_number", "type"), - name="unique_if_not_removed", - ), - ), - migrations.AlterField( - model_name="individual", - name="comms_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "NONE"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="hearing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "NONE"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="memory_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "NONE"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="physical_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "NONE"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="seeing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "NONE"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="selfcare_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "NONE"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("HEAD", "Head of household (self)"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("BROTHER_SISTER", "Brother / Sister"), - ("MOTHER_FATHER", "Mother / Father"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ("COUSIN", "Cousin"), - ], - help_text="This represents the MEMBER relationship. can be blank\n as well if household is null!", - max_length=255, - ), - ), - migrations.AddField( - model_name="individual", - name="business_area", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="core.businessarea", - ), - ), - migrations.AlterField( - model_name="individual", - name="business_area", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, to="core.businessarea" - ), - ), - migrations.AlterModelManagers( - name="individual", - managers=[ - ("active_objects", django.db.models.manager.Manager()), - ], - ), - migrations.AddField( - model_name="individual", - name="is_removed", - field=models.BooleanField(default=False), - ), - migrations.AlterModelManagers( - name="individual", - managers=[], - ), - migrations.AddField( - model_name="household", - name="is_removed", - field=models.BooleanField(default=False), - ), - migrations.RemoveField( - model_name="household", - name="end", - ), - migrations.RemoveField( - model_name="household", - name="female_adults_count", - ), - migrations.RemoveField( - model_name="household", - name="female_adults_disabled_count", - ), - migrations.RemoveField( - model_name="household", - name="male_adults_count", - ), - migrations.RemoveField( - model_name="household", - name="male_adults_disabled_count", - ), - migrations.AddField( - model_name="agency", - name="country", - field=django_countries.fields.CountryField(default="AF", max_length=2), - preserve_default=False, - ), - migrations.AddField( - model_name="household", - name="currency", - field=models.CharField( - choices=[ - ("", "None"), - ("AED", "United Arab Emirates dirham"), - ("AFN", "Afghan afghani"), - ("ALL", "Albanian lek"), - ("AMD", "Armenian dram"), - ("ANG", "Netherlands Antillean guilder"), - ("AOA", "Angolan kwanza"), - ("ARS", "Argentine peso"), - ("AUD", "Australian dollar"), - ("AWG", "Aruban florin"), - ("AZN", "Azerbaijani manat"), - ("BAM", "Bosnia and Herzegovina convertible mark"), - ("BBD", "Barbados dollar"), - ("BDT", "Bangladeshi taka"), - ("BGN", "Bulgarian lev"), - ("BHD", "Bahraini dinar"), - ("BIF", "Burundian franc"), - ("BMD", "Bermudian dollar"), - ("BND", "Brunei dollar"), - ("BOB", "Boliviano"), - ("BOV", "Bolivian Mvdol (funds code)"), - ("BRL", "Brazilian real"), - ("BSD", "Bahamian dollar"), - ("BTN", "Bhutanese ngultrum"), - ("BWP", "Botswana pula"), - ("BYN", "Belarusian ruble"), - ("BZD", "Belize dollar"), - ("CAD", "Canadian dollar"), - ("CDF", "Congolese franc"), - ("CHF", "Swiss franc"), - ("CLP", "Chilean peso"), - ("CNY", "Chinese yuan"), - ("COP", "Colombian peso"), - ("CRC", "Costa Rican colon"), - ("CUC", "Cuban convertible peso"), - ("CUP", "Cuban peso"), - ("CVE", "Cape Verdean escudo"), - ("CZK", "Czech koruna"), - ("DJF", "Djiboutian franc"), - ("DKK", "Danish krone"), - ("DOP", "Dominican peso"), - ("DZD", "Algerian dinar"), - ("EGP", "Egyptian pound"), - ("ERN", "Eritrean nakfa"), - ("ETB", "Ethiopian birr"), - ("EUR", "Euro"), - ("FJD", "Fiji dollar"), - ("FKP", "Falkland Islands pound"), - ("GBP", "Pound sterling"), - ("GEL", "Georgian lari"), - ("GHS", "Ghanaian cedi"), - ("GIP", "Gibraltar pound"), - ("GMD", "Gambian dalasi"), - ("GNF", "Guinean franc"), - ("GTQ", "Guatemalan quetzal"), - ("GYD", "Guyanese dollar"), - ("HKD", "Hong Kong dollar"), - ("HNL", "Honduran lempira"), - ("HRK", "Croatian kuna"), - ("HTG", "Haitian gourde"), - ("HUF", "Hungarian forint"), - ("IDR", "Indonesian rupiah"), - ("ILS", "Israeli new shekel"), - ("INR", "Indian rupee"), - ("IQD", "Iraqi dinar"), - ("IRR", "Iranian rial"), - ("ISK", "Icelandic króna"), - ("JMD", "Jamaican dollar"), - ("JOD", "Jordanian dinar"), - ("JPY", "Japanese yen"), - ("KES", "Kenyan shilling"), - ("KGS", "Kyrgyzstani som"), - ("KHR", "Cambodian riel"), - ("KMF", "Comoro franc"), - ("KPW", "North Korean won"), - ("KRW", "South Korean won"), - ("KWD", "Kuwaiti dinar"), - ("KYD", "Cayman Islands dollar"), - ("KZT", "Kazakhstani tenge"), - ("LAK", "Lao kip"), - ("LBP", "Lebanese pound"), - ("LKR", "Sri Lankan rupee"), - ("LRD", "Liberian dollar"), - ("LSL", "Lesotho loti"), - ("LYD", "Libyan dinar"), - ("MAD", "Moroccan dirham"), - ("MDL", "Moldovan leu"), - ("MGA", "Malagasy ariary"), - ("MKD", "Macedonian denar"), - ("MMK", "Myanmar kyat"), - ("MNT", "Mongolian tögrög"), - ("MOP", "Macanese pataca"), - ("MRU", "Mauritanian ouguiya"), - ("MUR", "Mauritian rupee"), - ("MVR", "Maldivian rufiyaa"), - ("MWK", "Malawian kwacha"), - ("MXN", "Mexican peso"), - ("MYR", "Malaysian ringgit"), - ("MZN", "Mozambican metical"), - ("NAD", "Namibian dollar"), - ("NGN", "Nigerian naira"), - ("NIO", "Nicaraguan córdoba"), - ("NOK", "Norwegian krone"), - ("NPR", "Nepalese rupee"), - ("NZD", "New Zealand dollar"), - ("OMR", "Omani rial"), - ("PAB", "Panamanian balboa"), - ("PEN", "Peruvian sol"), - ("PGK", "Papua New Guinean kina"), - ("PHP", "Philippine peso"), - ("PKR", "Pakistani rupee"), - ("PLN", "Polish złoty"), - ("PYG", "Paraguayan guaraní"), - ("QAR", "Qatari riyal"), - ("RON", "Romanian leu"), - ("RSD", "Serbian dinar"), - ("RUB", "Russian ruble"), - ("RWF", "Rwandan franc"), - ("SAR", "Saudi riyal"), - ("SBD", "Solomon Islands dollar"), - ("SCR", "Seychelles rupee"), - ("SDG", "Sudanese pound"), - ("SEK", "Swedish krona/kronor"), - ("SGD", "Singapore dollar"), - ("SHP", "Saint Helena pound"), - ("SLL", "Sierra Leonean leone"), - ("SOS", "Somali shilling"), - ("SRD", "Surinamese dollar"), - ("SSP", "South Sudanese pound"), - ("STN", "São Tomé and Príncipe dobra"), - ("SVC", "Salvadoran colón"), - ("SYP", "Syrian pound"), - ("SZL", "Swazi lilangeni"), - ("THB", "Thai baht"), - ("TJS", "Tajikistani somoni"), - ("TMT", "Turkmenistan manat"), - ("TND", "Tunisian dinar"), - ("TOP", "Tongan paʻanga"), - ("TRY", "Turkish lira"), - ("TTD", "Trinidad and Tobago dollar"), - ("TWD", "New Taiwan dollar"), - ("TZS", "Tanzanian shilling"), - ("UAH", "Ukrainian hryvnia"), - ("UGX", "Ugandan shilling"), - ("USD", "United States dollar"), - ("UYU", "Uruguayan peso"), - ("UYW", "Unidad previsional[14]"), - ("UZS", "Uzbekistan som"), - ("VES", "Venezuelan bolívar soberano"), - ("VND", "Vietnamese đồng"), - ("VUV", "Vanuatu vatu"), - ("WST", "Samoan tala"), - ("XAF", "CFA franc BEAC"), - ("XAG", "Silver (one troy ounce)"), - ("XAU", "Gold (one troy ounce)"), - ("XCD", "East Caribbean dollar"), - ("XOF", "CFA franc BCEAO"), - ("XPF", "CFP franc (franc Pacifique)"), - ("YER", "Yemeni rial"), - ("ZAR", "South African rand"), - ("ZMW", "Zambian kwacha"), - ("ZWL", "Zimbabwean dollar"), - ], - default="", - max_length=250, - ), - ), - migrations.AddField( - model_name="household", - name="female_age_group_18_59_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="female_age_group_18_59_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="female_age_group_60_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="female_age_group_60_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="male_age_group_18_59_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="male_age_group_18_59_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="male_age_group_60_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="male_age_group_60_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="registration_method", - field=models.CharField( - choices=[ - ("", "None"), - ("HH_REGISTRATION", "Household Registration"), - ("COMMUNITY", "Community-level Registration"), - ], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="documenttype", - name="country", - field=django_countries.fields.CountryField(max_length=2), - ), - migrations.AlterField( - model_name="household", - name="child_hoh", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="household", - name="consent", - field=models.BooleanField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="consent_sharing", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("", "None"), - ("UNICEF", "UNICEF"), - ("HUMANITARIAN_PARTNER", "Humanitarian partners"), - ("PRIVATE_PARTNER", "Private partners"), - ("GOVERNMENT_PARTNER", "Government partners"), - ], - default="", - max_length=63, - ), - ), - migrations.AlterField( - model_name="household", - name="country", - field=django_countries.fields.CountryField(max_length=2), - ), - migrations.AlterField( - model_name="household", - name="fchild_hoh", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="household", - name="female_age_group_0_5_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="female_age_group_0_5_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="female_age_group_12_17_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="female_age_group_12_17_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="female_age_group_6_11_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="female_age_group_6_11_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="first_registration_date", - field=models.DateTimeField(), - ), - migrations.AlterField( - model_name="household", - name="last_registration_date", - field=models.DateTimeField(), - ), - migrations.AlterField( - model_name="household", - name="male_age_group_0_5_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="male_age_group_0_5_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="male_age_group_12_17_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="male_age_group_12_17_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="male_age_group_6_11_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="male_age_group_6_11_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="name_enumerator", - field=models.CharField(blank=True, max_length=250), - ), - migrations.AlterField( - model_name="household", - name="org_enumerator", - field=models.CharField( - choices=[("", "None"), ("UNICEF", "UNICEF"), ("PARTNER", "Partner")], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="household", - name="org_name_enumerator", - field=models.CharField(blank=True, max_length=250), - ), - migrations.AlterField( - model_name="household", - name="pregnant_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="household", - name="residence_status", - field=models.CharField( - choices=[ - ("", "None"), - ("IDP", "Displaced | Internally Displaced People"), - ("REFUGEE", "Displaced | Refugee / Asylum Seeker"), - ("OTHERS_OF_CONCERN", "Displaced | Others of Concern"), - ("HOST", "Non-displaced | Host"), - ("NON_HOST", "Non-displaced | Non-host"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="household", - name="returnee", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="individual", - name="administration_of_rutf", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="individual", - name="comms_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="enrolled_in_nutrition_programme", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="individual", - name="full_name", - field=models.CharField( - max_length=255, - validators=[django.core.validators.MinLengthValidator(2)], - ), - ), - migrations.AlterField( - model_name="individual", - name="hearing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="marital_status", - field=models.CharField( - choices=[ - ("", "None"), - ("SINGLE", "Single"), - ("MARRIED", "Married"), - ("WIDOWED", "Widowed"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - default="", - max_length=255, - ), - ), - migrations.AlterField( - model_name="individual", - name="memory_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="physical_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="pregnant", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="individual", - name="seeing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="selfcare_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="household", - name="collect_individual_data", - field=models.CharField( - choices=[("", "None"), ("1", "Yes"), ("0", "No")], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="individual", - name="work_status", - field=models.CharField( - blank=True, - choices=[("1", "Yes"), ("0", "No"), ("NOT_PROVIDED", "Not provided")], - default="NOT_PROVIDED", - max_length=20, - ), - ), - migrations.AlterField( - model_name="household", - name="child_hoh", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="household", - name="consent", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="household", - name="deviceid", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="household", - name="fchild_hoh", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="household", - name="name_enumerator", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="household", - name="org_name_enumerator", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="household", - name="returnee", - field=models.BooleanField(null=True), - ), - migrations.AddField( - model_name="household", - name="unhcr_id", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="household", - name="unicef_id", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="household", - name="village", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="individual", - name="administration_of_rutf", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="individual", - name="enrolled_in_nutrition_programme", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="individual", - name="pregnant", - field=models.BooleanField(null=True), - ), - migrations.DeleteModel( - name="HouseholdIdentity", - ), - migrations.AddField( - model_name="household", - name="version", - field=concurrency.fields.IntegerVersionField( - default=0, help_text="record revision number" - ), - ), - migrations.AddField( - model_name="individual", - name="version", - field=concurrency.fields.IntegerVersionField( - default=0, help_text="record revision number" - ), - ), - migrations.AlterModelOptions( - name="household", - options={"verbose_name": "Household"}, - ), - migrations.AlterModelOptions( - name="individual", - options={"verbose_name": "Individual"}, - ), - migrations.RemoveField( - model_name="household", - name="status", - ), - migrations.RemoveField( - model_name="individual", - name="status", - ), - migrations.AddField( - model_name="household", - name="removed_date", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="individual", - name="duplicate_date", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="individual", - name="removed_date", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="individual", - name="withdrawn_date", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name="household", - name="flex_fields", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default=dict - ), - ), - migrations.AlterField( - model_name="household", - name="last_sync_at", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name="individual", - name="flex_fields", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default=dict - ), - ), - migrations.AlterField( - model_name="individual", - name="last_sync_at", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name="individualroleinhousehold", - name="last_sync_at", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name="household", - name="address", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, max_length=255 - ), - ), - migrations.AlterField( - model_name="household", - name="unicef_id", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, default="", max_length=250 - ), - ), - migrations.AlterField( - model_name="individual", - name="family_name", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, max_length=85 - ), - ), - migrations.AlterField( - model_name="individual", - name="full_name", - field=django.contrib.postgres.fields.citext.CICharField( - max_length=255, - validators=[django.core.validators.MinLengthValidator(2)], - ), - ), - migrations.AlterField( - model_name="individual", - name="given_name", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, max_length=85 - ), - ), - migrations.AlterField( - model_name="individual", - name="middle_name", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, max_length=85 - ), - ), - migrations.AlterField( - model_name="individual", - name="unicef_id", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, max_length=250 - ), - ), - migrations.AlterField( - model_name="document", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="document", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="documenttype", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="documenttype", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="documentvalidator", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="documentvalidator", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="entitlementcard", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="entitlementcard", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="household", - name="country", - field=django_countries.fields.CountryField(db_index=True, max_length=2), - ), - migrations.AlterField( - model_name="household", - name="country_origin", - field=django_countries.fields.CountryField( - blank=True, db_index=True, max_length=2 - ), - ), - migrations.AlterField( - model_name="household", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="household", - name="size", - field=models.PositiveIntegerField(db_index=True), - ), - migrations.AlterField( - model_name="household", - name="unhcr_id", - field=models.CharField( - blank=True, db_index=True, default="", max_length=250 - ), - ), - migrations.AlterField( - model_name="household", - name="unicef_id", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, db_index=True, default="", max_length=250 - ), - ), - migrations.AlterField( - model_name="household", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AddField( - model_name="household", - name="withdrawn", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AddField( - model_name="household", - name="withdrawn_date", - field=models.DateTimeField(blank=True, db_index=True, null=True), - ), - migrations.AlterField( - model_name="individual", - name="birth_date", - field=models.DateField(db_index=True), - ), - migrations.AlterField( - model_name="individual", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AddField( - model_name="individual", - name="duplicate", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name="individual", - name="family_name", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, db_index=True, max_length=85 - ), - ), - migrations.AlterField( - model_name="individual", - name="full_name", - field=django.contrib.postgres.fields.citext.CICharField( - db_index=True, - max_length=255, - validators=[django.core.validators.MinLengthValidator(2)], - ), - ), - migrations.AlterField( - model_name="individual", - name="given_name", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, db_index=True, max_length=85 - ), - ), - migrations.AlterField( - model_name="individual", - name="marital_status", - field=models.CharField( - choices=[ - ("", "None"), - ("SINGLE", "Single"), - ("MARRIED", "Married"), - ("WIDOWED", "Widowed"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - db_index=True, - default="", - max_length=255, - ), - ), - migrations.AlterField( - model_name="individual", - name="middle_name", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, db_index=True, max_length=85 - ), - ), - migrations.AlterField( - model_name="individual", - name="sex", - field=models.CharField( - choices=[("MALE", "Male"), ("FEMALE", "Female")], - db_index=True, - max_length=255, - ), - ), - migrations.AlterField( - model_name="individual", - name="unicef_id", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, db_index=True, max_length=250 - ), - ), - migrations.AlterField( - model_name="individual", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AddField( - model_name="individual", - name="withdrawn", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name="individualroleinhousehold", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="individualroleinhousehold", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AddField( - model_name="individual", - name="sanction_list_confirmed_match", - field=models.BooleanField(default=False), - ), - migrations.RemoveConstraint( - model_name="document", - name="unique_if_not_removed", - ), - migrations.AddField( - model_name="document", - name="status", - field=models.CharField( - choices=[ - ("PENDING", "Pending"), - ("VALID", "Valid"), - ("INVALID", "Invalid"), - ], - default="VALID", - max_length=20, - ), - ), - migrations.AddConstraint( - model_name="document", - constraint=models.UniqueConstraint( - condition=models.Q( - models.Q(("is_removed", False), ("status", "VALID")) - ), - fields=("document_number", "type"), - name="unique_if_not_removed_and_valid", - ), - ), - migrations.AlterField( - model_name="document", - name="status", - field=models.CharField( - choices=[ - ("PENDING", "Pending"), - ("VALID", "Valid"), - ("INVALID", "Invalid"), - ], - default="PENDING", - max_length=20, - ), - ), - migrations.AlterField( - model_name="document", - name="status", - field=models.CharField( - choices=[ - ("PENDING", "Pending"), - ("VALID", "Valid"), - ("NEED_INVESTIGATION", "Need Investigation"), - ("INVALID", "Invalid"), - ], - default="PENDING", - max_length=20, - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("WFP", "WFP"), ("UNHCR", "UNHCR")], max_length=100 - ), - ), - migrations.AddConstraint( - model_name="agency", - constraint=models.UniqueConstraint( - fields=("type", "country"), name="unique_type_and_country" - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("UNHCR", "UNHCR"), ("WFP", "WFP")], max_length=100 - ), - ), - migrations.AddField( - model_name="individual", - name="user_fields", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default=dict - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("WFP", "WFP"), ("UNHCR", "UNHCR")], max_length=100 - ), - ), - migrations.RunPython(cast_flex_field_values, empty_reverse), - migrations.RunPython(round_muac, empty_reverse), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("UNHCR", "UNHCR"), ("WFP", "WFP")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("WFP", "WFP"), ("UNHCR", "UNHCR")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("UNHCR", "UNHCR"), ("WFP", "WFP")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("WFP", "WFP"), ("UNHCR", "UNHCR")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("UNHCR", "UNHCR"), ("WFP", "WFP")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("WFP", "WFP"), ("UNHCR", "UNHCR")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("UNHCR", "UNHCR"), ("WFP", "WFP")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("WFP", "WFP"), ("UNHCR", "UNHCR")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("UNHCR", "UNHCR"), ("WFP", "WFP")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("WFP", "WFP"), ("UNHCR", "UNHCR")], max_length=100 - ), - ), - migrations.AlterField( - model_name="agency", - name="type", - field=models.CharField( - choices=[("UNHCR", "UNHCR"), ("WFP", "WFP")], max_length=100 - ), - ), - migrations.AlterField( - model_name="individual", - name="disability", - field=models.CharField( - choices=[("disabled", "disabled"), ("not disabled", "not disabled")], - default="not disabled", - max_length=20, - ), - ), - migrations.RunPython(set_disability, empty_reverse), - migrations.RunPython(cast_flex_field_values_2nd, empty_reverse), - migrations.AddField( - model_name="household", - name="user_fields", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default=dict - ), - ), - migrations.AlterField( - model_name="documenttype", - name="country", - field=django_countries.fields.CountryField(default="U", max_length=2), - ), - migrations.AlterModelOptions( - name="agency", - options={"verbose_name_plural": "Agencies"}, - ), - migrations.AddField( - model_name="individual", - name="child_hoh", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="individual", - name="fchild_hoh", - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name="household", - name="admin_area", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="core.adminarea", - ), - ), - migrations.AlterField( - model_name="individual", - name="deduplication_batch_results", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default=dict - ), - ), - migrations.AlterField( - model_name="individual", - name="deduplication_golden_record_results", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default=dict - ), - ), - migrations.AlterField( - model_name="individual", - name="imported_individual_id", - field=models.UUIDField(blank=True, null=True), - ), - migrations.RenameField( - model_name="household", - old_name="female_age_group_0_5_count", - new_name="female_age_group_0_4_count", - ), - migrations.RenameField( - model_name="household", - old_name="female_age_group_0_5_disabled_count", - new_name="female_age_group_0_4_disabled_count", - ), - migrations.RenameField( - model_name="household", - old_name="female_age_group_12_17_count", - new_name="female_age_group_13_17_count", - ), - migrations.RenameField( - model_name="household", - old_name="female_age_group_12_17_disabled_count", - new_name="female_age_group_13_17_disabled_count", - ), - migrations.RenameField( - model_name="household", - old_name="female_age_group_6_11_count", - new_name="female_age_group_5_12_count", - ), - migrations.RenameField( - model_name="household", - old_name="female_age_group_6_11_disabled_count", - new_name="female_age_group_5_12_disabled_count", - ), - migrations.RenameField( - model_name="household", - old_name="male_age_group_0_5_count", - new_name="male_age_group_0_4_count", - ), - migrations.RenameField( - model_name="household", - old_name="male_age_group_0_5_disabled_count", - new_name="male_age_group_0_4_disabled_count", - ), - migrations.RenameField( - model_name="household", - old_name="male_age_group_12_17_count", - new_name="male_age_group_13_17_count", - ), - migrations.RenameField( - model_name="household", - old_name="male_age_group_12_17_disabled_count", - new_name="male_age_group_13_17_disabled_count", - ), - migrations.RenameField( - model_name="household", - old_name="male_age_group_6_11_count", - new_name="male_age_group_5_12_count", - ), - migrations.RenameField( - model_name="household", - old_name="male_age_group_6_11_disabled_count", - new_name="male_age_group_5_12_disabled_count", - ), - migrations.AddField( - model_name="agency", - name="country_new", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - to="geo.country", - ), - ), - migrations.AddField( - model_name="documenttype", - name="country_new", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - to="geo.country", - ), - ), - migrations.AddField( - model_name="household", - name="country_new", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="geo.country", - ), - ), - migrations.AddField( - model_name="household", - name="country_origin_new", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="+", - to="geo.country", - ), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0087_migration.py b/src/hct_mis_api/apps/household/migrations/0087_migration.py deleted file mode 100644 index 2bf0f83059..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0087_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-27 12:29 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0004_migration'), - ('household', '0003_migration_squashed_0086_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='admin_area_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='geo.Area'), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/household/migrations/0087_migration_squashed_0088_migration.py b/src/hct_mis_api/apps/household/migrations/0087_migration_squashed_0088_migration.py deleted file mode 100644 index fbe355082a..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0087_migration_squashed_0088_migration.py +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 06:25 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - replaces = [('household', '0087_migration'), ('household', '0088_migration')] - - dependencies = [ - ('geo', '0004_migration'), - ('household', '0003_migration_squashed_0086_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='admin_area_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='geo.area'), - ), - migrations.AlterModelOptions( - name='household', - options={'permissions': (('can_withdrawn', 'Can withdrawn Household'),), 'verbose_name': 'Household'}, - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_0_4_count', - new_name='female_age_group_0_5_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_0_4_disabled_count', - new_name='female_age_group_0_5_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_13_17_count', - new_name='female_age_group_12_17_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_13_17_disabled_count', - new_name='female_age_group_12_17_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_5_12_count', - new_name='female_age_group_6_11_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_5_12_disabled_count', - new_name='female_age_group_6_11_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_0_4_count', - new_name='male_age_group_0_5_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_0_4_disabled_count', - new_name='male_age_group_0_5_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_13_17_count', - new_name='male_age_group_12_17_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_13_17_disabled_count', - new_name='male_age_group_12_17_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_5_12_count', - new_name='male_age_group_6_11_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_5_12_disabled_count', - new_name='male_age_group_6_11_disabled_count', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0088_migration.py b/src/hct_mis_api/apps/household/migrations/0088_migration.py deleted file mode 100644 index 30d3ef30d8..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0088_migration.py +++ /dev/null @@ -1,77 +0,0 @@ -# Generated by Django 2.2.16 on 2021-10-14 10:26 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0087_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='household', - options={'permissions': (('can_withdrawn', 'Can withdrawn Household'),), 'verbose_name': 'Household'}, - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_0_4_count', - new_name='female_age_group_0_5_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_0_4_disabled_count', - new_name='female_age_group_0_5_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_13_17_count', - new_name='female_age_group_12_17_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_13_17_disabled_count', - new_name='female_age_group_12_17_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_5_12_count', - new_name='female_age_group_6_11_count', - ), - migrations.RenameField( - model_name='household', - old_name='female_age_group_5_12_disabled_count', - new_name='female_age_group_6_11_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_0_4_count', - new_name='male_age_group_0_5_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_0_4_disabled_count', - new_name='male_age_group_0_5_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_13_17_count', - new_name='male_age_group_12_17_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_13_17_disabled_count', - new_name='male_age_group_12_17_disabled_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_5_12_count', - new_name='male_age_group_6_11_count', - ), - migrations.RenameField( - model_name='household', - old_name='male_age_group_5_12_disabled_count', - new_name='male_age_group_6_11_disabled_count', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0089_migration_squashed_0109_migration.py b/src/hct_mis_api/apps/household/migrations/0089_migration_squashed_0109_migration.py deleted file mode 100644 index 83ec90ddee..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0089_migration_squashed_0109_migration.py +++ /dev/null @@ -1,577 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 13:19 - -from django.conf import settings -import django.contrib.postgres.fields -import django.contrib.postgres.fields.citext -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import multiselectfield.db.fields -import phonenumber_field.modelfields -import uuid - - -class Migration(migrations.Migration): - dependencies = [ - ("registration_data", "0018_migration"), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("core", "0042_migration_squashed_0043_migration"), - ("household", "0088_migration"), - ] - - operations = [ - migrations.AddField( - model_name="household", - name="row_id", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name="individual", - name="kobo_asset_id", - field=models.CharField(blank=True, default="", max_length=150), - ), - migrations.AddField( - model_name="individual", - name="row_id", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.CreateModel( - name="XlsxUpdateFile", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("file", models.FileField(upload_to="")), - ( - "xlsx_match_columns", - django.contrib.postgres.fields.ArrayField( - base_field=models.CharField(max_length=32), null=True, size=None - ), - ), - ( - "business_area", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="core.businessarea", - ), - ), - ( - "rdi", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="registration_data.registrationdataimport", - ), - ), - ( - "uploaded_by", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - to=settings.AUTH_USER_MODEL, - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.AlterField( - model_name="agency", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - migrations.AlterField( - model_name="household", - name="flex_fields", - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name="household", - name="user_fields", - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name="individual", - name="deduplication_batch_results", - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name="individual", - name="deduplication_golden_record_results", - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name="individual", - name="flex_fields", - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name="individual", - name="user_fields", - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name="individualidentity", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - migrations.AlterModelOptions( - name="documenttype", - options={"ordering": ["country", "label"]}, - ), - migrations.AlterModelOptions( - name="individualidentity", - options={"verbose_name_plural": "Individual Identities"}, - ), - migrations.AlterField( - model_name="documenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="household", - name="consent_sharing", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("", "None"), - ("GOVERNMENT_PARTNER", "Government partners"), - ("HUMANITARIAN_PARTNER", "Humanitarian partners"), - ("PRIVATE_PARTNER", "Private partners"), - ("UNICEF", "UNICEF"), - ], - default="", - max_length=63, - ), - ), - migrations.AlterField( - model_name="household", - name="org_enumerator", - field=models.CharField( - choices=[("", "None"), ("PARTNER", "Partner"), ("UNICEF", "UNICEF")], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="household", - name="registration_method", - field=models.CharField( - choices=[ - ("", "None"), - ("COMMUNITY", "Community-level Registration"), - ("HH_REGISTRATION", "Household Registration"), - ], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="individual", - name="comms_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="deduplication_batch_status", - field=models.CharField( - choices=[ - ("DUPLICATE_IN_BATCH", "Duplicate in batch"), - ("NOT_PROCESSED", "Not Processed"), - ("SIMILAR_IN_BATCH", "Similar in batch"), - ("UNIQUE_IN_BATCH", "Unique in batch"), - ], - default="UNIQUE_IN_BATCH", - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="deduplication_golden_record_status", - field=models.CharField( - choices=[ - ("DUPLICATE", "Duplicate"), - ("NEEDS_ADJUDICATION", "Needs Adjudication"), - ("NOT_PROCESSED", "Not Processed"), - ("UNIQUE", "Unique"), - ], - default="UNIQUE", - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="hearing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="marital_status", - field=models.CharField( - choices=[ - ("", "None"), - ("DIVORCED", "Divorced"), - ("MARRIED", "Married"), - ("SEPARATED", "Separated"), - ("SINGLE", "Single"), - ("WIDOWED", "Widowed"), - ], - db_index=True, - default="", - max_length=255, - ), - ), - migrations.AlterField( - model_name="individual", - name="memory_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="physical_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ], - help_text="This represents the MEMBER relationship. can be blank\n as well if household is null!", - max_length=255, - ), - ), - migrations.AlterField( - model_name="individual", - name="seeing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individual", - name="selfcare_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="individualroleinhousehold", - name="role", - field=models.CharField( - blank=True, - choices=[ - ("NO_ROLE", "None"), - ("ALTERNATE", "Alternate collector"), - ("PRIMARY", "Primary collector"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="household", - name="residence_status", - field=models.CharField( - choices=[ - ("", "None"), - ("IDP", "Displaced | Internally Displaced People"), - ("REFUGEE", "Displaced | Refugee / Asylum Seeker"), - ("OTHERS_OF_CONCERN", "Displaced | Others of Concern"), - ("HOST", "Non-displaced | Host"), - ("NON_HOST", "Non-displaced | Non-host"), - ], - max_length=254, - ), - ), - migrations.AlterField( - model_name="household", - name="is_removed", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name="individual", - name="is_removed", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name="documenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("TAX_ID", "Tax Number Identification"), - ("RESIDENCE_PERMIT_NO", "Foreigner's Residence Permit"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="individual", - name="disability_certificate_picture", - field=models.ImageField(blank=True, null=True, upload_to=""), - ), - migrations.AlterField( - model_name="individual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("OTHER", "Other"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ], - help_text="This represents the MEMBER relationship. can be blank\n as well if household is null!", - max_length=255, - ), - ), - migrations.CreateModel( - name="BankAccountInfo", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("is_removed", models.BooleanField(db_index=True, default=False)), - ("removed_date", models.DateTimeField(blank=True, null=True)), - ("last_sync_at", models.DateTimeField(blank=True, null=True)), - ("bank_name", models.CharField(max_length=255)), - ("bank_account_number", models.CharField(max_length=64)), - ( - "debit_card_number", - models.CharField(blank=True, default="", max_length=255), - ), - ( - "individual", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="bank_account_info", - to="household.individual", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.RemoveField( - model_name="individual", - name="sanction_list_last_check", - ), - migrations.AlterField( - model_name="individual", - name="sanction_list_confirmed_match", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name="individual", - name="sanction_list_possible_match", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AddField( - model_name="household", - name="children_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="children_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="female_children_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="female_children_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="male_children_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="male_children_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="household", - name="total_cash_received", - field=models.DecimalField( - blank=True, decimal_places=2, max_digits=64, null=True - ), - ), - migrations.AddField( - model_name="household", - name="total_cash_received_usd", - field=models.DecimalField( - blank=True, decimal_places=2, max_digits=64, null=True - ), - ), - migrations.AlterField( - model_name="household", - name="address", - field=django.contrib.postgres.fields.citext.CICharField( - blank=True, max_length=1024 - ), - ), - migrations.AlterField( - model_name="individual", - name="phone_no", - field=phonenumber_field.modelfields.PhoneNumberField( - blank=True, db_index=True, max_length=128, region=None - ), - ), - migrations.AlterField( - model_name="individual", - name="phone_no_alternative", - field=phonenumber_field.modelfields.PhoneNumberField( - blank=True, db_index=True, max_length=128, region=None - ), - ), - migrations.AddField( - model_name="household", - name="kobo_asset_id", - field=models.CharField( - blank=True, db_index=True, default="", max_length=150 - ), - ), - migrations.AlterField( - model_name="individual", - name="deduplication_golden_record_status", - field=models.CharField( - choices=[ - ("DUPLICATE", "Duplicate"), - ("NEEDS_ADJUDICATION", "Needs Adjudication"), - ("NOT_PROCESSED", "Not Processed"), - ("POSTPONE", "Postpone"), - ("UNIQUE", "Unique"), - ], - default="UNIQUE", - max_length=50, - ), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0110_migration.py b/src/hct_mis_api/apps/household/migrations/0110_migration.py deleted file mode 100644 index 2e61b44e77..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0110_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.13 on 2022-07-19 12:07 - -import django.contrib.postgres.indexes -import django.contrib.postgres.search -from django.db import migrations -from django.contrib.postgres.operations import AddIndexConcurrently - - -class Migration(migrations.Migration): - atomic = False - dependencies = [ - ('household', '0089_migration_squashed_0109_migration'), - ] - - operations = [ - migrations.AddField( - model_name='individual', - name='vector_column', - field=django.contrib.postgres.search.SearchVectorField(null=True), - ), - AddIndexConcurrently( - model_name='individual', - index=django.contrib.postgres.indexes.GinIndex(fields=['vector_column'], name='household_i_vector__4c5828_gin'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0111_migration.py b/src/hct_mis_api/apps/household/migrations/0111_migration.py deleted file mode 100644 index bea73b7673..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0111_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.13 on 2022-07-19 12:08 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0110_migration'), - ] - - operations = [ - migrations.RunSQL( - sql=''' - CREATE TRIGGER vector_column_trigger - BEFORE INSERT OR UPDATE OF observed_disability, full_name, vector_column - ON household_individual - FOR EACH ROW EXECUTE PROCEDURE - tsvector_update_trigger( - vector_column, 'pg_catalog.english', observed_disability, full_name - ); - - UPDATE household_individual SET vector_column = NULL; - ''', - - reverse_sql=''' - DROP TRIGGER IF EXISTS vector_column_trigger - ON household_individual; - ''' - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0112_migration.py b/src/hct_mis_api/apps/household/migrations/0112_migration.py deleted file mode 100644 index 70e9b1e6ad..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0112_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.13 on 2022-06-27 15:59 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0111_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='household', - name='country', - ), - migrations.RemoveField( - model_name='household', - name='country_origin', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0113_migration.py b/src/hct_mis_api/apps/household/migrations/0113_migration.py deleted file mode 100644 index c0f6badec1..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0113_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0112_migration'), - ] - - operations = [ - migrations.RenameField( - model_name='household', - old_name='country_new', - new_name='country', - ), - migrations.RenameField( - model_name='household', - old_name='country_origin_new', - new_name='country_origin', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0114_migration.py b/src/hct_mis_api/apps/household/migrations/0114_migration.py deleted file mode 100644 index e5257ae433..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0114_migration.py +++ /dev/null @@ -1,24 +0,0 @@ -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0007_migration'), - ('household', '0113_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='documenttype', - options={'ordering': ['country_new', 'label']}, - ), - migrations.AlterUniqueTogether( - name='documenttype', - unique_together={('country_new', 'type')}, - ), - migrations.RemoveField( - model_name='documenttype', - name='country', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0114_migration_squashed_0119_migration.py b/src/hct_mis_api/apps/household/migrations/0114_migration_squashed_0119_migration.py deleted file mode 100644 index 4ced4f2912..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0114_migration_squashed_0119_migration.py +++ /dev/null @@ -1,75 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - replaces = [('household', '0114_migration'), ('household', '0115_migration'), ('household', '0116_migration'), ('household', '0117_migration'), ('household', '0118_migration'), ('household', '0119_migration')] - - dependencies = [ - ('geo', '0007_migration'), - ('household', '0113_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='documenttype', - options={'ordering': ['country_new', 'label']}, - ), - migrations.AlterUniqueTogether( - name='documenttype', - unique_together={('country_new', 'type')}, - ), - migrations.RemoveField( - model_name='documenttype', - name='country', - ), - migrations.AlterModelOptions( - name='documenttype', - options={'ordering': ['country', 'label']}, - ), - migrations.RenameField( - model_name='documenttype', - old_name='country_new', - new_name='country', - ), - migrations.AlterUniqueTogether( - name='documenttype', - unique_together={('country', 'type')}, - ), - migrations.RemoveConstraint( - model_name='agency', - name='unique_type_and_country', - ), - migrations.RemoveField( - model_name='agency', - name='country', - ), - migrations.AddConstraint( - model_name='agency', - constraint=models.UniqueConstraint(fields=('type', 'country_new'), name='unique_type_and_country'), - ), - migrations.RemoveConstraint( - model_name='agency', - name='unique_type_and_country', - ), - migrations.RenameField( - model_name='agency', - old_name='country_new', - new_name='country', - ), - migrations.AddConstraint( - model_name='agency', - constraint=models.UniqueConstraint(fields=('type', 'country'), name='unique_type_and_country'), - ), - migrations.RemoveField( - model_name='household', - name='admin_area', - ), - migrations.RenameField( - model_name='household', - old_name='admin_area_new', - new_name='admin_area', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0115_migration.py b/src/hct_mis_api/apps/household/migrations/0115_migration.py deleted file mode 100644 index f54c87d9c3..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0115_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0007_migration'), - ('household', '0114_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='documenttype', - options={'ordering': ['country', 'label']}, - ), - migrations.RenameField( - model_name='documenttype', - old_name='country_new', - new_name='country', - ), - migrations.AlterUniqueTogether( - name='documenttype', - unique_together={('country', 'type')}, - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0116_migration.py b/src/hct_mis_api/apps/household/migrations/0116_migration.py deleted file mode 100644 index 2c998e1d7f..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0116_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0115_migration'), - ] - - operations = [ - migrations.RemoveConstraint( - model_name='agency', - name='unique_type_and_country', - ), - migrations.RemoveField( - model_name='agency', - name='country', - ), - migrations.AddConstraint( - model_name='agency', - constraint=models.UniqueConstraint(fields=('type', 'country_new'), name='unique_type_and_country'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0117_migration.py b/src/hct_mis_api/apps/household/migrations/0117_migration.py deleted file mode 100644 index b78b1e782a..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0117_migration.py +++ /dev/null @@ -1,24 +0,0 @@ -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0116_migration'), - ] - - operations = [ - migrations.RemoveConstraint( - model_name='agency', - name='unique_type_and_country', - ), - migrations.RenameField( - model_name='agency', - old_name='country_new', - new_name='country', - ), - migrations.AddConstraint( - model_name='agency', - constraint=models.UniqueConstraint(fields=('type', 'country'), name='unique_type_and_country'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0118_migration.py b/src/hct_mis_api/apps/household/migrations/0118_migration.py deleted file mode 100644 index f9bb131a23..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0118_migration.py +++ /dev/null @@ -1,15 +0,0 @@ -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0117_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='household', - name='admin_area', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0119_migration.py b/src/hct_mis_api/apps/household/migrations/0119_migration.py deleted file mode 100644 index af837a4b9d..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0119_migration.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0118_migration'), - ] - - operations = [ - migrations.RenameField( - model_name='household', - old_name='admin_area_new', - new_name='admin_area', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0120_migration.py b/src/hct_mis_api/apps/household/migrations/0120_migration.py deleted file mode 100644 index 4b7a85619b..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0120_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-20 12:24 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0044_migration_squashed_0057_migration'), - ('household', '0119_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='family_id', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='household', - name='storage_obj', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.storagefile'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0121_migration.py b/src/hct_mis_api/apps/household/migrations/0121_migration.py deleted file mode 100644 index be0dbac856..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0121_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.15 on 2022-09-21 21:27 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0023_migration'), - ('household', '0120_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='household', - name='collect_individual_data', - field=models.CharField(choices=[('', 'Unknown'), ('2', 'Partial individuals collected'), ('1', 'Full individual collected'), ('0', 'No individual data')], default='', max_length=250), - ), - migrations.AlterField( - model_name='household', - name='registration_data_import', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='households', to='registration_data.registrationdataimport'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0122_migration.py b/src/hct_mis_api/apps/household/migrations/0122_migration.py deleted file mode 100644 index 6c74508501..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0122_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2022-09-29 08:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0121_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='household', - name='size', - field=models.PositiveIntegerField(db_index=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0123_migration.py b/src/hct_mis_api/apps/household/migrations/0123_migration.py deleted file mode 100644 index d5df9f9f9d..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0123_migration.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.15 on 2022-11-28 09:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0122_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='individual', - name='deduplication_batch_status', - field=models.CharField(choices=[('DUPLICATE_IN_BATCH', 'Duplicate in batch'), ('NOT_PROCESSED', 'Not Processed'), ('SIMILAR_IN_BATCH', 'Similar in batch'), ('UNIQUE_IN_BATCH', 'Unique in batch')], db_index=True, default='UNIQUE_IN_BATCH', max_length=50), - ), - migrations.AlterField( - model_name='individual', - name='deduplication_golden_record_status', - field=models.CharField(choices=[('DUPLICATE', 'Duplicate'), ('NEEDS_ADJUDICATION', 'Needs Adjudication'), ('NOT_PROCESSED', 'Not Processed'), ('POSTPONE', 'Postpone'), ('UNIQUE', 'Unique')], db_index=True, default='UNIQUE', max_length=50), - ), - migrations.RunSQL("CREATE INDEX IF NOT EXISTS household_household_default_page_index ON public.household_household USING btree (created_at, business_area_id, is_removed) WHERE NOT is_removed;","DROP INDEX IF EXISTS household_household_default_page_index;") - ] diff --git a/src/hct_mis_api/apps/household/migrations/0124_migration.py b/src/hct_mis_api/apps/household/migrations/0124_migration.py deleted file mode 100644 index 008383515e..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0124_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-02 15:35 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0123_migration'), - ] - - operations = [ - migrations.AddField( - model_name='document', - name='country', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country'), - ), - migrations.AlterUniqueTogether( - name='documenttype', - unique_together=set(), - ), - migrations.RemoveConstraint( - model_name='document', - name='unique_if_not_removed_and_valid', - ), - migrations.AddConstraint( - model_name='document', - constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'))), fields=('document_number', 'type', 'country'), name='unique_if_not_removed_and_valid'), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/household/migrations/0125_migration.py b/src/hct_mis_api/apps/household/migrations/0125_migration.py deleted file mode 100644 index 90cb144f5e..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0125_migration.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.2.15 on 2022-09-19 23:40 - -from django.db import migrations - -from hct_mis_api.apps.household.models import IDENTIFICATION_TYPE_CHOICE - - -def migrate_doc_type(apps, schema_editor): - # Country = apps.get_model('geo', 'Country') - # Document = apps.get_model('household', 'Document') - # DocumentType = apps.get_model('household', 'DocumentType') - # - # for country in Country.objects.all(): - # Document.objects.filter(type__country=country).update(country=country) - # - # tostay = Country.objects.first() - # for code, _ in IDENTIFICATION_TYPE_CHOICE: - # new_type, _ = DocumentType.objects.get_or_create(type=code, country=tostay, defaults={'label': code}) - # Document.objects.filter(type__type=code).update(type=new_type) - # DocumentType.objects.exclude(country=tostay).delete() - pass - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0124_migration'), - ] - - operations = [ - migrations.RunPython(migrate_doc_type, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0126_migration.py b/src/hct_mis_api/apps/household/migrations/0126_migration.py deleted file mode 100644 index 54e044f8ef..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0126_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-03 18:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0125_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='documenttype', - options={'ordering': ['label']}, - ), - migrations.AlterField( - model_name='documenttype', - name='type', - field=models.CharField(choices=[('BIRTH_CERTIFICATE', 'Birth Certificate'), ('DRIVERS_LICENSE', "Driver's License"), ('ELECTORAL_CARD', 'Electoral Card'), ('NATIONAL_ID', 'National ID'), ('NATIONAL_PASSPORT', 'National Passport'), ('TAX_ID', 'Tax Number Identification'), ('RESIDENCE_PERMIT_NO', "Foreigner's Residence Permit"), ('OTHER', 'Other')], max_length=50, unique=True), - ), - migrations.RemoveField( - model_name='documenttype', - name='country', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0127_migration.py b/src/hct_mis_api/apps/household/migrations/0127_migration.py deleted file mode 100644 index 20353ab959..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0127_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-24 09:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0126_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='household', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='individual', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0128_migration.py b/src/hct_mis_api/apps/household/migrations/0128_migration.py deleted file mode 100644 index 49843df9fb..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0128_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2022-12-02 10:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0127_migration'), - ] - - operations = [ - migrations.AddField( - model_name='document', - name='last_sync_at', - field=models.DateTimeField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0129_migration.py b/src/hct_mis_api/apps/household/migrations/0129_migration.py deleted file mode 100644 index c12792d06b..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0129_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-02 15:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("household", "0128_migration"), - ] - - operations = [ - migrations.RemoveConstraint( - model_name="document", - name="unique_if_not_removed_and_valid", - ), - migrations.AddConstraint( - model_name="document", - constraint=models.UniqueConstraint( - condition=models.Q(models.Q(("is_removed", False), ("status", "VALID"))), - fields=("document_number", "type", "country"), - name="unique_if_not_removed_and_valid", - ), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0130_migration_squashed_0140_migration.py b/src/hct_mis_api/apps/household/migrations/0130_migration_squashed_0140_migration.py deleted file mode 100644 index 18b98a5794..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0130_migration_squashed_0140_migration.py +++ /dev/null @@ -1,290 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-12 08:20 - -from django.conf import settings -from django.db import migrations, models -import django.utils.timezone -from functools import lru_cache - -from django.db import migrations, models -import django.db.models.deletion - -from hct_mis_api.apps.account.models import Partner - - -@lru_cache(maxsize=None) -def get_partner(model, partner_name: str) -> Partner: - return model.objects.get(name=partner_name) - - -@lru_cache(maxsize=None) -def get_country(model, country_id): - return model.objects.get(id=country_id) - - -def populate_partner_and_country(apps, schema_editor): - IndividualIdentity = apps.get_model("household", "IndividualIdentity") - Partner = apps.get_model("account", "Partner") - Country = apps.get_model("geo", "Country") - - for identity in IndividualIdentity.objects.all(): - identity.partner = get_partner(Partner, identity.agency.type) - identity.country = get_country(Country, identity.agency.country_id) - identity.save(update_fields=("partner", "country")) - - -class Migration(migrations.Migration): - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("geo", "0007_migration"), - ("household", "0129_migration"), - ("account", "0042_migration_squashed_0050_migration"), - ] - - operations = [ - migrations.AddField( - model_name="individual", - name="phone_no_alternative_valid", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AddField( - model_name="individual", - name="phone_no_valid", - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AddField( - model_name="individualidentity", - name="country", - field=models.ForeignKey( - null=True, on_delete=django.db.models.deletion.PROTECT, to="geo.country" - ), - ), - migrations.AddField( - model_name="individualidentity", - name="partner", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="individual_identities", - to="account.partner", - ), - ), - migrations.RunPython(populate_partner_and_country, migrations.RunPython.noop), - migrations.RemoveField( - model_name="individualidentity", - name="agency", - ), - migrations.DeleteModel( - name="Agency", - ), - migrations.RemoveConstraint( - model_name="document", - name="unique_if_not_removed_and_valid", - ), - migrations.AddConstraint( - model_name="document", - constraint=models.UniqueConstraint( - condition=models.Q( - models.Q(("is_removed", False), ("status", "VALID")) - ), - fields=("document_number", "type", "country"), - name="unique_if_not_removed_and_valid", - ), - ), - migrations.AddField( - model_name="household", - name="admin1", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="geo.area", - ), - ), - migrations.AddField( - model_name="household", - name="admin2", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="geo.area", - ), - ), - migrations.AddField( - model_name="household", - name="admin3", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="geo.area", - ), - ), - migrations.AddField( - model_name="household", - name="admin4", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="geo.area", - ), - ), - migrations.AddField( - model_name="individual", - name="preferred_language", - field=models.CharField( - blank=True, - choices=[ - ("en-us", "en-us"), - ("ar-ae", "ar-ae"), - ("cs-cz", "cs-cz"), - ("de-de", "de-de"), - ("es-es", "es-es"), - ("fr-fr", "fr-fr"), - ("hu-hu", "hu-hu"), - ("it-it", "it-it"), - ("pl-pl", "pl-pl"), - ("pt-pt", "pt-pt"), - ("ro-ro", "ro-ro"), - ("ru-ru", "ru-ru"), - ("si-si", "si-si"), - ("ta-ta", "ta-ta"), - ("uk-ua", "uk-ua"), - ("hi-hi", "hi-hi"), - ], - max_length=6, - null=True, - ), - ), - migrations.AddField( - model_name="documenttype", - name="is_identity_document", - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name="documenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("TAX_ID", "Tax Number Identification"), - ("RESIDENCE_PERMIT_NO", "Foreigner's Residence Permit"), - ("BANK_STATEMENT", "Bank Statement"), - ("OTHER", "Other"), - ], - max_length=50, - unique=True, - ), - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS household_household_composite_default_page_idx ON household_household (business_area_id, is_removed, unicef_id);", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS household_individual_composite_default_page_idx ON household_individual (business_area_id, is_removed, unicef_id);", - ), - migrations.AlterField( - model_name="documenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("TAX_ID", "Tax Number Identification"), - ("RESIDENCE_PERMIT_NO", "Foreigner's Residence Permit"), - ("BANK_STATEMENT", "Bank Statement"), - ("DISABILITY_CERTIFICATE", "Disability Certificate"), - ("OTHER", "Other"), - ], - max_length=50, - unique=True, - ), - ), - migrations.AddField( - model_name="document", - name="cleared", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="document", - name="cleared_by", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to=settings.AUTH_USER_MODEL, - ), - ), - migrations.AddField( - model_name="document", - name="cleared_date", - field=models.DateTimeField(default=django.utils.timezone.now), - ), - migrations.AddField( - model_name="individual", - name="relationship_confirmed", - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name="documenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("TAX_ID", "Tax Number Identification"), - ("RESIDENCE_PERMIT_NO", "Foreigner's Residence Permit"), - ("BANK_STATEMENT", "Bank Statement"), - ("DISABILITY_CERTIFICATE", "Disability Certificate"), - ("FOSTER_CHILD", "Foster Child"), - ("OTHER", "Other"), - ], - max_length=50, - unique=True, - ), - ), - migrations.AlterField( - model_name="individual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("OTHER", "Other"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("FOSTER_CHILD", "Foster child"), - ], - help_text="This represents the MEMBER relationship. can be blank\n as well if household is null!", - max_length=255, - ), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0141_migration.py b/src/hct_mis_api/apps/household/migrations/0141_migration.py deleted file mode 100644 index 8b9a2e949b..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0141_migration.py +++ /dev/null @@ -1,74 +0,0 @@ -from django.db import migrations, models -import django.db.models.expressions - - -class Migration(migrations.Migration): - - dependencies = [ - ("household", "0130_migration_squashed_0140_migration"), - ] - - operations = [ - migrations.RemoveConstraint( - model_name="document", - name="unique_if_not_removed_and_valid", - ), - migrations.AddField( - model_name="documenttype", - name="unique_for_individual", - field=models.BooleanField(default=False), - ), - migrations.RunSQL( - """ - create or replace function check_unique_document_for_individual(uuid, boolean) - returns boolean - language plpgsql - immutable - as - $$ - begin - return(select exists(select 1 from household_documenttype where id = $1 and unique_for_individual = $2)); - end; - $$ - """, - migrations.RunSQL.noop, - ), - migrations.AddConstraint( - model_name="document", - constraint=models.UniqueConstraint( - condition=models.Q( - models.Q( - ("is_removed", False), - ("status", "VALID"), - django.db.models.expressions.Func( - django.db.models.expressions.F("type_id"), - django.db.models.expressions.Value(True), - function="check_unique_document_for_individual", - output_field=models.BooleanField(), - ), - ) - ), - fields=("type", "country"), - name="unique_for_individual_if_not_removed_and_valid", - ), - ), - migrations.AddConstraint( - model_name="document", - constraint=models.UniqueConstraint( - condition=models.Q( - models.Q( - ("is_removed", False), - ("status", "VALID"), - django.db.models.expressions.Func( - django.db.models.expressions.F("type_id"), - django.db.models.expressions.Value(False), - function="check_unique_document_for_individual", - output_field=models.BooleanField(), - ), - ) - ), - fields=("document_number", "type", "country"), - name="unique_if_not_removed_and_valid", - ), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0142_migration.py b/src/hct_mis_api/apps/household/migrations/0142_migration.py deleted file mode 100644 index eb6088b6d4..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0142_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.18 on 2023-03-23 18:24 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0141_migration'), - ] - - operations = [ - migrations.AddField( - model_name='documenttype', - name='valid_for_deduplication', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='household', - name='collect_individual_data', - field=models.CharField(choices=[('', 'Unknown'), ('2', 'Partial individuals collected'), ('1', 'Full individual collected'), ('3', 'Size only collected'), ('0', 'No individual data')], default='', max_length=250), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0143_migration.py b/src/hct_mis_api/apps/household/migrations/0143_migration.py deleted file mode 100644 index aa11cf8488..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0143_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-05 08:25 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0142_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='zip_code', - field=models.CharField(blank=True, max_length=12, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0144_migration.py b/src/hct_mis_api/apps/household/migrations/0144_migration.py deleted file mode 100644 index 14a521208f..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0144_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-04 16:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0143_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='individual', - name='phone_no_alternative_valid', - field=models.BooleanField(db_index=True, null=True), - ), - migrations.AlterField( - model_name='individual', - name='phone_no_valid', - field=models.BooleanField(db_index=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0145_migration.py b/src/hct_mis_api/apps/household/migrations/0145_migration.py deleted file mode 100644 index df817431af..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0145_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-06 11:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0144_migration'), - ] - - operations = [ - migrations.AddField( - model_name='individual', - name='email', - field=models.CharField(blank=True, max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0146_migration.py b/src/hct_mis_api/apps/household/migrations/0146_migration.py deleted file mode 100644 index 420e5755f9..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0146_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-04 09:35 - -from django.db import migrations, models -from django.db.models.functions import Lower - - -def update_document_type_keys(apps, schema_editor): - DocumentType = apps.get_model("household", "DocumentType") - DocumentType.objects.all().update(key=Lower("key")) - - -class Migration(migrations.Migration): - - dependencies = [ - ("household", "0145_migration"), - ] - - operations = [ - migrations.RenameField("DocumentType", "type", "key"), - migrations.RunPython(update_document_type_keys, reverse_code=migrations.RunPython.noop), - migrations.AlterField( - model_name="documenttype", - name="key", - field=models.CharField(max_length=50, unique=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0147_migration.py b/src/hct_mis_api/apps/household/migrations/0147_migration.py deleted file mode 100644 index 59ecc3492f..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0147_migration.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-17 11:04 -from django.contrib.postgres.operations import AddIndexConcurrently -from django.db import migrations, models - - -class Migration(migrations.Migration): - atomic = False - - dependencies = [ - ('household', '0146_migration'), - ] - - operations = [ - migrations.AddField( - model_name='document', - name='expiry_date', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name='document', - name='issuance_date', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.SeparateDatabaseAndState( - state_operations=[ - migrations.AlterField( - model_name='document', - name='expiry_date', - field=models.DateTimeField(db_index=True), - ) - ], - database_operations=[ - AddIndexConcurrently( - model_name="document", - index=models.Index( - fields=["expiry_date"], name="household_document_expiry_date_idx" - ) - ), - ] - ) - ] diff --git a/src/hct_mis_api/apps/household/migrations/0148_migration.py b/src/hct_mis_api/apps/household/migrations/0148_migration.py deleted file mode 100644 index 49e058b303..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0148_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-11 11:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("household", "0147_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="individual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("OTHER", "Other"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("FOSTER_CHILD", "Foster child"), - ("FREE_UNION", "Free union"), - ], - help_text="This represents the MEMBER relationship. can be blank\n as well if household is null!", - max_length=255, - ), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0148_migration_squashed_0169_migration.py b/src/hct_mis_api/apps/household/migrations/0148_migration_squashed_0169_migration.py deleted file mode 100644 index a2d9e847fb..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0148_migration_squashed_0169_migration.py +++ /dev/null @@ -1,394 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:03 - -from django.db import migrations, models -from django.db.models import Count -import django.utils.timezone -import model_utils.fields -import phonenumber_field.modelfields -from hct_mis_api.apps.household.models import ROLE_ALTERNATE - - -def update_individuals_with_multiple_roles(apps, schema_editor) -> None: - IndividualRoleInHousehold = apps.get_model('household', 'IndividualRoleInHousehold') - multiple_roles_within_household_individual = ( - IndividualRoleInHousehold.objects.values("household", "individual") - .annotate(Count("id")) - .order_by() - .filter(id__count__gt=1) - ) - for household_individual_pair in multiple_roles_within_household_individual: - IndividualRoleInHousehold.objects.filter( - household=household_individual_pair["household"], - individual=household_individual_pair["individual"], - role=ROLE_ALTERNATE, - ).delete() - - -def update_individual_relationship_typo(apps, schema_editor): - # old name is 'GRANDDAUGHER_GRANDSON' new -> 'GRANDDAUGHTER_GRANDSON' - Individual = apps.get_model("household", "Individual") - Individual.objects.filter(relationship="GRANDDAUGHER_GRANDSON").update(relationship="GRANDDAUGHTER_GRANDSON") - - - - -class Migration(migrations.Migration): - - replaces = [('household', '0148_migration'), ('household', '0149_migration'), ('household', '0150_migration'), ('household', '0151_migration'), ('household', '0152_migration'), ('household', '0153_migration'), ('household', '0154_migration'), ('household', '0155_migration'), ('household', '0156_migration'), ('household', '0157_migration'), ('household', '0158_migration'), ('household', '0159_migration'), ('household', '0160_migration'), ('household', '0161_migration'), ('household', '0162_migration'), ('household', '0163_migration'), ('household', '0164_migration'), ('household', '0165_migration'), ('household', '0166_migration'), ('household', '0167_migration'), ('household', '0168_migration'), ('household', '0169_migration')] - - dependencies = [ - ('household', '0147_migration'), - ('core', '0070_migration'), - ('program', '0039_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='individual', - name='relationship', - field=models.CharField(blank=True, choices=[('UNKNOWN', 'Unknown'), ('AUNT_UNCLE', 'Aunt / Uncle'), ('BROTHER_SISTER', 'Brother / Sister'), ('COUSIN', 'Cousin'), ('DAUGHTERINLAW_SONINLAW', 'Daughter-in-law / Son-in-law'), ('GRANDDAUGHER_GRANDSON', 'Granddaughter / Grandson'), ('GRANDMOTHER_GRANDFATHER', 'Grandmother / Grandfather'), ('HEAD', 'Head of household (self)'), ('MOTHER_FATHER', 'Mother / Father'), ('MOTHERINLAW_FATHERINLAW', 'Mother-in-law / Father-in-law'), ('NEPHEW_NIECE', 'Nephew / Niece'), ('NON_BENEFICIARY', 'Not a Family Member. Can only act as a recipient.'), ('OTHER', 'Other'), ('SISTERINLAW_BROTHERINLAW', 'Sister-in-law / Brother-in-law'), ('SON_DAUGHTER', 'Son / Daughter'), ('WIFE_HUSBAND', 'Wife / Husband'), ('FOSTER_CHILD', 'Foster child'), ('FREE_UNION', 'Free union')], help_text='This represents the MEMBER relationship. can be blank\n as well if household is null!', max_length=255), - ), - migrations.RunPython(update_individuals_with_multiple_roles, migrations.RunPython.noop), - migrations.AlterUniqueTogether( - name='individualroleinhousehold', - unique_together={('role', 'household'), ('household', 'individual')}, - ), - migrations.AlterField( - model_name='document', - name='expiry_date', - field=models.DateTimeField(blank=True, db_index=True, null=True), - ), - migrations.AlterField( - model_name='individual', - name='relationship', - field=models.CharField(blank=True, choices=[('UNKNOWN', 'Unknown'), ('AUNT_UNCLE', 'Aunt / Uncle'), ('BROTHER_SISTER', 'Brother / Sister'), ('COUSIN', 'Cousin'), ('DAUGHTERINLAW_SONINLAW', 'Daughter-in-law / Son-in-law'), ('GRANDDAUGHTER_GRANDSON', 'Granddaughter / Grandson'), ('GRANDMOTHER_GRANDFATHER', 'Grandmother / Grandfather'), ('HEAD', 'Head of household (self)'), ('MOTHER_FATHER', 'Mother / Father'), ('MOTHERINLAW_FATHERINLAW', 'Mother-in-law / Father-in-law'), ('NEPHEW_NIECE', 'Nephew / Niece'), ('NON_BENEFICIARY', 'Not a Family Member. Can only act as a recipient.'), ('OTHER', 'Other'), ('SISTERINLAW_BROTHERINLAW', 'Sister-in-law / Brother-in-law'), ('SON_DAUGHTER', 'Son / Daughter'), ('WIFE_HUSBAND', 'Wife / Husband'), ('FOSTER_CHILD', 'Foster child'), ('FREE_UNION', 'Free union')], help_text='This represents the MEMBER relationship. can be blank\n as well if household is null!', max_length=255), - ), - migrations.RunPython(update_individual_relationship_typo, migrations.RunPython.noop), - migrations.AddField( - model_name='individual', - name='age_at_registration', - field=models.PositiveSmallIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name='household', - name='registration_id', - field=models.IntegerField(blank=True, null=True, verbose_name='Registration ID (Aurora)'), - ), - migrations.AddField( - model_name='individual', - name='registration_id', - field=models.IntegerField(blank=True, null=True, verbose_name='Registration ID (Aurora)'), - ), - migrations.AlterField( - model_name='individual', - name='relationship', - field=models.CharField(blank=True, choices=[('UNKNOWN', 'Unknown'), ('AUNT_UNCLE', 'Aunt / Uncle'), ('BROTHER_SISTER', 'Brother / Sister'), ('COUSIN', 'Cousin'), ('DAUGHTERINLAW_SONINLAW', 'Daughter-in-law / Son-in-law'), ('GRANDDAUGHER_GRANDSON', 'Granddaughter / Grandson'), ('GRANDMOTHER_GRANDFATHER', 'Grandmother / Grandfather'), ('HEAD', 'Head of household (self)'), ('MOTHER_FATHER', 'Mother / Father'), ('MOTHERINLAW_FATHERINLAW', 'Mother-in-law / Father-in-law'), ('NEPHEW_NIECE', 'Nephew / Niece'), ('NON_BENEFICIARY', 'Not a Family Member. Can only act as a recipient.'), ('OTHER', 'Other'), ('SISTERINLAW_BROTHERINLAW', 'Sister-in-law / Brother-in-law'), ('SON_DAUGHTER', 'Son / Daughter'), ('WIFE_HUSBAND', 'Wife / Husband'), ('FOSTER_CHILD', 'Foster child'), ('FREE_UNION', 'Free union')], help_text='This represents the MEMBER relationship. can be blank\n as well if household is null!', max_length=255), - ), - migrations.CreateModel( - name='HouseholdCollection', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='IndividualCollection', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='bankaccountinfo', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.bankaccountinfo'), - ), - migrations.AddField( - model_name='bankaccountinfo', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='bankaccountinfo', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='document', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.document'), - ), - migrations.AddField( - model_name='document', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='document', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='document', - name='program', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='program.program'), - ), - migrations.AddField( - model_name='entitlementcard', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='household', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this household was copied from another household, this field will contain the household it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.household'), - ), - migrations.AddField( - model_name='household', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='household', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='household', - name='origin_unicef_id', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='household', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), - ), - migrations.AddField( - model_name='individual', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this individual was copied from another individual, this field will contain the individual it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individual'), - ), - migrations.AddField( - model_name='individual', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individual', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='individual', - name='origin_unicef_id', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='individual', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='individuals', to='program.program'), - ), - migrations.AddField( - model_name='individualidentity', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individualidentity'), - ), - migrations.AddField( - model_name='individualidentity', - name='created', - field=model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created'), - ), - migrations.AddField( - model_name='individualidentity', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individualidentity', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='individualidentity', - name='is_removed', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individualidentity', - name='modified', - field=model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified'), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individualroleinhousehold'), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='is_removed', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='household', - name='household_collection', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='households', to='household.householdcollection'), - ), - migrations.AddField( - model_name='individual', - name='individual_collection', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='individuals', to='household.individualcollection'), - ), - migrations.AddField( - model_name='household', - name='is_recalculated_group_ages', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='individual', - name='preferred_language', - field=models.CharField(blank=True, choices=[('en-us', 'English | English'), ('ar-ae', ' | عربيArabic'), ('cs-cz', 'čeština | Czech'), ('de-de', 'Deutsch'), ('es-es', 'Español | Spanish'), ('fr-fr', 'Français | French'), ('hu-hu', 'Magyar | Hungarian'), ('it-it', 'Italiano'), ('pl-pl', 'Polskie | Polish'), ('pt-pt', 'Português'), ('ro-ro', 'Română'), ('ru-ru', 'Русский | Russian'), ('si-si', 'සිංහල | Sinhala'), ('ta-ta', 'தமிழ் | Tamil'), ('uk-ua', 'український | Ukrainian'), ('hi-hi', 'हिंदी')], max_length=6, null=True), - ), - migrations.AddField( - model_name='individual', - name='payment_delivery_phone_no', - field=phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, null=True, region=None), - ), - migrations.RunSQL( - sql='ALTER TABLE household_householdcollection ADD unicef_id_index SERIAL', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_hhc_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('HHC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n return NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="UPDATE household_householdcollection SET unicef_id = format('HHC-%s' ,trim(replace(to_char(unicef_id_index,'0000,0000'),',','.')))", - ), - migrations.RunSQL( - sql='ALTER TABLE household_individualcollection ADD unicef_id_index SERIAL', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_indc_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('INDC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n return NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="UPDATE household_individualcollection SET unicef_id = format('INDC-%s' ,trim(replace(to_char(unicef_id_index,'0000,0000'),',','.')))", - ), - migrations.AddField( - model_name='household', - name='migrated_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name='individual', - name='migrated_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='migrated_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_hh_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n IF NEW.unicef_id IS NULL THEN\n NEW.unicef_id := format('HH-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n END IF;\n return NEW;\n end\n $$;\n ", - reverse_sql='', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_ii_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin \n IF NEW.unicef_id IS NULL THEN\n NEW.unicef_id := format('IND-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n END IF;\n return NEW;\n end\n $$;\n ", - reverse_sql='', - ), - migrations.AlterField( - model_name='household', - name='residence_status', - field=models.CharField(choices=[('', 'None'), ('IDP', 'Displaced | Internally Displaced People'), ('REFUGEE', 'Displaced | Refugee / Asylum Seeker'), ('OTHERS_OF_CONCERN', 'Displaced | Others of Concern'), ('HOST', 'Non-displaced | Host'), ('NON_HOST', 'Non-displaced | Non-host'), ('RETURNEE', 'Displaced | Returnee')], max_length=254, blank=True), - ), - migrations.AlterField( - model_name='household', - name='size', - field=models.PositiveIntegerField(blank=True, db_index=True, null=True), - ), - migrations.RemoveConstraint( - model_name='document', - name='unique_for_individual_if_not_removed_and_valid', - ), - migrations.RemoveConstraint( - model_name='document', - name='unique_if_not_removed_and_valid', - ), - migrations.AddConstraint( - model_name='document', - constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'), django.db.models.expressions.Func(django.db.models.expressions.F('type_id'), django.db.models.expressions.Value(True), function='check_unique_document_for_individual', output_field=models.BooleanField()))), fields=('individual', 'type', 'country', 'program'), name='unique_for_individual_if_not_removed_and_valid'), - ), - migrations.AddConstraint( - model_name='document', - constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'))), fields=('document_number', 'type', 'country', 'program', 'is_original'), name='unique_if_not_removed_and_valid_for_representations'), - ), - migrations.AlterField( - model_name='bankaccountinfo', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='document', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='entitlementcard', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='household', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='individual', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='individualidentity', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='individualroleinhousehold', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='bankaccountinfo', - name='account_holder_name', - field=models.CharField(blank=True, default='', max_length=255), - ), - migrations.AddField( - model_name='bankaccountinfo', - name='bank_branch_name', - field=models.CharField(blank=True, default='', max_length=255), - ), - migrations.AddField( - model_name='household', - name='detail_id', - field=models.CharField(blank=True, help_text='Kobo asset ID, Xlsx row ID, Aurora source ID', max_length=150, null=True), - ), - migrations.AddField( - model_name='individual', - name='detail_id', - field=models.CharField(blank=True, help_text='Kobo asset ID, Xlsx row ID, Aurora source ID', max_length=150, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0149_migration.py b/src/hct_mis_api/apps/household/migrations/0149_migration.py deleted file mode 100644 index 23313e4690..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0149_migration.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.2.18 on 2023-06-16 10:56 - -from django.db import migrations, models - -from django.db.models import Count - -from hct_mis_api.apps.household.models import ROLE_ALTERNATE - - -def update_individuals_with_multiple_roles(apps, schema_editor) -> None: - IndividualRoleInHousehold = apps.get_model('household', 'IndividualRoleInHousehold') - multiple_roles_within_household_individual = ( - IndividualRoleInHousehold.objects.values("household", "individual") - .annotate(Count("id")) - .order_by() - .filter(id__count__gt=1) - ) - for household_individual_pair in multiple_roles_within_household_individual: - IndividualRoleInHousehold.objects.filter( - household=household_individual_pair["household"], - individual=household_individual_pair["individual"], - role=ROLE_ALTERNATE, - ).delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0148_migration'), - ] - - operations = [ - migrations.RunPython(update_individuals_with_multiple_roles, migrations.RunPython.noop), - migrations.AlterUniqueTogether( - name='individualroleinhousehold', - unique_together={('household', 'individual'), ('role', 'household')}, - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0150_migration.py b/src/hct_mis_api/apps/household/migrations/0150_migration.py deleted file mode 100644 index d9d8431d12..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0150_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 18:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0149_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='expiry_date', - field=models.DateTimeField(blank=True, db_index=True, null=True), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/household/migrations/0151_migration.py b/src/hct_mis_api/apps/household/migrations/0151_migration.py deleted file mode 100644 index 494269a385..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0151_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-21 11:59 - -from django.db import migrations, models - - -def update_individual_relationship_typo(apps, schema_editor): - # old name is 'GRANDDAUGHER_GRANDSON' new -> 'GRANDDAUGHTER_GRANDSON' - Individual = apps.get_model("household", "Individual") - Individual.objects.filter(relationship="GRANDDAUGHER_GRANDSON").update(relationship="GRANDDAUGHTER_GRANDSON") - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0150_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='individual', - name='relationship', - field=models.CharField(blank=True, choices=[('UNKNOWN', 'Unknown'), ('AUNT_UNCLE', 'Aunt / Uncle'), ('BROTHER_SISTER', 'Brother / Sister'), ('COUSIN', 'Cousin'), ('DAUGHTERINLAW_SONINLAW', 'Daughter-in-law / Son-in-law'), ('GRANDDAUGHTER_GRANDSON', 'Granddaughter / Grandson'), ('GRANDMOTHER_GRANDFATHER', 'Grandmother / Grandfather'), ('HEAD', 'Head of household (self)'), ('MOTHER_FATHER', 'Mother / Father'), ('MOTHERINLAW_FATHERINLAW', 'Mother-in-law / Father-in-law'), ('NEPHEW_NIECE', 'Nephew / Niece'), ('NON_BENEFICIARY', 'Not a Family Member. Can only act as a recipient.'), ('OTHER', 'Other'), ('SISTERINLAW_BROTHERINLAW', 'Sister-in-law / Brother-in-law'), ('SON_DAUGHTER', 'Son / Daughter'), ('WIFE_HUSBAND', 'Wife / Husband'), ('FOSTER_CHILD', 'Foster child'), ('FREE_UNION', 'Free union')], help_text='This represents the MEMBER relationship. can be blank\n as well if household is null!', max_length=255), - ), - migrations.RunPython(update_individual_relationship_typo, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0152_migration.py b/src/hct_mis_api/apps/household/migrations/0152_migration.py deleted file mode 100644 index 6500035f1d..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0152_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-30 16:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0151_migration'), - ] - - operations = [ - migrations.AddField( - model_name='individual', - name='age_at_registration', - field=models.PositiveSmallIntegerField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0153_migration.py b/src/hct_mis_api/apps/household/migrations/0153_migration.py deleted file mode 100644 index c16b86f02d..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0153_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.20 on 2023-08-02 13:18 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0152_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='registration_id', - field=models.IntegerField(blank=True, null=True, verbose_name='Registration ID (Aurora)'), - ), - migrations.AddField( - model_name='individual', - name='registration_id', - field=models.IntegerField(blank=True, null=True, verbose_name='Registration ID (Aurora)'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0154_migration.py b/src/hct_mis_api/apps/household/migrations/0154_migration.py deleted file mode 100644 index 9911a521fd..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0154_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.20 on 2023-08-24 09:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0153_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='individual', - name='relationship', - field=models.CharField(blank=True, choices=[('UNKNOWN', 'Unknown'), ('AUNT_UNCLE', 'Aunt / Uncle'), ('BROTHER_SISTER', 'Brother / Sister'), ('COUSIN', 'Cousin'), ('DAUGHTERINLAW_SONINLAW', 'Daughter-in-law / Son-in-law'), ('GRANDDAUGHER_GRANDSON', 'Granddaughter / Grandson'), ('GRANDMOTHER_GRANDFATHER', 'Grandmother / Grandfather'), ('HEAD', 'Head of household (self)'), ('MOTHER_FATHER', 'Mother / Father'), ('MOTHERINLAW_FATHERINLAW', 'Mother-in-law / Father-in-law'), ('NEPHEW_NIECE', 'Nephew / Niece'), ('NON_BENEFICIARY', 'Not a Family Member. Can only act as a recipient.'), ('OTHER', 'Other'), ('SISTERINLAW_BROTHERINLAW', 'Sister-in-law / Brother-in-law'), ('SON_DAUGHTER', 'Son / Daughter'), ('WIFE_HUSBAND', 'Wife / Husband'), ('FOSTER_CHILD', 'Foster child'), ('FREE_UNION', 'Free union')], help_text='This represents the MEMBER relationship. can be blank\n as well if household is null!', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0155_migration.py b/src/hct_mis_api/apps/household/migrations/0155_migration.py deleted file mode 100644 index d36447f7af..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0155_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-18 11:23 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0070_migration'), - ('household', '0154_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='data_collecting_type', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='households', to='core.datacollectingtype'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0156_migration.py b/src/hct_mis_api/apps/household/migrations/0156_migration.py deleted file mode 100644 index 437ffddecf..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0156_migration.py +++ /dev/null @@ -1,187 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-18 12:27 - -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone -import model_utils.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0039_migration'), - ('household', '0155_migration'), - ] - - operations = [ - migrations.CreateModel( - name='HouseholdCollection', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='IndividualCollection', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='bankaccountinfo', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.bankaccountinfo'), - ), - migrations.AddField( - model_name='bankaccountinfo', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='bankaccountinfo', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='document', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.document'), - ), - migrations.AddField( - model_name='document', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='document', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='document', - name='program', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='program.program'), - ), - migrations.AddField( - model_name='entitlementcard', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='household', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this household was copied from another household, this field will contain the household it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.household'), - ), - migrations.AddField( - model_name='household', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='household', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='household', - name='origin_unicef_id', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='household', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), - ), - migrations.AddField( - model_name='individual', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this individual was copied from another individual, this field will contain the individual it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individual'), - ), - migrations.AddField( - model_name='individual', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individual', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='individual', - name='origin_unicef_id', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='individual', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='individuals', to='program.program'), - ), - migrations.AddField( - model_name='individualidentity', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individualidentity'), - ), - migrations.AddField( - model_name='individualidentity', - name='created', - field=model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created'), - ), - migrations.AddField( - model_name='individualidentity', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individualidentity', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='individualidentity', - name='is_removed', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individualidentity', - name='modified', - field=model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified'), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='household.individualroleinhousehold'), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='is_removed', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='household', - name='household_collection', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='households', to='household.householdcollection'), - ), - migrations.AddField( - model_name='individual', - name='individual_collection', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='individuals', to='household.individualcollection'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0157_migration.py b/src/hct_mis_api/apps/household/migrations/0157_migration.py deleted file mode 100644 index 2c1b85bcfe..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0157_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-19 20:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0156_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='is_recalculated_group_ages', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0158_migration.py b/src/hct_mis_api/apps/household/migrations/0158_migration.py deleted file mode 100644 index 60252b8598..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0158_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.20 on 2023-10-05 11:43 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0157_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='individual', - name='preferred_language', - field=models.CharField(blank=True, choices=[('en-us', 'English | English'), ('ar-ae', ' | عربيArabic'), ('cs-cz', 'čeština | Czech'), ('de-de', 'Deutsch'), ('es-es', 'Español | Spanish'), ('fr-fr', 'Français | French'), ('hu-hu', 'Magyar | Hungarian'), ('it-it', 'Italiano'), ('pl-pl', 'Polskie | Polish'), ('pt-pt', 'Português'), ('ro-ro', 'Română'), ('ru-ru', 'Русский | Russian'), ('si-si', 'සිංහල | Sinhala'), ('ta-ta', 'தமிழ் | Tamil'), ('uk-ua', 'український | Ukrainian'), ('hi-hi', 'हिंदी')], max_length=6, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0159_migration.py b/src/hct_mis_api/apps/household/migrations/0159_migration.py deleted file mode 100644 index 24d1ce2983..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0159_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.22 on 2023-10-18 16:43 - -from django.db import migrations -import phonenumber_field.modelfields - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0158_migration'), - ] - - operations = [ - migrations.AddField( - model_name='individual', - name='payment_delivery_phone_no', - field=phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, null=True, region=None), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0160_migration.py b/src/hct_mis_api/apps/household/migrations/0160_migration.py deleted file mode 100644 index a8292f8c30..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0160_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.22 on 2023-10-30 01:51 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0159_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='household', - name='data_collecting_type', - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0161_migration.py b/src/hct_mis_api/apps/household/migrations/0161_migration.py deleted file mode 100644 index a7707e01f2..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0161_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-21 00:12 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0160_migration'), - ] - - operations = [ - migrations.RunSQL( - sql="ALTER TABLE household_householdcollection ADD unicef_id_index SERIAL", - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_hhc_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('HHC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n return NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="UPDATE household_householdcollection SET unicef_id = format('HHC-%s' ,trim(replace(to_char(unicef_id_index,'0000,0000'),',','.')))", - ), - migrations.RunSQL( - sql="ALTER TABLE household_individualcollection ADD unicef_id_index SERIAL", - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_indc_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n begin\n NEW.unicef_id := format('INDC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.')));\n return NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="UPDATE household_individualcollection SET unicef_id = format('INDC-%s' ,trim(replace(to_char(unicef_id_index,'0000,0000'),',','.')))", - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0162_migration.py b/src/hct_mis_api/apps/household/migrations/0162_migration.py deleted file mode 100644 index c3c6d9627c..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0162_migration.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-05 08:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("household", "0161_migration"), - ] - - operations = [ - migrations.AddField( - model_name="household", - name="migrated_at", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="individual", - name="migrated_at", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="individualroleinhousehold", - name="migrated_at", - field=models.DateTimeField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0163_migration.py b/src/hct_mis_api/apps/household/migrations/0163_migration.py deleted file mode 100644 index 664b28eee8..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0163_migration.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-05 08:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("household", "0162_migration"), - ] - - operations = [ - migrations.RunSQL(""" - CREATE OR REPLACE FUNCTION create_hh_unicef_id() RETURNS trigger - LANGUAGE plpgsql - AS $$ - begin - IF NEW.unicef_id IS NULL THEN - NEW.unicef_id := format('HH-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); - END IF; - return NEW; - end - $$; - """, reverse_sql=migrations.RunSQL.noop,), - migrations.RunSQL(""" - CREATE OR REPLACE FUNCTION create_ii_unicef_id() RETURNS trigger - LANGUAGE plpgsql - AS $$ - begin - IF NEW.unicef_id IS NULL THEN - NEW.unicef_id := format('IND-%s-%s',TO_CHAR(NEW.first_registration_date, 'yy'), trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); - END IF; - return NEW; - end - $$; - """, reverse_sql=migrations.RunSQL.noop,) - ] diff --git a/src/hct_mis_api/apps/household/migrations/0164_migration.py b/src/hct_mis_api/apps/household/migrations/0164_migration.py deleted file mode 100644 index 921f073754..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0164_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-20 13:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0163_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='household', - name='residence_status', - field=models.CharField(choices=[('', 'None'), ('IDP', 'Displaced | Internally Displaced People'), ('REFUGEE', 'Displaced | Refugee / Asylum Seeker'), ('OTHERS_OF_CONCERN', 'Displaced | Others of Concern'), ('HOST', 'Non-displaced | Host'), ('NON_HOST', 'Non-displaced | Non-host'), ('RETURNEE', 'Displaced | Returnee')], max_length=254), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0165_migration.py b/src/hct_mis_api/apps/household/migrations/0165_migration.py deleted file mode 100644 index 5182f32c65..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0165_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-04 07:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0164_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='household', - name='size', - field=models.PositiveIntegerField(blank=True, db_index=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0166_migration.py b/src/hct_mis_api/apps/household/migrations/0166_migration.py deleted file mode 100644 index e6aedd869c..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0166_migration.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.2.22 on 2023-12-13 13:34 - -from django.db import migrations, models -import django.db.models.expressions - - - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0165_migration'), - ] - - operations = [ - migrations.RemoveConstraint( - model_name='document', - name='unique_for_individual_if_not_removed_and_valid', - ), - migrations.RemoveConstraint( - model_name='document', - name='unique_if_not_removed_and_valid', - ), - migrations.AddConstraint( - model_name='document', - constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'), django.db.models.expressions.Func(django.db.models.expressions.F('type_id'), django.db.models.expressions.Value(True), function='check_unique_document_for_individual', output_field=models.BooleanField()))), fields=('individual', 'type', 'country', 'program'), name='unique_for_individual_if_not_removed_and_valid'), - ), - migrations.AddConstraint( - model_name='document', - constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'))), fields=('document_number', 'type', 'country', 'program', 'is_original'), name='unique_if_not_removed_and_valid_for_representations'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0167_migration.py b/src/hct_mis_api/apps/household/migrations/0167_migration.py deleted file mode 100644 index 95aa044fb3..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0167_migration.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 3.2.23 on 2023-12-12 14:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0166_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='bankaccountinfo', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='document', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='entitlementcard', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='household', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='individual', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='individualidentity', - name='is_original', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='individualroleinhousehold', - name='is_original', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0168_migration.py b/src/hct_mis_api/apps/household/migrations/0168_migration.py deleted file mode 100644 index 1e7fb7d8c7..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0168_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-04 13:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0167_migration'), - ] - - operations = [ - migrations.AddField( - model_name='bankaccountinfo', - name='account_holder_name', - field=models.CharField(blank=True, default='', max_length=255), - ), - migrations.AddField( - model_name='bankaccountinfo', - name='bank_branch_name', - field=models.CharField(blank=True, default='', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0169_migration.py b/src/hct_mis_api/apps/household/migrations/0169_migration.py deleted file mode 100644 index 38c47ccb4e..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0169_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-13 15:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0168_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='detail_id', - field=models.CharField(blank=True, help_text='Kobo asset ID, Xlsx row ID, Aurora source ID', max_length=150, null=True), - ), - migrations.AddField( - model_name='individual', - name='detail_id', - field=models.CharField(blank=True, help_text='Kobo asset ID, Xlsx row ID, Aurora source ID', max_length=150, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0170_migration.py b/src/hct_mis_api/apps/household/migrations/0170_migration.py deleted file mode 100644 index 547446220d..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0170_migration.py +++ /dev/null @@ -1,68 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-20 23:24 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('household', '0148_migration_squashed_0169_migration'), - ] - - operations = [ - migrations.RunSQL( - """ - CREATE OR REPLACE FUNCTION create_hhc_unicef_id() RETURNS trigger - LANGUAGE plpgsql - AS $$ - begin - IF NEW.unicef_id IS NULL THEN - NEW.unicef_id := format('HHC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); - END IF; - return NEW; - end - $$; - CREATE TRIGGER create_hhc_unicef_id BEFORE INSERT ON household_householdcollection - FOR EACH ROW EXECUTE PROCEDURE create_hhc_unicef_id(); - """, - reverse_sql=""" - DROP TRIGGER IF EXISTS create_hhc_unicef_id - ON household_householdcollection; - """ - ), - migrations.RunSQL( - """ - CREATE OR REPLACE FUNCTION create_indc_unicef_id() RETURNS trigger - LANGUAGE plpgsql - AS $$ - begin - IF NEW.unicef_id IS NULL THEN - NEW.unicef_id := format('INDC-%s', trim(replace(to_char(NEW.unicef_id_index,'0000,0000'),',','.'))); - END IF; - return NEW; - end - $$; - CREATE TRIGGER create_indc_unicef_id BEFORE INSERT ON household_individualcollection - FOR EACH ROW EXECUTE PROCEDURE create_indc_unicef_id(); - """, - reverse_sql=""" - DROP TRIGGER IF EXISTS create_indc_unicef_id - ON household_individualcollection; - """ - ), - migrations.RunSQL( - """ - UPDATE household_individualcollection - SET unicef_id = format('INDC-%s', trim(replace(to_char(unicef_id_index, '0000,0000'), ',', '.'))) - WHERE unicef_id IS NULL; - """, - reverse_sql=migrations.RunSQL.noop, - ), - migrations.RunSQL( - """ - UPDATE household_householdcollection - SET unicef_id = format('HHC-%s', trim(replace(to_char(unicef_id_index, '0000,0000'), ',', '.'))) - WHERE unicef_id IS NULL; - """, - reverse_sql=migrations.RunSQL.noop, - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0171_migration.py b/src/hct_mis_api/apps/household/migrations/0171_migration.py deleted file mode 100644 index d3e03ffaf7..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0171_migration.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-26 16:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0170_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='bankaccountinfo', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='document', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='entitlementcard', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='household', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='individual', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='individualidentity', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='individualroleinhousehold', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0172_migration.py b/src/hct_mis_api/apps/household/migrations/0172_migration.py deleted file mode 100644 index 5510559928..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0172_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.24 on 2024-03-13 15:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0171_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='collect_type', - field=models.CharField(choices=[('STANDARD', 'Standard'), ('SINGLE', 'Single')], default='STANDARD', - max_length=8), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0173_migration.py b/src/hct_mis_api/apps/household/migrations/0173_migration.py deleted file mode 100644 index 912abb4532..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0173_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.25 on 2024-03-22 10:11 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0046_migration'), - ('household', '0172_migration'), - ] - - operations = [ - migrations.AddField( - model_name='xlsxupdatefile', - name='program', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='program.program'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0174_migration.py b/src/hct_mis_api/apps/household/migrations/0174_migration.py deleted file mode 100644 index 6da1bbf221..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0174_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-26 11:18 - -import django.contrib.postgres.fields.citext -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('household', '0173_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='household', - name='registration_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=100, - null=True, - verbose_name='Beneficiary Program Registration Id'), - ), - migrations.AlterField( - model_name='individual', - name='registration_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=100, null=True, - verbose_name='Beneficiary Program Registration Id'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0175_migration.py b/src/hct_mis_api/apps/household/migrations/0175_migration.py deleted file mode 100644 index 2418deb3d2..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0175_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.25 on 2024-04-26 15:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0174_migration'), - ] - - operations = [ - migrations.AddField( - model_name='individual', - name='blockchain_name', - field=models.CharField(blank=True, default='', max_length=64), - ), - migrations.AddField( - model_name='individual', - name='wallet_address', - field=models.CharField(blank=True, default='', max_length=128), - ), - migrations.AddField( - model_name='individual', - name='wallet_name', - field=models.CharField(blank=True, default='', max_length=64), - ), - migrations.AlterField( - model_name='household', - name='currency', - field=models.CharField(choices=[('', 'None'), ('AED', 'United Arab Emirates dirham'), ('AFN', 'Afghan afghani'), ('ALL', 'Albanian lek'), ('AMD', 'Armenian dram'), ('ANG', 'Netherlands Antillean guilder'), ('AOA', 'Angolan kwanza'), ('ARS', 'Argentine peso'), ('AUD', 'Australian dollar'), ('AWG', 'Aruban florin'), ('AZN', 'Azerbaijani manat'), ('BAM', 'Bosnia and Herzegovina convertible mark'), ('BBD', 'Barbados dollar'), ('BDT', 'Bangladeshi taka'), ('BGN', 'Bulgarian lev'), ('BHD', 'Bahraini dinar'), ('BIF', 'Burundian franc'), ('BMD', 'Bermudian dollar'), ('BND', 'Brunei dollar'), ('BOB', 'Boliviano'), ('BOV', 'Bolivian Mvdol (funds code)'), ('BRL', 'Brazilian real'), ('BSD', 'Bahamian dollar'), ('BTN', 'Bhutanese ngultrum'), ('BWP', 'Botswana pula'), ('BYN', 'Belarusian ruble'), ('BZD', 'Belize dollar'), ('CAD', 'Canadian dollar'), ('CDF', 'Congolese franc'), ('CHF', 'Swiss franc'), ('CLP', 'Chilean peso'), ('CNY', 'Chinese yuan'), ('COP', 'Colombian peso'), ('CRC', 'Costa Rican colon'), ('CUC', 'Cuban convertible peso'), ('CUP', 'Cuban peso'), ('CVE', 'Cape Verdean escudo'), ('CZK', 'Czech koruna'), ('DJF', 'Djiboutian franc'), ('DKK', 'Danish krone'), ('DOP', 'Dominican peso'), ('DZD', 'Algerian dinar'), ('EGP', 'Egyptian pound'), ('ERN', 'Eritrean nakfa'), ('ETB', 'Ethiopian birr'), ('EUR', 'Euro'), ('FJD', 'Fiji dollar'), ('FKP', 'Falkland Islands pound'), ('GBP', 'Pound sterling'), ('GEL', 'Georgian lari'), ('GHS', 'Ghanaian cedi'), ('GIP', 'Gibraltar pound'), ('GMD', 'Gambian dalasi'), ('GNF', 'Guinean franc'), ('GTQ', 'Guatemalan quetzal'), ('GYD', 'Guyanese dollar'), ('HKD', 'Hong Kong dollar'), ('HNL', 'Honduran lempira'), ('HRK', 'Croatian kuna'), ('HTG', 'Haitian gourde'), ('HUF', 'Hungarian forint'), ('IDR', 'Indonesian rupiah'), ('ILS', 'Israeli new shekel'), ('INR', 'Indian rupee'), ('IQD', 'Iraqi dinar'), ('IRR', 'Iranian rial'), ('ISK', 'Icelandic króna'), ('JMD', 'Jamaican dollar'), ('JOD', 'Jordanian dinar'), ('JPY', 'Japanese yen'), ('KES', 'Kenyan shilling'), ('KGS', 'Kyrgyzstani som'), ('KHR', 'Cambodian riel'), ('KMF', 'Comoro franc'), ('KPW', 'North Korean won'), ('KRW', 'South Korean won'), ('KWD', 'Kuwaiti dinar'), ('KYD', 'Cayman Islands dollar'), ('KZT', 'Kazakhstani tenge'), ('LAK', 'Lao kip'), ('LBP', 'Lebanese pound'), ('LKR', 'Sri Lankan rupee'), ('LRD', 'Liberian dollar'), ('LSL', 'Lesotho loti'), ('LYD', 'Libyan dinar'), ('MAD', 'Moroccan dirham'), ('MDL', 'Moldovan leu'), ('MGA', 'Malagasy ariary'), ('MKD', 'Macedonian denar'), ('MMK', 'Myanmar kyat'), ('MNT', 'Mongolian tögrög'), ('MOP', 'Macanese pataca'), ('MRU', 'Mauritanian ouguiya'), ('MUR', 'Mauritian rupee'), ('MVR', 'Maldivian rufiyaa'), ('MWK', 'Malawian kwacha'), ('MXN', 'Mexican peso'), ('MYR', 'Malaysian ringgit'), ('MZN', 'Mozambican metical'), ('NAD', 'Namibian dollar'), ('NGN', 'Nigerian naira'), ('NIO', 'Nicaraguan córdoba'), ('NOK', 'Norwegian krone'), ('NPR', 'Nepalese rupee'), ('NZD', 'New Zealand dollar'), ('OMR', 'Omani rial'), ('PAB', 'Panamanian balboa'), ('PEN', 'Peruvian sol'), ('PGK', 'Papua New Guinean kina'), ('PHP', 'Philippine peso'), ('PKR', 'Pakistani rupee'), ('PLN', 'Polish złoty'), ('PYG', 'Paraguayan guaraní'), ('QAR', 'Qatari riyal'), ('RON', 'Romanian leu'), ('RSD', 'Serbian dinar'), ('RUB', 'Russian ruble'), ('RWF', 'Rwandan franc'), ('SAR', 'Saudi riyal'), ('SBD', 'Solomon Islands dollar'), ('SCR', 'Seychelles rupee'), ('SDG', 'Sudanese pound'), ('SEK', 'Swedish krona/kronor'), ('SGD', 'Singapore dollar'), ('SHP', 'Saint Helena pound'), ('SLL', 'Sierra Leonean leone'), ('SOS', 'Somali shilling'), ('SRD', 'Surinamese dollar'), ('SSP', 'South Sudanese pound'), ('STN', 'São Tomé and Príncipe dobra'), ('SVC', 'Salvadoran colón'), ('SYP', 'Syrian pound'), ('SZL', 'Swazi lilangeni'), ('THB', 'Thai baht'), ('TJS', 'Tajikistani somoni'), ('TMT', 'Turkmenistan manat'), ('TND', 'Tunisian dinar'), ('TOP', 'Tongan paʻanga'), ('TRY', 'Turkish lira'), ('TTD', 'Trinidad and Tobago dollar'), ('TWD', 'New Taiwan dollar'), ('TZS', 'Tanzanian shilling'), ('UAH', 'Ukrainian hryvnia'), ('UGX', 'Ugandan shilling'), ('USD', 'United States dollar'), ('UYU', 'Uruguayan peso'), ('UYW', 'Unidad previsional[14]'), ('UZS', 'Uzbekistan som'), ('VES', 'Venezuelan bolívar soberano'), ('VND', 'Vietnamese đồng'), ('VUV', 'Vanuatu vatu'), ('WST', 'Samoan tala'), ('XAF', 'CFA franc BEAC'), ('XAG', 'Silver (one troy ounce)'), ('XAU', 'Gold (one troy ounce)'), ('XCD', 'East Caribbean dollar'), ('XOF', 'CFA franc BCEAO'), ('XPF', 'CFP franc (franc Pacifique)'), ('YER', 'Yemeni rial'), ('ZAR', 'South African rand'), ('ZMW', 'Zambian kwacha'), ('ZWL', 'Zimbabwean dollar'), ('USDC', 'USD Coin')], default='', max_length=250), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0176_migration.py b/src/hct_mis_api/apps/household/migrations/0176_migration.py deleted file mode 100644 index 62ef399c3b..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0176_migration.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-11 11:19 - -import django.contrib.postgres.fields.citext -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0175_migration'), - ] - - operations = [ - migrations.AddField( - model_name='household', - name='program_registration_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=100, null=True, unique=True, verbose_name='Beneficiary Program Registration Id'), - ), - migrations.AddField( - model_name='individual', - name='program_registration_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=100, null=True, verbose_name='Beneficiary Program Registration Id'), - ), - migrations.AlterField( - model_name='household', - name='registration_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=100, null=True, verbose_name='Aurora Registration Id'), - ), - migrations.AlterField( - model_name='individual', - name='registration_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=100, null=True, verbose_name='Aurora Registration Id'), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/household/migrations/0177_migration.py b/src/hct_mis_api/apps/household/migrations/0177_migration.py deleted file mode 100644 index 35969d81e5..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0177_migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-11 14:49 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0176_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='household', - name='kobo_asset_id', - ), - migrations.RemoveField( - model_name='household', - name='row_id', - ), - migrations.RemoveField( - model_name='individual', - name='kobo_asset_id', - ), - migrations.RemoveField( - model_name='individual', - name='row_id', - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/household/migrations/0178_migration.py b/src/hct_mis_api/apps/household/migrations/0178_migration.py deleted file mode 100644 index a5f0bb2e0e..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0178_migration.py +++ /dev/null @@ -1,79 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-20 14:01 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0177_migration'), - ] - - operations = [ - migrations.AddField( - model_name='bankaccountinfo', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='MERGED', max_length=10, null=True), - ), - migrations.AddField( - model_name='document', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='MERGED', max_length=10, null=True), - ), - migrations.AddField( - model_name='household', - name='enumerator_rec_id', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name='household', - name='flex_registrations_record_id', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name='household', - name='kobo_submission_time', - field=models.DateTimeField(blank=True, max_length=150, null=True), - ), - migrations.AddField( - model_name='household', - name='kobo_submission_uuid', - field=models.UUIDField(default=None, null=True), - ), - migrations.AddField( - model_name='household', - name='mis_unicef_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='household', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='MERGED', max_length=10, null=True), - ), - migrations.AddField( - model_name='individual', - name='mis_unicef_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='individual', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='MERGED', max_length=10, null=True), - ), - migrations.AddField( - model_name='individualidentity', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='MERGED', max_length=10, null=True), - ), - migrations.AddField( - model_name='individualroleinhousehold', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='MERGED', max_length=10, null=True), - ), - migrations.AlterField( - model_name='household', - name='head_of_household', - field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='heading_household', to='household.individual'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0179_migration.py b/src/hct_mis_api/apps/household/migrations/0179_migration.py deleted file mode 100644 index 89c8dd6c0d..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0179_migration.py +++ /dev/null @@ -1,78 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-21 13:42 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0178_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PendingDocument', - fields=[ - ], - options={ - 'verbose_name': 'Imported Document', - 'verbose_name_plural': 'Imported Documents', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('household.document',), - ), - migrations.CreateModel( - name='PendingHousehold', - fields=[ - ], - options={ - 'verbose_name': 'Imported Household', - 'verbose_name_plural': 'Imported Households', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('household.household',), - ), - migrations.CreateModel( - name='PendingIndividual', - fields=[ - ], - options={ - 'verbose_name': 'Imported Individual', - 'verbose_name_plural': 'Imported Individuals', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('household.individual',), - ), - migrations.CreateModel( - name='PendingIndividualIdentity', - fields=[ - ], - options={ - 'verbose_name': 'Imported Individual Identity', - 'verbose_name_plural': 'Imported Individual Identities', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('household.individualidentity',), - ), - migrations.CreateModel( - name='PendingIndividualRoleInHousehold', - fields=[ - ], - options={ - 'verbose_name': 'Imported Individual Role In Household', - 'verbose_name_plural': 'Imported Individual Roles In Household', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('household.individualroleinhousehold',), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0180_migration.py b/src/hct_mis_api/apps/household/migrations/0180_migration.py deleted file mode 100644 index 3cf4bff155..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0180_migration.py +++ /dev/null @@ -1,43 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-21 14:36 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0179_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='bankaccountinfo', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10), - ), - migrations.AlterField( - model_name='document', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10), - ), - migrations.AlterField( - model_name='household', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10), - ), - migrations.AlterField( - model_name='individual', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10), - ), - migrations.AlterField( - model_name='individualidentity', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10), - ), - migrations.AlterField( - model_name='individualroleinhousehold', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0181_migration.py b/src/hct_mis_api/apps/household/migrations/0181_migration.py deleted file mode 100644 index abd670fd1d..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0181_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-23 21:49 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0180_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PendingBankAccountInfo', - fields=[ - ], - options={ - 'verbose_name': 'Imported Bank Account Info', - 'verbose_name_plural': 'Imported Bank Account Infos', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('household.bankaccountinfo',), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0182_migration.py b/src/hct_mis_api/apps/household/migrations/0182_migration.py deleted file mode 100644 index 2c21e2c82a..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0182_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-24 00:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0181_migration'), - ] - - operations = [ - migrations.RemoveConstraint( - model_name='document', - name='unique_if_not_removed_and_valid_for_representations', - ), - migrations.AddConstraint( - model_name='document', - constraint=models.UniqueConstraint(condition=models.Q(models.Q(('is_removed', False), ('status', 'VALID'), ('rdi_merge_status', 'MERGED'))), fields=('document_number', 'type', 'country', 'program', 'is_original'), name='unique_if_not_removed_and_valid_for_representations'), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0183_migration.py b/src/hct_mis_api/apps/household/migrations/0183_migration.py deleted file mode 100644 index 072747e712..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0183_migration.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-04 11:24 - -from django.db import migrations, models - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0182_migration'), - ] - - operations = [ - migrations.RunSQL( - """ - CREATE OR REPLACE FUNCTION generate_unique_program_registration_id() - RETURNS TRIGGER AS $$ - DECLARE - new_id TEXT; - count INT := 0; - BEGIN - -- Check if program_registration_id is empty - IF NEW.program_registration_id IS NULL OR NEW.program_registration_id = '' THEN - NEW.program_registration_id := NULL; -- Convert empty string to NULL - RETURN NEW; -- Do not modify with increasing number - END IF; - new_id := NEW.program_registration_id || '#0'; -- Initial attempt with #0 - LOOP - IF NOT EXISTS (SELECT 1 FROM household_household WHERE program_registration_id = new_id) THEN - EXIT; - END IF; - count := count + 1; - new_id := NEW.program_registration_id || '#' || count; - END LOOP; - NEW.program_registration_id := new_id; - RETURN NEW; - END; - $$ LANGUAGE plpgsql; - - CREATE TRIGGER unique_program_registration_id_trigger - BEFORE INSERT OR UPDATE ON household_household - FOR EACH ROW - EXECUTE FUNCTION generate_unique_program_registration_id(); - """, - reverse_sql=""" - DROP TRIGGER IF EXISTS unique_program_registration_id_trigger ON household_household; - DROP FUNCTION IF EXISTS generate_unique_program_registration_id(); - """ - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0184_migration.py b/src/hct_mis_api/apps/household/migrations/0184_migration.py deleted file mode 100644 index c5cc26bebe..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0184_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-18 09:53 - -from django.db import migrations, models -import hct_mis_api.apps.core.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0183_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='individual', - name='flex_fields', - field=models.JSONField(blank=True, default=dict, encoder=hct_mis_api.apps.core.utils.FlexFieldsEncoder), - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0185_migration.py b/src/hct_mis_api/apps/household/migrations/0185_migration.py deleted file mode 100644 index a25dab38f4..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0185_migration.py +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-16 11:24 - -from django.db import migrations, models -import django.db.models.deletion -from django.db.models import Count, F, Subquery, OuterRef - - -def assign_individual_to_rdi(apps, schema_editor): - RegistrationDataImport = apps.get_model("registration_data", "RegistrationDataImport") - Individual = apps.get_model("household", "Individual") - Program = apps.get_model("program", "Program") - Household = apps.get_model("household", "Household") - - for program in Program.objects.all(): - # create RDI only if exists any individual without RDI - individual_qs = Individual.objects.filter( - program=program, registration_data_import__isnull=True, household__registration_data_import__isnull=True - ) - aggregated_data = individual_qs.aggregate( - individual_count=Count("id"), household_count=Count("household", distinct=True) - ) - if aggregated_data["individual_count"] > 0: - rdi = RegistrationDataImport.objects.create( - name=f"RDI for Individuals [data migration for Programme: {program.name}]", - status="MERGED", - imported_by=None, - data_source="XLS", - number_of_individuals=aggregated_data["individual_count"], - number_of_households=aggregated_data["household_count"], - business_area=program.business_area, - program_id=program.id, - import_data=None, - ) - - individual_qs.update(registration_data_import_id=rdi.id) - - # assign RDI from Household - household_rdi_subquery = Household.objects.filter( - id=OuterRef("household_id"), registration_data_import__isnull=False - ).values("registration_data_import_id")[:1] - - individual_qs = Individual.objects.filter( - registration_data_import__isnull=True, household__registration_data_import__isnull=False - ).annotate(household_rdi_id=Subquery(household_rdi_subquery)) - individual_qs.update(registration_data_import_id=F("household_rdi_id")) - - rdi_ids = individual_qs.values_list("household_rdi_id", flat=True).distinct() - for rdi_id in rdi_ids: - rdi = RegistrationDataImport.objects.get(id=rdi_id) - rdi.refresh_population_statistics() - - -class Migration(migrations.Migration): - - dependencies = [ - ("registration_data", "0038_migration"), - ("household", "0184_migration"), - ] - - operations = [ - migrations.SeparateDatabaseAndState( - database_operations=[ - migrations.RunPython( - assign_individual_to_rdi, - migrations.RunPython.noop, - ), - ], - state_operations=[ - migrations.AlterField( - model_name="individual", - name="registration_data_import", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="registration_data.registrationdataimport", - ), - ), - ], - ), - ] diff --git a/src/hct_mis_api/apps/household/migrations/0186_migration.py b/src/hct_mis_api/apps/household/migrations/0186_migration.py deleted file mode 100644 index 9bacf5a816..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0186_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-07 14:09 -from django.contrib.postgres.operations import AddIndexConcurrently -from django.db import migrations, models - - -class Migration(migrations.Migration): - atomic = False - - dependencies = [ - ('household', '0185_migration'), - ] - - operations = [ - migrations.SeparateDatabaseAndState( - state_operations=[ - migrations.AlterField( - model_name='document', - name='document_number', - field=models.CharField(db_index=True), - ), - ], - database_operations=[ - AddIndexConcurrently( - model_name="document", - index=models.Index( - fields=["document_number"], name="household_document_number_idx" - ) - ), - ] - ) - ] diff --git a/src/hct_mis_api/apps/household/migrations/0187_migration.py b/src/hct_mis_api/apps/household/migrations/0187_migration.py deleted file mode 100644 index 6323ffaab5..0000000000 --- a/src/hct_mis_api/apps/household/migrations/0187_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-11 12:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0186_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='document_number', - field=models.CharField(blank=True, db_index=True, max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0001_migration.py b/src/hct_mis_api/apps/payment/migrations/0001_migration.py index 1be11b8b2e..958e662ad8 100644 --- a/src/hct_mis_api/apps/payment/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/payment/migrations/0001_migration.py @@ -1,10 +1,23 @@ -# Generated by Django 2.2.8 on 2020-04-29 08:18 +# Generated by Django 3.2.25 on 2024-11-07 12:18 +import concurrency.fields from decimal import Decimal +from django.conf import settings +import django.contrib.postgres.fields +import django.contrib.postgres.fields.ranges +import django.contrib.postgres.validators import django.core.validators from django.db import migrations, models import django.db.models.deletion +import django_fsm +import hct_mis_api.apps.account.models +import hct_mis_api.apps.payment.fields +import hct_mis_api.apps.payment.models +import hct_mis_api.apps.payment.validators +import hct_mis_api.apps.utils.models import model_utils.fields +import multiselectfield.db.fields +import psycopg2.extras import uuid @@ -13,79 +26,609 @@ class Migration(migrations.Migration): initial = True dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('steficon', '0001_migration'), + ('contenttypes', '0002_remove_content_type_name'), + ('program', '0001_migration'), + ('household', '0002_migration'), + ('targeting', '0001_migration'), + ('core', '0002_migration'), ] operations = [ migrations.CreateModel( - name='PaymentEntitlement', + name='CashPlan', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('delivery_type', models.CharField(choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], max_length=255)), - ('entitlement_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('delivered_quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('entitlement_card_issue_date', models.DateField(blank=True, null=True)), - ('entitlement_card_number', models.CharField(max_length=255)), - ('currency', models.CharField(max_length=255)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('status_date', models.DateTimeField()), + ('start_date', models.DateTimeField(blank=True, db_index=True, null=True)), + ('end_date', models.DateTimeField(blank=True, db_index=True, null=True)), + ('exchange_rate', models.DecimalField(blank=True, decimal_places=8, max_digits=14, null=True)), + ('total_entitled_quantity', models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_entitled_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_entitled_quantity_revised', models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_entitled_quantity_revised_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_delivered_quantity', models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_delivered_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_undelivered_quantity', models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_undelivered_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('name', models.CharField(db_index=True, max_length=255)), + ('ca_id', models.CharField(db_index=True, max_length=255, null=True)), + ('ca_hash_id', models.UUIDField(null=True, unique=True)), + ('status', models.CharField(choices=[('Distribution Completed', 'Distribution Completed'), ('Distribution Completed with Errors', 'Distribution Completed with Errors'), ('Transaction Completed', 'Transaction Completed'), ('Transaction Completed with Errors', 'Transaction Completed with Errors')], db_index=True, max_length=255)), + ('distribution_level', models.CharField(max_length=255)), + ('dispersion_date', models.DateTimeField()), + ('coverage_duration', models.PositiveIntegerField()), + ('coverage_unit', models.CharField(max_length=255)), + ('comments', models.CharField(max_length=255, null=True)), + ('delivery_type', models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], db_index=True, max_length=32, null=True)), + ('assistance_measurement', models.CharField(db_index=True, max_length=255)), + ('assistance_through', models.CharField(db_index=True, max_length=255)), + ('vision_id', models.CharField(max_length=255, null=True)), + ('funds_commitment', models.CharField(max_length=255, null=True)), + ('down_payment', models.CharField(max_length=255, null=True)), + ('validation_alerts_count', models.IntegerField()), + ('total_persons_covered', models.IntegerField(db_index=True)), + ('total_persons_covered_revised', models.IntegerField(db_index=True)), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='program.program')), + ], + options={ + 'verbose_name': 'Cash Plan', + 'ordering': ['created_at'], + }, + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), + ), + migrations.CreateModel( + name='DeliveryMechanism', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('payment_gateway_id', models.CharField(max_length=255, null=True, unique=True)), + ('code', models.CharField(max_length=255, unique=True)), + ('name', models.CharField(max_length=255, unique=True)), + ('optional_fields', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)), + ('required_fields', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)), + ('unique_fields', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)), + ('is_active', models.BooleanField(default=True)), + ('transfer_type', models.CharField(choices=[('CASH', 'Cash'), ('VOUCHER', 'Voucher'), ('DIGITAL', 'Digital')], default='CASH', max_length=255)), + ], + options={ + 'verbose_name': 'Delivery Mechanism', + 'verbose_name_plural': 'Delivery Mechanisms', + 'ordering': ['code'], + }, + ), + migrations.CreateModel( + name='FinancialServiceProvider', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('name', models.CharField(max_length=100, unique=True)), + ('vision_vendor_number', models.CharField(max_length=100, unique=True)), + ('delivery_mechanisms_choices', hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=32), null=True, size=None)), + ('distribution_limit', models.DecimalField(blank=True, db_index=True, decimal_places=2, help_text='The maximum amount of money in USD that can be distributed or unlimited if null', max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('communication_channel', models.CharField(choices=[('API', 'API'), ('SFTP', 'SFTP'), ('XLSX', 'XLSX')], db_index=True, max_length=6)), + ('data_transfer_configuration', models.JSONField(blank=True, default=dict, help_text='JSON configuration for the data transfer mechanism', null=True)), + ('payment_gateway_id', models.CharField(max_length=255, null=True)), + ('allowed_business_areas', models.ManyToManyField(blank=True, to='core.BusinessArea')), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_financial_service_providers', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), + ('delivery_mechanisms', models.ManyToManyField(to='payment.DeliveryMechanism')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='FinancialServiceProviderXlsxTemplate', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('name', models.CharField(max_length=120, verbose_name='Name')), + ('columns', multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('individual_id', 'Individual ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reference_id', 'Reference id'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token'), ('status', 'Status'), ('transaction_status_blockchain_link', 'Transaction Status on the Blockchain')], default=['payment_id', 'household_id', 'individual_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reference_id', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token', 'status', 'transaction_status_blockchain_link'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns')), + ('core_fields', hct_mis_api.apps.payment.fields.DynamicChoiceArrayField(base_field=models.CharField(blank=True, max_length=255), blank=True, default=list, size=None)), + ('flex_fields', hct_mis_api.apps.payment.models.FlexFieldArrayField(base_field=models.CharField(blank=True, max_length=255), blank=True, default=list, size=None)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='created_financial_service_provider_xlsx_templates', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='Payment', + fields=[ + ('is_removed', models.BooleanField(default=False)), + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('signature_hash', models.CharField(blank=True, editable=False, max_length=40)), + ('status', models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending'), ('Sent to Payment Gateway', 'Sent to Payment Gateway'), ('Sent to FSP', 'Sent to FSP'), ('Manually Cancelled', 'Manually Cancelled')], default='Pending', max_length=255)), + ('status_date', models.DateTimeField()), + ('delivery_type_choice', models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=32, null=True)), + ('currency', models.CharField(max_length=4)), + ('entitlement_quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('entitlement_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('delivered_quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('delivered_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), ('delivery_date', models.DateTimeField(blank=True, null=True)), - ('transaction_reference_id', models.CharField(max_length=255)), - ('fsp', models.CharField(max_length=255)), + ('transaction_reference_id', models.CharField(blank=True, max_length=255, null=True)), + ('transaction_status_blockchain_link', models.CharField(blank=True, max_length=255, null=True)), + ('conflicted', models.BooleanField(default=False)), + ('excluded', models.BooleanField(default=False)), + ('entitlement_date', models.DateTimeField(blank=True, null=True)), + ('is_follow_up', models.BooleanField(default=False)), + ('reason_for_unsuccessful_payment', models.CharField(blank=True, max_length=255, null=True)), + ('order_number', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(999999999), hct_mis_api.apps.payment.validators.payment_token_and_order_number_validator])), + ('token_number', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1000000), django.core.validators.MaxValueValidator(9999999), hct_mis_api.apps.payment.validators.payment_token_and_order_number_validator])), + ('additional_collector_name', models.CharField(blank=True, help_text='Use this field for reconciliation data when funds are collected by someone other than the designated collector or the alternate collector', max_length=64, null=True)), + ('additional_document_type', models.CharField(blank=True, help_text='Use this field for reconciliation data', max_length=128, null=True)), + ('additional_document_number', models.CharField(blank=True, help_text='Use this field for reconciliation data', max_length=128, null=True)), + ('fsp_auth_code', models.CharField(blank=True, help_text='FSP Auth Code', max_length=128, null=True)), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ('collector', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='collector_payments', to='household.individual')), + ('delivery_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='payment.deliverymechanism')), + ('financial_service_provider', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='payment.financialserviceprovider')), + ('head_of_household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='household.individual')), + ('household', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='household.household')), + ], + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), + ), + migrations.CreateModel( + name='PaymentPlan', + fields=[ + ('is_removed', models.BooleanField(default=False)), + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('status_date', models.DateTimeField()), + ('start_date', models.DateTimeField(blank=True, db_index=True, null=True)), + ('end_date', models.DateTimeField(blank=True, db_index=True, null=True)), + ('exchange_rate', models.DecimalField(blank=True, decimal_places=8, max_digits=14, null=True)), + ('total_entitled_quantity', models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_entitled_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_entitled_quantity_revised', models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_entitled_quantity_revised_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_delivered_quantity', models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_delivered_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_undelivered_quantity', models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('total_undelivered_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])), + ('status', django_fsm.FSMField(choices=[('PREPARING', 'Preparing'), ('OPEN', 'Open'), ('LOCKED', 'Locked'), ('LOCKED_FSP', 'Locked FSP'), ('IN_APPROVAL', 'In Approval'), ('IN_AUTHORIZATION', 'In Authorization'), ('IN_REVIEW', 'In Review'), ('ACCEPTED', 'Accepted'), ('FINISHED', 'Finished')], db_index=True, default='OPEN', max_length=50)), + ('background_action_status', django_fsm.FSMField(blank=True, choices=[('RULE_ENGINE_RUN', 'Rule Engine Running'), ('RULE_ENGINE_ERROR', 'Rule Engine Errored'), ('XLSX_EXPORTING', 'Exporting XLSX file'), ('XLSX_EXPORT_ERROR', 'Export XLSX file Error'), ('XLSX_IMPORT_ERROR', 'Import XLSX file Error'), ('XLSX_IMPORTING_ENTITLEMENTS', 'Importing Entitlements XLSX file'), ('XLSX_IMPORTING_RECONCILIATION', 'Importing Reconciliation XLSX file'), ('EXCLUDE_BENEFICIARIES', 'Exclude Beneficiaries Running'), ('EXCLUDE_BENEFICIARIES_ERROR', 'Exclude Beneficiaries Error'), ('SEND_TO_PAYMENT_GATEWAY', 'Sending to Payment Gateway'), ('SEND_TO_PAYMENT_GATEWAY_ERROR', 'Send to Payment Gateway Error')], db_index=True, default=None, max_length=50, null=True)), + ('currency', models.CharField(choices=[('', 'None'), ('AED', 'United Arab Emirates dirham'), ('AFN', 'Afghan afghani'), ('ALL', 'Albanian lek'), ('AMD', 'Armenian dram'), ('ANG', 'Netherlands Antillean guilder'), ('AOA', 'Angolan kwanza'), ('ARS', 'Argentine peso'), ('AUD', 'Australian dollar'), ('AWG', 'Aruban florin'), ('AZN', 'Azerbaijani manat'), ('BAM', 'Bosnia and Herzegovina convertible mark'), ('BBD', 'Barbados dollar'), ('BDT', 'Bangladeshi taka'), ('BGN', 'Bulgarian lev'), ('BHD', 'Bahraini dinar'), ('BIF', 'Burundian franc'), ('BMD', 'Bermudian dollar'), ('BND', 'Brunei dollar'), ('BOB', 'Boliviano'), ('BOV', 'Bolivian Mvdol (funds code)'), ('BRL', 'Brazilian real'), ('BSD', 'Bahamian dollar'), ('BTN', 'Bhutanese ngultrum'), ('BWP', 'Botswana pula'), ('BYN', 'Belarusian ruble'), ('BZD', 'Belize dollar'), ('CAD', 'Canadian dollar'), ('CDF', 'Congolese franc'), ('CHF', 'Swiss franc'), ('CLP', 'Chilean peso'), ('CNY', 'Chinese yuan'), ('COP', 'Colombian peso'), ('CRC', 'Costa Rican colon'), ('CUC', 'Cuban convertible peso'), ('CUP', 'Cuban peso'), ('CVE', 'Cape Verdean escudo'), ('CZK', 'Czech koruna'), ('DJF', 'Djiboutian franc'), ('DKK', 'Danish krone'), ('DOP', 'Dominican peso'), ('DZD', 'Algerian dinar'), ('EGP', 'Egyptian pound'), ('ERN', 'Eritrean nakfa'), ('ETB', 'Ethiopian birr'), ('EUR', 'Euro'), ('FJD', 'Fiji dollar'), ('FKP', 'Falkland Islands pound'), ('GBP', 'Pound sterling'), ('GEL', 'Georgian lari'), ('GHS', 'Ghanaian cedi'), ('GIP', 'Gibraltar pound'), ('GMD', 'Gambian dalasi'), ('GNF', 'Guinean franc'), ('GTQ', 'Guatemalan quetzal'), ('GYD', 'Guyanese dollar'), ('HKD', 'Hong Kong dollar'), ('HNL', 'Honduran lempira'), ('HRK', 'Croatian kuna'), ('HTG', 'Haitian gourde'), ('HUF', 'Hungarian forint'), ('IDR', 'Indonesian rupiah'), ('ILS', 'Israeli new shekel'), ('INR', 'Indian rupee'), ('IQD', 'Iraqi dinar'), ('IRR', 'Iranian rial'), ('ISK', 'Icelandic króna'), ('JMD', 'Jamaican dollar'), ('JOD', 'Jordanian dinar'), ('JPY', 'Japanese yen'), ('KES', 'Kenyan shilling'), ('KGS', 'Kyrgyzstani som'), ('KHR', 'Cambodian riel'), ('KMF', 'Comoro franc'), ('KPW', 'North Korean won'), ('KRW', 'South Korean won'), ('KWD', 'Kuwaiti dinar'), ('KYD', 'Cayman Islands dollar'), ('KZT', 'Kazakhstani tenge'), ('LAK', 'Lao kip'), ('LBP', 'Lebanese pound'), ('LKR', 'Sri Lankan rupee'), ('LRD', 'Liberian dollar'), ('LSL', 'Lesotho loti'), ('LYD', 'Libyan dinar'), ('MAD', 'Moroccan dirham'), ('MDL', 'Moldovan leu'), ('MGA', 'Malagasy ariary'), ('MKD', 'Macedonian denar'), ('MMK', 'Myanmar kyat'), ('MNT', 'Mongolian tögrög'), ('MOP', 'Macanese pataca'), ('MRU', 'Mauritanian ouguiya'), ('MUR', 'Mauritian rupee'), ('MVR', 'Maldivian rufiyaa'), ('MWK', 'Malawian kwacha'), ('MXN', 'Mexican peso'), ('MYR', 'Malaysian ringgit'), ('MZN', 'Mozambican metical'), ('NAD', 'Namibian dollar'), ('NGN', 'Nigerian naira'), ('NIO', 'Nicaraguan córdoba'), ('NOK', 'Norwegian krone'), ('NPR', 'Nepalese rupee'), ('NZD', 'New Zealand dollar'), ('OMR', 'Omani rial'), ('PAB', 'Panamanian balboa'), ('PEN', 'Peruvian sol'), ('PGK', 'Papua New Guinean kina'), ('PHP', 'Philippine peso'), ('PKR', 'Pakistani rupee'), ('PLN', 'Polish złoty'), ('PYG', 'Paraguayan guaraní'), ('QAR', 'Qatari riyal'), ('RON', 'Romanian leu'), ('RSD', 'Serbian dinar'), ('RUB', 'Russian ruble'), ('RWF', 'Rwandan franc'), ('SAR', 'Saudi riyal'), ('SBD', 'Solomon Islands dollar'), ('SCR', 'Seychelles rupee'), ('SDG', 'Sudanese pound'), ('SEK', 'Swedish krona/kronor'), ('SGD', 'Singapore dollar'), ('SHP', 'Saint Helena pound'), ('SLL', 'Sierra Leonean leone'), ('SOS', 'Somali shilling'), ('SRD', 'Surinamese dollar'), ('SSP', 'South Sudanese pound'), ('STN', 'São Tomé and Príncipe dobra'), ('SVC', 'Salvadoran colón'), ('SYP', 'Syrian pound'), ('SZL', 'Swazi lilangeni'), ('THB', 'Thai baht'), ('TJS', 'Tajikistani somoni'), ('TMT', 'Turkmenistan manat'), ('TND', 'Tunisian dinar'), ('TOP', 'Tongan paʻanga'), ('TRY', 'Turkish lira'), ('TTD', 'Trinidad and Tobago dollar'), ('TWD', 'New Taiwan dollar'), ('TZS', 'Tanzanian shilling'), ('UAH', 'Ukrainian hryvnia'), ('UGX', 'Ugandan shilling'), ('USD', 'United States dollar'), ('UYU', 'Uruguayan peso'), ('UYW', 'Unidad previsional[14]'), ('UZS', 'Uzbekistan som'), ('VES', 'Venezuelan bolívar soberano'), ('VND', 'Vietnamese đồng'), ('VUV', 'Vanuatu vatu'), ('WST', 'Samoan tala'), ('XAF', 'CFA franc BEAC'), ('XAG', 'Silver (one troy ounce)'), ('XAU', 'Gold (one troy ounce)'), ('XCD', 'East Caribbean dollar'), ('XOF', 'CFA franc BCEAO'), ('XPF', 'CFP franc (franc Pacifique)'), ('YER', 'Yemeni rial'), ('ZAR', 'South African rand'), ('ZMW', 'Zambian kwacha'), ('ZWL', 'Zimbabwean dollar'), ('USDC', 'USD Coin')], max_length=4)), + ('dispersion_start_date', models.DateField()), + ('dispersion_end_date', models.DateField()), + ('female_children_count', models.PositiveIntegerField(default=0)), + ('male_children_count', models.PositiveIntegerField(default=0)), + ('female_adults_count', models.PositiveIntegerField(default=0)), + ('male_adults_count', models.PositiveIntegerField(default=0)), + ('total_households_count', models.PositiveIntegerField(default=0)), + ('total_individuals_count', models.PositiveIntegerField(default=0)), + ('imported_file_date', models.DateTimeField(blank=True, null=True)), + ('steficon_applied_date', models.DateTimeField(blank=True, null=True)), + ('is_follow_up', models.BooleanField(default=False)), + ('exclusion_reason', models.TextField(blank=True)), + ('exclude_household_error', models.TextField(blank=True)), + ('name', models.CharField(blank=True, max_length=255, null=True, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='created_payment_plans', to=settings.AUTH_USER_MODEL)), + ('export_file_entitlement', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.filetemp')), + ('export_file_per_fsp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.filetemp')), + ('export_pdf_file_summary', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.filetemp')), + ('imported_file', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.filetemp')), + ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='program.program')), + ('program_cycle', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payment_plans', to='program.programcycle')), + ('source_payment_plan', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='follow_ups', to='payment.paymentplan')), + ('steficon_rule', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='payment_plans', to='steficon.rulecommit')), + ('target_population', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_plans', to='targeting.targetpopulation')), + ], + options={ + 'verbose_name': 'Payment Plan', + 'ordering': ['created_at'], + }, + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), + migrations.CreateModel( + name='PaymentPlanSplit', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('split_type', models.CharField(choices=[('BY_RECORDS', 'By Records'), ('BY_COLLECTOR', 'By Collector'), ('BY_ADMIN_AREA1', 'By Admin Area 1'), ('BY_ADMIN_AREA2', 'By Admin Area 2'), ('BY_ADMIN_AREA3', 'By Admin Area 3')], max_length=24)), + ('chunks_no', models.IntegerField(blank=True, null=True)), + ('sent_to_payment_gateway', models.BooleanField(default=False)), + ('order', models.IntegerField(default=0)), + ('payment_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='splits', to='payment.paymentplan')), ], options={ 'abstract': False, }, ), + migrations.CreateModel( + name='ServiceProvider', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('ca_id', models.CharField(max_length=255, unique=True)), + ('full_name', models.CharField(max_length=255, null=True)), + ('short_name', models.CharField(max_length=100, null=True)), + ('country', models.CharField(max_length=3)), + ('vision_id', models.CharField(max_length=255, null=True)), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='PaymentVerificationSummary', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('status', models.CharField(choices=[('ACTIVE', 'Active'), ('FINISHED', 'Finished'), ('PENDING', 'Pending')], db_index=True, default='PENDING', max_length=50, verbose_name='Verification status')), + ('activation_date', models.DateTimeField(null=True)), + ('completion_date', models.DateTimeField(null=True)), + ('payment_plan_object_id', models.UUIDField()), + ('payment_plan_content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')), + ], + ), + migrations.CreateModel( + name='PaymentVerificationPlan', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('status', models.CharField(choices=[('ACTIVE', 'Active'), ('FINISHED', 'Finished'), ('PENDING', 'Pending'), ('INVALID', 'Invalid'), ('RAPID_PRO_ERROR', 'RapidPro Error')], db_index=True, default='PENDING', max_length=50)), + ('payment_plan_object_id', models.UUIDField()), + ('sampling', models.CharField(choices=[('FULL_LIST', 'Full list'), ('RANDOM', 'Random sampling')], max_length=50)), + ('verification_channel', models.CharField(choices=[('MANUAL', 'MANUAL'), ('RAPIDPRO', 'RAPIDPRO'), ('XLSX', 'XLSX')], max_length=50)), + ('sample_size', models.PositiveIntegerField(blank=True, null=True)), + ('responded_count', models.PositiveIntegerField(blank=True, null=True)), + ('received_count', models.PositiveIntegerField(blank=True, null=True)), + ('not_received_count', models.PositiveIntegerField(blank=True, null=True)), + ('received_with_problems_count', models.PositiveIntegerField(blank=True, null=True)), + ('confidence_interval', models.FloatField(blank=True, null=True)), + ('margin_of_error', models.FloatField(blank=True, null=True)), + ('rapid_pro_flow_id', models.CharField(blank=True, max_length=255)), + ('rapid_pro_flow_start_uuids', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=255), default=list, size=None)), + ('age_filter', models.JSONField(blank=True, null=True)), + ('excluded_admin_areas_filter', models.JSONField(blank=True, null=True)), + ('sex_filter', models.CharField(blank=True, max_length=10, null=True)), + ('activation_date', models.DateTimeField(null=True)), + ('completion_date', models.DateTimeField(null=True)), + ('xlsx_file_exporting', models.BooleanField(default=False)), + ('xlsx_file_imported', models.BooleanField(default=False)), + ('error', models.CharField(blank=True, max_length=500, null=True)), + ('payment_plan_content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')), + ], + options={ + 'ordering': ('created_at',), + }, + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), + migrations.CreateModel( + name='PaymentVerification', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('payment_object_id', models.UUIDField()), + ('status', models.CharField(choices=[('NOT_RECEIVED', 'NOT RECEIVED'), ('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], default='PENDING', max_length=50)), + ('status_date', models.DateTimeField(null=True)), + ('received_amount', models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), + ('sent_to_rapid_pro', models.BooleanField(default=False)), + ('payment_content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')), + ('payment_verification_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_record_verifications', to='payment.paymentverificationplan')), + ], + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), migrations.CreateModel( name='PaymentRecord', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('status', models.CharField(choices=[('SUCCESS', 'Sucess'), ('PENDING', 'Pending'), ('ERROR', 'Error')], max_length=255)), - ('name', models.CharField(max_length=255)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('status', models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending'), ('Sent to Payment Gateway', 'Sent to Payment Gateway'), ('Sent to FSP', 'Sent to FSP'), ('Manually Cancelled', 'Manually Cancelled')], default='Pending', max_length=255)), ('status_date', models.DateTimeField()), - ('cash_assist_id', models.CharField(max_length=255)), - ('head_of_household', models.CharField(max_length=255)), - ('total_person_covered', models.PositiveIntegerField()), + ('delivery_type_choice', models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=32, null=True)), + ('currency', models.CharField(max_length=4)), + ('entitlement_quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('entitlement_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('delivered_quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('delivered_quantity_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('delivery_date', models.DateTimeField(blank=True, null=True)), + ('transaction_reference_id', models.CharField(blank=True, max_length=255, null=True)), + ('transaction_status_blockchain_link', models.CharField(blank=True, max_length=255, null=True)), + ('ca_id', models.CharField(db_index=True, max_length=255, null=True)), + ('ca_hash_id', models.UUIDField(null=True, unique=True)), + ('full_name', models.CharField(max_length=255)), + ('total_persons_covered', models.IntegerField()), ('distribution_modality', models.CharField(max_length=255)), + ('target_population_cash_assist_id', models.CharField(max_length=255)), + ('entitlement_card_number', models.CharField(max_length=255, null=True)), + ('entitlement_card_status', models.CharField(choices=[('ACTIVE', 'Active'), ('INACTIVE', 'Inactive')], default='ACTIVE', max_length=20, null=True)), + ('entitlement_card_issue_date', models.DateField(null=True)), + ('vision_id', models.CharField(max_length=255, null=True)), + ('registration_ca_id', models.CharField(max_length=255, null=True)), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ('delivery_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='payment.deliverymechanism')), + ('head_of_household', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='household.individual')), + ('household', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='household.household')), + ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payment_items', to='payment.cashplan')), + ('service_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='payment.serviceprovider')), + ('target_population', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_records', to='targeting.targetpopulation')), ], options={ 'abstract': False, }, + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), ), migrations.CreateModel( - name='VerificationProcess', + name='PaymentPlanSupportingDocument', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=255)), + ('file', models.FileField(upload_to='')), + ('uploaded_at', models.DateTimeField(auto_now_add=True)), + ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('payment_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='payment.paymentplan')), + ], + options={ + 'ordering': ['uploaded_at'], + }, + ), + migrations.CreateModel( + name='PaymentPlanSplitPayments', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('payment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_plan_split_payment', to='payment.payment')), + ('payment_plan_split', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_plan_split', to='payment.paymentplansplit')), + ], + ), + migrations.AddField( + model_name='paymentplansplit', + name='payments', + field=models.ManyToManyField(related_name='_payment_paymentplansplit_payments_+', through='payment.PaymentPlanSplitPayments', to='payment.Payment'), + ), + migrations.CreateModel( + name='PaymentHouseholdSnapshot', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('payment_records_to_verify', models.PositiveIntegerField()), - ('verification_type', models.CharField(choices=[('RAPIDPRO', 'RapidPro'), ('MANUAL', 'Manual'), ('OTHER', 'Other')], max_length=10)), - ('status', models.CharField(choices=[('PENDING', 'Pending'), ('ERROR', 'Error'), ('SUCCESS', 'Success')], max_length=10)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('snapshot_data', models.JSONField(default=dict)), + ('household_id', models.UUIDField()), + ('payment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='household_snapshot', to='payment.payment')), ], options={ 'abstract': False, }, ), + migrations.AddField( + model_name='payment', + name='parent', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_items', to='payment.paymentplan'), + ), + migrations.AddField( + model_name='payment', + name='program', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), + ), + migrations.AddField( + model_name='payment', + name='source_payment', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='follow_ups', to='payment.payment'), + ), + migrations.CreateModel( + name='FspXlsxTemplatePerDeliveryMechanism', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('delivery_mechanism_choice', models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=255, verbose_name='Delivery Mechanism')), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='created_fsp_xlsx_template_per_delivery_mechanisms', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), + ('delivery_mechanism', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='payment.deliverymechanism')), + ('financial_service_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fsp_xlsx_template_per_delivery_mechanisms', to='payment.financialserviceprovider')), + ('xlsx_template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fsp_xlsx_template_per_delivery_mechanisms', to='payment.financialserviceproviderxlsxtemplate')), + ], + ), + migrations.AddField( + model_name='financialserviceprovider', + name='xlsx_templates', + field=models.ManyToManyField(related_name='financial_service_providers', through='payment.FspXlsxTemplatePerDeliveryMechanism', to='payment.FinancialServiceProviderXlsxTemplate'), + ), + migrations.CreateModel( + name='DeliveryMechanismPerPaymentPlan', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('sent_date', models.DateTimeField()), + ('status', django_fsm.FSMField(db_index=True, default='NOT_SENT', max_length=50)), + ('delivery_mechanism_choice', models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], db_index=True, max_length=255, null=True)), + ('delivery_mechanism_order', models.PositiveIntegerField()), + ('sent_to_payment_gateway', models.BooleanField(default=False)), + ('chosen_configuration', models.CharField(max_length=50, null=True)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='created_delivery_mechanisms', to=settings.AUTH_USER_MODEL)), + ('delivery_mechanism', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='payment.deliverymechanism')), + ('financial_service_provider', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='delivery_mechanisms_per_payment_plan', to='payment.financialserviceprovider')), + ('payment_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='delivery_mechanisms', to='payment.paymentplan')), + ('sent_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sent_delivery_mechanisms', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='DeliveryMechanismData', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('rdi_merge_status', models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('signature_hash', models.CharField(blank=True, editable=False, max_length=40)), + ('delivery_mechanism_choice', models.CharField(blank=True, choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=255, null=True, verbose_name='Delivery Mechanism')), + ('data', models.JSONField(blank=True, default=dict)), + ('is_valid', models.BooleanField(default=False)), + ('validation_errors', models.JSONField(default=dict)), + ('unique_key', models.CharField(blank=True, editable=False, max_length=256, null=True, unique=True)), + ('delivery_mechanism', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='payment.deliverymechanism')), + ('individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='delivery_mechanisms_data', to='household.individual')), + ('possible_duplicate_of', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='possible_duplicates', to='payment.deliverymechanismdata')), + ], + ), + migrations.AddField( + model_name='cashplan', + name='service_provider', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cash_plans', to='payment.serviceprovider'), + ), migrations.CreateModel( - name='PaymentRecordVerification', + name='ApprovalProcess', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('start_date', models.DateTimeField()), - ('end_date', models.DateTimeField()), - ('sample_size', models.PositiveIntegerField()), - ('responded', models.PositiveIntegerField()), - ('received', models.PositiveIntegerField()), - ('not_received', models.PositiveIntegerField()), - ('received_correct_amount', models.PositiveIntegerField()), - ('received_wrong_amount', models.PositiveIntegerField()), - ('verification_process', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='verification_processes', to='payment.VerificationProcess')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('sent_for_approval_date', models.DateTimeField(null=True)), + ('sent_for_authorization_date', models.DateTimeField(null=True)), + ('sent_for_finance_release_date', models.DateTimeField(null=True)), + ('approval_number_required', models.PositiveIntegerField(default=1)), + ('authorization_number_required', models.PositiveIntegerField(default=1)), + ('finance_release_number_required', models.PositiveIntegerField(default=1)), + ('payment_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='approval_process', to='payment.paymentplan')), + ('sent_for_approval_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('sent_for_authorization_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), + ('sent_for_finance_release_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ], options={ - 'abstract': False, + 'verbose_name_plural': 'Approval Processes', + 'ordering': ('-created_at',), }, ), + migrations.CreateModel( + name='Approval', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('type', models.CharField(choices=[('APPROVAL', 'Approval'), ('AUTHORIZATION', 'Authorization'), ('FINANCE_RELEASE', 'Finance Release'), ('REJECT', 'Reject')], default='APPROVAL', max_length=50, verbose_name='Approval type')), + ('comment', models.CharField(blank=True, max_length=500, null=True)), + ('approval_process', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='approvals', to='payment.approvalprocess')), + ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'ordering': ('-created_at',), + }, + ), + migrations.CreateModel( + name='AcceptanceProcessThreshold', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('payments_range_usd', django.contrib.postgres.fields.ranges.IntegerRangeField(default=psycopg2.extras.NumericRange(0, None, '[)'), validators=[django.contrib.postgres.validators.RangeMinValueValidator(0)])), + ('approval_number_required', models.PositiveIntegerField(default=1)), + ('authorization_number_required', models.PositiveIntegerField(default=1)), + ('finance_release_number_required', models.PositiveIntegerField(default=1)), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='acceptance_process_thresholds', to='core.businessarea')), + ], + options={ + 'ordering': ('payments_range_usd',), + }, + ), + migrations.CreateModel( + name='PendingDeliveryMechanismData', + fields=[ + ], + options={ + 'verbose_name': 'Imported Delivery Mechanism Data', + 'verbose_name_plural': 'Imported Delivery Mechanism Datas', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('payment.deliverymechanismdata',), + ), + migrations.AddIndex( + model_name='paymentverificationsummary', + index=models.Index(fields=['payment_plan_content_type', 'payment_plan_object_id'], name='payment_pay_payment_8b7d61_idx'), + ), + migrations.AddConstraint( + model_name='paymentverificationsummary', + constraint=models.UniqueConstraint(fields=('payment_plan_content_type', 'payment_plan_object_id'), name='payment_plan_content_type_and_payment_plan_id'), + ), + migrations.AddIndex( + model_name='paymentverificationplan', + index=models.Index(fields=['payment_plan_content_type', 'payment_plan_object_id'], name='payment_pay_payment_3ba67e_idx'), + ), + migrations.AddIndex( + model_name='paymentverification', + index=models.Index(fields=['payment_content_type', 'payment_object_id'], name='payment_pay_payment_ec4a29_idx'), + ), + migrations.AddConstraint( + model_name='paymentverification', + constraint=models.UniqueConstraint(fields=('payment_content_type', 'payment_object_id'), name='payment_content_type_and_payment_id'), + ), + migrations.AlterUniqueTogether( + name='paymentplansplitpayments', + unique_together={('payment_plan_split', 'payment')}, + ), + migrations.AddConstraint( + model_name='paymentplan', + constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('name', 'program', 'is_removed'), name='name_unique_per_program'), + ), + migrations.AddConstraint( + model_name='payment', + constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('parent', 'household'), name='payment_plan_and_household'), + ), + migrations.AddConstraint( + model_name='payment', + constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('program_id', 'order_number'), name='order_number_unique_per_program'), + ), + migrations.AddConstraint( + model_name='payment', + constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('program_id', 'token_number'), name='token_number_unique_per_program'), + ), + migrations.AlterUniqueTogether( + name='fspxlsxtemplateperdeliverymechanism', + unique_together={('financial_service_provider', 'delivery_mechanism')}, + ), + migrations.AddConstraint( + model_name='deliverymechanismperpaymentplan', + constraint=models.UniqueConstraint(fields=('payment_plan', 'delivery_mechanism', 'delivery_mechanism_order'), name='unique payment_plan_delivery_mechanism'), + ), + migrations.AddConstraint( + model_name='deliverymechanismdata', + constraint=models.UniqueConstraint(fields=('individual', 'delivery_mechanism'), name='unique_individual_delivery_mechanism'), + ), + migrations.RunSQL( + sql='ALTER TABLE payment_paymentverificationplan ADD unicef_id_index SERIAL', + ), + migrations.RunSQL( + sql="\n CREATE OR REPLACE FUNCTION create_pvp_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n BEGIN\n NEW.unicef_id := format('PVP-%s', NEW.unicef_id_index);\n return NEW;\n END\n $$;\n \n CREATE TRIGGER create_pvp_unicef_id BEFORE INSERT ON payment_paymentverificationplan FOR EACH ROW EXECUTE PROCEDURE create_pvp_unicef_id();\n ", + ), + migrations.RunSQL( + sql="\n CREATE OR REPLACE FUNCTION payment_plan_fill_unicef_id_per_business_area_seq() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n DECLARE businessAreaID varchar;\n DECLARE businessAreaCode varchar;\n begin\n SELECT INTO businessAreaID translate(ba.id::text, '-','_') FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n SELECT INTO businessAreaCode ba.code FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n\n NEW.unicef_id := format('PP-%s-%s-%s', trim(businessAreaCode), to_char(NEW.created_at, 'yy'), trim(replace(to_char(nextval('payment_plan_business_area_seq_' || businessAreaID),'00000000'),',','.')));\n RETURN NEW;\n end\n $$;\n ", + ), + migrations.RunSQL( + sql="CREATE TRIGGER payment_plan_fill_unicef_id_per_business_area_seq BEFORE INSERT ON payment_paymentplan FOR EACH ROW EXECUTE PROCEDURE payment_plan_fill_unicef_id_per_business_area_seq();", + ), + migrations.RunSQL( + sql="\n CREATE OR REPLACE FUNCTION payment_fill_unicef_id_per_business_area_seq() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n DECLARE businessAreaID varchar;\n DECLARE businessAreaCode varchar;\n begin\n SELECT INTO businessAreaID translate(ba.id::text, '-','_') FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n SELECT INTO businessAreaCode ba.code FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n\n NEW.unicef_id := format('RCPT-%s-%s-%s', trim(businessAreaCode), to_char(NEW.created_at, 'yy'), trim(replace(to_char(nextval('payment_business_area_seq_' || businessAreaID),'0,000,000'),',','.')));\n RETURN NEW;\n end\n $$;\n ", + ), + migrations.RunSQL( + sql="CREATE TRIGGER payment_fill_unicef_id_per_business_area_seq BEFORE INSERT ON payment_payment FOR EACH ROW EXECUTE PROCEDURE payment_fill_unicef_id_per_business_area_seq();", + ), ] diff --git a/src/hct_mis_api/apps/payment/migrations/0147_migration.py b/src/hct_mis_api/apps/payment/migrations/0002_migration.py similarity index 86% rename from src/hct_mis_api/apps/payment/migrations/0147_migration.py rename to src/hct_mis_api/apps/payment/migrations/0002_migration.py index a67f542dea..1d7a890a66 100644 --- a/src/hct_mis_api/apps/payment/migrations/0147_migration.py +++ b/src/hct_mis_api/apps/payment/migrations/0002_migration.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.25 on 2024-10-30 17:40 +# Generated by Django 3.2.25 on 2024-11-07 14:43 from django.db import migrations @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('payment', '0146_migration'), + ('payment', '0001_migration'), ] operations = [ diff --git a/src/hct_mis_api/apps/payment/migrations/0002_migration_squashed_0003_migration.py b/src/hct_mis_api/apps/payment/migrations/0002_migration_squashed_0003_migration.py deleted file mode 100644 index 77f4db22b7..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0002_migration_squashed_0003_migration.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-09 07:12 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0001_migration'), - ('program', '0001_migration'), - ('household', '0002_migration'), - ('targeting', '0001_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='paymentrecordverification', - name='verification_process', - ), - migrations.DeleteModel( - name='PaymentEntitlement', - ), - migrations.DeleteModel( - name='PaymentRecord', - ), - migrations.DeleteModel( - name='PaymentRecordVerification', - ), - migrations.DeleteModel( - name='VerificationProcess', - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0004_migration_squashed_0009_migration.py b/src/hct_mis_api/apps/payment/migrations/0004_migration_squashed_0009_migration.py deleted file mode 100644 index ae96dae86c..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0004_migration_squashed_0009_migration.py +++ /dev/null @@ -1,106 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-11 10:59 - -from decimal import Decimal -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0003_migration_squashed_0086_migration'), - ('core', '0002_migration_squashed_0006_migration'), - ('program', '0002_migration_squashed_0020_migration'), - ('targeting', '0006_migration'), - ('payment', '0002_migration_squashed_0003_migration'), - ] - - operations = [ - migrations.CreateModel( - name='ServiceProvider', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('ca_id', models.CharField(max_length=255, unique=True)), - ('full_name', models.CharField(max_length=255)), - ('short_name', models.CharField(max_length=100)), - ('country', models.CharField(max_length=3)), - ('vision_id', models.CharField(max_length=255)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='PaymentRecord', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('status', models.CharField(choices=[('SUCCESS', 'Sucess'), ('PENDING', 'Pending'), ('ERROR', 'Error')], max_length=255)), - ('status_date', models.DateTimeField()), - ('ca_id', models.CharField(max_length=255, null=True)), - ('ca_hash_id', models.UUIDField(null=True, unique=True)), - ('full_name', models.CharField(max_length=255)), - ('total_persons_covered', models.IntegerField()), - ('distribution_modality', models.CharField(max_length=255)), - ('target_population_cash_assist_id', models.CharField(max_length=255)), - ('entitlement_card_number', models.CharField(max_length=255)), - ('entitlement_card_status', models.CharField(choices=[('ACTIVE', 'Active'), ('INACTIVE', 'Inactive')], default='ACTIVE', max_length=20)), - ('entitlement_card_issue_date', models.DateField()), - ('delivery_type', models.CharField(choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], default='ACTIVE', max_length=20)), - ('currency', models.CharField(max_length=4)), - ('entitlement_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('delivered_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('delivery_date', models.DateTimeField()), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ('cash_plan', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payment_records', to='program.cashplan')), - ('household', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_records', to='household.household')), - ('service_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_records', to='payment.serviceprovider')), - ('target_population', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_records', to='targeting.targetpopulation')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='CashPlanPaymentVerification', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('status', models.CharField(choices=[('PENDING', 'Pending'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], default='PENDING', max_length=50)), - ('sampling', models.CharField(choices=[('FULL_LIST', 'Full list'), ('RANDOM', 'Draft')], max_length=50)), - ('verification_method', models.CharField(choices=[('RAPIDPRO', 'RAPIDPRO'), ('XLSX', 'XLSX'), ('MANUAL', 'MANUAL')], max_length=50)), - ('sample_size', models.PositiveIntegerField(null=True, blank=True)), - ('responded_count', models.PositiveIntegerField(null=True, blank=True)), - ('received_count', models.PositiveIntegerField(null=True, blank=True)), - ('not_received_count', models.PositiveIntegerField(null=True, blank=True)), - ('received_with_problems_count', models.PositiveIntegerField(null=True, blank=True)), - ('cash_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='verifications', to='program.cashplan')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='PaymentVerification', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('status', models.CharField(choices=[('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('NOT_RECEIVED', 'NOT RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], default='DRAFT', max_length=50)), - ('status_date', models.DateField(null=True)), - ('cash_plan_payment_verification', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_record_verifications', to='payment.cashplanpaymentverification')), - ('payment_record', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='verifications', to='payment.paymentrecord')), - ], - options={ - 'abstract': False, - }, - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0010_migration_squashed_0029_migration.py b/src/hct_mis_api/apps/payment/migrations/0010_migration_squashed_0029_migration.py deleted file mode 100644 index 4bd79334a7..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0010_migration_squashed_0029_migration.py +++ /dev/null @@ -1,264 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 19:44 - -import concurrency.fields -from decimal import Decimal -import django.contrib.postgres.fields.jsonb -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -# Functions from the following migrations need manual copying. -# Move them and any dependencies into this file, then update the -# RunPython operations to refer to the local versions: -def change_all_rapidpro_to_pending(apps, schema_editor): - CashPlanPaymentVerification = apps.get_model("payment", "CashPlanPaymentVerification") - CashPlanPaymentVerification.objects.filter( - verification_method="RAPIDPRO", - ).update(status="PENDING") - -def empty_reverse(apps, schema_editor): - pass - -def populate_existing_payment_record_usd_amount(apps, schema_editor): - PaymentRecord = apps.get_model("payment", "PaymentRecord") - all_payment_records = PaymentRecord.objects.all() - - for payment_record in all_payment_records: - exchange_rate = payment_record.cash_plan.exchange_rate if payment_record.cash_plan else None - if exchange_rate: - payment_record.delivered_quantity_usd = Decimal(payment_record.delivered_quantity * exchange_rate).quantize( - Decimal(".01") - ) - PaymentRecord.objects.bulk_update(all_payment_records, ["delivered_quantity_usd"]) - -def fill_in_registration_ca_id(apps, schema_editor): - pass - - -def assign_valid_delivered_quantity(apps, schema_editor): - PaymentRecord = apps.get_model("payment", "PaymentRecord") - all_payment_records = PaymentRecord.objects.all() - - payment_records_to_update = [] - for payment_record in all_payment_records: - if payment_record.currency == "USD": - payment_record.delivered_quantity_usd = payment_record.delivered_quantity - payment_records_to_update.append(payment_record) - - PaymentRecord.objects.bulk_update(payment_records_to_update, ["delivered_quantity_usd"]) - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0004_migration_squashed_0009_migration'), - ('household', '0003_migration_squashed_0086_migration'), - ('program', '0002_migration_squashed_0020_migration'), - ] - - operations = [ - migrations.AddField( - model_name='paymentverification', - name='received_amount', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AddField( - model_name='paymentrecord', - name='transaction_reference_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='paymentrecord', - name='vision_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='confidence_interval', - field=models.FloatField(null=True, blank=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='margin_of_error', - field=models.FloatField(null=True, blank=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='rapid_pro_flow_id', - field=models.CharField(blank=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='sampling', - field=models.CharField(choices=[('FULL_LIST', 'Full list'), ('RANDOM', 'Random sampling')], max_length=50), - ), - migrations.AlterField( - model_name='paymentverification', - name='status', - field=models.CharField(choices=[('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('NOT_RECEIVED', 'NOT RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], default='PENDING', max_length=50), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='rapid_pro_flow_start_uuid', - field=models.CharField(blank=True, max_length=255), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='age_filter', - field=django.contrib.postgres.fields.jsonb.JSONField(null=True, blank=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='excluded_admin_areas_filter', - field=django.contrib.postgres.fields.jsonb.JSONField(null=True, blank=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='sex_filter', - field=models.CharField(max_length=10, null=True, blank=True), - ), - migrations.RunPython(change_all_rapidpro_to_pending, empty_reverse), - migrations.AddField( - model_name='cashplanpaymentverification', - name='activation_date', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='completion_date', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='paymentrecord', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AddField( - model_name='paymentverification', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AddField( - model_name='paymentrecord', - name='delivered_quantity_usd', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.RunPython(populate_existing_payment_record_usd_amount, empty_reverse), - migrations.AddField( - model_name='paymentrecord', - name='head_of_household', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payment_records', to='household.individual'), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], max_length=20), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_card_issue_date', - field=models.DateField(null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_card_number', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_card_status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('INACTIVE', 'Inactive')], default='ACTIVE', max_length=20, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('SUCCESS', 'Success'), ('PENDING', 'Pending'), ('ERROR', 'Error')], max_length=255), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, default='PENDING', max_length=50), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='paymentverification', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='paymentverification', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='serviceprovider', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='serviceprovider', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('In Kind', 'In Kind'), ('Mobile Money', 'Mobile Money'), ('Other', 'Other'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24), - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('Transaction Successful', 'Transaction Successful'), ('Transaction Pending', 'Transaction Pending'), ('Transaction Erroneous', 'Transaction Erroneous')], max_length=255), - ), - migrations.AddField( - model_name='paymentrecord', - name='registration_ca_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.RunPython(fill_in_registration_ca_id, empty_reverse), - migrations.AlterField( - model_name='paymentverification', - name='status_date', - field=models.DateTimeField(null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed')], max_length=255), - ), - migrations.RunPython(assign_valid_delivered_quantity, empty_reverse), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_date', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='ca_id', - field=models.CharField(db_index=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0030_migration_squashed_0051_migration.py b/src/hct_mis_api/apps/payment/migrations/0030_migration_squashed_0051_migration.py deleted file mode 100644 index b046add4fa..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0030_migration_squashed_0051_migration.py +++ /dev/null @@ -1,278 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 19:37 - -from django.conf import settings -import django.contrib.postgres.fields -from django.db import migrations, models -import django.db.migrations.operations.special -import django.db.models.deletion -import model_utils.fields -import uuid - -from django.core.paginator import Paginator - - -# Functions from the following migrations need manual copying. -# Move them and any dependencies into this file, then update the -# RunPython operations to refer to the local versions: -def empty_reverse(apps, schema_editor): - pass - - -def move_status_to_summary(apps, schema_editor): - CashPlan = apps.get_model("program", "CashPlan") - CashPlanPaymentVerificationSummary = apps.get_model("payment", "CashPlanPaymentVerificationSummary") - for cash_plan in CashPlan.objects.all(): - verification = cash_plan.verifications.first() - activation_date = None - completion_date = None - if verification: - activation_date = verification.activation_date - completion_date = verification.completion_date - CashPlanPaymentVerificationSummary.objects.create( - status=cash_plan.verification_status, - cash_plan=cash_plan, - activation_date=activation_date, - completion_date=completion_date, - ) - - -def migrate_data(apps, schema_editor): - PaymentVerification = apps.get_model('payment', 'PaymentVerification') - - payment_verifications = PaymentVerification.objects.all().order_by("-id") - paginator = Paginator(payment_verifications, 100) - for page in paginator.page_range: - for payment_verification in paginator.page(page).object_list: - payment_verification.payment_record_new = payment_verification.payment_record - payment_verification.save() - -def get_cash_plan_payment_verification_model(apps): - return apps.get_model("payment", "CashPlanPaymentVerification") - - -class Migrator: - uuids = [] - - @staticmethod - def save_current_uuids(apps, schema_editor): - for cppv in get_cash_plan_payment_verification_model(apps).objects.all(): - if cppv.rapid_pro_flow_start_uuid: - Migrator.uuids.append({"cppv": cppv.pk, "uuid": cppv.rapid_pro_flow_start_uuid}) - - @staticmethod - def apply_saved_uuids(apps, schema_editor): - for uuid in Migrator.uuids: - cppv = get_cash_plan_payment_verification_model(apps).objects.get(pk=uuid["cppv"]) - cppv.rapid_pro_flow_start_uuids = [uuid["uuid"]] - cppv.save() - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0030_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('payment', '0010_migration_squashed_0029_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='serviceprovider', - name='full_name', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='serviceprovider', - name='short_name', - field=models.CharField(max_length=100, null=True), - ), - migrations.AlterField( - model_name='serviceprovider', - name='vision_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='unicef_id', - field=models.CharField(blank=True, max_length=250), - ), - migrations.RunSQL( - sql='ALTER TABLE payment_cashplanpaymentverification ADD unicef_id_index SERIAL', - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION create_pvp_unicef_id() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n BEGIN\n NEW.unicef_id := format('PVP-%s', NEW.unicef_id_index);\n return NEW;\n END\n $$;\n \n CREATE TRIGGER create_pvp_unicef_id BEFORE INSERT ON payment_cashplanpaymentverification FOR EACH ROW EXECUTE PROCEDURE create_pvp_unicef_id();\n ", - ), - migrations.RunSQL( - sql="UPDATE payment_cashplanpaymentverification SET unicef_id = format('PVP-%s', unicef_id_index)", - ), - migrations.AddField( - model_name='paymentrecord', - name='is_included', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous')], max_length=255), - ), - migrations.CreateModel( - name='CashPlanPaymentVerificationSummary', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('status', models.CharField(choices=[('PENDING', 'Pending'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, default='PENDING', max_length=50)), - ('activation_date', models.DateTimeField(null=True)), - ('completion_date', models.DateTimeField(null=True)), - ('cash_plan', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='cash_plan_payment_verification_summary', to='program.cashplan')), - ], - options={ - 'abstract': False, - }, - ), - migrations.RunPython(move_status_to_summary, empty_reverse), - migrations.AddField( - model_name='paymentverification', - name='payment_record_new', - field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='verification', to='payment.paymentrecord'), - ), - migrations.RunPython(migrate_data, migrations.RunPython.noop), - migrations.RenameField( - model_name='paymentverification', - old_name='payment_record', - new_name='payment_record_old', - ), - migrations.RenameField( - model_name='paymentverification', - old_name='payment_record_new', - new_name='payment_record', - ), - migrations.RemoveField( - model_name='paymentverification', - name='payment_record_old', - ), - migrations.RemoveField( - model_name='paymentrecord', - name='is_included', - ), - migrations.RenameField( - model_name='cashplanpaymentverification', - old_name='verification_method', - new_name='verification_channel', - ), - migrations.AlterModelOptions( - name='cashplanpaymentverification', - options={'ordering': ('created_at',)}, - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='age_filter', - field=models.JSONField(null=True, blank=True), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='excluded_admin_areas_filter', - field=models.JSONField(null=True, blank=True), - ), - migrations.AlterField( - model_name='cashplanpaymentverificationsummary', - name='status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, default='PENDING', max_length=50, verbose_name='Verification status'), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('FINISHED', 'Finished'), ('PENDING', 'Pending')], db_index=True, default='PENDING', max_length=50), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='verification_channel', - field=models.CharField(choices=[('MANUAL', 'MANUAL'), ('RAPIDPRO', 'RAPIDPRO'), ('XLSX', 'XLSX')], max_length=50), - ), - migrations.AlterField( - model_name='cashplanpaymentverificationsummary', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('FINISHED', 'Finished'), ('PENDING', 'Pending')], db_index=True, default='PENDING', max_length=50, verbose_name='Verification status'), - ), - migrations.AlterField( - model_name='paymentverification', - name='status', - field=models.CharField(choices=[('NOT_RECEIVED', 'NOT RECEIVED'), ('PENDING', 'PENDING'), ('RECEIVED', 'RECEIVED'), ('RECEIVED_WITH_ISSUES', 'RECEIVED WITH ISSUES')], default='PENDING', max_length=50), - ), - migrations.RunPython(Migrator.save_current_uuids, migrations.RunPython.noop), - migrations.RemoveField( - model_name='cashplanpaymentverification', - name='rapid_pro_flow_start_uuid', - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='rapid_pro_flow_start_uuids', - field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=255), default=list, size=None), - preserve_default=False, - ), - migrations.RunPython(Migrator.apply_saved_uuids, migrations.RunPython.noop), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='rapid_pro_flow_start_uuids', - field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=255), default=list, size=None), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='unicef_id', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='xlsx_file_exporting', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='xlsx_file_imported', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('FINISHED', 'Finished'), ('PENDING', 'Pending'), ('INVALID', 'Invalid')], db_index=True, default='PENDING', max_length=50), - ), - migrations.CreateModel( - name='XlsxCashPlanPaymentVerificationFile', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('file', models.FileField(upload_to='')), - ('was_downloaded', models.BooleanField(default=False)), - ('cash_plan_payment_verification', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='xlsx_cashplan_payment_verification_file', to='payment.cashplanpaymentverification')), - ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'abstract': False, - }, - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed')], max_length=255), - ), - migrations.AddField( - model_name='cashplanpaymentverification', - name='error', - field=models.CharField(blank=True, max_length=500, null=True), - ), - migrations.AddField( - model_name='paymentverification', - name='sent_to_rapid_pro', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('FINISHED', 'Finished'), ('PENDING', 'Pending'), ('INVALID', 'Invalid'), ('RAPID_PRO_ERROR', 'RapidPro Error')], db_index=True, default='PENDING', max_length=50), - ), - migrations.AlterField( - model_name='cashplanpaymentverification', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0052_migration_squashed_0071_migration.py b/src/hct_mis_api/apps/payment/migrations/0052_migration_squashed_0071_migration.py deleted file mode 100644 index 2fc0a498d3..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0052_migration_squashed_0071_migration.py +++ /dev/null @@ -1,1729 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-13 08:24 - -from decimal import Decimal -from django.conf import settings -import django.contrib.postgres.fields -import django.contrib.postgres.fields.citext -import django.core.validators -from django.db import migrations, models -import django.db.migrations.operations.special -import django.db.models.deletion -import django_fsm -import hct_mis_api.apps.account.models -import model_utils.fields -import multiselectfield.db.fields -import uuid - - -def populate_existing_payment_record_usd_amount(apps, schema_editor): - PaymentRecord = apps.get_model("payment", "PaymentRecord") - all_payment_records = PaymentRecord.objects.all() - - for payment_record in all_payment_records: - exchange_rate = payment_record.cash_plan.exchange_rate if payment_record.cash_plan else None - if exchange_rate: - payment_record.entitlement_quantity_usd = Decimal( - payment_record.entitlement_quantity * exchange_rate - ).quantize(Decimal(".01")) - - PaymentRecord.objects.bulk_update(all_payment_records, ["entitlement_quantity_usd"]) - - -def populate_existing_cash_plan_usd_amount(apps, schema_editor): - CashPlan = apps.get_model("payment", "CashPlan") - all_cash_plans = CashPlan.objects.all() - - for cash_plan in all_cash_plans: - if cash_plan.exchange_rate: - cash_plan.total_delivered_quantity_usd = Decimal( - cash_plan.total_delivered_quantity * cash_plan.exchange_rate - ).quantize(Decimal(".01")) - cash_plan.total_undelivered_quantity_usd = Decimal( - cash_plan.total_undelivered_quantity * cash_plan.exchange_rate - ).quantize(Decimal(".01")) - cash_plan.total_entitled_quantity_usd = Decimal( - cash_plan.total_entitled_quantity * cash_plan.exchange_rate - ).quantize(Decimal(".01")) - cash_plan.total_entitled_quantity_revised_usd = Decimal( - cash_plan.total_entitled_quantity_revised * cash_plan.exchange_rate - ).quantize(Decimal(".01")) - - CashPlan.objects.bulk_update( - all_cash_plans, - [ - "total_delivered_quantity_usd", - "total_undelivered_quantity_usd", - "total_entitled_quantity_usd", - "total_entitled_quantity_revised_usd", - ], - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("steficon", "0017_migration"), - ("core", "0060_migration_squashed_0064_migration"), - ("household", "0119_migration"), - ("program", "0035_migration"), - ("payment", "0030_migration_squashed_0051_migration"), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.AlterField( - model_name="cashplanpaymentverification", - name="rapid_pro_flow_start_uuids", - field=django.contrib.postgres.fields.ArrayField( - base_field=models.CharField(blank=True, max_length=255), default=list, size=None - ), - ), - migrations.AlterField( - model_name="cashplanpaymentverification", - name="unicef_id", - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name="cashplanpaymentverification", - name="status", - field=models.CharField( - choices=[ - ("ACTIVE", "Active"), - ("FINISHED", "Finished"), - ("PENDING", "Pending"), - ("INVALID", "Invalid"), - ], - db_index=True, - default="PENDING", - max_length=50, - ), - ), - migrations.CreateModel( - name="PaymentChannel", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("delivery_data", models.JSONField(blank=True, default=dict)), - ( - "delivery_mechanism", - models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - max_length=255, - null=True, - ), - ), - ( - "individual", - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="household.individual"), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.AddField( - model_name="paymentrecord", - name="entitlement_quantity_usd", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AlterField( - model_name="paymentrecord", - name="head_of_household", - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to="household.individual"), - ), - migrations.AlterField( - model_name="paymentrecord", - name="household", - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="household.household"), - ), - migrations.SeparateDatabaseAndState( - state_operations=[ - migrations.CreateModel( - name="CashPlan", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, editable=False, primary_key=True, serialize=False - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("ca_id", models.CharField(db_index=True, max_length=255, null=True)), - ("ca_hash_id", models.UUIDField(null=True, unique=True)), - ( - "status", - models.CharField( - choices=[ - ("Distribution Completed", "Distribution Completed"), - ("Distribution Completed with Errors", "Distribution Completed with Errors"), - ("Transaction Completed", "Transaction Completed"), - ("Transaction Completed with Errors", "Transaction Completed with Errors"), - ], - db_index=True, - max_length=255, - ), - ), - ("status_date", models.DateTimeField()), - ("name", models.CharField(db_index=True, max_length=255)), - ("distribution_level", models.CharField(max_length=255)), - ("start_date", models.DateTimeField(db_index=True)), - ("end_date", models.DateTimeField(db_index=True)), - ("dispersion_date", models.DateTimeField()), - ("coverage_duration", models.PositiveIntegerField()), - ("coverage_unit", models.CharField(max_length=255)), - ("comments", models.CharField(max_length=255, null=True)), - ( - "delivery_type", - models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - db_index=True, - max_length=24, - null=True, - ), - ), - ("assistance_measurement", models.CharField(db_index=True, max_length=255)), - ("assistance_through", models.CharField(db_index=True, max_length=255)), - ("vision_id", models.CharField(max_length=255, null=True)), - ("funds_commitment", models.CharField(max_length=255, null=True)), - ("exchange_rate", models.DecimalField(blank=True, decimal_places=8, max_digits=12, null=True)), - ("down_payment", models.CharField(max_length=255, null=True)), - ("validation_alerts_count", models.IntegerField()), - ("total_persons_covered", models.IntegerField(db_index=True)), - ("total_persons_covered_revised", models.IntegerField(db_index=True)), - ( - "total_entitled_quantity", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_entitled_quantity_revised", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_delivered_quantity", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_undelivered_quantity", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "business_area", - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="core.businessarea"), - ), - ( - "program", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="cash_plans", - to="program.program", - ), - ), - ( - "service_provider", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="cash_plans", - to="payment.serviceprovider", - ), - ), - ], - options={ - "verbose_name": "Cash Plan", - "ordering": ["created_at"], - }, - ), - migrations.AlterField( - model_name="cashplanpaymentverification", - name="cash_plan", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, related_name="verifications", to="payment.cashplan" - ), - ), - migrations.AlterField( - model_name="cashplanpaymentverificationsummary", - name="cash_plan", - field=models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, - related_name="cash_plan_payment_verification_summary", - to="payment.cashplan", - ), - ), - migrations.AlterField( - model_name="paymentrecord", - name="cash_plan", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="payment_records", - to="payment.cashplan", - ), - ), - ], - ), - migrations.CreateModel( - name="PaymentPlan", - fields=[ - ("is_removed", models.BooleanField(default=False)), - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("status_date", models.DateTimeField()), - ("start_date", models.DateTimeField(db_index=True)), - ("end_date", models.DateTimeField(db_index=True)), - ("exchange_rate", models.DecimalField(blank=True, decimal_places=8, max_digits=12, null=True)), - ( - "total_entitled_quantity", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_entitled_quantity_usd", - models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_entitled_quantity_revised", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_entitled_quantity_revised_usd", - models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_delivered_quantity", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_delivered_quantity_usd", - models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_undelivered_quantity", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "total_undelivered_quantity_usd", - models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "status", - django_fsm.FSMField( - choices=[ - ("OPEN", "Open"), - ("LOCKED", "Locked"), - ("IN_APPROVAL", "In Approval"), - ("IN_AUTHORIZATION", "In Authorization"), - ("IN_REVIEW", "In Review"), - ("ACCEPTED", "Accepted"), - ], - db_index=True, - default="OPEN", - max_length=50, - ), - ), - ( - "unicef_id", - django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=250), - ), - ( - "currency", - models.CharField( - choices=[ - ("", "None"), - ("AED", "United Arab Emirates dirham"), - ("AFN", "Afghan afghani"), - ("ALL", "Albanian lek"), - ("AMD", "Armenian dram"), - ("ANG", "Netherlands Antillean guilder"), - ("AOA", "Angolan kwanza"), - ("ARS", "Argentine peso"), - ("AUD", "Australian dollar"), - ("AWG", "Aruban florin"), - ("AZN", "Azerbaijani manat"), - ("BAM", "Bosnia and Herzegovina convertible mark"), - ("BBD", "Barbados dollar"), - ("BDT", "Bangladeshi taka"), - ("BGN", "Bulgarian lev"), - ("BHD", "Bahraini dinar"), - ("BIF", "Burundian franc"), - ("BMD", "Bermudian dollar"), - ("BND", "Brunei dollar"), - ("BOB", "Boliviano"), - ("BOV", "Bolivian Mvdol (funds code)"), - ("BRL", "Brazilian real"), - ("BSD", "Bahamian dollar"), - ("BTN", "Bhutanese ngultrum"), - ("BWP", "Botswana pula"), - ("BYN", "Belarusian ruble"), - ("BZD", "Belize dollar"), - ("CAD", "Canadian dollar"), - ("CDF", "Congolese franc"), - ("CHF", "Swiss franc"), - ("CLP", "Chilean peso"), - ("CNY", "Chinese yuan"), - ("COP", "Colombian peso"), - ("CRC", "Costa Rican colon"), - ("CUC", "Cuban convertible peso"), - ("CUP", "Cuban peso"), - ("CVE", "Cape Verdean escudo"), - ("CZK", "Czech koruna"), - ("DJF", "Djiboutian franc"), - ("DKK", "Danish krone"), - ("DOP", "Dominican peso"), - ("DZD", "Algerian dinar"), - ("EGP", "Egyptian pound"), - ("ERN", "Eritrean nakfa"), - ("ETB", "Ethiopian birr"), - ("EUR", "Euro"), - ("FJD", "Fiji dollar"), - ("FKP", "Falkland Islands pound"), - ("GBP", "Pound sterling"), - ("GEL", "Georgian lari"), - ("GHS", "Ghanaian cedi"), - ("GIP", "Gibraltar pound"), - ("GMD", "Gambian dalasi"), - ("GNF", "Guinean franc"), - ("GTQ", "Guatemalan quetzal"), - ("GYD", "Guyanese dollar"), - ("HKD", "Hong Kong dollar"), - ("HNL", "Honduran lempira"), - ("HRK", "Croatian kuna"), - ("HTG", "Haitian gourde"), - ("HUF", "Hungarian forint"), - ("IDR", "Indonesian rupiah"), - ("ILS", "Israeli new shekel"), - ("INR", "Indian rupee"), - ("IQD", "Iraqi dinar"), - ("IRR", "Iranian rial"), - ("ISK", "Icelandic króna"), - ("JMD", "Jamaican dollar"), - ("JOD", "Jordanian dinar"), - ("JPY", "Japanese yen"), - ("KES", "Kenyan shilling"), - ("KGS", "Kyrgyzstani som"), - ("KHR", "Cambodian riel"), - ("KMF", "Comoro franc"), - ("KPW", "North Korean won"), - ("KRW", "South Korean won"), - ("KWD", "Kuwaiti dinar"), - ("KYD", "Cayman Islands dollar"), - ("KZT", "Kazakhstani tenge"), - ("LAK", "Lao kip"), - ("LBP", "Lebanese pound"), - ("LKR", "Sri Lankan rupee"), - ("LRD", "Liberian dollar"), - ("LSL", "Lesotho loti"), - ("LYD", "Libyan dinar"), - ("MAD", "Moroccan dirham"), - ("MDL", "Moldovan leu"), - ("MGA", "Malagasy ariary"), - ("MKD", "Macedonian denar"), - ("MMK", "Myanmar kyat"), - ("MNT", "Mongolian tögrög"), - ("MOP", "Macanese pataca"), - ("MRU", "Mauritanian ouguiya"), - ("MUR", "Mauritian rupee"), - ("MVR", "Maldivian rufiyaa"), - ("MWK", "Malawian kwacha"), - ("MXN", "Mexican peso"), - ("MYR", "Malaysian ringgit"), - ("MZN", "Mozambican metical"), - ("NAD", "Namibian dollar"), - ("NGN", "Nigerian naira"), - ("NIO", "Nicaraguan córdoba"), - ("NOK", "Norwegian krone"), - ("NPR", "Nepalese rupee"), - ("NZD", "New Zealand dollar"), - ("OMR", "Omani rial"), - ("PAB", "Panamanian balboa"), - ("PEN", "Peruvian sol"), - ("PGK", "Papua New Guinean kina"), - ("PHP", "Philippine peso"), - ("PKR", "Pakistani rupee"), - ("PLN", "Polish złoty"), - ("PYG", "Paraguayan guaraní"), - ("QAR", "Qatari riyal"), - ("RON", "Romanian leu"), - ("RSD", "Serbian dinar"), - ("RUB", "Russian ruble"), - ("RWF", "Rwandan franc"), - ("SAR", "Saudi riyal"), - ("SBD", "Solomon Islands dollar"), - ("SCR", "Seychelles rupee"), - ("SDG", "Sudanese pound"), - ("SEK", "Swedish krona/kronor"), - ("SGD", "Singapore dollar"), - ("SHP", "Saint Helena pound"), - ("SLL", "Sierra Leonean leone"), - ("SOS", "Somali shilling"), - ("SRD", "Surinamese dollar"), - ("SSP", "South Sudanese pound"), - ("STN", "São Tomé and Príncipe dobra"), - ("SVC", "Salvadoran colón"), - ("SYP", "Syrian pound"), - ("SZL", "Swazi lilangeni"), - ("THB", "Thai baht"), - ("TJS", "Tajikistani somoni"), - ("TMT", "Turkmenistan manat"), - ("TND", "Tunisian dinar"), - ("TOP", "Tongan paʻanga"), - ("TRY", "Turkish lira"), - ("TTD", "Trinidad and Tobago dollar"), - ("TWD", "New Taiwan dollar"), - ("TZS", "Tanzanian shilling"), - ("UAH", "Ukrainian hryvnia"), - ("UGX", "Ugandan shilling"), - ("USD", "United States dollar"), - ("UYU", "Uruguayan peso"), - ("UYW", "Unidad previsional[14]"), - ("UZS", "Uzbekistan som"), - ("VES", "Venezuelan bolívar soberano"), - ("VND", "Vietnamese đồng"), - ("VUV", "Vanuatu vatu"), - ("WST", "Samoan tala"), - ("XAF", "CFA franc BEAC"), - ("XAG", "Silver (one troy ounce)"), - ("XAU", "Gold (one troy ounce)"), - ("XCD", "East Caribbean dollar"), - ("XOF", "CFA franc BCEAO"), - ("XPF", "CFP franc (franc Pacifique)"), - ("YER", "Yemeni rial"), - ("ZAR", "South African rand"), - ("ZMW", "Zambian kwacha"), - ("ZWL", "Zimbabwean dollar"), - ], - max_length=4, - ), - ), - ("dispersion_start_date", models.DateTimeField()), - ("dispersion_end_date", models.DateTimeField()), - ("female_children_count", models.PositiveSmallIntegerField(default=0)), - ("male_children_count", models.PositiveSmallIntegerField(default=0)), - ("female_adults_count", models.PositiveSmallIntegerField(default=0)), - ("male_adults_count", models.PositiveSmallIntegerField(default=0)), - ("total_households_count", models.PositiveSmallIntegerField(default=0)), - ("total_individuals_count", models.PositiveSmallIntegerField(default=0)), - ( - "business_area", - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="core.businessarea"), - ), - ( - "created_by", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - related_name="created_payment_plans", - to=settings.AUTH_USER_MODEL, - ), - ), - ("program", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="program.program")), - ( - "target_population", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="payment_plans", - to="targeting.targetpopulation", - ), - ), - ], - options={ - "verbose_name": "Payment Plan", - "ordering": ["created_at"], - }, - ), - migrations.AddField( - model_name="cashplan", - name="total_delivered_quantity_usd", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AddField( - model_name="cashplan", - name="total_entitled_quantity_revised_usd", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AddField( - model_name="cashplan", - name="total_entitled_quantity_usd", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AddField( - model_name="cashplan", - name="total_undelivered_quantity_usd", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AlterField( - model_name="cashplan", - name="program", - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="program.program"), - ), - migrations.AlterField( - model_name="paymentrecord", - name="service_provider", - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="payment.serviceprovider"), - ), - migrations.RunPython( - code=populate_existing_payment_record_usd_amount, - reverse_code=django.db.migrations.operations.special.RunPython.noop, - ), - migrations.RunPython( - code=populate_existing_cash_plan_usd_amount, - reverse_code=django.db.migrations.operations.special.RunPython.noop, - ), - migrations.CreateModel( - name="FinancialServiceProvider", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("name", models.CharField(max_length=100, unique=True)), - ("vision_vendor_number", models.CharField(max_length=100, unique=True)), - ( - "delivery_mechanisms", - hct_mis_api.apps.account.models.ChoiceArrayField( - base_field=models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - max_length=24, - ), - size=None, - ), - ), - ( - "distribution_limit", - models.DecimalField( - db_index=True, - decimal_places=2, - help_text="The maximum amount of money that can be distributed or unlimited if 0", - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "communication_channel", - models.CharField( - choices=[("API", "API"), ("SFTP", "SFTP"), ("XLSX", "XLSX")], db_index=True, max_length=6 - ), - ), - ( - "data_transfer_configuration", - models.JSONField( - blank=True, - default=dict, - help_text="JSON configuration for the data transfer mechanism", - null=True, - ), - ), - ( - "created_by", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="created_financial_service_providers", - to=settings.AUTH_USER_MODEL, - verbose_name="Created by", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="Payment", - fields=[ - ("is_removed", models.BooleanField(default=False)), - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ( - "status", - models.CharField( - choices=[ - ("Distribution Successful", "Distribution Successful"), - ("Not Distributed", "Not Distributed"), - ("Transaction Successful", "Transaction Successful"), - ("Transaction Erroneous", "Transaction Erroneous"), - ], - max_length=255, - ), - ), - ("status_date", models.DateTimeField()), - ( - "delivery_type", - models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - max_length=24, - ), - ), - ("currency", models.CharField(max_length=4)), - ( - "entitlement_quantity", - models.DecimalField( - decimal_places=2, - max_digits=12, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "entitlement_quantity_usd", - models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "delivered_quantity", - models.DecimalField( - decimal_places=2, - max_digits=12, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "delivered_quantity_usd", - models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ("delivery_date", models.DateTimeField(blank=True, null=True)), - ("transaction_reference_id", models.CharField(max_length=255, null=True)), - ("excluded", models.BooleanField(default=False)), - ("entitlement_date", models.DateTimeField(blank=True, null=True)), - ( - "business_area", - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="core.businessarea"), - ), - ( - "head_of_household", - models.ForeignKey( - null=True, on_delete=django.db.models.deletion.CASCADE, to="household.individual" - ), - ), - ("household", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="household.household")), - ( - "payment_plan", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, related_name="payments", to="payment.paymentplan" - ), - ), - ( - "financial_service_provider", - models.ForeignKey( - null=True, on_delete=django.db.models.deletion.CASCADE, to="payment.financialserviceprovider" - ), - ), - ( - "collector", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="collector_payments", - to="household.individual", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.AddConstraint( - model_name="payment", - constraint=models.UniqueConstraint( - condition=models.Q(("is_removed", False)), - fields=("payment_plan", "household"), - name="payment_plan_and_household", - ), - ), - migrations.CreateModel( - name="FinancialServiceProviderXlsxTemplate", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("name", models.CharField(max_length=120, verbose_name="Name")), - ( - "columns", - multiselectfield.db.fields.MultiSelectField( - choices=[ - ("payment_id", "Payment ID"), - ("household_id", "Household ID"), - ("admin_leve_2", "Admin Level 2"), - ("collector_name", "Collector Name"), - ("payment_channel", "Payment Channel (Delivery mechanism)"), - ("fsp_name", "FSP Name"), - ("entitlement_quantity", "Entitlement Quantity"), - ("tbd", "TBD"), - ], - default=[ - "payment_id", - "household_id", - "admin_leve_2", - "collector_name", - "payment_channel", - "fsp_name", - "entitlement_quantity", - ], - help_text="Select the columns to include in the report", - max_length=101, - verbose_name="Columns", - ), - ), - ( - "created_by", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="created_financial_service_provider_xlsx_templates", - to=settings.AUTH_USER_MODEL, - verbose_name="Created by", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="FinancialServiceProviderXlsxReport", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("file", models.FileField(blank=True, editable=False, null=True, upload_to="")), - ( - "status", - models.IntegerField( - blank=True, - choices=[(1, "Processing"), (2, "Generated"), (3, "Failed")], - db_index=True, - editable=False, - null=True, - ), - ), - ( - "financial_service_provider", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - to="payment.financialserviceprovider", - verbose_name="Financial Service Provider", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.AddField( - model_name="financialserviceprovider", - name="fsp_xlsx_template", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="payment.financialserviceproviderxlsxtemplate", - verbose_name="XLSX Template", - ), - ), - migrations.CreateModel( - name="DeliveryMechanismPerPaymentPlan", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("sent_date", models.DateTimeField()), - ("status", django_fsm.FSMField(db_index=True, default="NOT_SENT", max_length=50)), - ("delivery_mechanism_order", models.PositiveIntegerField()), - ( - "entitlement_quantity", - models.DecimalField( - db_index=True, - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "entitlement_quantity_usd", - models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - ( - "created_by", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - related_name="created_delivery_mechanisms", - to=settings.AUTH_USER_MODEL, - ), - ), - ( - "delivery_mechanism", - models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - db_index=True, - max_length=255, - null=True, - ), - ), - ( - "payment_plan", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="delivery_mechanisms", - to="payment.paymentplan", - ), - ), - ( - "sent_by", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - related_name="sent_delivery_mechanisms", - to=settings.AUTH_USER_MODEL, - ), - ), - ( - "financial_service_provider", - models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - related_name="delivery_mechanisms_per_payment_plan", - to="payment.financialserviceprovider", - ), - ), - ], - options={ - "unique_together": {("payment_plan", "delivery_mechanism", "delivery_mechanism_order")}, - }, - ), - migrations.AddConstraint( - model_name="deliverymechanismperpaymentplan", - constraint=models.UniqueConstraint( - fields=("payment_plan", "delivery_mechanism"), name="unique payment_plan_delivery_mechanism" - ), - ), - migrations.AddConstraint( - model_name="deliverymechanismperpaymentplan", - constraint=models.UniqueConstraint( - fields=("payment_plan", "delivery_mechanism_order"), name="unique payment_plan_delivery_mechanism_order" - ), - ), - migrations.AddField( - model_name="payment", - name="assigned_payment_channel", - field=models.ForeignKey( - null=True, on_delete=django.db.models.deletion.CASCADE, to="payment.paymentchannel" - ), - ), - migrations.CreateModel( - name="ApprovalProcess", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("sent_for_approval_date", models.DateTimeField(null=True)), - ("sent_for_authorization_date", models.DateTimeField(null=True)), - ("sent_for_finance_review_date", models.DateTimeField(null=True)), - ( - "payment_plan", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="approval_process", - to="payment.paymentplan", - ), - ), - ( - "sent_for_approval_by", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to=settings.AUTH_USER_MODEL, - ), - ), - ( - "sent_for_authorization_by", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to=settings.AUTH_USER_MODEL, - ), - ), - ( - "sent_for_finance_review_by", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to=settings.AUTH_USER_MODEL, - ), - ), - ], - options={ - "verbose_name_plural": "Approval Processes", - "ordering": ("-created_at",), - }, - ), - migrations.AlterField( - model_name="payment", - name="delivery_type", - field=models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - max_length=24, - null=True, - ), - ), - migrations.AlterField( - model_name="paymentrecord", - name="delivery_type", - field=models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - max_length=24, - null=True, - ), - ), - migrations.AlterField( - model_name="payment", - name="delivered_quantity", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AlterField( - model_name="payment", - name="entitlement_quantity", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AlterField( - model_name="paymentrecord", - name="delivered_quantity", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.AlterField( - model_name="paymentrecord", - name="entitlement_quantity", - field=models.DecimalField( - decimal_places=2, - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.01"))], - ), - ), - migrations.CreateModel( - name="Approval", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ( - "type", - models.CharField( - choices=[ - ("APPROVAL", "Approval"), - ("AUTHORIZATION", "Authorization"), - ("FINANCE_REVIEW", "Finance Review"), - ("REJECT", "Reject"), - ], - default="APPROVAL", - max_length=50, - verbose_name="Approval type", - ), - ), - ("comment", models.CharField(blank=True, max_length=500, null=True)), - ( - "approval_process", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="approvals", - to="payment.approvalprocess", - ), - ), - ( - "created_by", - models.ForeignKey( - null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL - ), - ), - ], - options={ - "ordering": ("-created_at",), - }, - ), - migrations.AlterField( - model_name="paymentplan", - name="dispersion_end_date", - field=models.DateField(), - ), - migrations.AlterField( - model_name="paymentplan", - name="dispersion_start_date", - field=models.DateField(), - ), - migrations.AddField( - model_name="paymentplan", - name="steficon_applied_date", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="paymentplan", - name="steficon_rule", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="payment_plans", - to="steficon.rulecommit", - ), - ), - migrations.AddField( - model_name="paymentplan", - name="xlsx_file_imported_date", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name="financialserviceprovider", - name="distribution_limit", - field=models.DecimalField( - db_index=True, - decimal_places=2, - help_text="The maximum amount of money that can be distributed or unlimited if 0", - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.00"))], - ), - ), - migrations.AlterField( - model_name="paymentplan", - name="status", - field=django_fsm.FSMField( - choices=[ - ("OPEN", "Open"), - ("LOCKED", "Locked"), - ("IN_APPROVAL", "In Approval"), - ("IN_AUTHORIZATION", "In Authorization"), - ("IN_REVIEW", "In Review"), - ("ACCEPTED", "Accepted"), - ("STEFICON_WAIT", "Waiting for Rule Engine"), - ("STEFICON_RUN", "Rule Engine Running"), - ("STEFICON_COMPLETED", "Rule Engine Completed"), - ("STEFICON_ERROR", "Rule Engine Errored"), - ("XLSX_EXPORTING", "Exporting XLSX file"), - ("XLSX_IMPORTING", "Importing XLSX file"), - ], - db_index=True, - default="OPEN", - max_length=50, - ), - ), - migrations.AddField( - model_name="payment", - name="unicef_id", - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=250), - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION payment_plan_fill_unicef_id_per_business_area_seq() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n DECLARE businessAreaID varchar;\n DECLARE businessAreaCode varchar;\n begin\n SELECT INTO businessAreaID translate(ba.id::text, '-','_') FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n SELECT INTO businessAreaCode ba.code FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n\n NEW.unicef_id := format('PP-%s-%s-%s', trim(businessAreaCode), to_char(NEW.created_at, 'yy'), trim(replace(to_char(nextval('payment_plan_business_area_seq_' || businessAreaID),'00000000'),',','.')));\n RETURN NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="CREATE TRIGGER payment_plan_fill_unicef_id_per_business_area_seq BEFORE INSERT ON payment_paymentplan FOR EACH ROW EXECUTE PROCEDURE payment_plan_fill_unicef_id_per_business_area_seq();", - ), - migrations.RunSQL( - sql="\n CREATE OR REPLACE FUNCTION payment_fill_unicef_id_per_business_area_seq() RETURNS trigger\n LANGUAGE plpgsql\n AS $$\n DECLARE businessAreaID varchar;\n DECLARE businessAreaCode varchar;\n begin\n SELECT INTO businessAreaID translate(ba.id::text, '-','_') FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n SELECT INTO businessAreaCode ba.code FROM core_businessarea ba WHERE ba.id=NEW.business_area_id;\n\n NEW.unicef_id := format('RCPT-%s-%s-%s', trim(businessAreaCode), to_char(NEW.created_at, 'yy'), trim(replace(to_char(nextval('payment_business_area_seq_' || businessAreaID),'0,000,000'),',','.')));\n RETURN NEW;\n end\n $$;\n ", - ), - migrations.RunSQL( - sql="CREATE TRIGGER payment_fill_unicef_id_per_business_area_seq BEFORE INSERT ON payment_payment FOR EACH ROW EXECUTE PROCEDURE payment_fill_unicef_id_per_business_area_seq();", - ), - migrations.AlterField( - model_name="deliverymechanismperpaymentplan", - name="financial_service_provider", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="delivery_mechanisms_per_payment_plan", - to="payment.financialserviceprovider", - ), - ), - migrations.AlterField( - model_name="deliverymechanismperpaymentplan", - name="sent_by", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.PROTECT, - related_name="sent_delivery_mechanisms", - to=settings.AUTH_USER_MODEL, - ), - ), - migrations.RemoveConstraint( - model_name="deliverymechanismperpaymentplan", - name="unique payment_plan_delivery_mechanism", - ), - migrations.RemoveConstraint( - model_name="deliverymechanismperpaymentplan", - name="unique payment_plan_delivery_mechanism_order", - ), - migrations.AddConstraint( - model_name="deliverymechanismperpaymentplan", - constraint=models.UniqueConstraint( - fields=("payment_plan", "delivery_mechanism", "delivery_mechanism_order"), - name="unique payment_plan_delivery_mechanism", - ), - ), - migrations.AlterField( - model_name="payment", - name="unicef_id", - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name="paymentplan", - name="unicef_id", - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AddField( - model_name="paymentplan", - name="export_per_fsp_zip_file", - field=models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name="+", to="core.filetemp" - ), - ), - migrations.AddField( - model_name="paymentplan", - name="export_xlsx_file", - field=models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name="+", to="core.filetemp" - ), - ), - migrations.AddField( - model_name="paymentplan", - name="imported_xlsx_file", - field=models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name="+", to="core.filetemp" - ), - ), - migrations.AlterField( - model_name="paymentplan", - name="status", - field=django_fsm.FSMField( - choices=[ - ("OPEN", "Open"), - ("LOCKED", "Locked"), - ("LOCKED_FSP", "Locked FSP"), - ("IN_APPROVAL", "In Approval"), - ("IN_AUTHORIZATION", "In Authorization"), - ("IN_REVIEW", "In Review"), - ("ACCEPTED", "Accepted"), - ("STEFICON_WAIT", "Waiting for Rule Engine"), - ("STEFICON_RUN", "Rule Engine Running"), - ("STEFICON_COMPLETED", "Rule Engine Completed"), - ("STEFICON_ERROR", "Rule Engine Errored"), - ("XLSX_EXPORTING", "Exporting XLSX file"), - ("XLSX_IMPORTING", "Importing XLSX file"), - ], - db_index=True, - default="OPEN", - max_length=50, - ), - ), - migrations.AlterField( - model_name="financialserviceproviderxlsxtemplate", - name="columns", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("payment_id", "Payment ID"), - ("household_id", "Household ID"), - ("admin_leve_2", "Admin Level 2"), - ("collector_name", "Collector Name"), - ("payment_channel", "Payment Channel (Delivery mechanism)"), - ("fsp_name", "FSP Name"), - ("entitlement_quantity", "Entitlement Quantity"), - ("delivered_quantity", "Delivered Quantity"), - ("tbd", "TBD"), - ], - default=[ - "payment_id", - "household_id", - "admin_leve_2", - "collector_name", - "payment_channel", - "fsp_name", - "entitlement_quantity", - "delivered_quantity", - ], - help_text="Select the columns to include in the report", - max_length=120, - verbose_name="Columns", - ), - ), - migrations.AlterField( - model_name="paymentplan", - name="status", - field=django_fsm.FSMField( - choices=[ - ("OPEN", "Open"), - ("LOCKED", "Locked"), - ("LOCKED_FSP", "Locked FSP"), - ("IN_APPROVAL", "In Approval"), - ("IN_AUTHORIZATION", "In Authorization"), - ("IN_REVIEW", "In Review"), - ("ACCEPTED", "Accepted"), - ], - db_index=True, - default="OPEN", - max_length=50, - ), - ), - migrations.AddField( - model_name="paymentplan", - name="background_action_status", - field=django_fsm.FSMField( - blank=True, - choices=[ - ("STEFICON_RUN", "Rule Engine Running"), - ("STEFICON_ERROR", "Rule Engine Errored"), - ("XLSX_EXPORTING", "Exporting XLSX file"), - ("XLSX_EXPORT_ERROR", "Export XLSX file Error"), - ("XLSX_IMPORT_ERROR", "Import XLSX file Error"), - ("XLSX_IMPORTING_ENTITLEMENTS", "Importing Entitlements XLSX file"), - ("XLSX_IMPORTING_RECONCILIATION", "Importing Reconciliation XLSX file"), - ], - db_index=True, - default=None, - max_length=50, - null=True, - ), - ), - migrations.RenameField( - model_name="payment", - old_name="payment_plan", - new_name="parent", - ), - migrations.AlterField( - model_name="payment", - name="parent", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, related_name="payment_items", to="payment.paymentplan" - ), - ), - migrations.RenameField( - model_name="paymentrecord", - old_name="cash_plan", - new_name="parent", - ), - migrations.AlterField( - model_name="paymentrecord", - name="parent", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="payment_items", - to="payment.cashplan", - ), - ), - migrations.RemoveConstraint( - model_name="payment", - name="payment_plan_and_household", - ), - migrations.AddConstraint( - model_name="payment", - constraint=models.UniqueConstraint( - condition=models.Q(("is_removed", False)), - fields=("parent", "household"), - name="payment_plan_and_household", - ), - ), - migrations.AlterField( - model_name="cashplan", - name="exchange_rate", - field=models.DecimalField(blank=True, decimal_places=8, max_digits=14, null=True), - ), - migrations.AlterField( - model_name="paymentplan", - name="exchange_rate", - field=models.DecimalField(blank=True, decimal_places=8, max_digits=14, null=True), - ), - migrations.RenameField( - model_name="paymentplan", - old_name="xlsx_file_imported_date", - new_name="imported_file_date", - ), - migrations.RemoveField( - model_name="paymentplan", - name="export_per_fsp_zip_file", - ), - migrations.RemoveField( - model_name="paymentplan", - name="export_xlsx_file", - ), - migrations.RemoveField( - model_name="paymentplan", - name="imported_xlsx_file", - ), - migrations.AddField( - model_name="paymentplan", - name="export_file", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="core.filetemp", - ), - ), - migrations.AddField( - model_name="paymentplan", - name="imported_file", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="+", - to="core.filetemp", - ), - ), - migrations.AlterField( - model_name="payment", - name="assigned_payment_channel", - field=models.ForeignKey( - null=True, on_delete=django.db.models.deletion.PROTECT, to="payment.paymentchannel" - ), - ), - migrations.AlterField( - model_name="paymentchannel", - name="individual", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, related_name="payment_channels", to="household.individual" - ), - ), - migrations.AlterField( - model_name="financialserviceprovider", - name="distribution_limit", - field=models.DecimalField( - blank=True, - db_index=True, - decimal_places=2, - help_text="The maximum amount of money in USD that can be distributed or unlimited if null", - max_digits=12, - null=True, - validators=[django.core.validators.MinValueValidator(Decimal("0.00"))], - ), - ), - migrations.AlterField( - model_name="payment", - name="assigned_payment_channel", - field=models.ForeignKey( - null=True, on_delete=django.db.models.deletion.CASCADE, to="payment.paymentchannel" - ), - ), - migrations.AlterField( - model_name="paymentplan", - name="status", - field=django_fsm.FSMField( - choices=[ - ("OPEN", "Open"), - ("LOCKED", "Locked"), - ("LOCKED_FSP", "Locked FSP"), - ("IN_APPROVAL", "In Approval"), - ("IN_AUTHORIZATION", "In Authorization"), - ("IN_REVIEW", "In Review"), - ("ACCEPTED", "Accepted"), - ("RECONCILED", "Reconciled"), - ], - db_index=True, - default="OPEN", - max_length=50, - ), - ), - migrations.RemoveField( - model_name="deliverymechanismperpaymentplan", - name="entitlement_quantity", - ), - migrations.RemoveField( - model_name="deliverymechanismperpaymentplan", - name="entitlement_quantity_usd", - ), - migrations.AddField( - model_name="paymentchannel", - name="is_fallback", - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name="payment", - name="financial_service_provider", - field=models.ForeignKey( - null=True, on_delete=django.db.models.deletion.PROTECT, to="payment.financialserviceprovider" - ), - ), - migrations.AlterField( - model_name="financialserviceproviderxlsxtemplate", - name="columns", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("payment_id", "Payment ID"), - ("household_id", "Household ID"), - ("household_size", "Household Size"), - ("admin_level_2", "Admin Level 2"), - ("collector_name", "Collector Name"), - ("payment_channel", "Payment Channel (Delivery mechanism)"), - ("fsp_name", "FSP Name"), - ("currency", "Currency"), - ("entitlement_quantity", "Entitlement Quantity"), - ("entitlement_quantity_usd", "Entitlement Quantity USD"), - ("delivered_quantity", "Delivered Quantity"), - ], - default=[ - "payment_id", - "household_id", - "household_size", - "admin_level_2", - "collector_name", - "payment_channel", - "fsp_name", - "currency", - "entitlement_quantity", - "entitlement_quantity_usd", - "delivered_quantity", - ], - help_text="Select the columns to include in the report", - max_length=166, - verbose_name="Columns", - ), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0072_migration.py b/src/hct_mis_api/apps/payment/migrations/0072_migration.py deleted file mode 100644 index 1b0c0c0853..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0072_migration.py +++ /dev/null @@ -1,326 +0,0 @@ -# Generated by Django 3.2.15 on 2022-11-02 09:23 - -from django.db import migrations, models -import django.db.models.deletion -from django.db.models import Q - -from hct_mis_api.apps.account.fields import ChoiceArrayField -import model_utils.fields -import uuid -import multiselectfield.db.fields - - -def populate_delivery_mechanisms(apps, schema_editor): - DeliveryMechanism = apps.get_model("payment", "DeliveryMechanism") - - DeliveryMechanism.objects.get_or_create( - delivery_mechanism="Cash", - defaults=dict(global_core_fields=["given_name", "family_name"], payment_channel_fields=[]), - ) - - -def fix_fsp_communication_channels(apps, schema_editor): - FinancialServiceProvider = apps.get_model("payment", "FinancialServiceProvider") - - FinancialServiceProvider.objects.filter( - Q(communication_channel__isnull=True) | Q(communication_channel__exact="") - ).update(communication_channel="XLSX") - - -class Migration(migrations.Migration): - - dependencies = [ - ("payment", "0052_migration_squashed_0071_migration"), - ] - - operations = [ - migrations.CreateModel( - name="DeliveryMechanism", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ( - "delivery_mechanism", - models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - max_length=255, - null=True, - unique=True, - ), - ), - ( - "global_core_fields", - ChoiceArrayField( - base_field=models.CharField( - blank=True, - choices=[ - ("Age (calculated)", "age"), - ("Residence status", "residence_status"), - ("Do you consent?", "consent"), - ("Do you consent?", "consent_sign"), - ("Country of Origin", "country_origin"), - ("Country of registration", "country"), - ("Address", "address"), - ("Household resides in which ${admin1_h_c}?", "admin1"), - ("Household resides in which ${admin2_h_c}?", "admin2"), - ("Geolocation", "geopoint"), - ("UNHCR Case ID", "unhcr_id"), - ("Is this a returnee household?", "returnee"), - ("What is the household size?", "size"), - ("Child is female and head of household", "fchild_hoh"), - ("Child is/ head of household", "child_hoh"), - ("Relationship to head of household", "relationship"), - ("Full name", "full_name"), - ("Given name", "given_name"), - ("Middle name(s)", "middle_name"), - ("Family name", "family_name"), - ("Gender", "sex"), - ("Birth date", "birth_date"), - ("Estimated birth date?", "estimated_birth_date"), - ("Individual's photo", "photo"), - ("Marital status", "marital_status"), - ("Phone number", "phone_no"), - ("Who answers this phone?", "who_answers_phone"), - ("Alternative phone number", "phone_no_alternative"), - ("Who answers this phone?", "who_answers_alt_phone"), - ("Method of collection (e.g. HH survey, Community, etc.)", "registration_method"), - ("Will you be collecting all member Individuals' data?", "collect_individual_data"), - ("Which currency will be used for financial questions?", "currency"), - ("Birth certificate number", "birth_certificate_no"), - ("Issuing country of birth certificate", "birth_certificate_issuer"), - ("Birth certificate photo", "birth_certificate_photo"), - ("Driver's license number", "drivers_license_no"), - ("Issuing country of driver's license", "drivers_license_issuer"), - ("Driver's license photo", "drivers_license_photo"), - ("Electoral card number", "electoral_card_no"), - ("Issuing country of electoral card", "electoral_card_issuer"), - ("Electoral card photo", "electoral_card_photo"), - ("UNHCR ID number", "unhcr_id_no"), - ("Issuing entity of UNHCR ID", "unhcr_id_issuer"), - ("UNHCR ID photo", "unhcr_id_photo"), - ("National passport number", "national_passport"), - ("Issuing country of national passport", "national_passport_issuer"), - ("National passport photo", "national_passport_photo"), - ("National ID number", "national_id_no"), - ("Issuing country of national ID", "national_id_issuer"), - ("National ID photo", "national_id_photo"), - ("WFP Scope ID number", "scope_id_no"), - ("Issuing entity of SCOPE ID", "scope_id_issuer"), - ("WFP Scope ID photo", "scope_id_photo"), - ("If other type of ID, specify the type", "other_id_type"), - ("Other ID number", "other_id_no"), - ("Issuing country of other ID", "other_id_issuer"), - ("ID photo", "other_id_photo"), - ("Females Age 0 - 5", "female_age_group_0_5_count"), - ("Females Age 6 - 11", "female_age_group_6_11_count"), - ("Females Age 12 - 17", "female_age_group_12_17_count"), - ("Females Age 18 - 59", "female_age_group_18_59_count"), - ("Females Age 60 +", "female_age_group_60_count"), - ("Pregnant count", "pregnant_count"), - ("Males Age 0 - 5", "male_age_group_0_5_count"), - ("Males Age 6 - 11", "male_age_group_6_11_count"), - ("Males Age 12 - 17", "male_age_group_12_17_count"), - ("Males Age 18 - 59", "male_age_group_18_59_count"), - ("Males Age 60 +", "male_age_group_60_count"), - ("Females age 0 - 5 with disability", "female_age_group_0_5_disabled_count"), - ("Females age 6 - 11 with disability", "female_age_group_6_11_disabled_count"), - ("Females age 12 - 17 with disability", "female_age_group_12_17_disabled_count"), - ("Females Age 18 - 59 with disability", "female_age_group_18_59_disabled_count"), - ("Female members with Disability age 60 +", "female_age_group_60_disabled_count"), - ("Males age 0 - 5 with disability", "male_age_group_0_5_disabled_count"), - ("Males age 6 - 11 with disability", "male_age_group_6_11_disabled_count"), - ("Males age 12 - 17 with disability", "male_age_group_12_17_disabled_count"), - ("Males Age 18 - 59 with disability", "male_age_group_18_59_disabled_count"), - ("Male members with Disability age 60 +", "male_age_group_60_disabled_count"), - ("Is the individual pregnant?", "pregnant"), - ("Does the individual have paid employment in the current month?", "work_status"), - ("Does the individual have disability?", "observed_disability"), - ("If the individual has difficulty seeing, what is the severity?", "seeing_disability"), - ( - "If the individual has difficulty hearing, what is the severity?", - "hearing_disability", - ), - ( - "If the individual has difficulty walking or climbing steps, what is the severity?", - "physical_disability", - ), - ( - "If the individual has difficulty remembering or concentrating, what is the severity?", - "memory_disability", - ), - ( - "Do you have difficulty (with self-care such as) washing all over or dressing", - "selfcare_disability", - ), - ( - "If the individual has difficulty communicating, what is the severity?", - "comms_disability", - ), - ("Female child headed household", "fchild_hoh"), - ("Child headed household", "child_hoh"), - ("Village", "village"), - ("Device ID", "deviceid"), - ("Name of the enumerator", "name_enumerator"), - ("Organization of the enumerator", "org_enumerator"), - ("Which organizations may we share your information with?", "consent_sharing"), - ("Name of partner organization", "org_name_enumerator"), - ("Individual is disabled?", "disability"), - ], - max_length=255, - ), - default=list, - size=None, - ), - ), - ( - "payment_channel_fields", - ChoiceArrayField( - base_field=models.CharField( - blank=True, - choices=[ - ("Bank name", "bank_name"), - ("Bank account number", "bank_account_number"), - ("Debit Card Issuer", "debit_card_issuer"), - ("Debit card number", "debit_card_number"), - ], - max_length=255, - ), - default=list, - size=None, - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.AlterField( - model_name="cashplanpaymentverification", - name="status", - field=models.CharField( - choices=[ - ("ACTIVE", "Active"), - ("FINISHED", "Finished"), - ("PENDING", "Pending"), - ("INVALID", "Invalid"), - ("RAPID_PRO_ERROR", "RapidPro Error"), - ], - db_index=True, - default="PENDING", - max_length=50, - ), - ), - # WUUUUT - migrations.AlterField( - model_name="payment", - name="status", - field=models.CharField( - choices=[ - ("Distribution Successful", "Distribution Successful"), - ("Not Distributed", "Not Distributed"), - ("Transaction Successful", "Transaction Successful"), - ("Transaction Erroneous", "Transaction Erroneous"), - ("Force failed", "Force failed"), - ], - max_length=255, - ), - ), - migrations.AlterUniqueTogether( - name="deliverymechanismperpaymentplan", - unique_together=set(), - ), - migrations.AddConstraint( - model_name="paymentchannel", - constraint=models.UniqueConstraint( - fields=("individual", "delivery_mechanism"), name="unique individual_delivery_mechanism" - ), - ), - migrations.AlterField( - model_name="paymentchannel", - name="delivery_mechanism", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="payment_channels", - to="payment.deliverymechanism", - ), - ), - migrations.AlterField( - model_name="deliverymechanism", - name="delivery_mechanism", - field=models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - max_length=255, - unique=True, - ), - ), - migrations.AlterField( - model_name="financialserviceproviderxlsxtemplate", - name="columns", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("payment_id", "Payment ID"), - ("household_id", "Household ID"), - ("household_size", "Household Size"), - ("admin_level_2", "Admin Level 2"), - ("collector_name", "Collector Name"), - ("payment_channel", "Payment Channel (Delivery mechanism)"), - ("fsp_name", "FSP Name"), - ("currency", "Currency"), - ("entitlement_quantity", "Entitlement Quantity"), - ("entitlement_quantity_usd", "Entitlement Quantity USD"), - ("delivered_quantity", "Delivered Quantity"), - ], - default=[ - "payment_id", - "household_id", - "household_size", - "admin_level_2", - "collector_name", - "payment_channel", - "fsp_name", - "currency", - "entitlement_quantity", - "entitlement_quantity_usd", - "delivered_quantity", - ], - help_text="Select the columns to include in the report", - max_length=166, - verbose_name="Columns", - ), - ), - migrations.RunPython(populate_delivery_mechanisms, migrations.RunPython.noop), - migrations.RunPython(fix_fsp_communication_channels, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0073_migration_squashed_0074_migration.py b/src/hct_mis_api/apps/payment/migrations/0073_migration_squashed_0074_migration.py deleted file mode 100644 index 1c70514479..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0073_migration_squashed_0074_migration.py +++ /dev/null @@ -1,93 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-27 06:59 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - ('payment', '0072_migration'), - ] - - operations = [ - migrations.RenameModel( - old_name='CashPlanPaymentVerification', - new_name='PaymentVerificationPlan', - ), - migrations.RenameModel( - old_name='XlsxCashPlanPaymentVerificationFile', - new_name='XlsxPaymentVerificationPlanFile', - ), - migrations.RenameModel( - old_name='CashPlanPaymentVerificationSummary', - new_name='PaymentVerificationSummary', - ), - migrations.RenameField( - model_name='xlsxpaymentverificationplanfile', - old_name='cash_plan_payment_verification', - new_name='payment_verification_plan', - ), - migrations.RenameField( - model_name='paymentverification', - old_name='cash_plan_payment_verification', - new_name='payment_verification_plan', - ), - migrations.AlterField( - model_name='paymentverificationplan', - name='cash_plan', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='verification_plans', to='payment.cashplan'), - ), - migrations.AlterField( - model_name='paymentverificationsummary', - name='cash_plan', - field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payment_verification_summary', to='payment.cashplan'), - ), - migrations.AlterField( - model_name='xlsxpaymentverificationplanfile', - name='payment_verification_plan', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='xlsx_verification_file', to='payment.paymentverificationplan'), - ), - migrations.AddField( - model_name='paymentverificationplan', - name='payment_plan_content_type', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), - ), - migrations.AddField( - model_name='paymentverificationplan', - name='payment_plan_object_id', - field=models.UUIDField(null=True), - ), - migrations.AddField( - model_name='paymentverificationsummary', - name='payment_plan_content_type', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), - ), - migrations.AddField( - model_name='paymentverificationsummary', - name='payment_plan_object_id', - field=models.UUIDField(null=True), - ), - migrations.AddConstraint( - model_name='paymentverificationsummary', - constraint=models.UniqueConstraint(fields=('payment_plan_content_type', 'payment_plan_object_id'), - name='payment_plan_content_type_and_payment_plan_id'), - ), - migrations.AddField( - model_name='paymentverification', - name='payment_content_type', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, - to='contenttypes.contenttype'), - ), - migrations.AddField( - model_name='paymentverification', - name='payment_object_id', - field=models.UUIDField(null=True), - ), - migrations.AddConstraint( - model_name='paymentverification', - constraint=models.UniqueConstraint(fields=('payment_content_type', 'payment_object_id'), - name='payment_content_type_and_payment_id'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0075_migration.py b/src/hct_mis_api/apps/payment/migrations/0075_migration.py deleted file mode 100644 index 56c8c47d7c..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0075_migration.py +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by Django 3.2.15 on 2022-09-23 18:56 - -from django.db import migrations -from django.db.models import OuterRef, Subquery - - -def update_payment_verification_fk(apps, schema_editor): - PaymentVerificationPlan = apps.get_model("payment", "PaymentVerificationPlan") - PaymentVerificationSummary = apps.get_model("payment", "PaymentVerificationSummary") - CashPlan = apps.get_model("payment", "CashPlan") - ContentType = apps.get_model("contenttypes", "ContentType") - - content_type_for_cash_plan = ContentType.objects.get_for_model(CashPlan) - - subquery_pvp = Subquery( - PaymentVerificationPlan.objects - .filter(pk=OuterRef("pk")) - .values("cash_plan_id")[:1] - ) - subquery_summary = Subquery( - PaymentVerificationSummary.objects - .filter(pk=OuterRef("pk")) - .values("cash_plan_id")[:1] - ) - - PaymentVerificationPlan.objects.all().update( - payment_plan_content_type_id=content_type_for_cash_plan.id, - payment_plan_object_id=subquery_pvp, - ) - PaymentVerificationSummary.objects.all().update( - payment_plan_content_type_id=content_type_for_cash_plan.id, - payment_plan_object_id=subquery_summary, - ) - - -def update_payment_record_fk(apps, schema_editor): - PaymentVerification = apps.get_model("payment", "PaymentVerification") - PaymentRecord = apps.get_model("payment", "PaymentRecord") - ContentType = apps.get_model("contenttypes", "ContentType") - - content_type_for_payment_record = ContentType.objects.get_for_model(PaymentRecord) - - subquery_pv = Subquery( - PaymentVerification.objects - .filter(pk=OuterRef("pk")) - .values("payment_record_id")[:1] - ) - - PaymentVerification.objects.all().update( - payment_content_type_id=content_type_for_payment_record.id, - payment_object_id=subquery_pv, - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("contenttypes", "0002_remove_content_type_name"), - ("payment", "0073_migration_squashed_0074_migration"), - ] - - operations = [ - migrations.RunPython(update_payment_verification_fk, migrations.RunPython.noop), - migrations.RunPython(update_payment_record_fk, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0076_migration_squashed_0077_migration.py b/src/hct_mis_api/apps/payment/migrations/0076_migration_squashed_0077_migration.py deleted file mode 100644 index 95f5504698..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0076_migration_squashed_0077_migration.py +++ /dev/null @@ -1,79 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-27 07:13 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0075_migration'), - ('contenttypes', '0002_remove_content_type_name'), - ] - - operations = [ - migrations.RemoveField( - model_name='paymentverificationplan', - name='cash_plan', - ), - migrations.RemoveField( - model_name='paymentverificationsummary', - name='cash_plan', - ), - migrations.RemoveField( - model_name='paymentverification', - name='payment_record', - ), - migrations.AlterField( - model_name='payment', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed')], max_length=255), - ), - migrations.AlterField( - model_name='paymentverification', - name='payment_content_type', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), - ), - migrations.AlterField( - model_name='paymentverification', - name='payment_object_id', - field=models.UUIDField(), - ), - migrations.AlterField( - model_name='paymentverificationplan', - name='payment_plan_content_type', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), - ), - migrations.AlterField( - model_name='paymentverificationplan', - name='payment_plan_object_id', - field=models.UUIDField(), - ), - migrations.AlterField( - model_name='paymentverificationplan', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('FINISHED', 'Finished'), ('PENDING', 'Pending'), ('INVALID', 'Invalid'), ('RAPID_PRO_ERROR', 'RapidPro Error')], db_index=True, default='PENDING', max_length=50), - ), - migrations.AlterField( - model_name='paymentverificationsummary', - name='payment_plan_content_type', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype'), - ), - migrations.AlterField( - model_name='paymentverificationsummary', - name='payment_plan_object_id', - field=models.UUIDField(), - ), - migrations.AddIndex( - model_name='paymentverification', - index=models.Index(fields=['payment_content_type', 'payment_object_id'], name='payment_pay_payment_ec4a29_idx'), - ), - migrations.AddIndex( - model_name='paymentverificationplan', - index=models.Index(fields=['payment_plan_content_type', 'payment_plan_object_id'], name='payment_pay_payment_3ba67e_idx'), - ), - migrations.AddIndex( - model_name='paymentverificationsummary', - index=models.Index(fields=['payment_plan_content_type', 'payment_plan_object_id'], name='payment_pay_payment_8b7d61_idx'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0078_migration_squashed_0096_migration.py b/src/hct_mis_api/apps/payment/migrations/0078_migration_squashed_0096_migration.py deleted file mode 100644 index 328b34cd5e..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0078_migration_squashed_0096_migration.py +++ /dev/null @@ -1,322 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 19:09 - -from decimal import Decimal -from django.conf import settings -import django.contrib.postgres.fields.ranges -import django.contrib.postgres.validators -import django.core.validators -from django.db import migrations, models -import django.db.migrations.operations.special -import django.db.models.deletion -import django_fsm -import hct_mis_api.apps.account.fields -import hct_mis_api.apps.account.models -import model_utils.fields -import multiselectfield.db.fields -import psycopg2.extras -import uuid - - -# Functions from the following migrations need manual copying. -# Move them and any dependencies into this file, then update the -# RunPython operations to refer to the local versions: -def update_xlsx_payment_verification_plan_file(apps, schema_editor): - XlsxPaymentVerificationPlanFile = apps.get_model("payment", "XlsxPaymentVerificationPlanFile") - FileTemp = apps.get_model("core", "FileTemp") - PaymentVerificationPlan = apps.get_model("payment", "PaymentVerificationPlan") - ContentType = apps.get_model("contenttypes", "ContentType") - - ct = ContentType.objects.get_for_model(PaymentVerificationPlan) - objs_create_list = [] - - for xlsx in XlsxPaymentVerificationPlanFile.objects.all(): - new_obj = FileTemp( - file=xlsx.file, - object_id=xlsx.payment_verification_plan.pk, - content_type_id=ct.pk, - was_downloaded=xlsx.was_downloaded, - created_by=xlsx.created_by, - created=xlsx.created_at, - ) - objs_create_list.append(new_obj) - - FileTemp.objects.bulk_create(objs_create_list, 1000) - -def remove_payment_plan_old_export_file(apps, schema_editor): - PaymentPlan = apps.get_model("payment", "PaymentPlan") - - for pp in PaymentPlan.objects.exclude(export_file__isnull=True): - pp.export_file.file.delete(save=False) - pp.export_file.delete() - pp.export_file = None - pp.save() - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0076_migration_squashed_0077_migration'), - ('core', '0060_migration_squashed_0064_migration'), - ('contenttypes', '0002_remove_content_type_name'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='deliverymechanismperpaymentplan', - unique_together=set(), - ), - migrations.RunPython(update_xlsx_payment_verification_plan_file, migrations.RunPython.noop), - migrations.DeleteModel( - name='XlsxPaymentVerificationPlanFile', - ), - migrations.AlterField( - model_name='deliverymechanism', - name='global_core_fields', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?')], max_length=255), default=list, size=None), - ), - migrations.AlterField( - model_name='deliverymechanism', - name='payment_channel_fields', - field=hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(blank=True, choices=[('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), default=list, size=None), - ), - migrations.RemoveField( - model_name='paymentchannel', - name='delivery_mechanism', - ), - migrations.RemoveField( - model_name='paymentchannel', - name='individual', - ), - migrations.RemoveField( - model_name='payment', - name='assigned_payment_channel', - ), - migrations.DeleteModel( - name='DeliveryMechanism', - ), - migrations.DeleteModel( - name='PaymentChannel', - ), - migrations.RemoveField( - model_name='financialserviceprovider', - name='fsp_xlsx_template', - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity'], help_text='Select the columns to include in the report', max_length=152, verbose_name='Columns'), - ), - migrations.AddField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.CreateModel( - name='FspXlsxTemplatePerDeliveryMechanism', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('delivery_mechanism', models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('In Kind', 'In Kind'), ('Mobile Money', 'Mobile Money'), ('Other', 'Other'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=255, verbose_name='Delivery Mechanism')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='created_fsp_xlsx_template_per_delivery_mechanisms', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), - ('financial_service_provider', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fsp_xlsx_template_per_delivery_mechanisms', to='payment.financialserviceprovider')), - ('xlsx_template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fsp_xlsx_template_per_delivery_mechanisms', to='payment.financialserviceproviderxlsxtemplate')), - ], - options={ - 'unique_together': {('financial_service_provider', 'delivery_mechanism')}, - }, - ), - migrations.AddField( - model_name='financialserviceprovider', - name='xlsx_templates', - field=models.ManyToManyField(related_name='financial_service_providers', through='payment.FspXlsxTemplatePerDeliveryMechanism', to='payment.FinancialServiceProviderXlsxTemplate'), - ), - migrations.AlterField( - model_name='payment', - name='delivered_quantity', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='delivered_quantity_usd', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='entitlement_quantity', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='entitlement_quantity_usd', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending')], max_length=255), - ), - migrations.AlterField( - model_name='paymentplan', - name='status', - field=django_fsm.FSMField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('LOCKED_FSP', 'Locked FSP'), ('IN_APPROVAL', 'In Approval'), ('IN_AUTHORIZATION', 'In Authorization'), ('IN_REVIEW', 'In Review'), ('ACCEPTED', 'Accepted'), ('FINISHED', 'Finished')], db_index=True, default='OPEN', max_length=50), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivered_quantity', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivered_quantity_usd', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_quantity', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_quantity_usd', - field=models.DecimalField(decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending')], max_length=255), - ), - migrations.CreateModel( - name='AcceptanceProcessThreshold', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('payments_range_usd', django.contrib.postgres.fields.ranges.IntegerRangeField(default=psycopg2.extras.NumericRange(0, None, '[)'), validators=[django.contrib.postgres.validators.RangeMinValueValidator(0)])), - ('approval_number_required', models.PositiveIntegerField(default=1)), - ('authorization_number_required', models.PositiveIntegerField(default=1)), - ('finance_release_number_required', models.PositiveIntegerField(default=1)), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='acceptance_process_thresholds', to='core.businessarea')), - ], - options={ - 'ordering': ('payments_range_usd',), - }, - ), - migrations.RenameField( - model_name='approvalprocess', - old_name='sent_for_finance_review_by', - new_name='sent_for_finance_release_by', - ), - migrations.RenameField( - model_name='approvalprocess', - old_name='sent_for_finance_review_date', - new_name='sent_for_finance_release_date', - ), - migrations.AlterField( - model_name='approval', - name='type', - field=models.CharField(choices=[('APPROVAL', 'Approval'), ('AUTHORIZATION', 'Authorization'), ('FINANCE_RELEASE', 'Finance Release'), ('REJECT', 'Reject')], default='APPROVAL', max_length=50, verbose_name='Approval type'), - ), - migrations.AddField( - model_name='approvalprocess', - name='approval_number_required', - field=models.PositiveIntegerField(default=1), - ), - migrations.AddField( - model_name='approvalprocess', - name='authorization_number_required', - field=models.PositiveIntegerField(default=1), - ), - migrations.AddField( - model_name='approvalprocess', - name='finance_release_number_required', - field=models.PositiveIntegerField(default=1), - ), - migrations.AlterField( - model_name='payment', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending')], default='Pending', max_length=255), - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending')], default='Pending', max_length=255), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('In Kind', 'In Kind'), ('Mobile Money', 'Mobile Money'), ('Other', 'Other'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24), size=None), - ), - migrations.AlterField( - model_name='paymentplan', - name='background_action_status', - field=django_fsm.FSMField(blank=True, choices=[('RULE_ENGINE_RUN', 'Rule Engine Running'), ('RULE_ENGINE_ERROR', 'Rule Engine Errored'), ('XLSX_EXPORTING', 'Exporting XLSX file'), ('XLSX_EXPORT_ERROR', 'Export XLSX file Error'), ('XLSX_IMPORT_ERROR', 'Import XLSX file Error'), ('XLSX_IMPORTING_ENTITLEMENTS', 'Importing Entitlements XLSX file'), ('XLSX_IMPORTING_RECONCILIATION', 'Importing Reconciliation XLSX file')], db_index=True, default=None, max_length=50, null=True), - ), - migrations.AlterField( - model_name='paymentplan', - name='female_adults_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.AlterField( - model_name='paymentplan', - name='female_children_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.AlterField( - model_name='paymentplan', - name='male_adults_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.AlterField( - model_name='paymentplan', - name='male_children_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_households_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_individuals_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.RunSQL( - sql='SET CONSTRAINTS ALL IMMEDIATE;', - ), - migrations.RunPython(remove_payment_plan_old_export_file, migrations.RunPython.noop), - migrations.RunSQL( - sql='SET CONSTRAINTS ALL DEFERRED;', - ), - migrations.RenameField( - model_name='paymentplan', - old_name='export_file', - new_name='export_file_entitlement', - ), - migrations.AddField( - model_name='paymentplan', - name='export_file_per_fsp', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.filetemp'), - ), - migrations.AlterField( - model_name='paymentplan', - name='status', - field=django_fsm.FSMField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('LOCKED_FSP', 'Locked FSP'), ('IN_APPROVAL', 'In Approval'), ('IN_AUTHORIZATION', 'In Authorization'), ('IN_REVIEW', 'In Review'), ('ACCEPTED', 'Accepted'), ('FINISHED', 'Finished'), ('PREPARING', 'Preparing')], db_index=True, default='OPEN', max_length=50), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery date')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date'], help_text='Select the columns to include in the report', max_length=166, verbose_name='Columns'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0097_migration.py b/src/hct_mis_api/apps/payment/migrations/0097_migration.py deleted file mode 100644 index 63c4691bfe..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0097_migration.py +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-04 14:27 - -from django.db import migrations, models -import django.db.models.deletion -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0038_migration'), - ('payment', '0078_migration_squashed_0096_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='conflicted', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='payment', - name='is_follow_up', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='payment', - name='source_payment', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='follow_ups', to='payment.payment'), - ), - migrations.AddField( - model_name='paymentplan', - name='is_follow_up', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='paymentplan', - name='program_cycle', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='program.programcycle'), - ), - migrations.AddField( - model_name='paymentplan', - name='source_payment_plan', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='follow_ups', to='payment.paymentplan'), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date'], help_text='Select the columns to include in the report', max_length=166, verbose_name='Columns'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0097_migration_squashed_0117_migration.py b/src/hct_mis_api/apps/payment/migrations/0097_migration_squashed_0117_migration.py deleted file mode 100644 index 8938e4abc5..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0097_migration_squashed_0117_migration.py +++ /dev/null @@ -1,408 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 04:44 - -import concurrency.fields -from decimal import Decimal -import django.core.validators -from django.db import migrations, models -import hct_mis_api.apps.account.models -import hct_mis_api.apps.payment.validators -import model_utils.fields -import multiselectfield.db.fields -import uuid - -from django.core.paginator import Paginator -from django.db import migrations, models -import django.db.models.deletion -import django_fsm - -import hct_mis_api.apps.payment.validators -import multiselectfield.db.fields - - -def populate_program_id_for_payments(apps, schema_editor): - Payment = apps.get_model("payment", "Payment") - payment_qs = Payment.objects.all().order_by("-created_at") - - paginator = Paginator(payment_qs, 1000) - for page_number in paginator.page_range: - to_update = [] - for payment in paginator.page(page_number).object_list: - payment.program = payment.parent.program - to_update.append(payment) - - Payment.objects.bulk_update(to_update, ["program"]) - -class Migration(migrations.Migration): - - replaces = [('payment', '0097_migration'), ('payment', '0098_migration'), ('payment', '0099_migration'), ('payment', '0100_migration'), ('payment', '0101_migration'), ('payment', '0102_migration'), ('payment', '0103_migration'), ('payment', '0104_migration'), ('payment', '0105_migration'), ('payment', '0106_migration'), ('payment', '0107_migration'), ('payment', '0108_migration'), ('payment', '0109_migration'), ('payment', '0110_migration'), ('payment', '0111_migration'), ('payment', '0112_migration'), ('payment', '0113_migration'), ('payment', '0114_migration'), ('payment', '0115_migration'), ('payment', '0116_migration'), ('payment', '0117_migration')] - - dependencies = [ - ('program', '0038_migration'), - ('payment', '0078_migration_squashed_0096_migration'), - ('core', '0065_migration_squashed_0067_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='conflicted', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='payment', - name='is_follow_up', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='payment', - name='source_payment', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='follow_ups', to='payment.payment'), - ), - migrations.AddField( - model_name='paymentplan', - name='is_follow_up', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='paymentplan', - name='program_cycle', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='program.programcycle'), - ), - migrations.AddField( - model_name='paymentplan', - name='source_payment_plan', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='follow_ups', to='payment.paymentplan'), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date'], help_text='Select the columns to include in the report', max_length=166, verbose_name='Columns'), - ), - migrations.AddField( - model_name='paymentplan', - name='exclusion_reason', - field=models.TextField(blank=True), - ), - migrations.AddField( - model_name='payment', - name='reason_for_unsuccessful_payment', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment'], help_text='Select the columns to include in the report', max_length=250, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AddField( - model_name='payment', - name='order_number', - field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(999999999), hct_mis_api.apps.payment.validators.payment_token_and_order_number_validator]), - ), - migrations.AddField( - model_name='payment', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), - ), - migrations.AddField( - model_name='payment', - name='token_number', - field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1000000), django.core.validators.MaxValueValidator(9999999), hct_mis_api.apps.payment.validators.payment_token_and_order_number_validator]), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number'], help_text='Select the columns to include in the report', max_length=250, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='paymentplan', - name='status', - field=django_fsm.FSMField(choices=[('PREPARING', 'Preparing'), ('OPEN', 'Open'), ('LOCKED', 'Locked'), ('LOCKED_FSP', 'Locked FSP'), ('IN_APPROVAL', 'In Approval'), ('IN_AUTHORIZATION', 'In Authorization'), ('IN_REVIEW', 'In Review'), ('ACCEPTED', 'Accepted'), ('FINISHED', 'Finished')], db_index=True, default='OPEN', max_length=50), - ), - migrations.AddConstraint( - model_name='payment', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('program_id', 'order_number'), name='order_number_unique_per_program'), - ), - migrations.AddConstraint( - model_name='payment', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('program_id', 'token_number'), name='token_number_unique_per_program'), - ), - migrations.RunPython(populate_program_id_for_payments, migrations.RunPython.noop), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number'], help_text='Select the columns to include in the report', max_length=500, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='payment', - name='delivered_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='entitlement_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='entitlement_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_delivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity_revised_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_undelivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_undelivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivered_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AddField( - model_name='paymentplan', - name='exclude_household_error', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='paymentplan', - name='background_action_status', - field=django_fsm.FSMField(blank=True, choices=[('RULE_ENGINE_RUN', 'Rule Engine Running'), ('RULE_ENGINE_ERROR', 'Rule Engine Errored'), ('XLSX_EXPORTING', 'Exporting XLSX file'), ('XLSX_EXPORT_ERROR', 'Export XLSX file Error'), ('XLSX_IMPORT_ERROR', 'Import XLSX file Error'), ('XLSX_IMPORTING_ENTITLEMENTS', 'Importing Entitlements XLSX file'), ('XLSX_IMPORTING_RECONCILIATION', 'Importing Reconciliation XLSX file'), ('EXCLUDE_BENEFICIARIES', 'Exclude Beneficiaries Running'), ('EXCLUDE_BENEFICIARIES_ERROR', 'Exclude Beneficiaries Error')], db_index=True, default=None, max_length=50, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], db_index=True, max_length=24, null=True), - ), - migrations.AlterField( - model_name='deliverymechanismperpaymentplan', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24), size=None), - ), - migrations.AlterField( - model_name='fspxlsxtemplateperdeliverymechanism', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=255, verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='payment', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24, null=True), - ), - migrations.AddField( - model_name='paymentplan', - name='export_pdf_file_summary', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.filetemp'), - ), - migrations.CreateModel( - name='PaymentHouseholdSnapshot', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('snapshot_data', models.JSONField(default=dict)), - ('household_id', models.UUIDField()), - ('payment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='household_snapshot', to='payment.payment')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='cashplan', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AddField( - model_name='paymentplan', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('registration_token', 'Registration Token')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'registration_token'], help_text='Select the columns to include in the report', max_length=500, verbose_name='Columns'), - ), - migrations.AddField( - model_name='payment', - name='additional_collector_name', - field=models.CharField(blank=True, help_text='Use this field for reconciliation data when funds are collected by someone other than the designated collector or the alternate collector', max_length=64, null=True), - ), - migrations.AddField( - model_name='payment', - name='additional_document_number', - field=models.CharField(blank=True, help_text='Use this field for reconciliation data', max_length=128, null=True), - ), - migrations.AddField( - model_name='payment', - name='additional_document_type', - field=models.CharField(blank=True, help_text='Use this field for reconciliation data', max_length=128, null=True), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number'], help_text='Select the columns to include in the report', max_length=500, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - migrations.AddField( - model_name='payment', - name='signature_hash', - field=models.CharField(blank=True, editable=False, max_length=40), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AddField( - model_name='deliverymechanismperpaymentplan', - name='sent_to_payment_gateway', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='paymentplan', - name='background_action_status', - field=django_fsm.FSMField(blank=True, choices=[('RULE_ENGINE_RUN', 'Rule Engine Running'), ('RULE_ENGINE_ERROR', 'Rule Engine Errored'), ('XLSX_EXPORTING', 'Exporting XLSX file'), ('XLSX_EXPORT_ERROR', 'Export XLSX file Error'), ('XLSX_IMPORT_ERROR', 'Import XLSX file Error'), ('XLSX_IMPORTING_ENTITLEMENTS', 'Importing Entitlements XLSX file'), ('XLSX_IMPORTING_RECONCILIATION', 'Importing Reconciliation XLSX file'), ('EXCLUDE_BENEFICIARIES', 'Exclude Beneficiaries Running'), ('EXCLUDE_BENEFICIARIES_ERROR', 'Exclude Beneficiaries Error'), ('SEND_TO_PAYMENT_GATEWAY', 'Sending to Payment Gateway'), ('SEND_TO_PAYMENT_GATEWAY_ERROR', 'Send to Payment Gateway Error')], db_index=True, default=None, max_length=50, null=True), - ), - migrations.AddField( - model_name='financialserviceprovider', - name='payment_gateway_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='paymentplan', - name='name', - field=models.CharField(blank=True, max_length=25, null=True, validators=[django.core.validators.MinLengthValidator(5)]), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token'), ('status', 'Status')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token', 'status'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - migrations.AddConstraint( - model_name='paymentplan', - constraint=models.UniqueConstraint(fields=('name', 'program'), name='name_unique_per_program'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0098_migration.py b/src/hct_mis_api/apps/payment/migrations/0098_migration.py deleted file mode 100644 index 54629223b4..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0098_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-12 12:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0097_migration'), - ] - - operations = [ - migrations.AddField( - model_name='paymentplan', - name='exclusion_reason', - field=models.TextField(blank=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0099_migration.py b/src/hct_mis_api/apps/payment/migrations/0099_migration.py deleted file mode 100644 index 534bd3981b..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0099_migration.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-18 10:41 - -from django.db import migrations, models -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0098_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='reason_for_unsuccessful_payment', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment'], help_text='Select the columns to include in the report', max_length=250, verbose_name='Columns'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0100_migration.py b/src/hct_mis_api/apps/payment/migrations/0100_migration.py deleted file mode 100644 index 78d2a58140..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0100_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-23 06:01 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0099_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0101_migration.py b/src/hct_mis_api/apps/payment/migrations/0101_migration.py deleted file mode 100644 index 2ecadec2be..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0101_migration.py +++ /dev/null @@ -1,68 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-25 11:50 - -import django.core.validators -from django.core.paginator import Paginator -from django.db import migrations, models -import django.db.models.deletion -import django_fsm - -import hct_mis_api.apps.payment.validators -import multiselectfield.db.fields - - -def populate_program_id_for_payments(apps, schema_editor): - Payment = apps.get_model("payment", "Payment") - payment_qs = Payment.objects.all().order_by("-created_at") - - paginator = Paginator(payment_qs, 1000) - for page_number in paginator.page_range: - to_update = [] - for payment in paginator.page(page_number).object_list: - payment.program = payment.parent.program - to_update.append(payment) - - Payment.objects.bulk_update(to_update, ["program"]) - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0038_migration'), - ('payment', '0100_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='order_number', - field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(100000000), django.core.validators.MaxValueValidator(999999999), hct_mis_api.apps.payment.validators.payment_token_and_order_number_validator]), - ), - migrations.AddField( - model_name='payment', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), - ), - migrations.AddField( - model_name='payment', - name='token_number', - field=models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1000000), django.core.validators.MaxValueValidator(9999999), hct_mis_api.apps.payment.validators.payment_token_and_order_number_validator]), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number'], help_text='Select the columns to include in the report', max_length=250, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='paymentplan', - name='status', - field=django_fsm.FSMField(choices=[('PREPARING', 'Preparing'), ('OPEN', 'Open'), ('LOCKED', 'Locked'), ('LOCKED_FSP', 'Locked FSP'), ('IN_APPROVAL', 'In Approval'), ('IN_AUTHORIZATION', 'In Authorization'), ('IN_REVIEW', 'In Review'), ('ACCEPTED', 'Accepted'), ('FINISHED', 'Finished')], db_index=True, default='OPEN', max_length=50), - ), - migrations.AddConstraint( - model_name='payment', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('program_id', 'order_number'), name='order_number_unique_per_program'), - ), - migrations.AddConstraint( - model_name='payment', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('program_id', 'token_number'), name='token_number_unique_per_program'), - ), - migrations.RunPython(populate_program_id_for_payments, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0102_migration.py b/src/hct_mis_api/apps/payment/migrations/0102_migration.py deleted file mode 100644 index 41a78cc432..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0102_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.18 on 2023-06-28 07:21 - -from django.db import migrations -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0101_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number'], help_text='Select the columns to include in the report', max_length=500, verbose_name='Columns'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0103_migration.py b/src/hct_mis_api/apps/payment/migrations/0103_migration.py deleted file mode 100644 index 7d35b71dc1..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0103_migration.py +++ /dev/null @@ -1,145 +0,0 @@ -from decimal import Decimal -import django.core.validators - -from django.db import migrations, models -import django_fsm - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0102_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='payment', - name='delivered_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='entitlement_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='payment', - name='entitlement_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_delivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity_revised_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_entitled_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_undelivered_quantity', - field=models.DecimalField(blank=True, db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentplan', - name='total_undelivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivered_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivered_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_quantity', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='paymentrecord', - name='entitlement_quantity_usd', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AddField( - model_name='paymentplan', - name='exclude_household_error', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='paymentplan', - name='background_action_status', - field=django_fsm.FSMField(blank=True, choices=[('RULE_ENGINE_RUN', 'Rule Engine Running'), ('RULE_ENGINE_ERROR', 'Rule Engine Errored'), ('XLSX_EXPORTING', 'Exporting XLSX file'), ('XLSX_EXPORT_ERROR', 'Export XLSX file Error'), ('XLSX_IMPORT_ERROR', 'Import XLSX file Error'), ('XLSX_IMPORTING_ENTITLEMENTS', 'Importing Entitlements XLSX file'), ('XLSX_IMPORTING_RECONCILIATION', 'Importing Reconciliation XLSX file'), ('EXCLUDE_BENEFICIARIES', 'Exclude Beneficiaries Running'), ('EXCLUDE_BENEFICIARIES_ERROR', 'Exclude Beneficiaries Error')], db_index=True, default=None, max_length=50, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0104_migration.py b/src/hct_mis_api/apps/payment/migrations/0104_migration.py deleted file mode 100644 index ef53b6f732..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0104_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.19 on 2023-07-20 09:43 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0103_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], db_index=True, max_length=24, null=True), - ), - migrations.AlterField( - model_name='deliverymechanismperpaymentplan', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24), size=None), - ), - migrations.AlterField( - model_name='fspxlsxtemplateperdeliverymechanism', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=255, verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='payment', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], max_length=24, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0105_migration.py b/src/hct_mis_api/apps/payment/migrations/0105_migration.py deleted file mode 100644 index 5a4bf2a3dd..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0105_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-14 10:58 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0065_migration_squashed_0067_migration'), - ('payment', '0104_migration'), - ] - - operations = [ - migrations.AddField( - model_name='paymentplan', - name='export_pdf_file_summary', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='core.filetemp'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0106_migration.py b/src/hct_mis_api/apps/payment/migrations/0106_migration.py deleted file mode 100644 index 1513f0a4d4..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0106_migration.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-25 14:51 - -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0105_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PaymentHouseholdSnapshot', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('snapshot_data', models.JSONField(default=dict)), - ('household_id', models.UUIDField()), - ('payment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='household_snapshot', to='payment.payment')), - ], - options={ - 'abstract': False, - }, - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0107_migration.py b/src/hct_mis_api/apps/payment/migrations/0107_migration.py deleted file mode 100644 index 4a7ea7e3d2..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0107_migration.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 3.2.20 on 2023-08-04 11:18 - -import concurrency.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0106_migration'), - ] - - operations = [ - migrations.AddField( - model_name='cashplan', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AddField( - model_name='paymentplan', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0108_migration.py b/src/hct_mis_api/apps/payment/migrations/0108_migration.py deleted file mode 100644 index 12f6d474a3..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0108_migration.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-04 16:08 - -from django.db import migrations, models -import django.db.models.deletion -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0107_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='payment.payment'), - ), - migrations.AddField( - model_name='payment', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='payment', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='paymentrecord', - name='copied_from', - field=models.ForeignKey(blank=True, help_text='If this object was copied from another, this field will contain the object it was copied from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='copied_to', to='payment.paymentrecord'), - ), - migrations.AddField( - model_name='paymentrecord', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='paymentrecord', - name='is_original', - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0109_migration.py b/src/hct_mis_api/apps/payment/migrations/0109_migration.py deleted file mode 100644 index 9aaf5effb8..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0109_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.22 on 2023-10-30 09:29 - -from django.db import migrations -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0108_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('registration_token', 'Registration Token')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'registration_token'], help_text='Select the columns to include in the report', max_length=500, verbose_name='Columns'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0110_migration.py b/src/hct_mis_api/apps/payment/migrations/0110_migration.py deleted file mode 100644 index 7dcab11bf2..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0110_migration.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.2.20 on 2023-10-06 13:16 - -from django.db import migrations, models -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0109_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='additional_collector_name', - field=models.CharField(blank=True, help_text='Use this field for reconciliation data when funds are collected by someone other than the designated collector or the alternate collector', max_length=64, null=True), - ), - migrations.AddField( - model_name='payment', - name='additional_document_number', - field=models.CharField(blank=True, help_text='Use this field for reconciliation data', max_length=128, null=True), - ), - migrations.AddField( - model_name='payment', - name='additional_document_type', - field=models.CharField(blank=True, help_text='Use this field for reconciliation data', max_length=128, null=True), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number'], help_text='Select the columns to include in the report', max_length=500, verbose_name='Columns'), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/payment/migrations/0111_migration.py b/src/hct_mis_api/apps/payment/migrations/0111_migration.py deleted file mode 100644 index 4093c923d2..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0111_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.20 on 2023-10-09 08:27 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0110_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0112_migration.py b/src/hct_mis_api/apps/payment/migrations/0112_migration.py deleted file mode 100644 index a52556c358..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0112_migration.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 3.2.22 on 2023-10-29 20:02 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0111_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='payment', - name='copied_from', - ), - migrations.RemoveField( - model_name='payment', - name='is_migration_handled', - ), - migrations.RemoveField( - model_name='payment', - name='is_original', - ), - migrations.RemoveField( - model_name='paymentrecord', - name='copied_from', - ), - migrations.RemoveField( - model_name='paymentrecord', - name='is_migration_handled', - ), - migrations.RemoveField( - model_name='paymentrecord', - name='is_original', - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0113_migration.py b/src/hct_mis_api/apps/payment/migrations/0113_migration.py deleted file mode 100644 index 5f4aa59f8a..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0113_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-15 14:16 - -from django.db import migrations -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0112_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0114_migration.py b/src/hct_mis_api/apps/payment/migrations/0114_migration.py deleted file mode 100644 index eed2d9d384..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0114_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-03 08:06 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0113_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='signature_hash', - field=models.CharField(blank=True, editable=False, max_length=40), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0115_migration.py b/src/hct_mis_api/apps/payment/migrations/0115_migration.py deleted file mode 100644 index aad102627e..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0115_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-04 13:35 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0114_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0116_migration.py b/src/hct_mis_api/apps/payment/migrations/0116_migration.py deleted file mode 100644 index a4610f6b00..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0116_migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.2.22 on 2024-01-08 10:56 - -from django.db import migrations, models -import django_fsm - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0115_migration'), - ] - - operations = [ - migrations.AddField( - model_name='deliverymechanismperpaymentplan', - name='sent_to_payment_gateway', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='paymentplan', - name='background_action_status', - field=django_fsm.FSMField(blank=True, choices=[('RULE_ENGINE_RUN', 'Rule Engine Running'), ('RULE_ENGINE_ERROR', 'Rule Engine Errored'), ('XLSX_EXPORTING', 'Exporting XLSX file'), ('XLSX_EXPORT_ERROR', 'Export XLSX file Error'), ('XLSX_IMPORT_ERROR', 'Import XLSX file Error'), ('XLSX_IMPORTING_ENTITLEMENTS', 'Importing Entitlements XLSX file'), ('XLSX_IMPORTING_RECONCILIATION', 'Importing Reconciliation XLSX file'), ('EXCLUDE_BENEFICIARIES', 'Exclude Beneficiaries Running'), ('EXCLUDE_BENEFICIARIES_ERROR', 'Exclude Beneficiaries Error'), ('SEND_TO_PAYMENT_GATEWAY', 'Sending to Payment Gateway'), ('SEND_TO_PAYMENT_GATEWAY_ERROR', 'Send to Payment Gateway Error')], db_index=True, default=None, max_length=50, null=True), - ), - migrations.AddField( - model_name='financialserviceprovider', - name='payment_gateway_id', - field=models.CharField(max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0117_migration.py b/src/hct_mis_api/apps/payment/migrations/0117_migration.py deleted file mode 100644 index 6f1bd1a9fb..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0117_migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-07 14:54 - -import django.core.validators -from django.db import migrations, models -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0116_migration'), - ] - - operations = [ - migrations.AddField( - model_name='paymentplan', - name='name', - field=models.CharField(blank=True, max_length=25, null=True, validators=[django.core.validators.MinLengthValidator(5)]), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token'), ('status', 'Status')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token', 'status'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - migrations.AddConstraint( - model_name='paymentplan', - constraint=models.UniqueConstraint(fields=('name', 'program'), name='name_unique_per_program'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0118_migration.py b/src/hct_mis_api/apps/payment/migrations/0118_migration.py deleted file mode 100644 index c871d28557..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0118_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-21 13:37 - -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0117_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='paymentplan', - name='name', - field=models.CharField(blank=True, max_length=255, null=True, - validators=[django.core.validators.MinLengthValidator(3), - django.core.validators.MaxLengthValidator(255)]), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0119_migration.py b/src/hct_mis_api/apps/payment/migrations/0119_migration.py deleted file mode 100644 index 34d6efae0d..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0119_migration.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-12 14:48 - -import uuid - -import django.db.models.deletion -import model_utils.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0118_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PaymentPlanSplit', - fields=[ - ('id', - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('split_type', models.CharField(choices=[('BY_RECORDS', 'By Records'), ('BY_COLLECTOR', 'By Collector'), - ('BY_ADMIN_AREA2', 'By Admin Area 2')], max_length=24)), - ('chunks_no', models.IntegerField(blank=True, null=True)), - ('sent_to_payment_gateway', models.BooleanField(default=False)), - ('payment_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='splits', - to='payment.paymentplan')), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='PaymentPlanSplitPayments', - fields=[ - ('id', - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('payment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, - related_name='payment_plan_split_payment', to='payment.payment')), - ('payment_plan_split', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment_plan_split', - to='payment.paymentplansplit')), - ], - options={ - 'unique_together': {('payment_plan_split', 'payment')}, - }, - ), - migrations.AddField( - model_name='paymentplansplit', - name='payments', - field=models.ManyToManyField(related_name='_payment_paymentplansplit_payments_+', - through='payment.PaymentPlanSplitPayments', to='payment.Payment'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0120_migration.py b/src/hct_mis_api/apps/payment/migrations/0120_migration.py deleted file mode 100644 index 3b5cfa42ad..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0120_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-19 12:38 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0119_migration'), - ] - - operations = [ - migrations.AddField( - model_name='paymentplansplit', - name='order', - field=models.IntegerField(default=0), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0121_migration.py b/src/hct_mis_api/apps/payment/migrations/0121_migration.py deleted file mode 100644 index 1af0468683..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0121_migration.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-20 17:34 - -import multiselectfield.db.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0120_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField( - choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), - ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), - ('alternate_collector_full_name', 'Alternate collector Full Name'), - ('alternate_collector_given_name', 'Alternate collector Given Name'), - ('alternate_collector_middle_name', 'Alternate collector Middle Name'), - ('alternate_collector_phone_no', 'Alternate collector phone number'), - ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), - ('alternate_collector_sex', 'Alternate collector Gender'), - ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), - ('entitlement_quantity', 'Entitlement Quantity'), - ('entitlement_quantity_usd', 'Entitlement Quantity USD'), - ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), - ('reference_id', 'Reference id'), - ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), - ('order_number', 'Order Number'), ('token_number', 'Token Number'), - ('additional_collector_name', 'Additional Collector Name'), - ('additional_document_type', 'Additional Document Type'), - ('additional_document_number', 'Additional Document Number'), - ('registration_token', 'Registration Token'), ('status', 'Status')], - default=['payment_id', 'household_id', 'household_size', 'collector_name', - 'alternate_collector_full_name', 'alternate_collector_given_name', - 'alternate_collector_middle_name', 'alternate_collector_phone_no', - 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', - 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', - 'delivered_quantity', 'delivery_date', 'reference_id', 'reason_for_unsuccessful_payment', - 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', - 'additional_document_number', 'registration_token', 'status'], - help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0122_migration.py b/src/hct_mis_api/apps/payment/migrations/0122_migration.py deleted file mode 100644 index c249504945..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0122_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-03-17 00:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0077_migration'), - ('payment', '0121_migration'), - ] - - operations = [ - migrations.AddField( - model_name='financialserviceprovider', - name='allowed_business_areas', - field=models.ManyToManyField(to='core.BusinessArea'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0123_migration.py b/src/hct_mis_api/apps/payment/migrations/0123_migration.py deleted file mode 100644 index 64842f55c8..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0123_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-03-24 20:31 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0122_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which ${admin1_h_c}?'), ('admin2', 'Household resides in which ${admin2_h_c}?'), ('admin3', 'Household resides in which ${admin3_h_c}?'), ('admin4', 'Household resides in which ${admin4_h_c}?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('size', 'What is the household size?'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', "Will you be collecting all member Individuals' data?"), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed household'), ('child_hoh', 'Child headed household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('first_registration_date', 'First household registration date'), ('number_of_children', 'What is the number of children in the household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('index_id', 'Index ID'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('address', 'Address'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('zip_code', 'Zip code'), ('admin1', 'Social worker resides in which ${admin1_i_c}?'), ('admin2', 'Social worker resides in which ${admin2_i_c}?'), ('admin3', 'Social worker resides in which ${admin3_i_c}?'), ('admin4', 'Social worker resides in which ${admin4_i_c}?'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee household?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('currency', 'Which currency will be used for financial questions?'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('age', 'Age (calculated)'), ('fchild_hoh', 'Child is female and head of household'), ('child_hoh', 'Child is head of household'), ('relationship', 'Relationship to head of household'), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('pregnant', 'Is the individual pregnant?'), ('work_status', 'Does the individual have paid employment in the current month?'), ('observed_disability', 'Does the individual have disability?'), ('seeing_disability', 'If the individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the individual has difficulty communicating, what is the severity?'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First individual registration date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0124_migration.py b/src/hct_mis_api/apps/payment/migrations/0124_migration.py deleted file mode 100644 index a8a29d4616..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0124_migration.py +++ /dev/null @@ -1,94 +0,0 @@ -# Generated by Django 3.2.25 on 2024-03-24 20:31 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -def add_payment_gateway_fsp_mobile_money_delivery_mechanism(apps, schema_editor): - FinancialServiceProvider = apps.get_model("payment", "FinancialServiceProvider") - - for fsp in FinancialServiceProvider.objects.filter(payment_gateway_id__isnull=False): - fsp.delivery_mechanisms = ["Cash over the counter", "Mobile Money"] - fsp.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0123_migration'), - ] - - operations = [ - migrations.AddField( - model_name='deliverymechanismperpaymentplan', - name='chosen_configuration', - field=models.CharField(max_length=50, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter')], - db_index=True, max_length=24, null=True), - ), - migrations.AlterField( - model_name='deliverymechanismperpaymentplan', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter')], - db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField( - choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), - ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter')], max_length=24), - size=None), - ), - migrations.AlterField( - model_name='fspxlsxtemplateperdeliverymechanism', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter')], - max_length=255, verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='payment', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter')], - max_length=24, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter')], - max_length=24, null=True), - ), - migrations.RunPython(add_payment_gateway_fsp_mobile_money_delivery_mechanism, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0125_migration.py b/src/hct_mis_api/apps/payment/migrations/0125_migration.py deleted file mode 100644 index 86a48c3685..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0125_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.25 on 2024-04-21 18:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0124_migration'), - ] - - operations = [ - migrations.RemoveConstraint( - model_name='paymentplan', - name='name_unique_per_program', - ), - migrations.AddConstraint( - model_name='paymentplan', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('name', 'program', 'is_removed'), name='name_unique_per_program'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0126_migration.py b/src/hct_mis_api/apps/payment/migrations/0126_migration.py deleted file mode 100644 index 8cbef7fdfa..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0126_migration.py +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-07 09:12 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0125_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('ATM Card', 'ATM Card')], db_index=True, max_length=24, null=True), - ), - migrations.AlterField( - model_name='deliverymechanismperpaymentplan', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('ATM Card', 'ATM Card')], db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('ATM Card', 'ATM Card')], max_length=24), size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which admin1?'), ('admin2', 'Household resides in which admin2?'), ('admin3', 'Household resides in which admin3?'), ('admin4', 'Household resides in which admin4?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee Household?'), ('size', 'What is the Household size?'), ('fchild_hoh', 'Child is female and Head of Household'), ('child_hoh', 'Child is Head of Household'), ('relationship', 'Relationship to Head of Household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', 'Will you be collecting all member Individual data?'), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the Individual pregnant?'), ('work_status', 'Does the Individual have paid employment in the current month?'), ('observed_disability', 'Does the Individual have disability?'), ('seeing_disability', 'If the Individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the Individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the Individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the Individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the Individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed Household'), ('child_hoh', 'Child headed Household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First Individual registration date'), ('first_registration_date', 'First Household registration date'), ('number_of_children', 'What is the number of children in the Household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('index_id', 'Index ID'), ('registration_id', 'Program registration id'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AlterField( - model_name='fspxlsxtemplateperdeliverymechanism', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('ATM Card', 'ATM Card')], max_length=255, verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='payment', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('ATM Card', 'ATM Card')], max_length=24, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('ATM Card', 'ATM Card')], max_length=24, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0127_migration.py b/src/hct_mis_api/apps/payment/migrations/0127_migration.py deleted file mode 100644 index c60bb40916..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0127_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-04-26 15:13 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0126_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which admin1?'), ('admin2', 'Household resides in which admin2?'), ('admin3', 'Household resides in which admin3?'), ('admin4', 'Household resides in which admin4?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee Household?'), ('size', 'What is the Household size?'), ('fchild_hoh', 'Child is female and Head of Household'), ('child_hoh', 'Child is Head of Household'), ('relationship', 'Relationship to Head of Household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', 'Will you be collecting all member Individual data?'), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the Individual pregnant?'), ('work_status', 'Does the Individual have paid employment in the current month?'), ('observed_disability', 'Does the Individual have disability?'), ('seeing_disability', 'If the Individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the Individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the Individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the Individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the Individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed Household'), ('child_hoh', 'Child headed Household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First Individual registration date'), ('first_registration_date', 'First Household registration date'), ('number_of_children', 'What is the number of children in the Household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('index_id', 'Index ID'), ('wallet_name', 'Wallet Name'), ('blockchain_name', 'Blockchain Name'), ('wallet_address', 'Wallet Address'), ('registration_id', 'Program registration id'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0128_migration.py b/src/hct_mis_api/apps/payment/migrations/0128_migration.py deleted file mode 100644 index 6ad75b590b..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0128_migration.py +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-08 11:01 - -from django.db import migrations, models -import hct_mis_api.apps.account.models -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0127_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='transaction_status_blockchain_link', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='paymentrecord', - name='transaction_status_blockchain_link', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet'), ('ATM Card', 'ATM Card')], db_index=True, max_length=32, null=True), - ), - migrations.AlterField( - model_name='deliverymechanismperpaymentplan', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet'), ('ATM Card', 'ATM Card')], db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet'), ('ATM Card', 'ATM Card')], max_length=32), size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reference_id', 'Reference id'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token'), ('status', 'Status'), ('transaction_status_blockchain_link', 'Transaction Status on the Blockchain')], default=['payment_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reference_id', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token', 'status', 'transaction_status_blockchain_link'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='fspxlsxtemplateperdeliverymechanism', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet'), ('ATM Card', 'ATM Card')], max_length=255, verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='payment', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet'), ('ATM Card', 'ATM Card')], max_length=32, null=True), - ), - migrations.AlterField( - model_name='paymentplan', - name='currency', - field=models.CharField(choices=[('', 'None'), ('AED', 'United Arab Emirates dirham'), ('AFN', 'Afghan afghani'), ('ALL', 'Albanian lek'), ('AMD', 'Armenian dram'), ('ANG', 'Netherlands Antillean guilder'), ('AOA', 'Angolan kwanza'), ('ARS', 'Argentine peso'), ('AUD', 'Australian dollar'), ('AWG', 'Aruban florin'), ('AZN', 'Azerbaijani manat'), ('BAM', 'Bosnia and Herzegovina convertible mark'), ('BBD', 'Barbados dollar'), ('BDT', 'Bangladeshi taka'), ('BGN', 'Bulgarian lev'), ('BHD', 'Bahraini dinar'), ('BIF', 'Burundian franc'), ('BMD', 'Bermudian dollar'), ('BND', 'Brunei dollar'), ('BOB', 'Boliviano'), ('BOV', 'Bolivian Mvdol (funds code)'), ('BRL', 'Brazilian real'), ('BSD', 'Bahamian dollar'), ('BTN', 'Bhutanese ngultrum'), ('BWP', 'Botswana pula'), ('BYN', 'Belarusian ruble'), ('BZD', 'Belize dollar'), ('CAD', 'Canadian dollar'), ('CDF', 'Congolese franc'), ('CHF', 'Swiss franc'), ('CLP', 'Chilean peso'), ('CNY', 'Chinese yuan'), ('COP', 'Colombian peso'), ('CRC', 'Costa Rican colon'), ('CUC', 'Cuban convertible peso'), ('CUP', 'Cuban peso'), ('CVE', 'Cape Verdean escudo'), ('CZK', 'Czech koruna'), ('DJF', 'Djiboutian franc'), ('DKK', 'Danish krone'), ('DOP', 'Dominican peso'), ('DZD', 'Algerian dinar'), ('EGP', 'Egyptian pound'), ('ERN', 'Eritrean nakfa'), ('ETB', 'Ethiopian birr'), ('EUR', 'Euro'), ('FJD', 'Fiji dollar'), ('FKP', 'Falkland Islands pound'), ('GBP', 'Pound sterling'), ('GEL', 'Georgian lari'), ('GHS', 'Ghanaian cedi'), ('GIP', 'Gibraltar pound'), ('GMD', 'Gambian dalasi'), ('GNF', 'Guinean franc'), ('GTQ', 'Guatemalan quetzal'), ('GYD', 'Guyanese dollar'), ('HKD', 'Hong Kong dollar'), ('HNL', 'Honduran lempira'), ('HRK', 'Croatian kuna'), ('HTG', 'Haitian gourde'), ('HUF', 'Hungarian forint'), ('IDR', 'Indonesian rupiah'), ('ILS', 'Israeli new shekel'), ('INR', 'Indian rupee'), ('IQD', 'Iraqi dinar'), ('IRR', 'Iranian rial'), ('ISK', 'Icelandic króna'), ('JMD', 'Jamaican dollar'), ('JOD', 'Jordanian dinar'), ('JPY', 'Japanese yen'), ('KES', 'Kenyan shilling'), ('KGS', 'Kyrgyzstani som'), ('KHR', 'Cambodian riel'), ('KMF', 'Comoro franc'), ('KPW', 'North Korean won'), ('KRW', 'South Korean won'), ('KWD', 'Kuwaiti dinar'), ('KYD', 'Cayman Islands dollar'), ('KZT', 'Kazakhstani tenge'), ('LAK', 'Lao kip'), ('LBP', 'Lebanese pound'), ('LKR', 'Sri Lankan rupee'), ('LRD', 'Liberian dollar'), ('LSL', 'Lesotho loti'), ('LYD', 'Libyan dinar'), ('MAD', 'Moroccan dirham'), ('MDL', 'Moldovan leu'), ('MGA', 'Malagasy ariary'), ('MKD', 'Macedonian denar'), ('MMK', 'Myanmar kyat'), ('MNT', 'Mongolian tögrög'), ('MOP', 'Macanese pataca'), ('MRU', 'Mauritanian ouguiya'), ('MUR', 'Mauritian rupee'), ('MVR', 'Maldivian rufiyaa'), ('MWK', 'Malawian kwacha'), ('MXN', 'Mexican peso'), ('MYR', 'Malaysian ringgit'), ('MZN', 'Mozambican metical'), ('NAD', 'Namibian dollar'), ('NGN', 'Nigerian naira'), ('NIO', 'Nicaraguan córdoba'), ('NOK', 'Norwegian krone'), ('NPR', 'Nepalese rupee'), ('NZD', 'New Zealand dollar'), ('OMR', 'Omani rial'), ('PAB', 'Panamanian balboa'), ('PEN', 'Peruvian sol'), ('PGK', 'Papua New Guinean kina'), ('PHP', 'Philippine peso'), ('PKR', 'Pakistani rupee'), ('PLN', 'Polish złoty'), ('PYG', 'Paraguayan guaraní'), ('QAR', 'Qatari riyal'), ('RON', 'Romanian leu'), ('RSD', 'Serbian dinar'), ('RUB', 'Russian ruble'), ('RWF', 'Rwandan franc'), ('SAR', 'Saudi riyal'), ('SBD', 'Solomon Islands dollar'), ('SCR', 'Seychelles rupee'), ('SDG', 'Sudanese pound'), ('SEK', 'Swedish krona/kronor'), ('SGD', 'Singapore dollar'), ('SHP', 'Saint Helena pound'), ('SLL', 'Sierra Leonean leone'), ('SOS', 'Somali shilling'), ('SRD', 'Surinamese dollar'), ('SSP', 'South Sudanese pound'), ('STN', 'São Tomé and Príncipe dobra'), ('SVC', 'Salvadoran colón'), ('SYP', 'Syrian pound'), ('SZL', 'Swazi lilangeni'), ('THB', 'Thai baht'), ('TJS', 'Tajikistani somoni'), ('TMT', 'Turkmenistan manat'), ('TND', 'Tunisian dinar'), ('TOP', 'Tongan paʻanga'), ('TRY', 'Turkish lira'), ('TTD', 'Trinidad and Tobago dollar'), ('TWD', 'New Taiwan dollar'), ('TZS', 'Tanzanian shilling'), ('UAH', 'Ukrainian hryvnia'), ('UGX', 'Ugandan shilling'), ('USD', 'United States dollar'), ('UYU', 'Uruguayan peso'), ('UYW', 'Unidad previsional[14]'), ('UZS', 'Uzbekistan som'), ('VES', 'Venezuelan bolívar soberano'), ('VND', 'Vietnamese đồng'), ('VUV', 'Vanuatu vatu'), ('WST', 'Samoan tala'), ('XAF', 'CFA franc BEAC'), ('XAG', 'Silver (one troy ounce)'), ('XAU', 'Gold (one troy ounce)'), ('XCD', 'East Caribbean dollar'), ('XOF', 'CFA franc BCEAO'), ('XPF', 'CFP franc (franc Pacifique)'), ('YER', 'Yemeni rial'), ('ZAR', 'South African rand'), ('ZMW', 'Zambian kwacha'), ('ZWL', 'Zimbabwean dollar'), ('USDC', 'USD Coin')], max_length=4), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet'), ('ATM Card', 'ATM Card')], max_length=32, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0129_migration.py b/src/hct_mis_api/apps/payment/migrations/0129_migration.py deleted file mode 100644 index 5db79682b0..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0129_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-15 11:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0128_migration'), - ] - - operations = [ - migrations.AddField( - model_name='payment', - name='fsp_auth_code', - field=models.CharField(blank=True, help_text='FSP Auth Code', max_length=128, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0130_migration.py b/src/hct_mis_api/apps/payment/migrations/0130_migration.py deleted file mode 100644 index f844530db5..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0130_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-20 13:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0129_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='paymentplansplit', - name='split_type', - field=models.CharField(choices=[('BY_RECORDS', 'By Records'), ('BY_COLLECTOR', 'By Collector'), ('BY_ADMIN_AREA1', 'By Admin Area 1'), ('BY_ADMIN_AREA2', 'By Admin Area 2'), ('BY_ADMIN_AREA3', 'By Admin Area 3')], max_length=24), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0131_migration.py b/src/hct_mis_api/apps/payment/migrations/0131_migration.py deleted file mode 100644 index 2c5e1468ec..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0131_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-05 13:29 - -from django.db import migrations, models -import hct_mis_api.apps.account.models -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0130_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('individual_id', 'Individual ID'), ('household_id', 'Household ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reference_id', 'Reference id'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token'), ('status', 'Status'), ('transaction_status_blockchain_link', 'Transaction Status on the Blockchain')], default=['payment_id', 'individual_id', 'household_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reference_id', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token', 'status', 'transaction_status_blockchain_link'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which admin1?'), ('admin2', 'Household resides in which admin2?'), ('admin3', 'Household resides in which admin3?'), ('admin4', 'Household resides in which admin4?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee Household?'), ('size', 'What is the Household size?'), ('fchild_hoh', 'Child is female and Head of Household'), ('child_hoh', 'Child is Head of Household'), ('relationship', 'Relationship to Head of Household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', 'Will you be collecting all member Individual data?'), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the Individual pregnant?'), ('work_status', 'Does the Individual have paid employment in the current month?'), ('observed_disability', 'Does the Individual have disability?'), ('seeing_disability', 'If the Individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the Individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the Individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the Individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the Individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed Household'), ('child_hoh', 'Child headed Household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First Individual registration date'), ('first_registration_date', 'First Household registration date'), ('number_of_children', 'What is the number of children in the Household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('registration_data_import', 'Registration Data Import'), ('household_unicef_id', 'Household unicef id'), ('individual_unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('index_id', 'Index ID'), ('wallet_name', 'Wallet Name'), ('blockchain_name', 'Blockchain Name'), ('wallet_address', 'Wallet Address'), ('registration_id', 'Program registration id'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0132_migration.py b/src/hct_mis_api/apps/payment/migrations/0132_migration.py deleted file mode 100644 index d94ddf7139..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0132_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-04 14:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0131_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='payment', - name='transaction_reference_id', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='payment', - name='transaction_status_blockchain_link', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='transaction_reference_id', - field=models.CharField(blank=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='transaction_status_blockchain_link', - field=models.CharField(blank=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0133_migration.py b/src/hct_mis_api/apps/payment/migrations/0133_migration.py deleted file mode 100644 index ac7893c952..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0133_migration.py +++ /dev/null @@ -1,1242 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-07 09:07 - -from django.db import migrations, models -import django.db.models.deletion -import django.db.models.manager -import hct_mis_api.apps.account.models -import model_utils.fields -import uuid - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0132_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), - ('Cash over the counter', 'Cash over the counter')], db_index=True, - max_length=32, null=True), - ), - migrations.AlterField( - model_name='deliverymechanismperpaymentplan', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), - ('Cash over the counter', 'Cash over the counter')], db_index=True, - max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField( - choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), - ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), - ('Cash over the counter', 'Cash over the counter')], max_length=24), size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, - choices=[( - 'age', - 'Age (calculated)'), - ( - 'residence_status', - 'Residence status'), - ( - 'consent', - 'Do you consent?'), - ( - 'consent_sign', - 'Do you consent?'), - ( - 'country_origin', - 'Country of Origin'), - ( - 'country', - 'Country of registration'), - ( - 'address', - 'Address'), - ( - 'zip_code', - 'Zip code'), - ( - 'admin1', - 'Household resides in which ${admin1_h_c}?'), - ( - 'admin2', - 'Household resides in which ${admin2_h_c}?'), - ( - 'admin3', - 'Household resides in which ${admin3_h_c}?'), - ( - 'admin4', - 'Household resides in which ${admin4_h_c}?'), - ( - 'geopoint', - 'Geolocation'), - ( - 'unhcr_id', - 'UNHCR Case ID'), - ( - 'returnee', - 'Is this a returnee household?'), - ( - 'size', - 'What is the household size?'), - ( - 'fchild_hoh', - 'Child is female and head of household'), - ( - 'child_hoh', - 'Child is head of household'), - ( - 'relationship', - 'Relationship to head of household'), - ( - 'full_name', - 'Full name'), - ( - 'given_name', - 'Given name'), - ( - 'middle_name', - 'Middle name(s)'), - ( - 'family_name', - 'Family name'), - ( - 'sex', - 'Gender'), - ( - 'birth_date', - 'Birth date'), - ( - 'estimated_birth_date', - 'Estimated birth date?'), - ( - 'photo', - "Individual's photo"), - ( - 'marital_status', - 'Marital status'), - ( - 'phone_no', - 'Phone number'), - ( - 'who_answers_phone', - 'Who answers this phone?'), - ( - 'phone_no_alternative', - 'Alternative phone number'), - ( - 'who_answers_alt_phone', - 'Who answers this (alt) phone?'), - ( - 'registration_method', - 'Method of collection (e.g. HH survey, Community, etc.)'), - ( - 'collect_individual_data', - "Will you be collecting all member Individuals' data?"), - ( - 'currency', - 'Which currency will be used for financial questions?'), - ( - 'birth_certificate_no', - 'Birth certificate number'), - ( - 'birth_certificate_issuer', - 'Issuing country of birth certificate'), - ( - 'birth_certificate_photo', - 'Birth certificate photo'), - ( - 'tax_id_no', - 'Tax identification number'), - ( - 'tax_id_issuer', - 'Issuing country of tax identification'), - ( - 'tax_id_photo', - 'Tax identification photo'), - ( - 'drivers_license_no', - "Driver's license number"), - ( - 'drivers_license_issuer', - "Issuing country of driver's license"), - ( - 'drivers_license_photo', - "Driver's license photo"), - ( - 'electoral_card_no', - 'Electoral card number'), - ( - 'electoral_card_issuer', - 'Issuing country of electoral card'), - ( - 'electoral_card_photo', - 'Electoral card photo'), - ( - 'unhcr_id_no', - 'UNHCR ID number'), - ( - 'unhcr_id_issuer', - 'Issuing entity of UNHCR ID'), - ( - 'unhcr_id_photo', - 'UNHCR ID photo'), - ( - 'national_passport', - 'National passport number'), - ( - 'national_passport_issuer', - 'Issuing country of national passport'), - ( - 'national_passport_photo', - 'National passport photo'), - ( - 'national_id_no', - 'National ID number'), - ( - 'national_id_issuer', - 'Issuing country of national ID'), - ( - 'national_id_photo', - 'National ID photo'), - ( - 'scope_id_no', - 'WFP Scope ID number'), - ( - 'scope_id_issuer', - 'Issuing entity of SCOPE ID'), - ( - 'scope_id_photo', - 'WFP Scope ID photo'), - ( - 'other_id_type', - 'If other type of ID, specify the type'), - ( - 'other_id_no', - 'Other ID number'), - ( - 'other_id_issuer', - 'Issuing country of other ID'), - ( - 'other_id_photo', - 'ID photo'), - ( - 'female_age_group_0_5_count', - 'Females Age 0 - 5'), - ( - 'female_age_group_6_11_count', - 'Females Age 6 - 11'), - ( - 'female_age_group_12_17_count', - 'Females Age 12 - 17'), - ( - 'female_age_group_18_59_count', - 'Females Age 18 - 59'), - ( - 'female_age_group_60_count', - 'Females Age 60 +'), - ( - 'pregnant_count', - 'Pregnant count'), - ( - 'male_age_group_0_5_count', - 'Males Age 0 - 5'), - ( - 'male_age_group_6_11_count', - 'Males Age 6 - 11'), - ( - 'male_age_group_12_17_count', - 'Males Age 12 - 17'), - ( - 'male_age_group_18_59_count', - 'Males Age 18 - 59'), - ( - 'male_age_group_60_count', - 'Males Age 60 +'), - ( - 'female_age_group_0_5_disabled_count', - 'Females age 0 - 5 with disability'), - ( - 'female_age_group_6_11_disabled_count', - 'Females age 6 - 11 with disability'), - ( - 'female_age_group_12_17_disabled_count', - 'Females age 12 - 17 with disability'), - ( - 'female_age_group_18_59_disabled_count', - 'Females Age 18 - 59 with disability'), - ( - 'female_age_group_60_disabled_count', - 'Female members with Disability age 60 +'), - ( - 'male_age_group_0_5_disabled_count', - 'Males age 0 - 5 with disability'), - ( - 'male_age_group_6_11_disabled_count', - 'Males age 6 - 11 with disability'), - ( - 'male_age_group_12_17_disabled_count', - 'Males age 12 - 17 with disability'), - ( - 'male_age_group_18_59_disabled_count', - 'Males Age 18 - 59 with disability'), - ( - 'male_age_group_60_disabled_count', - 'Male members with Disability age 60 +'), - ( - 'pregnant', - 'Is the individual pregnant?'), - ( - 'work_status', - 'Does the individual have paid employment in the current month?'), - ( - 'observed_disability', - 'Does the individual have disability?'), - ( - 'seeing_disability', - 'If the individual has difficulty seeing, what is the severity?'), - ( - 'hearing_disability', - 'If the individual has difficulty hearing, what is the severity?'), - ( - 'physical_disability', - 'If the individual has difficulty walking or climbing steps, what is the severity?'), - ( - 'memory_disability', - 'If the individual has difficulty remembering or concentrating, what is the severity?'), - ( - 'selfcare_disability', - 'Do you have difficulty (with self-care such as) washing all over or dressing'), - ( - 'comms_disability', - 'If the individual has difficulty communicating, what is the severity?'), - ( - 'fchild_hoh', - 'Female child headed household'), - ( - 'child_hoh', - 'Child headed household'), - ( - 'village', - 'Village'), - ( - 'deviceid', - 'Device ID'), - ( - 'name_enumerator', - 'Name of the enumerator'), - ( - 'org_enumerator', - 'Organization of the enumerator'), - ( - 'consent_sharing', - 'Which organizations may we share your information with?'), - ( - 'org_name_enumerator', - 'Name of partner organization'), - ( - 'disability', - 'Individual is disabled?'), - ( - 'first_registration_date', - 'First individual registration date'), - ( - 'first_registration_date', - 'First household registration date'), - ( - 'number_of_children', - 'What is the number of children in the household?'), - ( - 'has_phone_number', - 'Has phone number?'), - ( - 'has_tax_id_number', - 'Has tax ID number?'), - ( - 'has_the_bank_account_number', - 'Has the bank account number?'), - ( - 'role', - 'Role'), - ( - 'registration_data_import', - 'Registration Data Import'), - ( - 'unicef_id', - 'Household unicef id'), - ( - 'unicef_id', - 'Individual unicef id'), - ( - 'admin_area_title', - 'Household resides in which admin area?'), - ( - 'start', - 'Data collection start date'), - ( - 'end', - 'Data collection end date'), - ( - 'primary_collector_id', - 'List of primary collectors ids, separated by a semicolon'), - ( - 'alternate_collector_id', - 'List of alternate collectors ids, separated by a semicolon'), - ( - 'household_id', - 'Household ID'), - ( - 'household_id', - 'Household ID'), - ( - 'email', - 'Individual email'), - ( - 'preferred_language', - 'Preferred language'), - ( - 'age_at_registration', - 'Age at registration'), - ( - 'index_id', - 'Index ID'), - ( - 'full_name', - 'Full name'), - ( - 'given_name', - 'Given name'), - ( - 'middle_name', - 'Middle name(s)'), - ( - 'family_name', - 'Family name'), - ( - 'sex', - 'Gender'), - ( - 'birth_date', - 'Birth date'), - ( - 'estimated_birth_date', - 'Estimated birth date?'), - ( - 'photo', - "Individual's photo"), - ( - 'address', - 'Address'), - ( - 'country_origin', - 'Country of Origin'), - ( - 'country', - 'Country of registration'), - ( - 'zip_code', - 'Zip code'), - ( - 'admin1', - 'Social worker resides in which ${admin1_i_c}?'), - ( - 'admin2', - 'Social worker resides in which ${admin2_i_c}?'), - ( - 'admin3', - 'Social worker resides in which ${admin3_i_c}?'), - ( - 'admin4', - 'Social worker resides in which ${admin4_i_c}?'), - ( - 'residence_status', - 'Residence status'), - ( - 'consent', - 'Do you consent?'), - ( - 'consent_sign', - 'Do you consent?'), - ( - 'geopoint', - 'Geolocation'), - ( - 'unhcr_id', - 'UNHCR Case ID'), - ( - 'returnee', - 'Is this a returnee household?'), - ( - 'registration_method', - 'Method of collection (e.g. HH survey, Community, etc.)'), - ( - 'currency', - 'Which currency will be used for financial questions?'), - ( - 'village', - 'Village'), - ( - 'deviceid', - 'Device ID'), - ( - 'name_enumerator', - 'Name of the enumerator'), - ( - 'org_enumerator', - 'Organization of the enumerator'), - ( - 'consent_sharing', - 'Which organizations may we share your information with?'), - ( - 'org_name_enumerator', - 'Name of partner organization'), - ( - 'age', - 'Age (calculated)'), - ( - 'fchild_hoh', - 'Child is female and head of household'), - ( - 'child_hoh', - 'Child is head of household'), - ( - 'relationship', - 'Relationship to head of household'), - ( - 'marital_status', - 'Marital status'), - ( - 'phone_no', - 'Phone number'), - ( - 'who_answers_phone', - 'Who answers this phone?'), - ( - 'phone_no_alternative', - 'Alternative phone number'), - ( - 'who_answers_alt_phone', - 'Who answers this (alt) phone?'), - ( - 'birth_certificate_no', - 'Birth certificate number'), - ( - 'birth_certificate_issuer', - 'Issuing country of birth certificate'), - ( - 'birth_certificate_photo', - 'Birth certificate photo'), - ( - 'tax_id_no', - 'Tax identification number'), - ( - 'tax_id_issuer', - 'Issuing country of tax identification'), - ( - 'tax_id_photo', - 'Tax identification photo'), - ( - 'drivers_license_no', - "Driver's license number"), - ( - 'drivers_license_issuer', - "Issuing country of driver's license"), - ( - 'drivers_license_photo', - "Driver's license photo"), - ( - 'electoral_card_no', - 'Electoral card number'), - ( - 'electoral_card_issuer', - 'Issuing country of electoral card'), - ( - 'electoral_card_photo', - 'Electoral card photo'), - ( - 'unhcr_id_no', - 'UNHCR ID number'), - ( - 'unhcr_id_issuer', - 'Issuing entity of UNHCR ID'), - ( - 'unhcr_id_photo', - 'UNHCR ID photo'), - ( - 'national_passport', - 'National passport number'), - ( - 'national_passport_issuer', - 'Issuing country of national passport'), - ( - 'national_passport_photo', - 'National passport photo'), - ( - 'national_id_no', - 'National ID number'), - ( - 'national_id_issuer', - 'Issuing country of national ID'), - ( - 'national_id_photo', - 'National ID photo'), - ( - 'scope_id_no', - 'WFP Scope ID number'), - ( - 'scope_id_issuer', - 'Issuing entity of SCOPE ID'), - ( - 'scope_id_photo', - 'WFP Scope ID photo'), - ( - 'other_id_type', - 'If other type of ID, specify the type'), - ( - 'other_id_no', - 'Other ID number'), - ( - 'other_id_issuer', - 'Issuing country of other ID'), - ( - 'other_id_photo', - 'ID photo'), - ( - 'pregnant', - 'Is the individual pregnant?'), - ( - 'work_status', - 'Does the individual have paid employment in the current month?'), - ( - 'observed_disability', - 'Does the individual have disability?'), - ( - 'seeing_disability', - 'If the individual has difficulty seeing, what is the severity?'), - ( - 'hearing_disability', - 'If the individual has difficulty hearing, what is the severity?'), - ( - 'physical_disability', - 'If the individual has difficulty walking or climbing steps, what is the severity?'), - ( - 'memory_disability', - 'If the individual has difficulty remembering or concentrating, what is the severity?'), - ( - 'selfcare_disability', - 'Do you have difficulty (with self-care such as) washing all over or dressing'), - ( - 'comms_disability', - 'If the individual has difficulty communicating, what is the severity?'), - ( - 'disability', - 'Individual is disabled?'), - ( - 'first_registration_date', - 'First individual registration date'), - ( - 'primary_collector_id', - 'List of primary collectors ids, separated by a semicolon'), - ( - 'alternate_collector_id', - 'List of alternate collectors ids, separated by a semicolon'), - ( - 'email', - 'Individual email'), - ( - 'preferred_language', - 'Preferred language'), - ( - 'age_at_registration', - 'Age at registration'), - ( - 'account_holder_name', - 'Account holder name'), - ( - 'bank_branch_name', - 'Bank branch name'), - ( - 'bank_name', - 'Bank name'), - ( - 'bank_account_number', - 'Bank account number'), - ( - 'debit_card_issuer', - 'Debit Card Issuer'), - ( - 'debit_card_number', - 'Debit card number'), - ( - 'payment_delivery_phone_no', - 'Payment delivery phone number'), - ( - 'account_holder_name', - 'Account holder name'), - ( - 'bank_branch_name', - 'Bank branch name'), - ( - 'bank_name', - 'Bank name'), - ( - 'bank_account_number', - 'Bank account number'), - ( - 'debit_card_issuer', - 'Debit Card Issuer'), - ( - 'debit_card_number', - 'Debit card number'), - ( - 'payment_delivery_phone_no', - 'Payment delivery phone number'), - ( - 'card_number_atm_card', - 'Card number (ATM card)'), - ( - 'card_expiry_date_atm_card', - 'Card expiry date (ATM card)'), - ( - 'name_of_cardholder_atm_card', - 'Name of cardholder (ATM card)')], - max_length=255), - blank=True, default=list, size=None), - ), - migrations.AlterField( - model_name='fspxlsxtemplateperdeliverymechanism', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), - ('Cash over the counter', 'Cash over the counter')], max_length=255, - verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='payment', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), - ('Cash over the counter', 'Cash over the counter')], max_length=32, - null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), - ('Cash over the counter', 'Cash over the counter')], max_length=32, - null=True), - ), - migrations.CreateModel( - name='DeliveryMechanismData', - fields=[ - ('id', - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('signature_hash', models.CharField(blank=True, editable=False, max_length=40)), - ('delivery_mechanism', models.CharField( - choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), - ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), - ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter')], - max_length=255, verbose_name='Delivery Mechanism')), - ('data', models.JSONField(blank=True, default=dict)), - ('is_valid', models.BooleanField(default=False)), - ('validation_errors', models.JSONField(default=dict)), - ('unique_key', models.CharField(blank=True, editable=False, max_length=256, null=True, unique=True)), - ('individual', - models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='delivery_mechanisms_data', - to='household.individual')), - ('possible_duplicate_of', - models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, - related_name='possible_duplicates', to='payment.deliverymechanismdata')), - ], - bases=(models.Model, ), - managers=[ - ('signature_manager', django.db.models.manager.Manager()), - ], - ), - migrations.AddConstraint( - model_name='deliverymechanismdata', - constraint=models.UniqueConstraint(fields=('individual', 'delivery_mechanism'), - name='unique_individual_delivery_mechanism'), - ), - migrations.AlterModelManagers( - name='deliverymechanismdata', - managers=[ - ], - ), - migrations.DeleteModel( - name='FinancialServiceProviderXlsxReport', - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, - choices=[( - 'age', - 'Age (calculated)'), - ( - 'residence_status', - 'Residence status'), - ( - 'consent', - 'Do you consent?'), - ( - 'consent_sign', - 'Do you consent?'), - ( - 'country_origin', - 'Country of Origin'), - ( - 'country', - 'Country of registration'), - ( - 'address', - 'Address'), - ( - 'zip_code', - 'Zip code'), - ( - 'admin1', - 'Household resides in which admin1?'), - ( - 'admin2', - 'Household resides in which admin2?'), - ( - 'admin3', - 'Household resides in which admin3?'), - ( - 'admin4', - 'Household resides in which admin4?'), - ( - 'geopoint', - 'Geolocation'), - ( - 'unhcr_id', - 'UNHCR Case ID'), - ( - 'returnee', - 'Is this a returnee Household?'), - ( - 'size', - 'What is the Household size?'), - ( - 'fchild_hoh', - 'Child is female and Head of Household'), - ( - 'child_hoh', - 'Child is Head of Household'), - ( - 'relationship', - 'Relationship to Head of Household'), - ( - 'full_name', - 'Full name'), - ( - 'given_name', - 'Given name'), - ( - 'middle_name', - 'Middle name(s)'), - ( - 'family_name', - 'Family name'), - ( - 'sex', - 'Gender'), - ( - 'birth_date', - 'Birth date'), - ( - 'estimated_birth_date', - 'Estimated birth date?'), - ( - 'photo', - "Individual's photo"), - ( - 'marital_status', - 'Marital status'), - ( - 'phone_no', - 'Phone number'), - ( - 'who_answers_phone', - 'Who answers this phone?'), - ( - 'phone_no_alternative', - 'Alternative phone number'), - ( - 'who_answers_alt_phone', - 'Who answers this (alt) phone?'), - ( - 'registration_method', - 'Method of collection (e.g. HH survey, Community, etc.)'), - ( - 'collect_individual_data', - 'Will you be collecting all member Individual data?'), - ( - 'currency', - 'Which currency will be used for financial questions?'), - ( - 'birth_certificate_no', - 'Birth certificate number'), - ( - 'birth_certificate_issuer', - 'Issuing country of birth certificate'), - ( - 'birth_certificate_photo', - 'Birth certificate photo'), - ( - 'tax_id_no', - 'Tax identification number'), - ( - 'tax_id_issuer', - 'Issuing country of tax identification'), - ( - 'tax_id_photo', - 'Tax identification photo'), - ( - 'drivers_license_no', - "Driver's license number"), - ( - 'drivers_license_issuer', - "Issuing country of driver's license"), - ( - 'drivers_license_photo', - "Driver's license photo"), - ( - 'electoral_card_no', - 'Electoral card number'), - ( - 'electoral_card_issuer', - 'Issuing country of electoral card'), - ( - 'electoral_card_photo', - 'Electoral card photo'), - ( - 'unhcr_id_no', - 'UNHCR ID number'), - ( - 'unhcr_id_issuer', - 'Issuing entity of UNHCR ID'), - ( - 'unhcr_id_photo', - 'UNHCR ID photo'), - ( - 'national_passport', - 'National passport number'), - ( - 'national_passport_issuer', - 'Issuing country of national passport'), - ( - 'national_passport_photo', - 'National passport photo'), - ( - 'national_id_no', - 'National ID number'), - ( - 'national_id_issuer', - 'Issuing country of national ID'), - ( - 'national_id_photo', - 'National ID photo'), - ( - 'scope_id_no', - 'WFP Scope ID number'), - ( - 'scope_id_issuer', - 'Issuing entity of SCOPE ID'), - ( - 'scope_id_photo', - 'WFP Scope ID photo'), - ( - 'other_id_type', - 'If other type of ID, specify the type'), - ( - 'other_id_no', - 'Other ID number'), - ( - 'other_id_issuer', - 'Issuing country of other ID'), - ( - 'other_id_photo', - 'ID photo'), - ( - 'female_age_group_0_5_count', - 'Females Age 0 - 5'), - ( - 'female_age_group_6_11_count', - 'Females Age 6 - 11'), - ( - 'female_age_group_12_17_count', - 'Females Age 12 - 17'), - ( - 'female_age_group_18_59_count', - 'Females Age 18 - 59'), - ( - 'female_age_group_60_count', - 'Females Age 60 +'), - ( - 'pregnant_count', - 'Pregnant count'), - ( - 'male_age_group_0_5_count', - 'Males Age 0 - 5'), - ( - 'male_age_group_6_11_count', - 'Males Age 6 - 11'), - ( - 'male_age_group_12_17_count', - 'Males Age 12 - 17'), - ( - 'male_age_group_18_59_count', - 'Males Age 18 - 59'), - ( - 'male_age_group_60_count', - 'Males Age 60 +'), - ( - 'female_age_group_0_5_disabled_count', - 'Females age 0 - 5 with disability'), - ( - 'female_age_group_6_11_disabled_count', - 'Females age 6 - 11 with disability'), - ( - 'female_age_group_12_17_disabled_count', - 'Females age 12 - 17 with disability'), - ( - 'female_age_group_18_59_disabled_count', - 'Females Age 18 - 59 with disability'), - ( - 'female_age_group_60_disabled_count', - 'Female members with Disability age 60 +'), - ( - 'male_age_group_0_5_disabled_count', - 'Males age 0 - 5 with disability'), - ( - 'male_age_group_6_11_disabled_count', - 'Males age 6 - 11 with disability'), - ( - 'male_age_group_12_17_disabled_count', - 'Males age 12 - 17 with disability'), - ( - 'male_age_group_18_59_disabled_count', - 'Males Age 18 - 59 with disability'), - ( - 'male_age_group_60_disabled_count', - 'Male members with Disability age 60 +'), - ( - 'pregnant', - 'Is the Individual pregnant?'), - ( - 'work_status', - 'Does the Individual have paid employment in the current month?'), - ( - 'observed_disability', - 'Does the Individual have disability?'), - ( - 'seeing_disability', - 'If the Individual has difficulty seeing, what is the severity?'), - ( - 'hearing_disability', - 'If the Individual has difficulty hearing, what is the severity?'), - ( - 'physical_disability', - 'If the Individual has difficulty walking or climbing steps, what is the severity?'), - ( - 'memory_disability', - 'If the Individual has difficulty remembering or concentrating, what is the severity?'), - ( - 'selfcare_disability', - 'Do you have difficulty (with self-care such as) washing all over or dressing'), - ( - 'comms_disability', - 'If the Individual has difficulty communicating, what is the severity?'), - ( - 'fchild_hoh', - 'Female child headed Household'), - ( - 'child_hoh', - 'Child headed Household'), - ( - 'village', - 'Village'), - ( - 'deviceid', - 'Device ID'), - ( - 'name_enumerator', - 'Name of the enumerator'), - ( - 'org_enumerator', - 'Organization of the enumerator'), - ( - 'consent_sharing', - 'Which organizations may we share your information with?'), - ( - 'org_name_enumerator', - 'Name of partner organization'), - ( - 'disability', - 'Individual is disabled?'), - ( - 'first_registration_date', - 'First Individual registration date'), - ( - 'first_registration_date', - 'First Household registration date'), - ( - 'number_of_children', - 'What is the number of children in the Household?'), - ( - 'has_phone_number', - 'Has phone number?'), - ( - 'has_tax_id_number', - 'Has tax ID number?'), - ( - 'has_the_bank_account_number', - 'Has the bank account number?'), - ( - 'role', - 'Role'), - ( - 'registration_data_import', - 'Registration Data Import'), - ( - 'registration_data_import', - 'Registration Data Import'), - ( - 'unicef_id', - 'Household unicef id'), - ( - 'unicef_id', - 'Individual unicef id'), - ( - 'admin_area_title', - 'Household resides in which admin area?'), - ( - 'start', - 'Data collection start date'), - ( - 'end', - 'Data collection end date'), - ( - 'primary_collector_id', - 'List of primary collectors ids, separated by a semicolon'), - ( - 'alternate_collector_id', - 'List of alternate collectors ids, separated by a semicolon'), - ( - 'household_id', - 'Household ID'), - ( - 'household_id', - 'Household ID'), - ( - 'email', - 'Individual email'), - ( - 'preferred_language', - 'Preferred language'), - ( - 'age_at_registration', - 'Age at registration'), - ( - 'account_holder_name', - 'Account holder name'), - ( - 'bank_branch_name', - 'Bank branch name'), - ( - 'index_id', - 'Index ID'), - ( - 'registration_id', - 'Program registration id'), - ( - 'account_holder_name', - 'Account holder name'), - ( - 'bank_branch_name', - 'Bank branch name'), - ( - 'bank_name', - 'Bank name'), - ( - 'bank_account_number', - 'Bank account number'), - ( - 'debit_card_issuer', - 'Debit Card Issuer'), - ( - 'debit_card_number', - 'Debit card number'), - ( - 'payment_delivery_phone_no', - 'Payment delivery phone number'), - ( - 'card_number_atm_card', - 'Card number (ATM card)'), - ( - 'card_expiry_date_atm_card', - 'Card expiry date (ATM card)'), - ( - 'name_of_cardholder_atm_card', - 'Name of cardholder (ATM card)'), - ( - 'card_number_deposit_to_card', - 'Card Number (Deposit to Card)'), - ( - 'delivery_phone_number_mobile_money', - 'Delivery Phone Number (Mobile Money)'), - ( - 'bank_name_transfer_to_account', - 'Bank Name (Transfer to Account)'), - ( - 'bank_account_number_transfer_to_account', - 'Bank Account Number (Transfer to Account)'), - ( - 'mobile_phone_number_cash_over_the_counter', - 'Mobile Phone Number (Cash Over the Counter)')], - max_length=255), - blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0134_migration.py b/src/hct_mis_api/apps/payment/migrations/0134_migration.py deleted file mode 100644 index 0e0d0d3bf9..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0134_migration.py +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-17 12:12 - -from django.db import migrations, models -import hct_mis_api.apps.account.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0133_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], db_index=True, max_length=32, null=True), - ), - migrations.AlterField( - model_name='deliverymechanismdata', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=255, verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='deliverymechanismperpaymentplan', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='financialserviceprovider', - name='delivery_mechanisms', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=32), size=None), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which admin1?'), ('admin2', 'Household resides in which admin2?'), ('admin3', 'Household resides in which admin3?'), ('admin4', 'Household resides in which admin4?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee Household?'), ('size', 'What is the Household size?'), ('fchild_hoh', 'Child is female and Head of Household'), ('child_hoh', 'Child is Head of Household'), ('relationship', 'Relationship to Head of Household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', 'Will you be collecting all member Individual data?'), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the Individual pregnant?'), ('work_status', 'Does the Individual have paid employment in the current month?'), ('observed_disability', 'Does the Individual have disability?'), ('seeing_disability', 'If the Individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the Individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the Individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the Individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the Individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed Household'), ('child_hoh', 'Child headed Household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First Individual registration date'), ('first_registration_date', 'First Household registration date'), ('number_of_children', 'What is the number of children in the Household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('registration_data_import', 'Registration Data Import'), ('unicef_id', 'Household unicef id'), ('unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('index_id', 'Index ID'), ('wallet_name', 'Wallet Name'), ('blockchain_name', 'Blockchain Name'), ('wallet_address', 'Wallet Address'), ('registration_id', 'Program registration id'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number'), ('card_number_atm_card', 'Card number (ATM card)'), ('card_expiry_date_atm_card', 'Card expiry date (ATM card)'), ('name_of_cardholder_atm_card', 'Name of cardholder (ATM card)'), ('card_number_deposit_to_card', 'Card Number (Deposit to Card)'), ('delivery_phone_number_mobile_money', 'Delivery Phone Number (Mobile Money)'), ('bank_name_transfer_to_account', 'Bank Name (Transfer to Account)'), ('bank_account_number_transfer_to_account', 'Bank Account Number (Transfer to Account)'), ('mobile_phone_number_cash_over_the_counter', 'Mobile Phone Number (Cash Over the Counter)')], max_length=255), blank=True, default=list, size=None), - ), - migrations.AlterField( - model_name='fspxlsxtemplateperdeliverymechanism', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=255, verbose_name='Delivery Mechanism'), - ), - migrations.AlterField( - model_name='payment', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=32, null=True), - ), - migrations.AlterField( - model_name='paymentrecord', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=32, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0135_migration.py b/src/hct_mis_api/apps/payment/migrations/0135_migration.py deleted file mode 100644 index 696c80e4d4..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0135_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-21 11:03 - -from django.db import migrations, models -import hct_mis_api.apps.account.models -import multiselectfield.db.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0134_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='columns', - field=multiselectfield.db.fields.MultiSelectField(choices=[('payment_id', 'Payment ID'), ('household_id', 'Household ID'), ('individual_id', 'Individual ID'), ('household_size', 'Household Size'), ('collector_name', 'Collector Name'), ('alternate_collector_full_name', 'Alternate collector Full Name'), ('alternate_collector_given_name', 'Alternate collector Given Name'), ('alternate_collector_middle_name', 'Alternate collector Middle Name'), ('alternate_collector_phone_no', 'Alternate collector phone number'), ('alternate_collector_document_numbers', 'Alternate collector Document numbers'), ('alternate_collector_sex', 'Alternate collector Gender'), ('payment_channel', 'Payment Channel'), ('fsp_name', 'FSP Name'), ('currency', 'Currency'), ('entitlement_quantity', 'Entitlement Quantity'), ('entitlement_quantity_usd', 'Entitlement Quantity USD'), ('delivered_quantity', 'Delivered Quantity'), ('delivery_date', 'Delivery Date'), ('reference_id', 'Reference id'), ('reason_for_unsuccessful_payment', 'Reason for unsuccessful payment'), ('order_number', 'Order Number'), ('token_number', 'Token Number'), ('additional_collector_name', 'Additional Collector Name'), ('additional_document_type', 'Additional Document Type'), ('additional_document_number', 'Additional Document Number'), ('registration_token', 'Registration Token'), ('status', 'Status'), ('transaction_status_blockchain_link', 'Transaction Status on the Blockchain')], default=['payment_id', 'household_id', 'individual_id', 'household_size', 'collector_name', 'alternate_collector_full_name', 'alternate_collector_given_name', 'alternate_collector_middle_name', 'alternate_collector_phone_no', 'alternate_collector_document_numbers', 'alternate_collector_sex', 'payment_channel', 'fsp_name', 'currency', 'entitlement_quantity', 'entitlement_quantity_usd', 'delivered_quantity', 'delivery_date', 'reference_id', 'reason_for_unsuccessful_payment', 'order_number', 'token_number', 'additional_collector_name', 'additional_document_type', 'additional_document_number', 'registration_token', 'status', 'transaction_status_blockchain_link'], help_text='Select the columns to include in the report', max_length=1000, verbose_name='Columns'), - ), - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='core_fields', - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField(base_field=models.CharField(blank=True, choices=[('age', 'Age (calculated)'), ('residence_status', 'Residence status'), ('consent', 'Do you consent?'), ('consent_sign', 'Do you consent?'), ('country_origin', 'Country of Origin'), ('country', 'Country of registration'), ('address', 'Address'), ('zip_code', 'Zip code'), ('admin1', 'Household resides in which admin1?'), ('admin2', 'Household resides in which admin2?'), ('admin3', 'Household resides in which admin3?'), ('admin4', 'Household resides in which admin4?'), ('geopoint', 'Geolocation'), ('unhcr_id', 'UNHCR Case ID'), ('returnee', 'Is this a returnee Household?'), ('size', 'What is the Household size?'), ('fchild_hoh', 'Child is female and Head of Household'), ('child_hoh', 'Child is Head of Household'), ('relationship', 'Relationship to Head of Household'), ('full_name', 'Full name'), ('given_name', 'Given name'), ('middle_name', 'Middle name(s)'), ('family_name', 'Family name'), ('sex', 'Gender'), ('birth_date', 'Birth date'), ('estimated_birth_date', 'Estimated birth date?'), ('photo', "Individual's photo"), ('marital_status', 'Marital status'), ('phone_no', 'Phone number'), ('who_answers_phone', 'Who answers this phone?'), ('phone_no_alternative', 'Alternative phone number'), ('who_answers_alt_phone', 'Who answers this (alt) phone?'), ('registration_method', 'Method of collection (e.g. HH survey, Community, etc.)'), ('collect_individual_data', 'Will you be collecting all member Individual data?'), ('currency', 'Which currency will be used for financial questions?'), ('birth_certificate_no', 'Birth certificate number'), ('birth_certificate_issuer', 'Issuing country of birth certificate'), ('birth_certificate_photo', 'Birth certificate photo'), ('tax_id_no', 'Tax identification number'), ('tax_id_issuer', 'Issuing country of tax identification'), ('tax_id_photo', 'Tax identification photo'), ('drivers_license_no', "Driver's license number"), ('drivers_license_issuer', "Issuing country of driver's license"), ('drivers_license_photo', "Driver's license photo"), ('electoral_card_no', 'Electoral card number'), ('electoral_card_issuer', 'Issuing country of electoral card'), ('electoral_card_photo', 'Electoral card photo'), ('unhcr_id_no', 'UNHCR ID number'), ('unhcr_id_issuer', 'Issuing entity of UNHCR ID'), ('unhcr_id_photo', 'UNHCR ID photo'), ('national_passport', 'National passport number'), ('national_passport_issuer', 'Issuing country of national passport'), ('national_passport_photo', 'National passport photo'), ('national_id_no', 'National ID number'), ('national_id_issuer', 'Issuing country of national ID'), ('national_id_photo', 'National ID photo'), ('scope_id_no', 'WFP Scope ID number'), ('scope_id_issuer', 'Issuing entity of SCOPE ID'), ('scope_id_photo', 'WFP Scope ID photo'), ('other_id_type', 'If other type of ID, specify the type'), ('other_id_no', 'Other ID number'), ('other_id_issuer', 'Issuing country of other ID'), ('other_id_photo', 'ID photo'), ('female_age_group_0_5_count', 'Females Age 0 - 5'), ('female_age_group_6_11_count', 'Females Age 6 - 11'), ('female_age_group_12_17_count', 'Females Age 12 - 17'), ('female_age_group_18_59_count', 'Females Age 18 - 59'), ('female_age_group_60_count', 'Females Age 60 +'), ('pregnant_count', 'Pregnant count'), ('male_age_group_0_5_count', 'Males Age 0 - 5'), ('male_age_group_6_11_count', 'Males Age 6 - 11'), ('male_age_group_12_17_count', 'Males Age 12 - 17'), ('male_age_group_18_59_count', 'Males Age 18 - 59'), ('male_age_group_60_count', 'Males Age 60 +'), ('female_age_group_0_5_disabled_count', 'Females age 0 - 5 with disability'), ('female_age_group_6_11_disabled_count', 'Females age 6 - 11 with disability'), ('female_age_group_12_17_disabled_count', 'Females age 12 - 17 with disability'), ('female_age_group_18_59_disabled_count', 'Females Age 18 - 59 with disability'), ('female_age_group_60_disabled_count', 'Female members with Disability age 60 +'), ('male_age_group_0_5_disabled_count', 'Males age 0 - 5 with disability'), ('male_age_group_6_11_disabled_count', 'Males age 6 - 11 with disability'), ('male_age_group_12_17_disabled_count', 'Males age 12 - 17 with disability'), ('male_age_group_18_59_disabled_count', 'Males Age 18 - 59 with disability'), ('male_age_group_60_disabled_count', 'Male members with Disability age 60 +'), ('pregnant', 'Is the Individual pregnant?'), ('work_status', 'Does the Individual have paid employment in the current month?'), ('observed_disability', 'Does the Individual have disability?'), ('seeing_disability', 'If the Individual has difficulty seeing, what is the severity?'), ('hearing_disability', 'If the Individual has difficulty hearing, what is the severity?'), ('physical_disability', 'If the Individual has difficulty walking or climbing steps, what is the severity?'), ('memory_disability', 'If the Individual has difficulty remembering or concentrating, what is the severity?'), ('selfcare_disability', 'Do you have difficulty (with self-care such as) washing all over or dressing'), ('comms_disability', 'If the Individual has difficulty communicating, what is the severity?'), ('fchild_hoh', 'Female child headed Household'), ('child_hoh', 'Child headed Household'), ('village', 'Village'), ('deviceid', 'Device ID'), ('name_enumerator', 'Name of the enumerator'), ('org_enumerator', 'Organization of the enumerator'), ('consent_sharing', 'Which organizations may we share your information with?'), ('org_name_enumerator', 'Name of partner organization'), ('disability', 'Individual is disabled?'), ('first_registration_date', 'First Individual registration date'), ('first_registration_date', 'First Household registration date'), ('number_of_children', 'What is the number of children in the Household?'), ('has_phone_number', 'Has phone number?'), ('has_tax_id_number', 'Has tax ID number?'), ('has_the_bank_account_number', 'Has the bank account number?'), ('role', 'Role'), ('registration_data_import', 'Registration Data Import'), ('registration_data_import', 'Registration Data Import'), ('household_unicef_id', 'Household unicef id'), ('individual_unicef_id', 'Individual unicef id'), ('admin_area_title', 'Household resides in which admin area?'), ('start', 'Data collection start date'), ('end', 'Data collection end date'), ('primary_collector_id', 'List of primary collectors ids, separated by a semicolon'), ('alternate_collector_id', 'List of alternate collectors ids, separated by a semicolon'), ('household_id', 'Household ID'), ('household_id', 'Household ID'), ('email', 'Individual email'), ('preferred_language', 'Preferred language'), ('age_at_registration', 'Age at registration'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('index_id', 'Index ID'), ('wallet_name', 'Wallet Name'), ('blockchain_name', 'Blockchain Name'), ('wallet_address', 'Wallet Address'), ('program_registration_id', 'Program registration id'), ('account_holder_name', 'Account holder name'), ('bank_branch_name', 'Bank branch name'), ('bank_name', 'Bank name'), ('bank_account_number', 'Bank account number'), ('debit_card_issuer', 'Debit Card Issuer'), ('debit_card_number', 'Debit card number'), ('payment_delivery_phone_no', 'Payment delivery phone number'), ('card_number_atm_card', 'Card number (ATM card)'), ('card_expiry_date_atm_card', 'Card expiry date (ATM card)'), ('name_of_cardholder_atm_card', 'Name of cardholder (ATM card)'), ('card_number_deposit_to_card', 'Card Number (Deposit to Card)'), ('delivery_phone_number_mobile_money', 'Delivery Phone Number (Mobile Money)'), ('provider_mobile_money', 'Provider (Mobile Money)'), ('bank_name_transfer_to_account', 'Bank Name (Transfer to Account)'), ('bank_account_number_transfer_to_account', 'Bank Account Number (Transfer to Account)'), ('mobile_phone_number_cash_over_the_counter', 'Mobile Phone Number (Cash Over the Counter)'), ('wallet_name_transfer_to_digital_wallet', 'Wallet Name'), ('blockchain_name_transfer_to_digital_wallet', 'Blockchain Name'), ('wallet_address_transfer_to_digital_wallet', 'Wallet Address')], max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0136_migration.py b/src/hct_mis_api/apps/payment/migrations/0136_migration.py deleted file mode 100644 index 5bb5532b8a..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0136_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-24 00:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0135_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PendingDeliveryMechanismData', - fields=[ - ], - options={ - 'verbose_name': 'Imported Delivery Mechanism Data', - 'verbose_name_plural': 'Imported Delivery Mechanism Datas', - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('payment.deliverymechanismdata',), - ), - migrations.AddField( - model_name='deliverymechanismdata', - name='rdi_merge_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('MERGED', 'Merged')], default='PENDING', max_length=10), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0137_migration.py b/src/hct_mis_api/apps/payment/migrations/0137_migration.py deleted file mode 100644 index 7aa27d8283..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0137_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-10 14:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0136_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='payment', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending'), ('Sent to Payment Gateway', 'Sent to Payment Gateway'), ('Sent to FSP', 'Sent to FSP'), ('Manually Cancelled', 'Manually Cancelled')], default='Pending', max_length=255), - ), - migrations.AlterField( - model_name='paymentrecord', - name='status', - field=models.CharField(choices=[('Distribution Successful', 'Distribution Successful'), ('Not Distributed', 'Not Distributed'), ('Transaction Successful', 'Transaction Successful'), ('Transaction Erroneous', 'Transaction Erroneous'), ('Force failed', 'Force failed'), ('Partially Distributed', 'Partially Distributed'), ('Pending', 'Pending'), ('Sent to Payment Gateway', 'Sent to Payment Gateway'), ('Sent to FSP', 'Sent to FSP'), ('Manually Cancelled', 'Manually Cancelled')], default='Pending', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0138_migration.py b/src/hct_mis_api/apps/payment/migrations/0138_migration.py deleted file mode 100644 index 9950d4589f..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0138_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-09 13:55 - -import django.contrib.postgres.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0137_migration'), - ] - - operations = [ - migrations.AddField( - model_name='financialserviceproviderxlsxtemplate', - name='flex_fields', - field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0139_migration.py b/src/hct_mis_api/apps/payment/migrations/0139_migration.py deleted file mode 100644 index 3d599cf217..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0139_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-10 14:23 -from decimal import Decimal - -from django.db import migrations, models - - -def migrate_payments_delivered_quantity(apps, schema_editor): - Payment = apps.get_model("payment", "Payment") - - not_distributed_payments = Payment.objects.filter(status="Not Distributed", delivered_quantity__isnull=True) - for payment in not_distributed_payments: - payment.delivered_quantity = Decimal(0) - payment.delivered_quantity_usd = Decimal(0) - - Payment.objects.bulk_update(not_distributed_payments, ["delivered_quantity", "delivered_quantity_usd"]) - - -class Migration(migrations.Migration): - - dependencies = [ - ("payment", "0138_migration"), - ] - - operations = [ - migrations.RunPython(migrate_payments_delivered_quantity, migrations.RunPython.noop), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0140_migration.py b/src/hct_mis_api/apps/payment/migrations/0140_migration.py deleted file mode 100644 index 7027faaaa6..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0140_migration.py +++ /dev/null @@ -1,274 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-17 13:59 - -import django.contrib.postgres.fields -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -def populate_delivery_mechanisms(apps, schema_editor): - DeliveryMechanism = apps.get_model("payment", "DeliveryMechanism") - - data = [ - { - "code": "cardless_cash_withdrawal", - "name": "Cardless cash withdrawal", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "cash", - "name": "Cash", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "cash_by_fsp", - "name": "Cash by FSP", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "cheque", - "name": "Cheque", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "deposit_to_card", - "name": "Deposit to Card", - "requirements": { - "required_fields": [ - "card_number__deposit_to_card", - ], - "optional_fields": [ - "full_name", - ], - "unique_fields": [ - "card_number__deposit_to_card", - ], - }, - "transfer_type": "CASH", - }, - { - "code": "mobile_money", - "name": "Mobile Money", - "requirements": { - "required_fields": ["delivery_phone_number__mobile_money", "provider__mobile_money"], - "optional_fields": [ - "full_name", - ], - "unique_fields": ["delivery_phone_number__mobile_money", "provider__mobile_money"], - }, - "transfer_type": "CASH", - }, - { - "code": "pre-paid_card", - "name": "Pre-paid card", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "referral", - "name": "Referral", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "transfer", - "name": "Transfer", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "transfer_to_account", - "name": "Transfer to Account", - "requirements": { - "required_fields": ["bank_name__transfer_to_account", "bank_account_number__transfer_to_account"], - "optional_fields": [ - "full_name", - ], - "unique_fields": [ - "bank_account_number__transfer_to_account", - ], - }, - "transfer_type": "CASH", - }, - { - "code": "voucher", - "name": "Voucher", - "requirements": { - "required_fields": [], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "VOUCHER", - }, - { - "code": "cash_over_the_counter", - "name": "Cash over the counter", - "requirements": { - "required_fields": [ - "mobile_phone_number__cash_over_the_counter", - ], - "optional_fields": [ - "full_name", - ], - "unique_fields": [], - }, - "transfer_type": "CASH", - }, - { - "code": "atm_card", - "name": "ATM Card", - "requirements": { - "required_fields": [ - "card_number__atm_card", - "card_expiry_date__atm_card", - "name_of_cardholder__atm_card", - ], - "optional_fields": [ - "full_name", - ], - "unique_fields": [ - "card_number__atm_card", - "card_expiry__date_atm_card", - "name_of_cardholder__atm_card", - ], - }, - "transfer_type": "CASH", - }, - { - "code": "transfer_to_digital_wallet", - "name": "Transfer to Digital Wallet", - "requirements": { - "required_fields": [ - "blockchain_name__transfer_to_digital_wallet", - "wallet_address__transfer_to_digital_wallet", - ], - "optional_fields": ["full_name", "wallet_name__transfer_to_digital_wallet"], - "unique_fields": [ - "blockchain_name__transfer_to_digital_wallet", - "wallet_address__transfer_to_digital_wallet", - ], - }, - "transfer_type": "DIGITAL", - }, - ] - for dm in data: - DeliveryMechanism.objects.update_or_create( - code=dm["code"], - defaults={ - "name": dm["name"], - "required_fields": dm["requirements"]["required_fields"], - "optional_fields": dm["requirements"]["optional_fields"], - "unique_fields": dm["requirements"]["unique_fields"], - "transfer_type": dm["transfer_type"], - "is_active": False, - }, - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("payment", "0139_migration"), - ] - - operations = [ - migrations.CreateModel( - name="DeliveryMechanism", - fields=[ - ( - "id", - model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("payment_gateway_id", models.CharField(max_length=255, unique=True, null=True)), - ("code", models.CharField(max_length=255, unique=True)), - ("name", models.CharField(max_length=255, unique=True)), - ( - "optional_fields", - django.contrib.postgres.fields.ArrayField( - base_field=models.CharField(max_length=255), default=list, size=None - ), - ), - ( - "required_fields", - django.contrib.postgres.fields.ArrayField( - base_field=models.CharField(max_length=255), default=list, size=None - ), - ), - ( - "unique_fields", - django.contrib.postgres.fields.ArrayField( - base_field=models.CharField(max_length=255), default=list, size=None - ), - ), - ("is_active", models.BooleanField(default=True)), - ( - "transfer_type", - models.CharField( - choices=[("CASH", "Cash"), ("VOUCHER", "Voucher"), ("DIGITAL", "Digital")], - default="CASH", - max_length=255, - ), - ), - ], - options={ - "verbose_name": "Delivery Mechanism", - "verbose_name_plural": "Delivery Mechanisms", - "ordering": ["code"], - }, - ), - migrations.RunPython( - populate_delivery_mechanisms, - migrations.RunPython.noop, - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0141_migration.py b/src/hct_mis_api/apps/payment/migrations/0141_migration.py deleted file mode 100644 index 672f57b0dc..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0141_migration.py +++ /dev/null @@ -1,194 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-17 13:59 - -from django.db import migrations, models -import django.db.models.deletion -import hct_mis_api.apps.payment.fields - - -def data_migration_financialserviceprovider_delivery_mechanisms(apps, schema_editor): - FinancialServiceProvider = apps.get_model("payment", "FinancialServiceProvider") - DeliveryMechanism = apps.get_model("payment", "DeliveryMechanism") - dms = list(DeliveryMechanism.objects.all()) - - fsps = FinancialServiceProvider.objects.exclude(delivery_mechanisms_choices__isnull=True) - for fsp in fsps: - fsp_dms = [dm for dm in dms if dm.name in fsp.delivery_mechanisms_choices] - fsp.delivery_mechanisms.set(fsp_dms) - - -def data_migration_deliverymechanismdata_delivery_mechanism(apps, schema_editor): - pass - - -def data_migration_deliverymechanismperpaymentplan_delivery_mechanism(apps, schema_editor): - pass - - -def data_migration_fspxlsxtemplateperdeliverymechanism_delivery_mechanism(apps, schema_editor): - pass - - -def data_migration_payment_delivery_type(apps, schema_editor): - Payment = apps.get_model("payment", "Payment") - DeliveryMechanism = apps.get_model("payment", "DeliveryMechanism") - - for dm in DeliveryMechanism.objects.all(): - Payment.objects.filter(delivery_type_choice=dm.name).update(delivery_type=dm) - - -def data_migration_payment_record_delivery_type(apps, schema_editor): - PaymentRecord = apps.get_model("payment", "PaymentRecord") - DeliveryMechanism = apps.get_model("payment", "DeliveryMechanism") - - for dm in DeliveryMechanism.objects.all(): - PaymentRecord.objects.filter(delivery_type_choice=dm.name).update(delivery_type=dm) - - -class Migration(migrations.Migration): - - dependencies = [ - ("payment", "0140_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="financialserviceproviderxlsxtemplate", - name="core_fields", - field=hct_mis_api.apps.payment.fields.DynamicChoiceArrayField( - base_field=models.CharField(blank=True, max_length=255), blank=True, default=list, size=None - ), - ), - migrations.RenameField( - model_name="financialserviceprovider", - old_name="delivery_mechanisms", - new_name="delivery_mechanisms_choices", - ), - migrations.AlterField( - model_name="financialserviceprovider", - name="delivery_mechanisms_choices", - field=hct_mis_api.apps.account.models.HorizontalChoiceArrayField( - base_field=models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("Mobile Money", "Mobile Money"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ("ATM Card", "ATM Card"), - ("Cash over the counter", "Cash over the counter"), - ("Transfer to Digital Wallet", "Transfer to Digital Wallet"), - ], - max_length=32, - ), - null=True, - size=None, - ), - ), - migrations.AddField( - model_name="financialserviceprovider", - name="delivery_mechanisms", - field=models.ManyToManyField(to="payment.DeliveryMechanism"), - ), - migrations.RunPython( - data_migration_financialserviceprovider_delivery_mechanisms, - migrations.RunPython.noop, - ), - migrations.RenameField( - model_name="deliverymechanismdata", - old_name="delivery_mechanism", - new_name="delivery_mechanism_choice", - ), - migrations.AddField( - model_name="deliverymechanismdata", - name="delivery_mechanism", - field=models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, to="payment.deliverymechanism", null=True - ), - ), - migrations.RunPython( - data_migration_deliverymechanismdata_delivery_mechanism, - migrations.RunPython.noop, - ), - migrations.AlterField( - model_name="deliverymechanismdata", - name="delivery_mechanism", - field=models.ForeignKey( - on_delete=django.db.models.deletion.PROTECT, - to="payment.deliverymechanism", - ), - ), - migrations.RenameField( - model_name="deliverymechanismperpaymentplan", - old_name="delivery_mechanism", - new_name="delivery_mechanism_choice", - ), - migrations.AddField( - model_name="deliverymechanismperpaymentplan", - name="delivery_mechanism", - field=models.ForeignKey( - on_delete=django.db.models.deletion.SET_NULL, to="payment.deliverymechanism", null=True - ), - ), - migrations.RunPython( - data_migration_deliverymechanismperpaymentplan_delivery_mechanism, - migrations.RunPython.noop, - ), - migrations.RenameField( - model_name="fspxlsxtemplateperdeliverymechanism", - old_name="delivery_mechanism", - new_name="delivery_mechanism_choice", - ), - migrations.AddField( - model_name="fspxlsxtemplateperdeliverymechanism", - name="delivery_mechanism", - field=models.ForeignKey( - on_delete=django.db.models.deletion.SET_NULL, to="payment.deliverymechanism", null=True - ), - ), - migrations.RunPython( - data_migration_fspxlsxtemplateperdeliverymechanism_delivery_mechanism, - migrations.RunPython.noop, - ), - migrations.AlterUniqueTogether( - name="fspxlsxtemplateperdeliverymechanism", - unique_together={("financial_service_provider", "delivery_mechanism")}, - ), - migrations.RenameField( - model_name="payment", - old_name="delivery_type", - new_name="delivery_type_choice", - ), - migrations.RenameField( - model_name="paymentrecord", - old_name="delivery_type", - new_name="delivery_type_choice", - ), - migrations.AddField( - model_name="payment", - name="delivery_type", - field=models.ForeignKey( - on_delete=django.db.models.deletion.SET_NULL, to="payment.deliverymechanism", null=True - ), - ), - migrations.AddField( - model_name="paymentrecord", - name="delivery_type", - field=models.ForeignKey( - on_delete=django.db.models.deletion.SET_NULL, to="payment.deliverymechanism", null=True - ), - ), - migrations.RunPython( - data_migration_payment_delivery_type, - migrations.RunPython.noop, - ), - migrations.RunPython( - data_migration_payment_record_delivery_type, - migrations.RunPython.noop, - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0142_migration.py b/src/hct_mis_api/apps/payment/migrations/0142_migration.py deleted file mode 100644 index 80834a1283..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0142_migration.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-05 13:12 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0049_migration'), - ('payment', '0141_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='end_date', - field=models.DateTimeField(blank=True, db_index=True, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='start_date', - field=models.DateTimeField(blank=True, db_index=True, null=True), - ), - migrations.AlterField( - model_name='paymentplan', - name='end_date', - field=models.DateTimeField(blank=True, db_index=True, null=True), - ), - migrations.AlterField( - model_name='paymentplan', - name='program_cycle', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payment_plans', to='program.programcycle'), - ), - migrations.AlterField( - model_name='paymentplan', - name='start_date', - field=models.DateTimeField(blank=True, db_index=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0143_migration.py b/src/hct_mis_api/apps/payment/migrations/0143_migration.py deleted file mode 100644 index 8562ac2e08..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0143_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-20 16:20 - -from django.db import migrations, models -import hct_mis_api.apps.payment.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0142_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceproviderxlsxtemplate', - name='flex_fields', - field=hct_mis_api.apps.payment.models.FlexFieldArrayField(base_field=models.CharField(blank=True, max_length=255), blank=True, default=list, size=None), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0144_migration.py b/src/hct_mis_api/apps/payment/migrations/0144_migration.py deleted file mode 100644 index 6ce4f70f91..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0144_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-23 14:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0143_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='deliverymechanismdata', - name='delivery_mechanism_choice', - field=models.CharField(blank=True, choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter'), ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], max_length=255, null=True, verbose_name='Delivery Mechanism'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0145_migration.py b/src/hct_mis_api/apps/payment/migrations/0145_migration.py deleted file mode 100644 index 7749049ce4..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0145_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-19 23:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0087_migration'), - ('payment', '0144_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='financialserviceprovider', - name='allowed_business_areas', - field=models.ManyToManyField(blank=True, to='core.BusinessArea'), - ), - ] diff --git a/src/hct_mis_api/apps/payment/migrations/0146_migration.py b/src/hct_mis_api/apps/payment/migrations/0146_migration.py deleted file mode 100644 index 8744eafa89..0000000000 --- a/src/hct_mis_api/apps/payment/migrations/0146_migration.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-30 09:00 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('payment', '0145_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PaymentPlanSupportingDocument', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=255)), - ('file', models.FileField(upload_to='')), - ('uploaded_at', models.DateTimeField(auto_now_add=True)), - ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), - ('payment_plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='payment.paymentplan')), - ], - options={ - 'ordering': ['uploaded_at'], - }, - ), - ] diff --git a/src/hct_mis_api/apps/periodic_data_update/migrations/0001_migration.py b/src/hct_mis_api/apps/periodic_data_update/migrations/0001_migration.py index 5baad1c734..7caa2320e7 100644 --- a/src/hct_mis_api/apps/periodic_data_update/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/periodic_data_update/migrations/0001_migration.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.25 on 2024-06-18 23:36 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.conf import settings from django.db import migrations, models @@ -11,8 +11,8 @@ class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('core', '0078_migration'), - ('program', '0047_migration'), + ('core', '0001_migration'), + ('program', '0001_migration'), ] operations = [ @@ -22,9 +22,10 @@ class Migration(migrations.Migration): ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('status', models.CharField(choices=[('TO_EXPORT', 'To export'), ('EXPORTING', 'Exporting'), ('EXPORTED', 'Exported')], default='TO_EXPORT', max_length=20)), + ('curr_async_result_id', models.CharField(blank=True, help_text='Current (active) AsyncResult is', max_length=36, null=True)), + ('status', models.CharField(choices=[('TO_EXPORT', 'To export'), ('NOT_SCHEDULED', 'Not scheduled'), ('EXPORTING', 'Exporting'), ('EXPORTED', 'Exported'), ('FAILED', 'Failed'), ('CANCELED', 'Canceled')], default='TO_EXPORT', max_length=20)), + ('filters', models.JSONField(blank=True, default=dict, null=True)), ('rounds_data', models.JSONField()), - ('filters', models.JSONField()), ('number_of_records', models.PositiveIntegerField(blank=True, null=True)), ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='periodic_data_update_templates', to='core.businessarea')), ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='periodic_data_updates_created', to=settings.AUTH_USER_MODEL)), @@ -35,4 +36,21 @@ class Migration(migrations.Migration): 'abstract': False, }, ), + migrations.CreateModel( + name='PeriodicDataUpdateUpload', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('curr_async_result_id', models.CharField(blank=True, help_text='Current (active) AsyncResult is', max_length=36, null=True)), + ('status', models.CharField(choices=[('PENDING', 'Pending'), ('NOT_SCHEDULED', 'Not scheduled'), ('PROCESSING', 'Processing'), ('SUCCESSFUL', 'Successful'), ('FAILED', 'Failed'), ('CANCELED', 'Canceled')], default='PENDING', max_length=20)), + ('file', models.FileField(upload_to='')), + ('error_message', models.TextField(blank=True, null=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='periodic_data_update_uploads', to=settings.AUTH_USER_MODEL)), + ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='uploads', to='periodic_data_update.periodicdataupdatetemplate')), + ], + options={ + 'abstract': False, + }, + ), ] diff --git a/src/hct_mis_api/apps/periodic_data_update/migrations/0002_migration.py b/src/hct_mis_api/apps/periodic_data_update/migrations/0002_migration.py deleted file mode 100644 index 77bb069f18..0000000000 --- a/src/hct_mis_api/apps/periodic_data_update/migrations/0002_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-08 15:31 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('periodic_data_update', '0001_migration'), - ] - - operations = [ - migrations.CreateModel( - name='PeriodicDataUpdateUpload', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('status', models.CharField(choices=[('PROCESSING', 'Processing'), ('SUCCESSFUL', 'Successful'), ('FAILED', 'Failed')], default='PROCESSING', max_length=20)), - ('file', models.FileField(upload_to='')), - ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='periodic_data_update_uploads', to=settings.AUTH_USER_MODEL)), - ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='uploads', to='periodic_data_update.periodicdataupdatetemplate')), - ], - options={ - 'abstract': False, - }, - ), - ] diff --git a/src/hct_mis_api/apps/periodic_data_update/migrations/0003_migration.py b/src/hct_mis_api/apps/periodic_data_update/migrations/0003_migration.py deleted file mode 100644 index 7d00279cbb..0000000000 --- a/src/hct_mis_api/apps/periodic_data_update/migrations/0003_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-17 09:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('periodic_data_update', '0002_migration'), - ] - - operations = [ - migrations.AddField( - model_name='periodicdataupdateupload', - name='error_message', - field=models.TextField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/periodic_data_update/migrations/0004_migration.py b/src/hct_mis_api/apps/periodic_data_update/migrations/0004_migration.py deleted file mode 100644 index d7b68666cf..0000000000 --- a/src/hct_mis_api/apps/periodic_data_update/migrations/0004_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-18 09:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('periodic_data_update', '0003_migration'), - ] - - operations = [ - migrations.AddField( - model_name='periodicdataupdateupload', - name='curr_async_result_id', - field=models.CharField(blank=True, help_text='Current (active) AsyncResult is', max_length=36, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/periodic_data_update/migrations/0005_migration.py b/src/hct_mis_api/apps/periodic_data_update/migrations/0005_migration.py deleted file mode 100644 index 6c0e5cf46e..0000000000 --- a/src/hct_mis_api/apps/periodic_data_update/migrations/0005_migration.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-18 14:15 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('periodic_data_update', '0004_migration'), - ] - - operations = [ - migrations.AddField( - model_name='periodicdataupdatetemplate', - name='curr_async_result_id', - field=models.CharField(blank=True, help_text='Current (active) AsyncResult is', max_length=36, null=True), - ), - migrations.AlterField( - model_name='periodicdataupdatetemplate', - name='status', - field=models.CharField(choices=[('TO_EXPORT', 'To export'), ('NOT_SCHEDULED', 'Not scheduled'), ('EXPORTING', 'Exporting'), ('EXPORTED', 'EXPORTED'), ('FAILED', 'Failed'), ('CANCELED', 'Canceled')], default='TO_EXPORT', max_length=20), - ), - migrations.AlterField( - model_name='periodicdataupdateupload', - name='status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('NOT_SCHEDULED', 'Not scheduled'), ('PROCESSING', 'Processing'), ('SUCCESSFUL', 'Successful'), ('FAILED', 'Failed'), ('CANCELED', 'Canceled')], default='PENDING', max_length=20), - ), - ] diff --git a/src/hct_mis_api/apps/periodic_data_update/migrations/0006_migration.py b/src/hct_mis_api/apps/periodic_data_update/migrations/0006_migration.py deleted file mode 100644 index e4435d5cff..0000000000 --- a/src/hct_mis_api/apps/periodic_data_update/migrations/0006_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-04 19:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('periodic_data_update', '0005_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='periodicdataupdatetemplate', - name='status', - field=models.CharField(choices=[('TO_EXPORT', 'To export'), ('NOT_SCHEDULED', 'Not scheduled'), ('EXPORTING', 'Exporting'), ('EXPORTED', 'Exported'), ('FAILED', 'Failed'), ('CANCELED', 'Canceled')], default='TO_EXPORT', max_length=20), - ), - ] diff --git a/src/hct_mis_api/apps/periodic_data_update/migrations/0007_migration.py b/src/hct_mis_api/apps/periodic_data_update/migrations/0007_migration.py deleted file mode 100644 index 496bb959f9..0000000000 --- a/src/hct_mis_api/apps/periodic_data_update/migrations/0007_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-12 09:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('periodic_data_update', '0006_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='periodicdataupdatetemplate', - name='filters', - field=models.JSONField(blank=True, default=dict, null=True), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/power_query/__init__.py b/src/hct_mis_api/apps/power_query/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/hct_mis_api/apps/power_query/migrations/__init__.py b/src/hct_mis_api/apps/power_query/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/hct_mis_api/apps/program/fixtures.py b/src/hct_mis_api/apps/program/fixtures.py index 73524762c8..0c9846dedc 100644 --- a/src/hct_mis_api/apps/program/fixtures.py +++ b/src/hct_mis_api/apps/program/fixtures.py @@ -4,8 +4,6 @@ from random import randint from typing import Any -from django.utils.timezone import utc - import factory from dateutil.relativedelta import relativedelta from factory import fuzzy @@ -29,7 +27,11 @@ class Meta: lambda o: ( o.program.cycles.latest("start_date").end_date + timedelta(days=1) if o.program.cycles.exists() - else fake.date_time_this_decade(before_now=True, after_now=True, tzinfo=utc).date() + else ( + datetime.fromisoformat(o.program.start_date) + if type(o.program.start_date) is str + else o.program.start_date + ) ) ) diff --git a/src/hct_mis_api/apps/program/migrations/0001_migration.py b/src/hct_mis_api/apps/program/migrations/0001_migration.py index e1f5720d30..96b957c748 100644 --- a/src/hct_mis_api/apps/program/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/program/migrations/0001_migration.py @@ -1,10 +1,13 @@ -# Generated by Django 2.2.8 on 2020-04-29 08:18 +# Generated by Django 3.2.25 on 2024-11-07 12:18 +import concurrency.fields from decimal import Decimal from django.conf import settings +import django.contrib.postgres.fields.citext import django.core.validators from django.db import migrations, models import django.db.models.deletion +import hct_mis_api.apps.utils.models import model_utils.fields import uuid @@ -14,69 +17,125 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('core', '0001_migration'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('geo', '0001_migration'), + ('account', '0001_migration'), + ('core', '0001_migration'), ] operations = [ migrations.CreateModel( name='Program', fields=[ + ('is_removed', models.BooleanField(default=False)), ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), - ('status', models.CharField(choices=[('DRAFT', 'Draft'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], max_length=10)), - ('start_date', models.DateField()), - ('end_date', models.DateField()), - ('description', models.CharField(max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), - ('program_ca_id', models.CharField(max_length=255)), - ('budget', models.DecimalField(decimal_places=2, max_digits=11, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), - ('frequency_of_payments', models.CharField(choices=[('REGULAR', 'Regular'), ('ONE_OFF', 'One-off')], max_length=50)), - ('sector', models.CharField(choices=[('CHILD_PROTECTION', 'Child Protection'), ('EDUCATION', 'Education'), ('GENDER', 'Gender'), ('HEALTH', 'Health'), ('HIV_AIDS', 'HIV / AIDS'), ('MULTI_PURPOSE', 'Multi Purpose'), ('NUTRITION', 'Nutrition'), ('SOCIAL_POLICY', 'Social Policy'), ('WASH', 'WASH')], max_length=50)), - ('scope', models.CharField(choices=[('FULL', 'Full'), ('PARTIAL', 'Partial'), ('NO_INTEGRATION', 'No Integration')], max_length=50)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('last_sync_at', models.DateTimeField(blank=True, null=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('name', django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()])), + ('status', models.CharField(choices=[('ACTIVE', 'Active'), ('DRAFT', 'Draft'), ('FINISHED', 'Finished')], db_index=True, max_length=10)), + ('start_date', models.DateField(db_index=True)), + ('end_date', models.DateField(blank=True, db_index=True, null=True)), + ('description', models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), + ('ca_id', django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=255, null=True)), + ('ca_hash_id', django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=255, null=True)), + ('budget', models.DecimalField(db_index=True, decimal_places=2, max_digits=11, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))])), + ('frequency_of_payments', models.CharField(choices=[('ONE_OFF', 'One-off'), ('REGULAR', 'Regular')], max_length=50)), + ('sector', models.CharField(choices=[('CHILD_PROTECTION', 'Child Protection'), ('EDUCATION', 'Education'), ('HEALTH', 'Health'), ('MULTI_PURPOSE', 'Multi Purpose'), ('NUTRITION', 'Nutrition'), ('SOCIAL_POLICY', 'Social Policy'), ('WASH', 'WASH')], db_index=True, max_length=50)), + ('scope', models.CharField(blank=True, choices=[('FOR_PARTNERS', 'For partners'), ('UNICEF', 'Unicef')], max_length=50, null=True)), ('cash_plus', models.BooleanField()), ('population_goal', models.PositiveIntegerField()), - ('administrative_areas_of_implementation', models.CharField(max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), - ('admin_areas', models.ManyToManyField(blank=True, related_name='programs', to='core.AdminArea')), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.BusinessArea')), + ('administrative_areas_of_implementation', models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), + ('is_visible', models.BooleanField(default=True)), + ('household_count', models.PositiveIntegerField(default=0)), + ('individual_count', models.PositiveIntegerField(default=0)), + ('programme_code', models.CharField(blank=True, max_length=4, null=True)), + ('partner_access', models.CharField(choices=[('ALL_PARTNERS_ACCESS', 'All partners access'), ('NONE_PARTNERS_ACCESS', 'None partners access'), ('SELECTED_PARTNERS_ACCESS', 'Selected partners access')], default='SELECTED_PARTNERS_ACCESS', max_length=50)), + ('biometric_deduplication_enabled', models.BooleanField(default=False, help_text='Enable Deduplication of Face Images')), + ('deduplication_set_id', models.UUIDField(blank=True, null=True)), + ('admin_areas', models.ManyToManyField(blank=True, related_name='programs', to='geo.Area')), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ('data_collecting_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='programs', to='core.datacollectingtype')), ], options={ - 'abstract': False, + 'verbose_name': 'Programme', + 'permissions': [('enroll_beneficiaries', 'Can enroll beneficiaries')], }, + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), + migrations.CreateModel( + name='ProgramPartnerThrough', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('full_area_access', models.BooleanField(default=False)), + ('areas', models.ManyToManyField(blank=True, related_name='program_partner_through', to='geo.Area')), + ('partner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='program_partner_through', to='account.partner')), + ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='program_partner_through', to='program.program')), + ], ), migrations.CreateModel( - name='CashPlan', + name='ProgramCycle', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), - ('start_date', models.DateTimeField()), - ('end_date', models.DateTimeField()), - ('disbursement_date', models.DateTimeField()), - ('number_of_households', models.PositiveIntegerField()), - ('created_date', models.DateTimeField(auto_now_add=True)), - ('coverage_duration', models.PositiveIntegerField()), - ('coverage_units', models.CharField(max_length=255)), - ('cash_assist_id', models.CharField(max_length=255)), - ('distribution_modality', models.CharField(max_length=255)), - ('fsp', models.CharField(max_length=255)), - ('status', models.CharField(choices=[('NOT_STARTED', 'NOT_STARTED'), ('STARTED', 'STARTED'), ('COMPLETE', 'COMPLETE')], max_length=50)), - ('currency', models.CharField(max_length=255)), - ('total_entitled_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('total_delivered_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('total_undelivered_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('dispersion_date', models.DateField()), - ('delivery_type', models.CharField(max_length=255)), - ('assistance_through', models.CharField(max_length=255)), - ('fc_id', models.CharField(max_length=255)), - ('dp_id', models.CharField(max_length=255)), - ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='cash_plans', to=settings.AUTH_USER_MODEL)), - ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cash_plans', to='program.Program')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('unicef_id', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('title', models.CharField(blank=True, default='Default Programme Cycle', max_length=255, null=True, verbose_name='Title')), + ('status', models.CharField(choices=[('DRAFT', 'Draft'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, default='DRAFT', max_length=10)), + ('start_date', models.DateField()), + ('end_date', models.DateField(blank=True, null=True)), + ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Created by')), + ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cycles', to='program.program')), ], options={ - 'abstract': False, + 'verbose_name': 'Programme Cycle', + 'ordering': ['start_date'], }, + bases=(hct_mis_api.apps.utils.models.AdminUrlMixin, models.Model), + ), + migrations.AddField( + model_name='program', + name='partners', + field=models.ManyToManyField(related_name='programs', through='program.ProgramPartnerThrough', to='account.Partner'), + ), + migrations.AddConstraint( + model_name='programpartnerthrough', + constraint=models.UniqueConstraint(fields=('program', 'partner'), name='unique_program_partner'), + ), + migrations.AddConstraint( + model_name='programcycle', + constraint=models.UniqueConstraint(fields=('title', 'program'), name='program_cycle_title_unique_per_program'), + ), + migrations.AddConstraint( + model_name='program', + constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('name', 'business_area', 'is_removed'), name='unique_for_program_if_not_removed'), + ), + migrations.AddConstraint( + model_name='program', + constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('business_area', 'programme_code'), name='unique_for_business_area_and_programme_code_if_not_removed'), + ), + migrations.RunSQL( + sql=""" + CREATE OR REPLACE FUNCTION program_cycle_fill_unicef_id_per_business_area_seq() RETURNS trigger + LANGUAGE plpgsql + AS $$ + DECLARE + businessAreaID varchar; + businessAreaCode varchar; + BEGIN + SELECT INTO businessAreaID p.business_area_id FROM program_program p WHERE p.id = NEW.program_id; + SELECT INTO businessAreaCode ba.code FROM core_businessarea ba WHERE ba.id = businessAreaID::uuid; + NEW.unicef_id := format('PC-%s-%s-%s', trim(businessAreaCode), to_char(NEW.created_at, 'yy'), trim(replace(to_char(nextval('program_cycle_business_area_seq_' || translate(businessAreaID::text, '-','_')),'000000'),',','.'))); + RETURN NEW; + END; + $$; + """, + ), + migrations.RunSQL( + sql="CREATE TRIGGER program_cycle_fill_unicef_id_per_business_area_seq BEFORE INSERT ON program_programcycle FOR EACH ROW EXECUTE PROCEDURE program_cycle_fill_unicef_id_per_business_area_seq();", ), ] diff --git a/src/hct_mis_api/apps/program/migrations/0002_migration_squashed_0020_migration.py b/src/hct_mis_api/apps/program/migrations/0002_migration_squashed_0020_migration.py deleted file mode 100644 index 2528a1a3c2..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0002_migration_squashed_0020_migration.py +++ /dev/null @@ -1,156 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 19:34 - -import concurrency.fields -from decimal import Decimal -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - -from hct_mis_api.apps.payment.delivery_mechanisms import DeliveryMechanismChoices - - -def delivery_type_labels_to_valid_choices(apps, schema_editor): - CashPlan = apps.get_model("program", "CashPlan") - delivery_type_choices_dict = {value: key for key, value in DeliveryMechanismChoices.DELIVERY_TYPE_CHOICES} - all_cash_plans = CashPlan.objects.all() - for cash_plan in all_cash_plans: - cash_plan.delivery_type = delivery_type_choices_dict.get( - cash_plan.delivery_type, DeliveryMechanismChoices.DELIVERY_TYPE_CASH - ) - CashPlan.objects.bulk_update(all_cash_plans, ["delivery_type"]) - -def empty_reverse(apps, schema_editor): - pass - -def populate_existing_cash_plan_rates(apps, schema_editor): - pass - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0002_migration_squashed_0006_migration'), - ('payment', '0002_migration_squashed_0003_migration'), - ('targeting', '0001_migration'), - ('program', '0001_migration'), - ] - - operations = [ - migrations.AddField( - model_name='cashplan', - name='target_population', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cash_plans', to='targeting.targetpopulation'), - ), - migrations.AlterUniqueTogether( - name='program', - unique_together={('name', 'business_area')}, - ), - migrations.DeleteModel( - name='CashPlan', - ), - migrations.AlterField( - model_name='program', - name='scope', - field=models.CharField(choices=[('FOR_PARTNERS', 'For partners'), ('UNICEF', 'Unicef')], max_length=50), - ), - migrations.AddField( - model_name='program', - name='last_sync_at', - field=models.DateTimeField(null=True), - ), - migrations.RemoveField( - model_name='program', - name='program_ca_id', - ), - migrations.AddField( - model_name='program', - name='ca_hash_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='program', - name='ca_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='program', - name='individual_data_needed', - field=models.BooleanField(default=False, help_text='\n This boolean decides whether the target population sync will send\n all individuals of a household thats part of the population or only\n the relevant ones (collectors etc.)'), - ), - migrations.AlterField( - model_name='program', - name='sector', - field=models.CharField(choices=[('CHILD_PROTECTION', 'Child Protection'), ('EDUCATION', 'Education'), ('HEALTH', 'Health'), ('MULTI_PURPOSE', 'Multi Purpose'), ('NUTRITION', 'Nutrition'), ('SOCIAL_POLICY', 'Social Policy'), ('WASH', 'WASH')], max_length=50), - ), - migrations.CreateModel( - name='CashPlan', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('ca_id', models.CharField(max_length=255, null=True)), - ('ca_hash_id', models.UUIDField(null=True, unique=True)), - ('status', models.CharField(choices=[('Distribution Completed', 'Distribution Completed'), ('Distribution Completed with Errors', 'Distribution Completed with Errors'), ('Transaction Completed', 'Transaction Completed'), ('Transaction Completed with Errors', 'Transaction Completed with Errors')], max_length=255)), - ('status_date', models.DateTimeField()), - ('name', models.CharField(max_length=255)), - ('distribution_level', models.CharField(max_length=255)), - ('start_date', models.DateTimeField()), - ('end_date', models.DateTimeField()), - ('dispersion_date', models.DateTimeField()), - ('coverage_duration', models.PositiveIntegerField()), - ('coverage_unit', models.CharField(max_length=255)), - ('comments', models.CharField(max_length=255, null=True)), - ('delivery_type', models.CharField(blank=True, choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], max_length=20)), - ('assistance_measurement', models.CharField(max_length=255)), - ('assistance_through', models.CharField(max_length=255)), - ('vision_id', models.CharField(max_length=255)), - ('funds_commitment', models.CharField(max_length=255)), - ('down_payment', models.CharField(max_length=255)), - ('validation_alerts_count', models.IntegerField()), - ('total_persons_covered', models.IntegerField()), - ('total_persons_covered_revised', models.IntegerField()), - ('total_entitled_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('total_entitled_quantity_revised', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('total_delivered_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('total_undelivered_quantity', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), - ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cash_plans', to='program.program')), - ('verification_status', models.CharField(choices=[('PENDING', 'Pending'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], default='PENDING', max_length=10)), - ], - options={ - 'abstract': False, - }, - ), - migrations.RunPython(delivery_type_labels_to_valid_choices, empty_reverse), - migrations.AlterModelOptions( - name='cashplan', - options={'verbose_name': 'Cash Plan'}, - ), - migrations.AlterModelOptions( - name='program', - options={'verbose_name': 'Programme'}, - ), - migrations.AddField( - model_name='program', - name='is_removed', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='program', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AddField( - model_name='cashplan', - name='exchange_rate', - field=models.DecimalField(blank=True, decimal_places=8, max_digits=12, null=True), - ), - migrations.RunPython(populate_existing_cash_plan_rates, empty_reverse), - migrations.AlterField( - model_name='program', - name='last_sync_at', - field=models.DateTimeField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0021_migration.py b/src/hct_mis_api/apps/program/migrations/0021_migration.py deleted file mode 100644 index 8a5039cd3f..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0021_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-12 14:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0002_migration_squashed_0020_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], max_length=20, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='down_payment', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='funds_commitment', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='vision_id', - field=models.CharField(max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0021_migration_squashed_0024_migration.py b/src/hct_mis_api/apps/program/migrations/0021_migration_squashed_0024_migration.py deleted file mode 100644 index 1a15ac81e7..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0021_migration_squashed_0024_migration.py +++ /dev/null @@ -1,199 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:48 - -from decimal import Decimal -import django.contrib.postgres.fields.citext -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - replaces = [('program', '0021_migration'), ('program', '0022_migration'), ('program', '0023_migration'), ('program', '0024_migration')] - - dependencies = [ - ('program', '0002_migration_squashed_0020_migration'), - ('steficon', '0002_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], max_length=20, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='down_payment', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='funds_commitment', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='vision_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='assistance_measurement', - field=models.CharField(db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='assistance_through', - field=models.CharField(db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], db_index=True, max_length=20, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='end_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='name', - field=models.CharField(db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='start_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='status', - field=models.CharField(choices=[('Distribution Completed', 'Distribution Completed'), ('Distribution Completed with Errors', 'Distribution Completed with Errors'), ('Transaction Completed', 'Transaction Completed'), ('Transaction Completed with Errors', 'Transaction Completed with Errors')], db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_persons_covered', - field=models.IntegerField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='total_persons_covered_revised', - field=models.IntegerField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='verification_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, default='PENDING', max_length=10), - ), - migrations.AlterField( - model_name='program', - name='budget', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=11, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='program', - name='ca_hash_id', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='ca_id', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='program', - name='end_date', - field=models.DateField(db_index=True), - ), - migrations.AlterField( - model_name='program', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)]), - ), - migrations.AlterField( - model_name='program', - name='sector', - field=models.CharField(choices=[('CHILD_PROTECTION', 'Child Protection'), ('EDUCATION', 'Education'), ('HEALTH', 'Health'), ('MULTI_PURPOSE', 'Multi Purpose'), ('NUTRITION', 'Nutrition'), ('SOCIAL_POLICY', 'Social Policy'), ('WASH', 'WASH')], db_index=True, max_length=50), - ), - migrations.AlterField( - model_name='program', - name='start_date', - field=models.DateField(db_index=True), - ), - migrations.AlterField( - model_name='program', - name='status', - field=models.CharField(choices=[('DRAFT', 'Draft'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, max_length=10), - ), - migrations.AlterField( - model_name='program', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='program', - name='administrative_areas_of_implementation', - field=models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)]), - ), - migrations.AlterField( - model_name='program', - name='ca_hash_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='ca_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='description', - field=models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)]), - ), - migrations.AlterField( - model_name='program', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('In Kind', 'In Kind'), ('Mobile Money', 'Mobile Money'), ('Other', 'Other'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher')], db_index=True, max_length=24, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0022_migration.py b/src/hct_mis_api/apps/program/migrations/0022_migration.py deleted file mode 100644 index c37a598126..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0022_migration.py +++ /dev/null @@ -1,147 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-16 13:11 - -from decimal import Decimal -import django.contrib.postgres.fields.citext -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0021_migration'), - ('steficon', '0002_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='assistance_measurement', - field=models.CharField(db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='assistance_through', - field=models.CharField(db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='delivery_type', - field=models.CharField(choices=[('CASH', 'Cash'), ('DEPOSIT_TO_CARD', 'Deposit to Card'), ('TRANSFER', 'Transfer')], db_index=True, max_length=20, null=True), - ), - migrations.AlterField( - model_name='cashplan', - name='end_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='name', - field=models.CharField(db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='start_date', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='status', - field=models.CharField(choices=[('Distribution Completed', 'Distribution Completed'), ('Distribution Completed with Errors', 'Distribution Completed with Errors'), ('Transaction Completed', 'Transaction Completed'), ('Transaction Completed with Errors', 'Transaction Completed with Errors')], db_index=True, max_length=255), - ), - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_persons_covered', - field=models.IntegerField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='total_persons_covered_revised', - field=models.IntegerField(db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='cashplan', - name='verification_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, default='PENDING', max_length=10), - ), - migrations.AlterField( - model_name='program', - name='budget', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=11, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))]), - ), - migrations.AlterField( - model_name='program', - name='ca_hash_id', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='ca_id', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='program', - name='end_date', - field=models.DateField(db_index=True), - ), - migrations.AlterField( - model_name='program', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)]), - ), - migrations.AlterField( - model_name='program', - name='sector', - field=models.CharField(choices=[('CHILD_PROTECTION', 'Child Protection'), ('EDUCATION', 'Education'), ('HEALTH', 'Health'), ('MULTI_PURPOSE', 'Multi Purpose'), ('NUTRITION', 'Nutrition'), ('SOCIAL_POLICY', 'Social Policy'), ('WASH', 'WASH')], db_index=True, max_length=50), - ), - migrations.AlterField( - model_name='program', - name='start_date', - field=models.DateField(db_index=True), - ), - migrations.AlterField( - model_name='program', - name='status', - field=models.CharField(choices=[('DRAFT', 'Draft'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, max_length=10), - ), - migrations.AlterField( - model_name='program', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0023_migration.py b/src/hct_mis_api/apps/program/migrations/0023_migration.py deleted file mode 100644 index 2540a1245f..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0023_migration.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-18 07:15 - -import django.contrib.postgres.fields.citext -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0022_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='program', - name='administrative_areas_of_implementation', - field=models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)]), - ), - migrations.AlterField( - model_name='program', - name='ca_hash_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='ca_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='program', - name='description', - field=models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)]), - ), - migrations.AlterField( - model_name='program', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0024_migration.py b/src/hct_mis_api/apps/program/migrations/0024_migration.py deleted file mode 100644 index d3deb3b029..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0024_migration.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-18 23:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("program", "0023_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="cashplan", - name="delivery_type", - field=models.CharField( - choices=[ - ("Cardless cash withdrawal", "Cardless cash withdrawal"), - ("Cash", "Cash"), - ("Cash by FSP", "Cash by FSP"), - ("Cheque", "Cheque"), - ("Deposit to Card", "Deposit to Card"), - ("In Kind", "In Kind"), - ("Mobile Money", "Mobile Money"), - ("Other", "Other"), - ("Pre-paid card", "Pre-paid card"), - ("Referral", "Referral"), - ("Transfer", "Transfer"), - ("Transfer to Account", "Transfer to Account"), - ("Voucher", "Voucher"), - ], - db_index=True, - max_length=24, - null=True, - ), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0025_migration.py b/src/hct_mis_api/apps/program/migrations/0025_migration.py deleted file mode 100644 index 540974c4f3..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0025_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-23 11:09 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('payment', '0010_migration_squashed_0029_migration'), - ('program', '0024_migration'), - ] - - operations = [ - migrations.AddField( - model_name='cashplan', - name='service_provider', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cash_plans', to='payment.ServiceProvider'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0025_migration_squashed_0030_migration.py b/src/hct_mis_api/apps/program/migrations/0025_migration_squashed_0030_migration.py deleted file mode 100644 index 61f04198e9..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0025_migration_squashed_0030_migration.py +++ /dev/null @@ -1,83 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:46 - -from decimal import Decimal -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -def assign_service_providers_based_on_ca_id(apps, schema_editor): - CashPlan = apps.get_model("program", "CashPlan") - ServiceProvider = apps.get_model("payment", "ServiceProvider") - for cash_plan in CashPlan.objects.all(): - if not cash_plan.assistance_through: - continue - sp = ServiceProvider.objects.filter(ca_id=cash_plan.assistance_through).first() - if not sp: - continue - cash_plan.service_provider = sp - cash_plan.save() - - -def empty_reverse(apps, schema_editor): - pass - - -class Migration(migrations.Migration): - - replaces = [('program', '0025_migration'), ('program', '0026_migration'), ('program', '0027_migration'), ('program', '0028_migration'), ('program', '0029_migration'), ('program', '0030_migration')] - - dependencies = [ - ('payment', '0010_migration_squashed_0029_migration'), - ('geo', '0004_migration'), - ('program', '0024_migration'), - ] - - operations = [ - migrations.AddField( - model_name='cashplan', - name='service_provider', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cash_plans', to='payment.serviceprovider'), - ), - migrations.RunPython(assign_service_providers_based_on_ca_id, empty_reverse), - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='ca_id', - field=models.CharField(db_index=True, max_length=255, null=True), - ), - migrations.AddField( - model_name='program', - name='admin_areas_new', - field=models.ManyToManyField(blank=True, related_name='programs', to='geo.Area'), - ), - migrations.AlterField( - model_name='program', - name='frequency_of_payments', - field=models.CharField(choices=[('ONE_OFF', 'One-off'), ('REGULAR', 'Regular')], max_length=50), - ), - migrations.AlterField( - model_name='program', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('DRAFT', 'Draft'), ('FINISHED', 'Finished')], db_index=True, max_length=10), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0026_migration.py b/src/hct_mis_api/apps/program/migrations/0026_migration.py deleted file mode 100644 index 84b73bf86a..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0026_migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-23 11:09 - -from django.db import migrations - - -def assign_service_providers_based_on_ca_id(apps, schema_editor): - CashPlan = apps.get_model("program", "CashPlan") - ServiceProvider = apps.get_model("payment", "ServiceProvider") - for cash_plan in CashPlan.objects.all(): - if not cash_plan.assistance_through: - continue - sp = ServiceProvider.objects.filter(ca_id=cash_plan.assistance_through).first() - if not sp: - continue - cash_plan.service_provider = sp - cash_plan.save() - - -def empty_reverse(apps, schema_editor): - pass - - -class Migration(migrations.Migration): - - dependencies = [ - ("program", "0025_migration"), - ] - - operations = [migrations.RunPython(assign_service_providers_based_on_ca_id, empty_reverse)] diff --git a/src/hct_mis_api/apps/program/migrations/0027_migration.py b/src/hct_mis_api/apps/program/migrations/0027_migration.py deleted file mode 100644 index 360c2767ae..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0027_migration.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-25 14:21 - -from decimal import Decimal -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0026_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='total_delivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_entitled_quantity_revised', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - migrations.AlterField( - model_name='cashplan', - name='total_undelivered_quantity', - field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))]), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0028_migration.py b/src/hct_mis_api/apps/program/migrations/0028_migration.py deleted file mode 100644 index 64630c653c..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0028_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2021-08-30 09:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0027_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='cashplan', - name='ca_id', - field=models.CharField(db_index=True, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0029_migration.py b/src/hct_mis_api/apps/program/migrations/0029_migration.py deleted file mode 100644 index 73bd665133..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0029_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-27 12:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0004_migration'), - ('program', '0028_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='admin_areas_new', - field=models.ManyToManyField(blank=True, related_name='programs', to='geo.Area'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0030_migration.py b/src/hct_mis_api/apps/program/migrations/0030_migration.py deleted file mode 100644 index ff5587095e..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0030_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.26 on 2022-02-17 11:58 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0029_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='program', - name='frequency_of_payments', - field=models.CharField(choices=[('ONE_OFF', 'One-off'), ('REGULAR', 'Regular')], max_length=50), - ), - migrations.AlterField( - model_name='program', - name='status', - field=models.CharField(choices=[('ACTIVE', 'Active'), ('DRAFT', 'Draft'), ('FINISHED', 'Finished')], db_index=True, max_length=10), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0031_migration.py b/src/hct_mis_api/apps/program/migrations/0031_migration.py deleted file mode 100644 index 27577b8520..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0031_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.26 on 2022-02-17 12:34 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0030_migration'), - ('payment', '0030_migration_squashed_0051_migration'), - - ] - - operations = [ - migrations.RemoveField( - model_name='cashplan', - name='verification_status', - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0031_migration_squashed_0034_migration.py b/src/hct_mis_api/apps/program/migrations/0031_migration_squashed_0034_migration.py deleted file mode 100644 index d7fadccaaa..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0031_migration_squashed_0034_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:45 - -from django.db import migrations - - -class Migration(migrations.Migration): - - replaces = [('program', '0031_migration'), ('program', '0032_migration'), ('program', '0033_migration'), ('program', '0034_migration')] - - dependencies = [ - ('program', '0030_migration'), - ('payment', '0030_migration_squashed_0051_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='cashplan', - name='verification_status', - ), - migrations.AlterModelOptions( - name='cashplan', - options={'ordering': ['created_at'], 'verbose_name': 'Cash Plan'}, - ), - migrations.RemoveField( - model_name='program', - name='admin_areas', - ), - migrations.RenameField( - model_name='program', - old_name='admin_areas_new', - new_name='admin_areas', - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0032_migration.py b/src/hct_mis_api/apps/program/migrations/0032_migration.py deleted file mode 100644 index 6599ce9b1b..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0032_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.12 on 2022-04-28 10:28 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0031_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='cashplan', - options={'ordering': ['created_at'], 'verbose_name': 'Cash Plan'}, - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0033_migration.py b/src/hct_mis_api/apps/program/migrations/0033_migration.py deleted file mode 100644 index 28233fe0fe..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0033_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.13 on 2022-06-28 15:43 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0032_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='program', - name='admin_areas', - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0034_migration.py b/src/hct_mis_api/apps/program/migrations/0034_migration.py deleted file mode 100644 index db43248b63..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0034_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.13 on 2022-06-28 15:44 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0033_migration'), - ] - - operations = [ - migrations.RenameField( - model_name='program', - old_name='admin_areas_new', - new_name='admin_areas', - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0035_migration.py b/src/hct_mis_api/apps/program/migrations/0035_migration.py deleted file mode 100644 index 6fe2837a8f..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0035_migration.py +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by Django 3.2.13 on 2022-07-11 09:00 - -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [("program", "0034_migration"), ("targeting", "0007_migration_squashed_0028_migration"), - ("steficon", "0003_migration_squashed_0007_empty_rules")] - - operations = [ - migrations.SeparateDatabaseAndState( - state_operations=[], - database_operations=[migrations.AlterModelTable("CashPlan", "payment_cashplan")], - ) - ] diff --git a/src/hct_mis_api/apps/program/migrations/0035_migration_squashed_0036_migration.py b/src/hct_mis_api/apps/program/migrations/0035_migration_squashed_0036_migration.py deleted file mode 100644 index e06a14f2b1..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0035_migration_squashed_0036_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:37 - -from django.db import migrations - - -class Migration(migrations.Migration): - - replaces = [('program', '0035_migration'), ('program', '0036_migration')] - - dependencies = [ - ('program', '0034_migration'), - ('targeting', '0007_migration_squashed_0028_migration'), - ('payment', '0030_migration_squashed_0051_migration'), - ('steficon', '0003_migration_squashed_0007_empty_rules'), - ] - - operations = [ - migrations.SeparateDatabaseAndState( - database_operations=[ - migrations.AlterModelTable( - name='CashPlan', - table='payment_cashplan', - ), - ], - ), - migrations.SeparateDatabaseAndState( - state_operations=[ - migrations.DeleteModel( - name='CashPlan', - ), - ], - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0036_migration.py b/src/hct_mis_api/apps/program/migrations/0036_migration.py deleted file mode 100644 index 48c307da91..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0036_migration.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.13 on 2022-07-11 14:12 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("program", "0035_migration"), - ("payment", "0030_migration_squashed_0051_migration"), - ] - - operations = [ - migrations.SeparateDatabaseAndState( - state_operations=[ - migrations.DeleteModel( - name="CashPlan", - ), - ], - database_operations=[], - ) - ] diff --git a/src/hct_mis_api/apps/program/migrations/0037_migration.py b/src/hct_mis_api/apps/program/migrations/0037_migration.py deleted file mode 100644 index e132b43c76..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0037_migration.py +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-17 11:41 - -import concurrency.fields -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - -def populate_program_cycles(apps, schema_editor): - Program = apps.get_model("program", "Program") - ProgramCycle = apps.get_model("program", "ProgramCycle") - program_cycles = [] - for program in Program.objects.all(): - program_cycles.append( - ProgramCycle( - program=program, - start_date=program.start_date, - end_date=program.end_date, - status="ACTIVE", # ProgramCycle.ACTIVE - ) - ) - - ProgramCycle.objects.bulk_create(program_cycles) - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0036_migration'), - ('payment', '0078_migration_squashed_0096_migration'), - ] - - operations = [ - migrations.CreateModel( - name='ProgramCycle', - fields=[ - ('is_removed', models.BooleanField(default=False)), - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('last_sync_at', models.DateTimeField(blank=True, null=True)), - ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), - ('iteration', models.PositiveIntegerField(db_index=True, default=1, validators=[django.core.validators.MinValueValidator(1)])), - ('status', models.CharField(choices=[('ACTIVE', 'Active'), ('CLOSED', 'Closed')], db_index=True, max_length=10)), - ('start_date', models.DateField()), - ('end_date', models.DateField(blank=True, null=True)), - ('description', models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), - ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cycles', to='program.program')), - ], - options={ - 'verbose_name': 'ProgrammeCycles', - 'unique_together': {('iteration', 'program')}, - }, - ), - migrations.RunPython(populate_program_cycles, migrations.RunPython.noop) - ] diff --git a/src/hct_mis_api/apps/program/migrations/0037_migration_squashed_0038_migration.py b/src/hct_mis_api/apps/program/migrations/0037_migration_squashed_0038_migration.py deleted file mode 100644 index 1e499343b2..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0037_migration_squashed_0038_migration.py +++ /dev/null @@ -1,72 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 06:35 - -import concurrency.fields -import django.core.validators -from django.db import migrations, models -import model_utils.fields -import concurrency.fields -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -def populate_program_cycles(apps, schema_editor): - Program = apps.get_model("program", "Program") - ProgramCycle = apps.get_model("program", "ProgramCycle") - program_cycles = [] - for program in Program.objects.all(): - program_cycles.append( - ProgramCycle( - program=program, - start_date=program.start_date, - end_date=program.end_date, - status="ACTIVE", # ProgramCycle.ACTIVE - ) - ) - - ProgramCycle.objects.bulk_create(program_cycles) - - -class Migration(migrations.Migration): - - replaces = [('program', '0037_migration'), ('program', '0038_migration')] - - dependencies = [ - ('payment', '0078_migration_squashed_0096_migration'), - ('program', '0036_migration'), - ] - - operations = [ - migrations.CreateModel( - name='ProgramCycle', - fields=[ - ('is_removed', models.BooleanField(default=False)), - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('last_sync_at', models.DateTimeField(blank=True, null=True)), - ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), - ('iteration', models.PositiveIntegerField(db_index=True, default=1, validators=[django.core.validators.MinValueValidator(1)])), - ('status', models.CharField(choices=[('ACTIVE', 'Active'), ('CLOSED', 'Closed')], db_index=True, max_length=10)), - ('start_date', models.DateField()), - ('end_date', models.DateField(blank=True, null=True)), - ('description', models.CharField(blank=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255)])), - ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cycles', to='program.program')), - ], - options={ - 'verbose_name': 'ProgrammeCycles', - 'unique_together': {('iteration', 'program')}, - }, - ), - migrations.RunPython(populate_program_cycles, migrations.RunPython.noop), - migrations.AlterModelOptions( - name='programcycle', - options={'ordering': ['program', 'iteration'], 'verbose_name': 'ProgrammeCycle'}, - ), - migrations.AlterField( - model_name='program', - name='individual_data_needed', - field=models.BooleanField(default=False, help_text="\n This boolean decides whether the target population sync will send\n all individuals of a household that's part of the population or only\n the relevant ones (collectors etc.)"), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0038_migration.py b/src/hct_mis_api/apps/program/migrations/0038_migration.py deleted file mode 100644 index 5dc16dcec8..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0038_migration.py +++ /dev/null @@ -1,22 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-04 14:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0037_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='programcycle', - options={'ordering': ['program', 'iteration'], 'verbose_name': 'ProgrammeCycle'}, - ), - migrations.AlterField( - model_name='program', - name='individual_data_needed', - field=models.BooleanField(default=False, help_text="\n This boolean decides whether the target population sync will send\n all individuals of a household that's part of the population or only\n the relevant ones (collectors etc.)"), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0039_migration.py b/src/hct_mis_api/apps/program/migrations/0039_migration.py deleted file mode 100644 index 6000e9af71..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0039_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-18 11:23 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0070_migration'), - ('program', '0038_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='data_collecting_type', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='programs', to='core.datacollectingtype'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0040_migration.py b/src/hct_mis_api/apps/program/migrations/0040_migration.py deleted file mode 100644 index aff8c9b2d1..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0040_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.22 on 2023-10-25 14:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0039_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='is_visible', - field=models.BooleanField(default=True), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0040_migration_squashed_0044_migration.py b/src/hct_mis_api/apps/program/migrations/0040_migration_squashed_0044_migration.py deleted file mode 100644 index fec97868ad..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0040_migration_squashed_0044_migration.py +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by Django 3.2.24 on 2024-03-06 10:37 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - replaces = [('program', '0040_migration'), ('program', '0041_migration'), ('program', '0042_migration'), ('program', '0043_migration'), ('program', '0044_migration')] - - dependencies = [ - ('program', '0039_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='is_visible', - field=models.BooleanField(default=True), - ), - migrations.AlterUniqueTogether( - name='program', - unique_together=set(), - ), - migrations.AddConstraint( - model_name='program', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('name', 'business_area', 'is_removed'), name='unique_for_program_if_not_removed'), - ), - migrations.AlterField( - model_name='program', - name='scope', - field=models.CharField(blank=True, choices=[('FOR_PARTNERS', 'For partners'), ('UNICEF', 'Unicef')], max_length=50, null=True), - ), - migrations.AlterModelOptions( - name='program', - options={'permissions': [('enroll_beneficiaries', 'Can enroll beneficiaries')], 'verbose_name': 'Programme'}, - ), - migrations.AddField( - model_name='program', - name='household_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='program', - name='individual_count', - field=models.PositiveIntegerField(default=0), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0041_migration.py b/src/hct_mis_api/apps/program/migrations/0041_migration.py deleted file mode 100644 index 9db153a240..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0041_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-03 12:28 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0040_migration'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='program', - unique_together=set(), - ), - migrations.AddConstraint( - model_name='program', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('name', 'business_area', 'is_removed'), name='unique_for_program_if_not_removed'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0042_migration.py b/src/hct_mis_api/apps/program/migrations/0042_migration.py deleted file mode 100644 index ce6c85d379..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0042_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-27 19:24 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0041_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='program', - name='scope', - field=models.CharField(blank=True, choices=[('FOR_PARTNERS', 'For partners'), ('UNICEF', 'Unicef')], max_length=50, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0043_migration.py b/src/hct_mis_api/apps/program/migrations/0043_migration.py deleted file mode 100644 index ccb510ed7c..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0043_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-19 15:39 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0042_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='program', - options={'permissions': [('enroll_beneficiaries', 'Can enroll beneficiaries')], - 'verbose_name': 'Programme'}, - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0044_migration.py b/src/hct_mis_api/apps/program/migrations/0044_migration.py deleted file mode 100644 index 1dc7aca44e..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0044_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-11 15:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0043_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='household_count', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='program', - name='individual_count', - field=models.PositiveIntegerField(default=0), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0045_migration.py b/src/hct_mis_api/apps/program/migrations/0045_migration.py deleted file mode 100644 index ca45e30824..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0045_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-31 13:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('program', '0040_migration_squashed_0044_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='programme_code', - field=models.CharField(blank=True, max_length=4, null=True), - ), - migrations.AddConstraint( - model_name='program', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), - fields=('business_area', 'programme_code'), - name='unique_for_business_area_and_programme_code_if_not_removed'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0046_migration.py b/src/hct_mis_api/apps/program/migrations/0046_migration.py deleted file mode 100644 index b8db3e02b4..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0046_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.24 on 2024-03-11 20:42 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0045_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='program', - name='individual_data_needed', - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0047_migration.py b/src/hct_mis_api/apps/program/migrations/0047_migration.py deleted file mode 100644 index dd7c911162..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0047_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.25 on 2024-04-23 00:03 - -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0008_migration'), - ('account', '0067_migration'), - ('program', '0046_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='partner_access', - field=models.CharField(choices=[('ALL_PARTNERS_ACCESS', 'All partners access'), ('NONE_PARTNERS_ACCESS', 'None partners access'), ('SELECTED_PARTNERS_ACCESS', 'Selected partners access')], default='SELECTED_PARTNERS_ACCESS', max_length=50), - ), - migrations.CreateModel( - name='ProgramPartnerThrough', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('full_area_access', models.BooleanField(default=False)), - ('areas', models.ManyToManyField(blank=True, related_name='program_partner_through', to='geo.Area')), - ('partner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='program_partner_through', to='account.partner')), - ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='program_partner_through', to='program.program')), - ], - ), - migrations.AddField( - model_name='program', - name='partners', - field=models.ManyToManyField(related_name='programs', through='program.ProgramPartnerThrough', to='account.Partner'), - ), - migrations.AddConstraint( - model_name='programpartnerthrough', - constraint=models.UniqueConstraint(fields=('program', 'partner'), name='unique_program_partner'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0048_migration.py b/src/hct_mis_api/apps/program/migrations/0048_migration.py deleted file mode 100644 index 2b8d6294e5..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0048_migration.py +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-17 15:20 - -from django.db import migrations, models -from django.conf import settings -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('program', '0047_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='programcycle', - options={'ordering': ['start_date'], 'verbose_name': 'ProgrammeCycle'}, - ), - migrations.AddField( - model_name='programcycle', - name='title', - field=models.CharField(blank=True, default='Default Programme Cycle', max_length=255, null=True, verbose_name='Title'), - ), - migrations.AddField( - model_name='programcycle', - name='unicef_id', - field=models.CharField(blank=True, db_index=True, max_length=255, null=True), - ), - migrations.AddField( - model_name='programcycle', - name='created_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, - related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Created by'), - ), - migrations.AlterField( - model_name='programcycle', - name='status', - field=models.CharField(choices=[('DRAFT', 'Draft'), ('ACTIVE', 'Active'), ('FINISHED', 'Finished')], db_index=True, default='DRAFT', max_length=10), - ), - migrations.AlterUniqueTogether( - name='programcycle', - unique_together=set(), - ), - migrations.AddConstraint( - model_name='programcycle', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('title', 'program', 'is_removed'), name='program_cycle_name_unique_if_not_removed'), - ), - migrations.RemoveField( - model_name='programcycle', - name='description', - ), - migrations.RemoveField( - model_name='programcycle', - name='iteration', - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0049_migration.py b/src/hct_mis_api/apps/program/migrations/0049_migration.py deleted file mode 100644 index 0c8c9d1d45..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0049_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-16 11:25 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0048_migration'), - ] - - operations = [ - migrations.RunSQL( - sql=""" - CREATE OR REPLACE FUNCTION program_cycle_fill_unicef_id_per_business_area_seq() RETURNS trigger - LANGUAGE plpgsql - AS $$ - DECLARE - businessAreaID varchar; - businessAreaCode varchar; - BEGIN - SELECT INTO businessAreaID p.business_area_id FROM program_program p WHERE p.id = NEW.program_id; - SELECT INTO businessAreaCode ba.code FROM core_businessarea ba WHERE ba.id = businessAreaID::uuid; - NEW.unicef_id := format('PC-%s-%s-%s', trim(businessAreaCode), to_char(NEW.created_at, 'yy'), trim(replace(to_char(nextval('program_cycle_business_area_seq_' || translate(businessAreaID::text, '-','_')),'000000'),',','.'))); - RETURN NEW; - END; - $$; - """, - ), - migrations.RunSQL( - sql="CREATE TRIGGER program_cycle_fill_unicef_id_per_business_area_seq BEFORE INSERT ON program_programcycle FOR EACH ROW EXECUTE PROCEDURE program_cycle_fill_unicef_id_per_business_area_seq();", - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0050_migration.py b/src/hct_mis_api/apps/program/migrations/0050_migration.py deleted file mode 100644 index 3da6ffd244..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0050_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-16 10:26 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0083_migration'), - ('program', '0049_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='program', - name='data_collecting_type', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='programs', to='core.datacollectingtype'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0051_migration.py b/src/hct_mis_api/apps/program/migrations/0051_migration.py deleted file mode 100644 index 342acff281..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0051_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-20 16:20 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0050_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='programcycle', - name='last_sync_at', - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0052_migration.py b/src/hct_mis_api/apps/program/migrations/0052_migration.py deleted file mode 100644 index 54571eb8fc..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0052_migration.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-05 11:44 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0051_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='programcycle', - options={'ordering': ['start_date'], 'verbose_name': 'Programme Cycle'}, - ), - migrations.RemoveConstraint( - model_name='programcycle', - name='program_cycle_name_unique_if_not_removed', - ), - migrations.RemoveField( - model_name='programcycle', - name='is_removed', - ), - migrations.AlterField( - model_name='program', - name='end_date', - field=models.DateField(blank=True, db_index=True, null=True), - ), - migrations.AddConstraint( - model_name='programcycle', - constraint=models.UniqueConstraint(fields=('title', 'program'), name='program_cycle_title_unique_per_program'), - ), - ] diff --git a/src/hct_mis_api/apps/program/migrations/0053_migration.py b/src/hct_mis_api/apps/program/migrations/0053_migration.py deleted file mode 100644 index a4c025c7bd..0000000000 --- a/src/hct_mis_api/apps/program/migrations/0053_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-10 07:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0052_migration'), - ] - - operations = [ - migrations.AddField( - model_name='program', - name='biometric_deduplication_enabled', - field=models.BooleanField(default=False, help_text='Enable Deduplication of Face Images'), - ), - migrations.AddField( - model_name='program', - name='deduplication_set_id', - field=models.UUIDField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0001_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0001_migration.py index 8f54cb4bee..d206bc69fb 100644 --- a/src/hct_mis_api/apps/registration_data/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/registration_data/migrations/0001_migration.py @@ -1,8 +1,13 @@ -# Generated by Django 2.2.8 on 2020-04-29 08:18 +# Generated by Django 3.2.25 on 2024-11-07 12:18 +import concurrency.fields from django.conf import settings +import django.contrib.postgres.fields.citext +import django.core.validators from django.db import migrations, models import django.db.models.deletion +import django.db.models.expressions +import hct_mis_api.apps.utils.models import model_utils.fields import uuid @@ -12,29 +17,136 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('core', '0001_migration'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('household', '0001_migration'), + ('core', '0002_migration'), + ('program', '0001_migration'), ] operations = [ migrations.CreateModel( - name='RegistrationDataImport', + name='ImportData', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=255, unique=True)), - ('status', models.CharField(choices=[('IN_REVIEW', 'In Review'), ('APPROVED', 'Approved'), ('MERGED', 'Merged'), ('MERGING', 'Merging')], default='IN_REVIEW', max_length=255)), - ('import_date', models.DateTimeField(auto_now_add=True)), - ('data_source', models.CharField(choices=[('XLS', 'Excel'), ('3RD_PARTY', '3rd party'), ('XML', 'XML'), ('OTHER', 'Other')], max_length=255)), - ('number_of_individuals', models.PositiveIntegerField()), - ('number_of_households', models.PositiveIntegerField()), - ('datahub_id', models.UUIDField(default=None, null=True)), - ('business_area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.BusinessArea')), - ('imported_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_imports', to=settings.AUTH_USER_MODEL)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('status', models.CharField(choices=[('PENDING', 'Pending'), ('RUNNING', 'Running'), ('FINISHED', 'Finished'), ('ERROR', 'Error'), ('VALIDATION_ERROR', 'Validation Error'), ('DELIVERY_MECHANISMS_VALIDATION_ERROR', 'Delivery Mechanisms Validation Error')], default='FINISHED', max_length=40)), + ('business_area_slug', models.CharField(blank=True, max_length=200)), + ('file', models.FileField(null=True, upload_to='')), + ('data_type', models.CharField(choices=[('XLSX', 'XLSX File'), ('JSON', 'JSON File'), ('FLEX', 'Flex Registration')], default='XLSX', max_length=4)), + ('number_of_households', models.PositiveIntegerField(null=True)), + ('number_of_individuals', models.PositiveIntegerField(null=True)), + ('error', models.TextField(blank=True)), + ('validation_errors', models.TextField(blank=True)), + ('delivery_mechanisms_validation_errors', models.TextField(blank=True)), + ('created_by_id', models.UUIDField(null=True)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='KoboImportData', + fields=[ + ('importdata_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registration_data.importdata')), + ('kobo_asset_id', models.CharField(max_length=100)), + ('only_active_submissions', models.BooleanField(default=True)), + ('pull_pictures', models.BooleanField(default=True)), ], options={ 'abstract': False, }, + bases=('registration_data.importdata',), + ), + migrations.CreateModel( + name='RegistrationDataImportDatahub', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('name', models.CharField(blank=True, max_length=255)), + ('import_date', models.DateTimeField(auto_now_add=True)), + ('hct_id', models.UUIDField(db_index=True, null=True)), + ('import_done', models.CharField(choices=[('LOADING', 'Loading'), ('NOT_STARTED', 'Not Started'), ('STARTED', 'Started'), ('DONE', 'Done')], default='NOT_STARTED', max_length=15)), + ('business_area_slug', models.CharField(blank=True, max_length=250)), + ('import_data', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_import', to='registration_data.importdata')), + ], + options={ + 'ordering': ('name',), + 'permissions': (['api_upload', 'Can upload'],), + }, + ), + migrations.CreateModel( + name='RegistrationDataImport', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('name', django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, unique=True, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()])), + ('status', models.CharField(choices=[('LOADING', 'Loading'), ('DEDUPLICATION', 'Deduplication'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('IMPORT_SCHEDULED', 'Import Scheduled'), ('IMPORTING', 'Importing'), ('IMPORT_ERROR', 'Import Error'), ('IN_REVIEW', 'In Review'), ('MERGE_SCHEDULED', 'Merge Scheduled'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('MERGE_ERROR', 'Merge Error'), ('REFUSED', 'Refused import')], db_index=True, default='IN_REVIEW', max_length=255)), + ('import_date', models.DateTimeField(auto_now_add=True, db_index=True)), + ('data_source', models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API'), ('EDOPOMOGA', 'eDopomoga'), ('PROGRAM_POPULATION', 'Programme Population'), ('ENROLL_FROM_PROGRAM', 'Enroll From Programme')], max_length=255)), + ('number_of_individuals', models.PositiveIntegerField(db_index=True)), + ('number_of_households', models.PositiveIntegerField(db_index=True)), + ('batch_duplicates', models.PositiveIntegerField(default=0)), + ('batch_possible_duplicates', models.PositiveIntegerField(default=0)), + ('batch_unique', models.PositiveIntegerField(default=0)), + ('golden_record_duplicates', models.PositiveIntegerField(default=0)), + ('golden_record_possible_duplicates', models.PositiveIntegerField(default=0)), + ('golden_record_unique', models.PositiveIntegerField(default=0)), + ('dedup_engine_batch_duplicates', models.PositiveIntegerField(default=0)), + ('dedup_engine_golden_record_duplicates', models.PositiveIntegerField(default=0)), + ('datahub_id', models.UUIDField(blank=True, db_index=True, default=None, null=True)), + ('error_message', models.TextField(blank=True)), + ('sentry_id', models.CharField(blank=True, default='', max_length=100, null=True)), + ('pull_pictures', models.BooleanField(default=True)), + ('screen_beneficiary', models.BooleanField(default=False)), + ('excluded', models.BooleanField(default=False, help_text='Exclude RDI in UI')), + ('erased', models.BooleanField(default=False, help_text='Abort RDI')), + ('refuse_reason', models.CharField(blank=True, max_length=100, null=True)), + ('allow_delivery_mechanisms_validation_errors', models.BooleanField(default=False)), + ('deduplication_engine_status', models.CharField(blank=True, choices=[('PENDING', 'Pending'), ('UPLOADED', 'Uploaded'), ('IN_PROGRESS', 'Started'), ('PROCESSING', 'Processing'), ('FINISHED', 'Finished'), ('ERROR', 'Error'), ('UPLOAD_ERROR', 'Upload Error')], default=None, max_length=255, null=True)), + ('business_area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ('import_data', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_import_hope', to='registration_data.importdata')), + ('imported_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_imports', to=settings.AUTH_USER_MODEL)), + ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='registration_imports', to='program.program')), + ], + options={ + 'verbose_name': 'Registration data import', + 'unique_together': {('name', 'business_area')}, + }, + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), + migrations.CreateModel( + name='KoboImportedSubmission', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, null=True)), + ('kobo_submission_uuid', models.UUIDField()), + ('kobo_asset_id', models.CharField(max_length=150)), + ('kobo_submission_time', models.DateTimeField()), + ('amended', models.BooleanField(blank=True, default=False)), + ('imported_household', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='household.household')), + ('registration_data_import', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='registration_data.registrationdataimport')), + ], + ), + migrations.CreateModel( + name='DeduplicationEngineSimilarityPair', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('similarity_score', models.DecimalField(decimal_places=2, max_digits=5)), + ('individual1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='biometric_duplicates_1', to='household.individual')), + ('individual2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='biometric_duplicates_2', to='household.individual')), + ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deduplication_engine_similarity_pairs', to='program.program')), + ], + ), + migrations.AddConstraint( + model_name='deduplicationenginesimilaritypair', + constraint=models.CheckConstraint(check=models.Q(('individual1__lt', django.db.models.expressions.F('individual2'))), name='individual1_lt_individual2'), + ), + migrations.AlterUniqueTogether( + name='deduplicationenginesimilaritypair', + unique_together={('individual1', 'individual2')}, ), ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0002_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0002_migration.py deleted file mode 100644 index 1bb63c8068..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0002_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-05-06 17:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0001_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('APPROVED', 'Approved'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing')], default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0002_migration_squashed_0018_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0002_migration_squashed_0018_migration.py deleted file mode 100644 index 21451e49a3..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0002_migration_squashed_0018_migration.py +++ /dev/null @@ -1,156 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:43 - -import concurrency.fields -import django.contrib.postgres.fields.citext -import django.core.validators -from django.db import migrations, models -from django.db.models import Q - - -def converts_data_source(apps, schema_editor): - # We get the model from the versioned app registry; - # if we directly import it, it'll be the wrong version - RegistrationDataImport = apps.get_model( - "registration_data", "RegistrationDataImport" - ) - RegistrationDataImport.objects.filter(~Q(data_source="XLS")).update( - data_source="KOBO" - ) - - -class Migration(migrations.Migration): - - replaces = [('registration_data', '0002_migration'), ('registration_data', '0003_migration'), ('registration_data', '0004_migration'), ('registration_data', '0005_migration'), ('registration_data', '0006_migration'), ('registration_data', '0007_migration'), ('registration_data', '0008_migration'), ('registration_data', '0009_migration'), ('registration_data', '0010_migration'), ('registration_data', '0011_migration'), ('registration_data', '0012_migration'), ('registration_data', '0013_migration'), ('registration_data', '0014_migration'), ('registration_data', '0015_migration'), ('registration_data', '0016_migration'), ('registration_data', '0017_migration'), ('registration_data', '0018_migration')] - - dependencies = [ - ('registration_data', '0001_migration'), - ('core', '0002_migration_squashed_0006_migration'), - ('steficon', '0002_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('APPROVED', 'Approved'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing')], default='IN_REVIEW', max_length=255), - ), - migrations.AlterUniqueTogether( - name='registrationdataimport', - unique_together={('name', 'business_area')}, - ), - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo')], max_length=255), - ), - migrations.RunPython(converts_data_source), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing')], default='IN_REVIEW', max_length=255), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed')], default='IN_REVIEW', max_length=255), - ), - migrations.AddField( - model_name='registrationdataimport', - name='error_message', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication')], default='IN_REVIEW', max_length=255), - ), - migrations.AddField( - model_name='registrationdataimport', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AlterModelOptions( - name='registrationdataimport', - options={'verbose_name': 'Registration data import'}, - ), - migrations.AlterField( - model_name='registrationdataimport', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='datahub_id', - field=models.UUIDField(db_index=True, default=None, null=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='import_date', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, unique=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='number_of_households', - field=models.PositiveIntegerField(db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='number_of_individuals', - field=models.PositiveIntegerField(db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication')], db_index=True, default='IN_REVIEW', max_length=255), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='datahub_id', - field=models.UUIDField(blank=True, db_index=True, default=None, null=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, unique=True, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication'), ('IMPORT_ERROR', 'Import Error'), ('MERGE_ERROR', 'Merge Error')], db_index=True, default='IN_REVIEW', max_length=255), - ), - migrations.AddField( - model_name='registrationdataimport', - name='pull_pictures', - field=models.BooleanField(default=True), - ), - migrations.AddField( - model_name='registrationdataimport', - name='sentry_id', - field=models.CharField(blank=True, default='', max_length=100, null=True), - ), - migrations.AddField( - model_name='registrationdataimport', - name='screen_beneficiary', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication'), ('REFUSE', 'Refuse import'), ('IMPORT_ERROR', 'Import Error'), ('MERGE_ERROR', 'Merge Error')], db_index=True, default='IN_REVIEW', max_length=255), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication'), ('REFUSED', 'Refused import'), ('IMPORT_ERROR', 'Import Error'), ('MERGE_ERROR', 'Merge Error')], db_index=True, default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0003_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0003_migration.py deleted file mode 100644 index a1dcc7873f..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0003_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-05-11 11:30 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0002_migration_squashed_0006_migration'), - ('registration_data', '0002_migration'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='registrationdataimport', - unique_together={('name', 'business_area')}, - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0004_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0004_migration.py deleted file mode 100644 index 6789d30d08..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0004_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-06-23 12:01 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0003_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0005_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0005_migration.py deleted file mode 100644 index 305d5dc633..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0005_migration.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.8 on 2020-06-23 12:02 - -from django.db import migrations -from django.db.models import Q - - -def converts_data_source(apps, schema_editor): - # We get the model from the versioned app registry; - # if we directly import it, it'll be the wrong version - RegistrationDataImport = apps.get_model( - "registration_data", "RegistrationDataImport" - ) - RegistrationDataImport.objects.filter(~Q(data_source="XLS")).update( - data_source="KOBO" - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("registration_data", "0004_migration"), - ] - - operations = [migrations.RunPython(converts_data_source)] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0006_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0006_migration.py deleted file mode 100644 index b48eb36bbe..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0006_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-07-06 11:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0005_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing')], default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0007_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0007_migration.py deleted file mode 100644 index dd648666ed..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0007_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-08-25 11:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0006_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed')], default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0008_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0008_migration.py deleted file mode 100644 index 19cbcc1539..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0008_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.8 on 2020-08-26 13:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0007_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='error_message', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication')], default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0009_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0009_migration.py deleted file mode 100644 index d2e2b9fbc9..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0009_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.16 on 2021-01-08 15:52 - -import concurrency.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0008_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0010_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0010_migration.py deleted file mode 100644 index debbf77505..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0010_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 2.2.16 on 2021-01-21 13:39 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0009_migration'), - ] - - operations = [ - migrations.AlterModelOptions( - name='registrationdataimport', - options={'verbose_name': 'Registration data import'}, - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0011_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0011_migration.py deleted file mode 100644 index 52cec1a814..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0011_migration.py +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-16 13:11 - -import django.contrib.postgres.fields.citext -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0010_migration'), - ('steficon', '0002_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='datahub_id', - field=models.UUIDField(db_index=True, default=None, null=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='import_date', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, unique=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='number_of_households', - field=models.PositiveIntegerField(db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='number_of_individuals', - field=models.PositiveIntegerField(db_index=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication')], db_index=True, default='IN_REVIEW', max_length=255), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0012_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0012_migration.py deleted file mode 100644 index c994e70443..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0012_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-18 07:15 - -import django.contrib.postgres.fields.citext -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0011_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='datahub_id', - field=models.UUIDField(blank=True, db_index=True, default=None, null=True), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, unique=True, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0013_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0013_migration.py deleted file mode 100644 index e9bc93f6fd..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0013_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2021-04-21 12:19 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0012_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication'), ('IMPORT_ERROR', 'Import Error'), ('MERGE_ERROR', 'Merge Error')], db_index=True, default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0014_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0014_migration.py deleted file mode 100644 index 590d28ea04..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0014_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2021-04-29 08:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0013_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='pull_pictures', - field=models.BooleanField(default=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0015_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0015_migration.py deleted file mode 100644 index 710625155e..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0015_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2021-07-09 15:36 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0014_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='sentry_id', - field=models.CharField(blank=True, default='', max_length=100, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0016_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0016_migration.py deleted file mode 100644 index 0c81daef2b..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0016_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-01 14:05 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0015_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='screen_beneficiary', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0017_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0017_migration.py deleted file mode 100644 index a0b78adc0f..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0017_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-17 10:03 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0016_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication'), ('REFUSE', 'Refuse import'), ('IMPORT_ERROR', 'Import Error'), ('MERGE_ERROR', 'Merge Error')], db_index=True, default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0018_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0018_migration.py deleted file mode 100644 index c1e44e1ad1..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0018_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-17 11:38 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0017_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('IMPORTING', 'Importing'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('DEDUPLICATION', 'Deduplication'), ('REFUSED', 'Refused import'), ('IMPORT_ERROR', 'Import Error'), ('MERGE_ERROR', 'Merge Error')], db_index=True, default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0019_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0019_migration.py deleted file mode 100644 index f634a02acf..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0019_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.12 on 2022-03-17 17:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0018_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('DEDUPLICATION', 'Deduplication'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('IMPORTING', 'Importing'), ('IMPORT_ERROR', 'Import Error'), ('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('MERGE_ERROR', 'Merge Error'), ('REFUSED', 'Refused import')], db_index=True, default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0019_migration_squashed_0022_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0019_migration_squashed_0022_migration.py deleted file mode 100644 index 5895305626..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0019_migration_squashed_0022_migration.py +++ /dev/null @@ -1,38 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 05:37 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - replaces = [('registration_data', '0019_migration'), ('registration_data', '0020_migration'), ('registration_data', '0021_migration'), ('registration_data', '0022_migration')] - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('registration_data', '0018_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('DEDUPLICATION', 'Deduplication'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('IMPORTING', 'Importing'), ('IMPORT_ERROR', 'Import Error'), ('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('MERGE_ERROR', 'Merge Error'), ('REFUSED', 'Refused import')], db_index=True, default='IN_REVIEW', max_length=255), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('FLEX_REGISTRATION', 'Flex Registration')], max_length=255), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='imported_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_imports', to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('DIIA', 'DIIA'), ('FLEX_REGISTRATION', 'Flex Registration')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0020_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0020_migration.py deleted file mode 100644 index 96c794e6c4..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0020_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.12 on 2022-04-06 13:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0019_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('FLEX_REGISTRATION', 'Flex Registration')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0021_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0021_migration.py deleted file mode 100644 index 0da5753e85..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0021_migration.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 3.2.12 on 2022-05-17 10:26 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('registration_data', '0020_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='imported_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_imports', to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0022_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0022_migration.py deleted file mode 100644 index 2607444d9e..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0022_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.12 on 2022-05-19 16:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0021_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('DIIA', 'DIIA'), ('FLEX_REGISTRATION', 'Flex Registration')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0023_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0023_migration.py deleted file mode 100644 index 662b479aad..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0023_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.15 on 2022-09-21 21:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0022_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('DIIA', 'DIIA'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API')], max_length=255), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('LOADING', 'Loading'), ('DEDUPLICATION', 'Deduplication'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('IMPORTING', 'Importing'), ('IMPORT_ERROR', 'Import Error'), ('IN_REVIEW', 'In Review'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('MERGE_ERROR', 'Merge Error'), ('REFUSED', 'Refused import')], db_index=True, default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0024_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0024_migration.py deleted file mode 100644 index 41db54ca29..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0024_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2023-01-12 18:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0023_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('DIIA', 'DIIA'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API'), ('EDOPOMOGA', 'eDopomoga')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0024_migration_squashed_0032_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0024_migration_squashed_0032_migration.py deleted file mode 100644 index 08ab1a61a0..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0024_migration_squashed_0032_migration.py +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 04:42 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - replaces = [('registration_data', '0024_migration'), ('registration_data', '0025_migration'), ('registration_data', '0026_migration'), ('registration_data', '0027_migration'), ('registration_data', '0028_migration'), ('registration_data', '0029_migration'), ('registration_data', '0030_migration'), ('registration_data', '0031_migration'), ('registration_data', '0032_migration')] - - dependencies = [ - ('program', '0038_migration'), - ('registration_data', '0023_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('DIIA', 'DIIA'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API'), ('EDOPOMOGA', 'eDopomoga')], max_length=255), - ), - migrations.AddField( - model_name='registrationdataimport', - name='excluded', - field=models.BooleanField(default=False, help_text='Exclude RDI in UI'), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('LOADING', 'Loading'), ('DEDUPLICATION', 'Deduplication'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('IMPORT_SCHEDULED', 'Import Scheduled'), ('IMPORTING', 'Importing'), ('IMPORT_ERROR', 'Import Error'), ('IN_REVIEW', 'In Review'), ('MERGE_SCHEDULED', 'Merge Scheduled'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('MERGE_ERROR', 'Merge Error'), ('REFUSED', 'Refused import')], db_index=True, default='IN_REVIEW', max_length=255), - ), - migrations.AddField( - model_name='registrationdataimport', - name='erased', - field=models.BooleanField(default=False, help_text='Abort RDI'), - ), - migrations.AddField( - model_name='registrationdataimport', - name='refuse_reason', - field=models.CharField(blank=True, max_length=100, null=True), - ), - migrations.AddField( - model_name='registrationdataimport', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='registration_imports', to='program.program'), - ), - migrations.AddField( - model_name='registrationdataimport', - name='batch_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='batch_possible_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='batch_unique', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='golden_record_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='golden_record_possible_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='golden_record_unique', - field=models.PositiveIntegerField(default=0), - ), - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API'), ('EDOPOMOGA', 'eDopomoga')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0026_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0026_migration.py deleted file mode 100644 index 0628c2a574..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0026_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-03-22 13:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0025_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='status', - field=models.CharField(choices=[('LOADING', 'Loading'), ('DEDUPLICATION', 'Deduplication'), ('DEDUPLICATION_FAILED', 'Deduplication Failed'), ('IMPORT_SCHEDULED', 'Import Scheduled'), ('IMPORTING', 'Importing'), ('IMPORT_ERROR', 'Import Error'), ('IN_REVIEW', 'In Review'), ('MERGE_SCHEDULED', 'Merge Scheduled'), ('MERGED', 'Merged'), ('MERGING', 'Merging'), ('MERGE_ERROR', 'Merge Error'), ('REFUSED', 'Refused import')], db_index=True, default='IN_REVIEW', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0027_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0027_migration.py deleted file mode 100644 index af1c75e8f7..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0027_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.19 on 2023-07-16 18:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0026_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='erased', - field=models.BooleanField(default=False, help_text='Abort RDI'), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0028_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0028_migration.py deleted file mode 100644 index 8f5dffb668..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0028_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.19 on 2023-07-16 23:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0027_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='refuse_reason', - field=models.CharField(blank=True, max_length=100, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0029_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0029_migration.py deleted file mode 100644 index d1f3c2009a..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0029_migration.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-04 16:08 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0038_migration'), - ('registration_data', '0028_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='program', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='registration_imports', to='program.program'), - ), - migrations.AddField( - model_name='registrationdataimport', - name='programs', - field=models.ManyToManyField(related_name='registration_data_imports', to='program.Program'), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0030_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0030_migration.py deleted file mode 100644 index c041f762e5..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0030_migration.py +++ /dev/null @@ -1,43 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-06 11:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0029_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='batch_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='batch_possible_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='batch_unique', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='golden_record_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='golden_record_possible_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='golden_record_unique', - field=models.PositiveIntegerField(default=0), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0031_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0031_migration.py deleted file mode 100644 index 6ff1a3bd18..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0031_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.22 on 2023-11-02 22:34 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0030_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='registrationdataimport', - name='programs', - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0032_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0032_migration.py deleted file mode 100644 index 5cd9e4e78b..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0032_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-11 09:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0031_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API'), ('EDOPOMOGA', 'eDopomoga')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0033_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0033_migration.py deleted file mode 100644 index 3d40261db1..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0033_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-26 20:30 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0024_migration_squashed_0032_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API'), ('EDOPOMOGA', 'eDopomoga'), ('PROGRAM_POPULATION', 'Program Population')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0034_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0034_migration.py deleted file mode 100644 index d435b7b9bb..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0034_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-11 09:53 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0033_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='allow_delivery_mechanisms_validation_errors', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0035_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0035_migration.py deleted file mode 100644 index 77a617fde6..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0035_migration.py +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-26 18:38 - -import django.contrib.gis.db.models.fields -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion -import django_countries.fields -import model_utils.fields -import multiselectfield.db.fields -import phonenumber_field.modelfields -import sorl.thumbnail.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0176_migration'), - ('registration_data', '0034_migration'), - ] - - operations = [ - migrations.CreateModel( - name='ImportData', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('status', models.CharField(choices=[('PENDING', 'Pending'), ('RUNNING', 'Running'), ('FINISHED', 'Finished'), ('ERROR', 'Error'), ('VALIDATION_ERROR', 'Validation Error')], default='FINISHED', max_length=20)), - ('business_area_slug', models.CharField(blank=True, max_length=200)), - ('file', models.FileField(null=True, upload_to='')), - ('data_type', models.CharField(choices=[('XLSX', 'XLSX File'), ('JSON', 'JSON File'), ('FLEX', 'Flex Registration')], default='XLSX', max_length=4)), - ('number_of_households', models.PositiveIntegerField(null=True)), - ('number_of_individuals', models.PositiveIntegerField(null=True)), - ('error', models.TextField(blank=True)), - ('validation_errors', models.TextField(blank=True)), - ('created_by_id', models.UUIDField(null=True)), - ], - options={ - 'abstract': False, - }, - ), - migrations.CreateModel( - name='KoboImportData', - fields=[ - ('importdata_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registration_data.importdata')), - ('kobo_asset_id', models.CharField(max_length=100)), - ('only_active_submissions', models.BooleanField(default=True)), - ], - options={ - 'abstract': False, - }, - bases=('registration_data.importdata',), - ), - migrations.CreateModel( - name='RegistrationDataImportDatahub', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('name', models.CharField(blank=True, max_length=255)), - ('import_date', models.DateTimeField(auto_now_add=True)), - ('hct_id', models.UUIDField(db_index=True, null=True)), - ('import_done', models.CharField(choices=[('LOADING', 'Loading'), ('NOT_STARTED', 'Not Started'), ('STARTED', 'Started'), ('DONE', 'Done')], default='NOT_STARTED', max_length=15)), - ('business_area_slug', models.CharField(blank=True, max_length=250)), - ('import_data', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_import', to='registration_data.importdata')), - ], - options={ - 'ordering': ('name',), - 'permissions': (['api_upload', 'Can upload'],), - }, - ), - migrations.CreateModel( - name='KoboImportedSubmission', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, null=True)), - ('kobo_submission_uuid', models.UUIDField()), - ('kobo_asset_id', models.CharField(max_length=150)), - ('kobo_submission_time', models.DateTimeField()), - ('amended', models.BooleanField(blank=True, default=False)), - ('imported_household', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='household.household')), - ('registration_data_import', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='registration_data.registrationdataimportdatahub')), - ], - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0036_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0036_migration.py deleted file mode 100644 index 3ca264dedc..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0036_migration.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 3.2.25 on 2024-05-26 20:45 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('household', '0177_migration'), - ('registration_data', '0035_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='koboimportedsubmission', - name='imported_household', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='household.household'), - ), - migrations.AddField( - model_name='importdata', - name='delivery_mechanisms_validation_errors', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='importdata', - name='status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('RUNNING', 'Running'), ('FINISHED', 'Finished'), ('ERROR', 'Error'), ('VALIDATION_ERROR', 'Validation Error'), ('DELIVERY_MECHANISMS_VALIDATION_ERROR', 'Delivery Mechanisms Validation Error')], default='FINISHED', max_length=40), - ), - migrations.AddField( - model_name='registrationdataimport', - name='import_data', - field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='registration_data_import_hope', to='registration_data.importdata'), - ), - migrations.AlterField( - model_name='koboimportedsubmission', - name='registration_data_import', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='registration_data.registrationdataimport'), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0037_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0037_migration.py deleted file mode 100644 index bace1ab8c7..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0037_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-22 10:01 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0036_migration'), - ] - - operations = [ - migrations.AddField( - model_name='koboimportdata', - name='pull_pictures', - field=models.BooleanField(default=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0038_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0038_migration.py deleted file mode 100644 index 202953cdb1..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0038_migration.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-13 07:06 - -from django.db import migrations, models -import django.db.models.deletion -import django.db.models.expressions - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0049_migration'), - ('household', '0184_migration'), - ('registration_data', '0037_migration'), - ] - - operations = [ - migrations.AddField( - model_name='registrationdataimport', - name='deduplication_engine_status', - field=models.CharField(blank=True, choices=[('PENDING', 'Pending'), ('UPLOADED', 'Uploaded'), ('IN_PROGRESS', 'In Progress'), ('FINISHED', 'Finished'), ('ERROR', 'Error'), ('UPLOAD_ERROR', 'Upload Error')], default=None, max_length=255, null=True), - ), - migrations.CreateModel( - name='DeduplicationEngineSimilarityPair', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('similarity_score', models.DecimalField(decimal_places=2, max_digits=5)), - ('individual1', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='biometric_duplicates_1', to='household.individual')), - ('individual2', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='biometric_duplicates_2', to='household.individual')), - ('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deduplication_engine_similarity_pairs', to='program.program')), - ], - ), - migrations.AddConstraint( - model_name='deduplicationenginesimilaritypair', - constraint=models.CheckConstraint(check=models.Q(('individual1__lt', django.db.models.expressions.F('individual2'))), name='individual1_lt_individual2'), - ), - migrations.AlterUniqueTogether( - name='deduplicationenginesimilaritypair', - unique_together={('individual1', 'individual2')}, - ), - migrations.AddField( - model_name='registrationdataimport', - name='dedup_engine_batch_duplicates', - field=models.PositiveIntegerField(default=0), - ), - migrations.AddField( - model_name='registrationdataimport', - name='dedup_engine_golden_record_duplicates', - field=models.PositiveIntegerField(default=0), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0039_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0039_migration.py deleted file mode 100644 index c0751e8799..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0039_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-26 13:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0038_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='data_source', - field=models.CharField(choices=[('XLS', 'Excel'), ('KOBO', 'KoBo'), ('FLEX_REGISTRATION', 'Flex Registration'), ('API', 'Flex API'), ('EDOPOMOGA', 'eDopomoga'), ('PROGRAM_POPULATION', 'Programme Population'), ('ENROLL_FROM_PROGRAM', 'Enroll From Programme')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_data/migrations/0040_migration.py b/src/hct_mis_api/apps/registration_data/migrations/0040_migration.py deleted file mode 100644 index b71ff3f288..0000000000 --- a/src/hct_mis_api/apps/registration_data/migrations/0040_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-02 13:50 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_data', '0039_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='registrationdataimport', - name='deduplication_engine_status', - field=models.CharField(blank=True, choices=[('PENDING', 'Pending'), ('UPLOADED', 'Uploaded'), ('IN_PROGRESS', 'Started'), ('PROCESSING', 'Processing'), ('FINISHED', 'Finished'), ('ERROR', 'Error'), ('UPLOAD_ERROR', 'Upload Error')], default=None, max_length=255, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0001_migration_squashed_0088_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0001_migration_squashed_0088_migration.py deleted file mode 100644 index 4f88057836..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0001_migration_squashed_0088_migration.py +++ /dev/null @@ -1,2888 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-08 20:07 - -import datetime -import django.contrib.gis.db.models.fields -import django.contrib.postgres.fields.jsonb -import django.core.validators -from django.db import migrations, models, transaction -import django.db.migrations.operations.special -import django.db.models.deletion -import django_countries.fields -import model_utils.fields -import multiselectfield.db.fields -import phonenumber_field.modelfields -import sorl.thumbnail.fields -import uuid - -from django.db.models import F -from django.db.models.functions import Concat - -from hct_mis_api.apps.core.field_attributes.fields_types import TYPE_DECIMAL -from hct_mis_api.apps.core.utils import fix_flex_type_fields, serialize_flex_attributes -from hct_mis_api.apps.household.models import IDENTIFICATION_TYPE_CHOICE -from hct_mis_api.apps.utils.phone import calculate_phone_numbers_validity - - -class Migration(migrations.Migration): - dependencies = [] - - operations = [ - migrations.CreateModel( - name="Agency", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("type", models.CharField(max_length=100)), - ("label", models.CharField(max_length=100)), - ], - ), - migrations.CreateModel( - name="ImportData", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("xlsx_file", models.FileField(upload_to="")), - ("number_of_households", models.PositiveIntegerField()), - ("number_of_individuals", models.PositiveIntegerField()), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="ImportedDocumentType", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ( - "country", - django_countries.fields.CountryField(blank=True, max_length=2), - ), - ("label", models.CharField(max_length=100)), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="ImportedHousehold", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ( - "consent", - sorl.thumbnail.fields.ImageField( - upload_to="", - validators=[ - django.core.validators.validate_image_file_extension - ], - ), - ), - ( - "residence_status", - models.CharField( - choices=[ - ("REFUGEE", "Refugee"), - ("MIGRANT", "Migrant"), - ("CITIZEN", "Citizen"), - ("IDP", "IDP"), - ("OTHER", "Other"), - ], - max_length=255, - ), - ), - ("country_origin", django_countries.fields.CountryField(max_length=2)), - ("size", models.PositiveIntegerField()), - ("address", models.CharField(blank=True, max_length=255)), - ( - "country", - django_countries.fields.CountryField(blank=True, max_length=2), - ), - ("admin1", models.CharField(blank=True, max_length=255)), - ("admin2", models.CharField(blank=True, max_length=255)), - ( - "geopoint", - django.contrib.gis.db.models.fields.PointField( - blank=True, null=True, srid=4326 - ), - ), - ("female_age_group_0_5_count", models.PositiveIntegerField(default=0)), - ("female_age_group_6_11_count", models.PositiveIntegerField(default=0)), - ( - "female_age_group_12_17_count", - models.PositiveIntegerField(default=0), - ), - ("female_adults_count", models.PositiveIntegerField(default=0)), - ("pregnant_count", models.PositiveIntegerField(default=0)), - ("male_age_group_0_5_count", models.PositiveIntegerField(default=0)), - ("male_age_group_6_11_count", models.PositiveIntegerField(default=0)), - ("male_age_group_12_17_count", models.PositiveIntegerField(default=0)), - ("male_adults_count", models.PositiveIntegerField(default=0)), - ( - "female_age_group_0_5_disabled_count", - models.PositiveIntegerField(default=0), - ), - ( - "female_age_group_6_11_disabled_count", - models.PositiveIntegerField(default=0), - ), - ( - "female_age_group_12_17_disabled_count", - models.PositiveIntegerField(default=0), - ), - ( - "female_adults_disabled_count", - models.PositiveIntegerField(default=0), - ), - ( - "male_age_group_0_5_disabled_count", - models.PositiveIntegerField(default=0), - ), - ( - "male_age_group_6_11_disabled_count", - models.PositiveIntegerField(default=0), - ), - ( - "male_age_group_12_17_disabled_count", - models.PositiveIntegerField(default=0), - ), - ("male_adults_disabled_count", models.PositiveIntegerField(default=0)), - ("registration_date", models.DateField(null=True)), - ("returnee", models.BooleanField(default=False, null=True)), - ( - "flex_fields", - django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="ImportedIndividual", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("individual_id", models.CharField(blank=True, max_length=255)), - ("photo", models.ImageField(blank=True, upload_to="")), - ( - "full_name", - models.CharField( - max_length=255, - validators=[ - django.core.validators.MinLengthValidator(3), - django.core.validators.MaxLengthValidator(255), - ], - ), - ), - ("given_name", models.CharField(blank=True, max_length=85)), - ("middle_name", models.CharField(blank=True, max_length=85)), - ("family_name", models.CharField(blank=True, max_length=85)), - ( - "relationship", - models.CharField( - blank=True, - choices=[ - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("HEAD", "Head of household (self)"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("BROTHER_SISTER", "Brother / Sister"), - ("MOTHER_FATHER", "Mother / Father"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ( - "MOTHERINLAW_FATHERINLAW", - "Mother-in-law / Father-in-law", - ), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ( - "SISTERINLAW_BROTHERINLAW", - "Sister-in-law / Brother-in-law", - ), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ("COUSIN", "Cousin"), - ], - max_length=255, - ), - ), - ( - "role", - models.CharField( - blank=True, - choices=[ - ("PRIMARY", "Primary collector"), - ("ALTERNATE", "Alternate collector"), - ("NO_ROLE", "None"), - ], - max_length=255, - ), - ), - ( - "sex", - models.CharField( - choices=[("MALE", "Male"), ("FEMALE", "Female")], max_length=255 - ), - ), - ("birth_date", models.DateField()), - ("estimated_birth_date", models.BooleanField(default=False, null=True)), - ( - "marital_status", - models.CharField( - choices=[ - ("SINGLE", "SINGLE"), - ("MARRIED", "Married"), - ("WIDOW", "Widow"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - max_length=255, - ), - ), - ( - "phone_no", - phonenumber_field.modelfields.PhoneNumberField( - blank=True, max_length=128, region=None - ), - ), - ( - "phone_no_alternative", - phonenumber_field.modelfields.PhoneNumberField( - blank=True, max_length=128, region=None - ), - ), - ("disability", models.BooleanField(default=False)), - ( - "flex_fields", - django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - ( - "household", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="registration_datahub.importedhousehold", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="RegistrationDataImportDatahub", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("name", models.CharField(blank=True, max_length=255)), - ("import_date", models.DateTimeField(auto_now_add=True)), - ("hct_id", models.UUIDField(null=True)), - ( - "import_data", - models.OneToOneField( - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="registration_data_import", - to="registration_datahub.importdata", - ), - ), - ("import_done", models.BooleanField(default=False)), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="ImportedIndividualIdentity", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("document_number", models.CharField(max_length=255)), - ( - "agency", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="identities", - to="registration_datahub.agency", - ), - ), - ( - "individual", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="identities", - to="registration_datahub.importedindividual", - ), - ), - ], - ), - migrations.AddField( - model_name="importedindividual", - name="registration_data_import", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="registration_datahub.registrationdataimportdatahub", - ), - ), - migrations.CreateModel( - name="ImportedHouseholdIdentity", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("document_number", models.CharField(max_length=255)), - ( - "agency", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="households_identities", - to="registration_datahub.agency", - ), - ), - ( - "household", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="identities", - to="registration_datahub.importedhousehold", - ), - ), - ], - ), - migrations.AddField( - model_name="importedhousehold", - name="head_of_household", - field=models.OneToOneField( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="registration_datahub.importedindividual", - ), - ), - migrations.AddField( - model_name="importedhousehold", - name="registration_data_import", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="households", - to="registration_datahub.registrationdataimportdatahub", - ), - ), - migrations.CreateModel( - name="ImportedDocument", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("document_number", models.CharField(blank=True, max_length=255)), - ("photo", models.ImageField(blank=True, upload_to="")), - ( - "individual", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="documents", - to="registration_datahub.importedindividual", - ), - ), - ( - "type", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="documents", - to="registration_datahub.importeddocumenttype", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.CreateModel( - name="DocumentValidator", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True)), - ("updated_at", models.DateTimeField(auto_now=True)), - ("regex", models.CharField(default=".*", max_length=100)), - ( - "type", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="validators", - to="registration_datahub.importeddocumenttype", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.AlterField( - model_name="importedhousehold", - name="address", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AlterField( - model_name="importedhousehold", - name="admin1", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AlterField( - model_name="importedhousehold", - name="admin2", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AlterField( - model_name="importedhousehold", - name="country", - field=django_countries.fields.CountryField( - blank=True, default="", max_length=2 - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="geopoint", - field=django.contrib.gis.db.models.fields.PointField( - default=None, null=True, srid=4326 - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="registration_date", - field=models.DateField(auto_now_add=True, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="returnee", - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name="importedindividual", - name="estimated_birth_date", - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name="importedindividual", - name="family_name", - field=models.CharField(blank=True, default="", max_length=85), - ), - migrations.AlterField( - model_name="importedindividual", - name="given_name", - field=models.CharField(blank=True, default="", max_length=85), - ), - migrations.AlterField( - model_name="importedindividual", - name="middle_name", - field=models.CharField(blank=True, default="", max_length=85), - ), - migrations.AlterField( - model_name="importedindividual", - name="phone_no", - field=phonenumber_field.modelfields.PhoneNumberField( - blank=True, default="", max_length=128, region=None - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="phone_no_alternative", - field=phonenumber_field.modelfields.PhoneNumberField( - blank=True, default="", max_length=128, region=None - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("HEAD", "Head of household (self)"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("BROTHER_SISTER", "Brother / Sister"), - ("MOTHER_FATHER", "Mother / Father"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ("COUSIN", "Cousin"), - ], - default="", - max_length=255, - ), - ), - migrations.AddField( - model_name="importeddocumenttype", - name="type", - field=models.CharField( - blank=True, - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("ELECTORAL_CARD", "Electoral Card"), - ("OTHER", "Other"), - ], - default="", - max_length=50, - ), - preserve_default=False, - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("ELECTORAL_CARD", "Electoral Card"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - migrations.AlterUniqueTogether( - name="importeddocumenttype", - unique_together={("country", "type")}, - ), - migrations.RenameModel( - old_name="Agency", - new_name="ImportedAgency", - ), - migrations.RenameField( - model_name="importdata", - old_name="xlsx_file", - new_name="file", - ), - migrations.AddField( - model_name="importdata", - name="data_type", - field=models.CharField( - choices=[("XLSX", "XLSX File"), ("JSON", "JSON File")], - default="XLSX", - max_length=4, - ), - ), - migrations.AlterField( - model_name="registrationdataimportdatahub", - name="import_done", - field=models.CharField( - choices=[ - ("NOT_STARTED", "Not Started"), - ("STARTED", "Started"), - ("DONE", "Done"), - ], - default="NOT_STARTED", - max_length=15, - ), - ), - migrations.AddField( - model_name="registrationdataimportdatahub", - name="business_area_slug", - field=models.CharField(blank=True, max_length=250), - ), - migrations.AddField( - model_name="importedindividual", - name="work_status", - field=models.CharField( - blank=True, - choices=[("1", "Yes"), ("0", "No"), ("NOT_PROVIDED", "Not provided")], - default="NOT_PROVIDED", - max_length=20, - ), - ), - migrations.RemoveField( - model_name="importedhousehold", - name="registration_date", - ), - migrations.AddField( - model_name="importedhousehold", - name="first_registration_date", - field=models.DateTimeField(), - ), - migrations.AddField( - model_name="importedhousehold", - name="last_registration_date", - field=models.DateTimeField(), - ), - migrations.AddField( - model_name="importedindividual", - name="first_registration_date", - field=models.DateField( - default=datetime.datetime(2020, 7, 14, 13, 43, 16, 947) - ), - preserve_default=False, - ), - migrations.AddField( - model_name="importedindividual", - name="last_registration_date", - field=models.DateField( - default=datetime.datetime(2020, 7, 14, 13, 43, 21, 163324) - ), - preserve_default=False, - ), - migrations.AlterUniqueTogether( - name="importeddocument", - unique_together=set(), - ), - migrations.RemoveField( - model_name="importedindividual", - name="role", - ), - migrations.CreateModel( - name="ImportedIndividualRoleInHousehold", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ( - "role", - models.CharField( - blank=True, - choices=[ - ("PRIMARY", "Primary collector"), - ("ALTERNATE", "Alternate collector"), - ("NO_ROLE", "None"), - ], - max_length=255, - ), - ), - ( - "household", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals_and_roles", - to="registration_datahub.importedhousehold", - ), - ), - ( - "individual", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="households_and_roles", - to="registration_datahub.importedindividual", - ), - ), - ], - options={ - "unique_together": {("role", "household")}, - }, - ), - migrations.AlterField( - model_name="importedindividual", - name="household", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - related_name="individuals", - to="registration_datahub.importedhousehold", - ), - ), - migrations.AddField( - model_name="importedindividual", - name="deduplication_batch_results", - field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - migrations.AddField( - model_name="importedindividual", - name="deduplication_golden_record_results", - field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), - ), - migrations.AddField( - model_name="importedindividual", - name="deduplication_batch_status", - field=models.CharField( - blank=True, - choices=[ - ("SIMILAR_IN_BATCH", "Similar in batch"), - ("DUPLICATE_IN_BATCH", "Duplicate in batch"), - ("UNIQUE_IN_BATCH", "Unique in batch"), - ("NOT_PROCESSED", "Not Processed"), - ], - default="UNIQUE_IN_BATCH", - max_length=50, - ), - ), - migrations.AddField( - model_name="importedindividual", - name="deduplication_golden_record_status", - field=models.CharField( - blank=True, - choices=[ - ("UNIQUE", "Unique"), - ("DUPLICATE", "Duplicate"), - ("NEEDS_ADJUDICATION", "Needs Adjudication"), - ("NOT_PROCESSED", "Not Processed"), - ], - default="UNIQUE", - max_length=50, - ), - ), - migrations.RemoveField( - model_name="importedhousehold", - name="consent", - ), - migrations.AddField( - model_name="importedhousehold", - name="consent_sign", - field=sorl.thumbnail.fields.ImageField( - blank=True, - upload_to="", - validators=[django.core.validators.validate_image_file_extension], - ), - ), - migrations.AddField( - model_name="importedhousehold", - name="deviceid", - field=models.CharField(blank=True, max_length=250), - ), - migrations.AddField( - model_name="importedhousehold", - name="start", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="importedindividual", - name="observed_disability", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("NONE", "None"), - ("SEEING", "Difficulty seeing (even if wearing glasses)"), - ("HEARING", "Difficulty hearing (even if using a hearing aid)"), - ("WALKING", "Difficulty walking or climbing steps"), - ("MEMORY", "Difficulty remembering or concentrating"), - ("SELF_CARE", "Difficulty with self care (washing, dressing)"), - ( - "COMMUNICATING", - "Difficulty communicating (e.g understanding or being understood)", - ), - ], - default="NONE", - max_length=58, - ), - preserve_default=False, - ), - migrations.AddField( - model_name="importedindividual", - name="who_answers_alt_phone", - field=models.CharField(blank=True, max_length=150), - ), - migrations.AddField( - model_name="importedindividual", - name="who_answers_phone", - field=models.CharField(blank=True, max_length=150), - ), - migrations.AlterField( - model_name="importedhousehold", - name="residence_status", - field=models.CharField( - choices=[ - ("IDP", "Displaced | Internally Displaced People"), - ("REFUGEE", "Displaced | Refugee / Asylum Seeker"), - ("OTHERS_OF_CONCERN", "Displaced | Others of Concern"), - ("HOST", "Non-displaced | Host"), - ("NON_HOST", "Non-displaced | Non-host"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="marital_status", - field=models.CharField( - choices=[ - ("SINGLE", "SINGLE"), - ("MARRIED", "Married"), - ("WIDOWED", "Widowed"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="marital_status", - field=models.CharField( - choices=[ - ("SINGLE", "Single"), - ("MARRIED", "Married"), - ("WIDOWED", "Widowed"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - max_length=255, - ), - ), - migrations.AlterModelOptions( - name="registrationdataimportdatahub", - options={"ordering": ("name",)}, - ), - migrations.AlterField( - model_name="importedindividual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("HEAD", "Head of household (self)"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("BROTHER_SISTER", "Brother / Sister"), - ("MOTHER_FATHER", "Mother / Father"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ("COUSIN", "Cousin"), - ], - default="", - max_length=255, - ), - ), - migrations.RemoveField( - model_name="importedhousehold", - name="female_adults_count", - ), - migrations.RemoveField( - model_name="importedhousehold", - name="female_adults_disabled_count", - ), - migrations.RemoveField( - model_name="importedhousehold", - name="male_adults_count", - ), - migrations.RemoveField( - model_name="importedhousehold", - name="male_adults_disabled_count", - ), - migrations.AddField( - model_name="importedagency", - name="country", - field=django_countries.fields.CountryField(default="AF", max_length=2), - preserve_default=False, - ), - migrations.AddField( - model_name="importedhousehold", - name="currency", - field=models.CharField( - choices=[ - ("", "None"), - ("AED", "United Arab Emirates dirham"), - ("AFN", "Afghan afghani"), - ("ALL", "Albanian lek"), - ("AMD", "Armenian dram"), - ("ANG", "Netherlands Antillean guilder"), - ("AOA", "Angolan kwanza"), - ("ARS", "Argentine peso"), - ("AUD", "Australian dollar"), - ("AWG", "Aruban florin"), - ("AZN", "Azerbaijani manat"), - ("BAM", "Bosnia and Herzegovina convertible mark"), - ("BBD", "Barbados dollar"), - ("BDT", "Bangladeshi taka"), - ("BGN", "Bulgarian lev"), - ("BHD", "Bahraini dinar"), - ("BIF", "Burundian franc"), - ("BMD", "Bermudian dollar"), - ("BND", "Brunei dollar"), - ("BOB", "Boliviano"), - ("BOV", "Bolivian Mvdol (funds code)"), - ("BRL", "Brazilian real"), - ("BSD", "Bahamian dollar"), - ("BTN", "Bhutanese ngultrum"), - ("BWP", "Botswana pula"), - ("BYN", "Belarusian ruble"), - ("BZD", "Belize dollar"), - ("CAD", "Canadian dollar"), - ("CDF", "Congolese franc"), - ("CHF", "Swiss franc"), - ("CLP", "Chilean peso"), - ("CNY", "Chinese yuan"), - ("COP", "Colombian peso"), - ("CRC", "Costa Rican colon"), - ("CUC", "Cuban convertible peso"), - ("CUP", "Cuban peso"), - ("CVE", "Cape Verdean escudo"), - ("CZK", "Czech koruna"), - ("DJF", "Djiboutian franc"), - ("DKK", "Danish krone"), - ("DOP", "Dominican peso"), - ("DZD", "Algerian dinar"), - ("EGP", "Egyptian pound"), - ("ERN", "Eritrean nakfa"), - ("ETB", "Ethiopian birr"), - ("EUR", "Euro"), - ("FJD", "Fiji dollar"), - ("FKP", "Falkland Islands pound"), - ("GBP", "Pound sterling"), - ("GEL", "Georgian lari"), - ("GHS", "Ghanaian cedi"), - ("GIP", "Gibraltar pound"), - ("GMD", "Gambian dalasi"), - ("GNF", "Guinean franc"), - ("GTQ", "Guatemalan quetzal"), - ("GYD", "Guyanese dollar"), - ("HKD", "Hong Kong dollar"), - ("HNL", "Honduran lempira"), - ("HRK", "Croatian kuna"), - ("HTG", "Haitian gourde"), - ("HUF", "Hungarian forint"), - ("IDR", "Indonesian rupiah"), - ("ILS", "Israeli new shekel"), - ("INR", "Indian rupee"), - ("IQD", "Iraqi dinar"), - ("IRR", "Iranian rial"), - ("ISK", "Icelandic króna"), - ("JMD", "Jamaican dollar"), - ("JOD", "Jordanian dinar"), - ("JPY", "Japanese yen"), - ("KES", "Kenyan shilling"), - ("KGS", "Kyrgyzstani som"), - ("KHR", "Cambodian riel"), - ("KMF", "Comoro franc"), - ("KPW", "North Korean won"), - ("KRW", "South Korean won"), - ("KWD", "Kuwaiti dinar"), - ("KYD", "Cayman Islands dollar"), - ("KZT", "Kazakhstani tenge"), - ("LAK", "Lao kip"), - ("LBP", "Lebanese pound"), - ("LKR", "Sri Lankan rupee"), - ("LRD", "Liberian dollar"), - ("LSL", "Lesotho loti"), - ("LYD", "Libyan dinar"), - ("MAD", "Moroccan dirham"), - ("MDL", "Moldovan leu"), - ("MGA", "Malagasy ariary"), - ("MKD", "Macedonian denar"), - ("MMK", "Myanmar kyat"), - ("MNT", "Mongolian tögrög"), - ("MOP", "Macanese pataca"), - ("MRU", "Mauritanian ouguiya"), - ("MUR", "Mauritian rupee"), - ("MVR", "Maldivian rufiyaa"), - ("MWK", "Malawian kwacha"), - ("MXN", "Mexican peso"), - ("MYR", "Malaysian ringgit"), - ("MZN", "Mozambican metical"), - ("NAD", "Namibian dollar"), - ("NGN", "Nigerian naira"), - ("NIO", "Nicaraguan córdoba"), - ("NOK", "Norwegian krone"), - ("NPR", "Nepalese rupee"), - ("NZD", "New Zealand dollar"), - ("OMR", "Omani rial"), - ("PAB", "Panamanian balboa"), - ("PEN", "Peruvian sol"), - ("PGK", "Papua New Guinean kina"), - ("PHP", "Philippine peso"), - ("PKR", "Pakistani rupee"), - ("PLN", "Polish złoty"), - ("PYG", "Paraguayan guaraní"), - ("QAR", "Qatari riyal"), - ("RON", "Romanian leu"), - ("RSD", "Serbian dinar"), - ("RUB", "Russian ruble"), - ("RWF", "Rwandan franc"), - ("SAR", "Saudi riyal"), - ("SBD", "Solomon Islands dollar"), - ("SCR", "Seychelles rupee"), - ("SDG", "Sudanese pound"), - ("SEK", "Swedish krona/kronor"), - ("SGD", "Singapore dollar"), - ("SHP", "Saint Helena pound"), - ("SLL", "Sierra Leonean leone"), - ("SOS", "Somali shilling"), - ("SRD", "Surinamese dollar"), - ("SSP", "South Sudanese pound"), - ("STN", "São Tomé and Príncipe dobra"), - ("SVC", "Salvadoran colón"), - ("SYP", "Syrian pound"), - ("SZL", "Swazi lilangeni"), - ("THB", "Thai baht"), - ("TJS", "Tajikistani somoni"), - ("TMT", "Turkmenistan manat"), - ("TND", "Tunisian dinar"), - ("TOP", "Tongan paʻanga"), - ("TRY", "Turkish lira"), - ("TTD", "Trinidad and Tobago dollar"), - ("TWD", "New Taiwan dollar"), - ("TZS", "Tanzanian shilling"), - ("UAH", "Ukrainian hryvnia"), - ("UGX", "Ugandan shilling"), - ("USD", "United States dollar"), - ("UYU", "Uruguayan peso"), - ("UYW", "Unidad previsional[14]"), - ("UZS", "Uzbekistan som"), - ("VES", "Venezuelan bolívar soberano"), - ("VND", "Vietnamese đồng"), - ("VUV", "Vanuatu vatu"), - ("WST", "Samoan tala"), - ("XAF", "CFA franc BEAC"), - ("XAG", "Silver (one troy ounce)"), - ("XAU", "Gold (one troy ounce)"), - ("XCD", "East Caribbean dollar"), - ("XOF", "CFA franc BCEAO"), - ("XPF", "CFP franc (franc Pacifique)"), - ("YER", "Yemeni rial"), - ("ZAR", "South African rand"), - ("ZMW", "Zambian kwacha"), - ("ZWL", "Zimbabwean dollar"), - ], - default="", - max_length=250, - ), - ), - migrations.AddField( - model_name="importedhousehold", - name="female_age_group_18_59_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="female_age_group_18_59_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="female_age_group_60_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="female_age_group_60_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="male_age_group_18_59_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="male_age_group_18_59_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="male_age_group_60_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="male_age_group_60_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="registration_method", - field=models.CharField( - choices=[ - ("", "None"), - ("HH_REGISTRATION", "Household Registration"), - ("COMMUNITY", "Community-level Registration"), - ], - default="", - max_length=250, - ), - ), - migrations.AddField( - model_name="importedhousehold", - name="unhcr_id", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="country", - field=django_countries.fields.CountryField(max_length=2), - ), - migrations.AddField( - model_name="importedhousehold", - name="consent_sharing", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("", "None"), - ("UNICEF", "UNICEF"), - ("HUMANITARIAN_PARTNER", "Humanitarian partners"), - ("PRIVATE_PARTNER", "Private partners"), - ("GOVERNMENT_PARTNER", "Government partners"), - ], - default="", - max_length=63, - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="country", - field=django_countries.fields.CountryField(max_length=2), - ), - migrations.AlterField( - model_name="importedhousehold", - name="female_age_group_0_5_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="female_age_group_0_5_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="female_age_group_12_17_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="female_age_group_12_17_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="female_age_group_6_11_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="female_age_group_6_11_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="male_age_group_0_5_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="male_age_group_0_5_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="male_age_group_12_17_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="male_age_group_12_17_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="male_age_group_6_11_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="male_age_group_6_11_disabled_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="name_enumerator", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AddField( - model_name="importedhousehold", - name="org_enumerator", - field=models.CharField( - blank=True, - choices=[("", "None"), ("UNICEF", "UNICEF"), ("PARTNER", "Partner")], - default="", - max_length=250, - ), - ), - migrations.AddField( - model_name="importedhousehold", - name="org_name_enumerator", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AlterField( - model_name="importedhousehold", - name="pregnant_count", - field=models.PositiveIntegerField(default=None, null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="residence_status", - field=models.CharField( - choices=[ - ("", "None"), - ("IDP", "Displaced | Internally Displaced People"), - ("REFUGEE", "Displaced | Refugee / Asylum Seeker"), - ("OTHERS_OF_CONCERN", "Displaced | Others of Concern"), - ("HOST", "Non-displaced | Host"), - ("NON_HOST", "Non-displaced | Non-host"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="returnee", - field=models.BooleanField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="village", - field=models.CharField(blank=True, default="", max_length=250), - ), - migrations.AddField( - model_name="importedindividual", - name="comms_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="importedindividual", - name="hearing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="marital_status", - field=models.CharField( - choices=[ - ("", "None"), - ("SINGLE", "Single"), - ("MARRIED", "Married"), - ("WIDOWED", "Widowed"), - ("DIVORCED", "Divorced"), - ("SEPARATED", "Separated"), - ], - max_length=255, - ), - ), - migrations.AddField( - model_name="importedindividual", - name="memory_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="importedindividual", - name="physical_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="importedindividual", - name="seeing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="importedindividual", - name="selfcare_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("SOME_DIFFICULTY", "Some difficulty"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ], - max_length=50, - ), - ), - migrations.AlterUniqueTogether( - name="importedagency", - unique_together={("country", "type")}, - ), - migrations.CreateModel( - name="KoboImportedSubmission", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("kobo_submission_uuid", models.UUIDField()), - ("kobo_asset_id", models.CharField(max_length=150)), - ("kobo_submission_time", models.DateTimeField()), - ], - ), - migrations.AddField( - model_name="importedhousehold", - name="kobo_asset_id", - field=models.CharField(blank=True, default="", max_length=150), - ), - migrations.AddField( - model_name="importedhousehold", - name="kobo_submission_uuid", - field=models.UUIDField(default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="collect_individual_data", - field=models.CharField( - choices=[("", "None"), ("1", "Yes"), ("0", "No")], - default="", - max_length=250, - ), - ), - migrations.AddField( - model_name="importedhousehold", - name="child_hoh", - field=models.BooleanField(null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="consent", - field=models.BooleanField(null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="fchild_hoh", - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="returnee", - field=models.BooleanField(null=True), - ), - migrations.AddField( - model_name="importedindividual", - name="pregnant", - field=models.BooleanField(null=True), - ), - migrations.DeleteModel( - name="ImportedHouseholdIdentity", - ), - migrations.AddField( - model_name="importedhousehold", - name="kobo_submission_time", - field=models.DateTimeField(blank=True, max_length=150, null=True), - ), - migrations.AlterField( - model_name="documentvalidator", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="documentvalidator", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="importdata", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="importdata", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="importeddocument", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="importeddocument", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="importedindividual", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="importedindividual", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name="registrationdataimportdatahub", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name="registrationdataimportdatahub", - name="hct_id", - field=models.UUIDField(db_index=True, null=True), - ), - migrations.AlterField( - model_name="registrationdataimportdatahub", - name="updated_at", - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin1_title", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin2_title", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AlterField( - model_name="importedindividual", - name="disability", - field=models.CharField( - choices=[("disabled", "disabled"), ("not disabled", "not disabled")], - default="not disabled", - max_length=20, - ), - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="country", - field=django_countries.fields.CountryField(default="U", max_length=2), - ), - migrations.AddField( - model_name="koboimportedsubmission", - name="registration_data_import", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="registration_datahub.registrationdataimportdatahub", - ), - ), - migrations.AddField( - model_name="koboimportedsubmission", - name="imported_household", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="registration_datahub.importedhousehold", - ), - ), - migrations.AddField( - model_name="koboimportedsubmission", - name="created_at", - field=models.DateTimeField(auto_now_add=True, db_index=True, null=True), - ), - migrations.AddField( - model_name="koboimportedsubmission", - name="amended", - field=models.BooleanField(blank=True, default=False), - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_0_5_count", - new_name="female_age_group_0_4_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_0_5_disabled_count", - new_name="female_age_group_0_4_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_12_17_count", - new_name="female_age_group_13_17_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_12_17_disabled_count", - new_name="female_age_group_13_17_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_6_11_count", - new_name="female_age_group_5_12_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_6_11_disabled_count", - new_name="female_age_group_5_12_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_0_5_count", - new_name="male_age_group_0_4_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_0_5_disabled_count", - new_name="male_age_group_0_4_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_12_17_count", - new_name="male_age_group_13_17_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_12_17_disabled_count", - new_name="male_age_group_13_17_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_6_11_count", - new_name="male_age_group_5_12_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_6_11_disabled_count", - new_name="male_age_group_5_12_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_0_4_count", - new_name="female_age_group_0_5_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_0_4_disabled_count", - new_name="female_age_group_0_5_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_13_17_count", - new_name="female_age_group_12_17_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_13_17_disabled_count", - new_name="female_age_group_12_17_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_5_12_count", - new_name="female_age_group_6_11_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="female_age_group_5_12_disabled_count", - new_name="female_age_group_6_11_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_0_4_count", - new_name="male_age_group_0_5_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_0_4_disabled_count", - new_name="male_age_group_0_5_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_13_17_count", - new_name="male_age_group_12_17_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_13_17_disabled_count", - new_name="male_age_group_12_17_disabled_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_5_12_count", - new_name="male_age_group_6_11_count", - ), - migrations.RenameField( - model_name="importedhousehold", - old_name="male_age_group_5_12_disabled_count", - new_name="male_age_group_6_11_disabled_count", - ), - migrations.AddField( - model_name="importedindividual", - name="kobo_asset_id", - field=models.CharField(blank=True, default="", max_length=150), - ), - migrations.AddField( - model_name="importedhousehold", - name="row_id", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name="importedindividual", - name="row_id", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.CreateModel( - name="KoboImportData", - fields=[ - ( - "importdata_ptr", - models.OneToOneField( - auto_created=True, - on_delete=django.db.models.deletion.CASCADE, - parent_link=True, - primary_key=True, - serialize=False, - to="registration_datahub.importdata", - ), - ), - ("kobo_asset_id", models.CharField(max_length=100)), - ("only_active_submissions", models.BooleanField(default=True)), - ], - options={ - "abstract": False, - }, - bases=("registration_datahub.importdata",), - ), - migrations.AddField( - model_name="importdata", - name="business_area_slug", - field=models.CharField(blank=True, max_length=200), - ), - migrations.AddField( - model_name="importdata", - name="created_by_id", - field=models.UUIDField(null=True), - ), - migrations.AddField( - model_name="importdata", - name="error", - field=models.TextField(blank=True), - ), - migrations.AddField( - model_name="importdata", - name="status", - field=models.CharField( - choices=[ - ("PENDING", "Pending"), - ("RUNNING", "Running"), - ("FINISHED", "Finished"), - ("ERROR", "Error"), - ("VALIDATION_ERROR", "Validation Error"), - ], - default="FINISHED", - max_length=20, - ), - ), - migrations.AddField( - model_name="importdata", - name="validation_errors", - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name="importdata", - name="file", - field=models.FileField(null=True, upload_to=""), - ), - migrations.AlterField( - model_name="importdata", - name="number_of_households", - field=models.PositiveIntegerField(null=True), - ), - migrations.AlterField( - model_name="importdata", - name="number_of_individuals", - field=models.PositiveIntegerField(null=True), - ), - migrations.AlterField( - model_name="importedagency", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="flex_fields", - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name="importedindividual", - name="deduplication_batch_results", - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name="importedindividual", - name="deduplication_golden_record_results", - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name="importedindividual", - name="flex_fields", - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name="importedindividualidentity", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - migrations.AlterField( - model_name="koboimportedsubmission", - name="id", - field=models.BigAutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="consent_sharing", - field=multiselectfield.db.fields.MultiSelectField( - choices=[ - ("", "None"), - ("GOVERNMENT_PARTNER", "Government partners"), - ("HUMANITARIAN_PARTNER", "Humanitarian partners"), - ("PRIVATE_PARTNER", "Private partners"), - ("UNICEF", "UNICEF"), - ], - default="", - max_length=63, - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="org_enumerator", - field=models.CharField( - blank=True, - choices=[("", "None"), ("PARTNER", "Partner"), ("UNICEF", "UNICEF")], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="importedhousehold", - name="registration_method", - field=models.CharField( - choices=[ - ("", "None"), - ("COMMUNITY", "Community-level Registration"), - ("HH_REGISTRATION", "Household Registration"), - ], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="comms_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="deduplication_golden_record_status", - field=models.CharField( - blank=True, - choices=[ - ("DUPLICATE", "Duplicate"), - ("NEEDS_ADJUDICATION", "Needs Adjudication"), - ("NOT_PROCESSED", "Not Processed"), - ("UNIQUE", "Unique"), - ], - default="UNIQUE", - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="hearing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="marital_status", - field=models.CharField( - choices=[ - ("", "None"), - ("DIVORCED", "Divorced"), - ("MARRIED", "Married"), - ("SEPARATED", "Separated"), - ("SINGLE", "Single"), - ("WIDOWED", "Widowed"), - ], - max_length=255, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="memory_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="physical_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ], - default="", - max_length=255, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="seeing_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="selfcare_disability", - field=models.CharField( - blank=True, - choices=[ - ("", "None"), - ("LOT_DIFFICULTY", "A lot of difficulty"), - ("CANNOT_DO", "Cannot do at all"), - ("SOME_DIFFICULTY", "Some difficulty"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividualroleinhousehold", - name="role", - field=models.CharField( - blank=True, - choices=[ - ("NO_ROLE", "None"), - ("ALTERNATE", "Alternate collector"), - ("PRIMARY", "Primary collector"), - ], - max_length=255, - ), - ), - migrations.CreateModel( - name="Record", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("registration", models.IntegerField()), - ("timestamp", models.DateTimeField(db_index=True)), - ("storage", models.BinaryField(blank=True, null=True)), - ( - "ignored", - models.BooleanField( - blank=True, db_index=True, default=False, null=True - ), - ), - ("source_id", models.IntegerField(db_index=True)), - ("data", models.JSONField(blank=True, default=dict, null=True)), - ( - "registration_data_import", - models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="records", - to="registration_datahub.registrationdataimportdatahub", - ), - ), - ], - ), - migrations.AddField( - model_name="importedhousehold", - name="flex_registrations_record", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="imported_households", - to="registration_datahub.record", - ), - ), - migrations.AlterField( - model_name="importdata", - name="data_type", - field=models.CharField( - choices=[ - ("XLSX", "XLSX File"), - ("JSON", "JSON File"), - ("FLEX", "Flex Registration"), - ], - default="XLSX", - max_length=4, - ), - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("TAX_ID", "Tax Number Identification"), - ("RESIDENCE_PERMIT_NO", "Foreigner's Residence Permit"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - migrations.AddField( - model_name="importedindividual", - name="disability_certificate_picture", - field=models.ImageField(blank=True, null=True, upload_to=""), - ), - migrations.AlterField( - model_name="importedindividual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("OTHER", "Other"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ], - default="", - max_length=255, - ), - ), - migrations.CreateModel( - name="ImportedBankAccountInfo", - fields=[ - ( - "id", - model_utils.fields.UUIDField( - default=uuid.uuid4, - editable=False, - primary_key=True, - serialize=False, - ), - ), - ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), - ("updated_at", models.DateTimeField(auto_now=True, db_index=True)), - ("bank_name", models.CharField(max_length=255)), - ("bank_account_number", models.CharField(max_length=64)), - ( - "debit_card_number", - models.CharField(blank=True, default="", max_length=255), - ), - ( - "individual", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="bank_account_info", - to="registration_datahub.importedindividual", - ), - ), - ], - options={ - "abstract": False, - }, - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS individuals_num ON registration_datahub_record((data->'individuals_num'));", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS collectors_num ON registration_datahub_record((data->'collectors_num'));", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS head ON registration_datahub_record((data->'head'));", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS valid_phones ON registration_datahub_record((data->'valid_phones'));", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS birth_certificate ON registration_datahub_record((data->'birth_certificate'));", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS disability_certificate_match ON registration_datahub_record((data->'disability_certificate_match'));", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS collector_bank_account ON registration_datahub_record((data->'collector_bank_account'));", - ), - migrations.RunSQL( - sql="CREATE INDEX IF NOT EXISTS valid_payment ON registration_datahub_record((data->'valid_payment'));", - ), - migrations.AddField( - model_name="record", - name="error_message", - field=models.TextField(blank=True, null=True), - ), - migrations.AddField( - model_name="record", - name="status", - field=models.CharField( - blank=True, - choices=[ - ("TO_IMPORT", "To import"), - ("IMPORTED", "Imported"), - ("ERROR", "Error"), - ], - max_length=16, - null=True, - ), - ), - migrations.AlterModelOptions( - name="importedindividualidentity", - options={"verbose_name_plural": "Imported Individual Identities"}, - ), - migrations.AddField( - model_name="importedhousehold", - name="mis_unicef_id", - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name="importedindividual", - name="mis_unicef_id", - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name="importeddocument", - name="doc_date", - field=models.DateField(blank=True, default=None, null=True), - ), - migrations.AddField( - model_name="importedhousehold", - name="diia_rec_id", - field=models.CharField(blank=True, default="", max_length=50), - ), - migrations.AlterField( - model_name="importedindividual", - name="deduplication_batch_results", - field=models.JSONField(null=True), - ), - migrations.AlterField( - model_name="importedhousehold", - name="address", - field=models.CharField(blank=True, default="", max_length=1024), - ), - migrations.AddField( - model_name="record", - name="counters", - field=models.JSONField(blank=True, null=True), - ), - migrations.AddField( - model_name="record", - name="fields", - field=models.JSONField(blank=True, null=True), - ), - migrations.AddField( - model_name="record", - name="files", - field=models.BinaryField(blank=True, null=True), - ), - migrations.AddField( - model_name="record", - name="index1", - field=models.CharField( - blank=True, db_index=True, max_length=255, null=True - ), - ), - migrations.AddField( - model_name="record", - name="index2", - field=models.CharField( - blank=True, db_index=True, max_length=255, null=True - ), - ), - migrations.AddField( - model_name="record", - name="index3", - field=models.CharField( - blank=True, db_index=True, max_length=255, null=True - ), - ), - migrations.AddField( - model_name="record", - name="size", - field=models.IntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name="record", - name="unique_field", - field=models.CharField( - blank=True, db_index=True, max_length=255, null=True - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="deduplication_batch_results", - field=models.JSONField(default=dict), - ), - migrations.AlterField( - model_name="importdata", - name="data_type", - field=models.CharField( - choices=[ - ("XLSX", "XLSX File"), - ("JSON", "JSON File"), - ("FLEX", "Flex Registration"), - ("DIIA", "DIIA"), - ], - default="XLSX", - max_length=4, - ), - ), - migrations.CreateModel( - name="DiiaIndividual", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "rec_id", - models.CharField( - blank=True, db_index=True, max_length=20, null=True - ), - ), - ( - "individual_id", - models.CharField(blank=True, max_length=128, null=True), - ), - ("last_name", models.CharField(blank=True, max_length=85, null=True)), - ("first_name", models.CharField(blank=True, max_length=85, null=True)), - ("second_name", models.CharField(blank=True, max_length=85, null=True)), - ( - "relationship", - models.CharField( - blank=True, - choices=[ - (None, "Unknown"), - ("HEAD", "Head of household (self)"), - ("SON", "Son"), - ("DAUGHTER", "Daughter"), - ("HUSBAND", "Husband"), - ("WIFE", "Wife"), - ], - max_length=255, - null=True, - ), - ), - ( - "sex", - models.CharField( - blank=True, - choices=[("M", "Male"), ("F", "Female")], - max_length=255, - null=True, - ), - ), - ("birth_date", models.CharField(blank=True, max_length=64, null=True)), - ("birth_doc", models.CharField(blank=True, max_length=128, null=True)), - ( - "marital_status", - models.CharField( - blank=True, - choices=[ - ("", "None"), - ("DIVORCED", "Divorced"), - ("MARRIED", "Married"), - ("SEPARATED", "Separated"), - ("SINGLE", "Single"), - ("WIDOWED", "Widowed"), - ], - max_length=255, - null=True, - ), - ), - ( - "disability", - models.CharField( - blank=True, - choices=[("True", "disabled"), ("False", "not disabled")], - default="not disabled", - max_length=20, - null=True, - ), - ), - ("iban", models.CharField(blank=True, max_length=255, null=True)), - ("bank_name", models.CharField(blank=True, max_length=255, null=True)), - ("doc_type", models.CharField(blank=True, max_length=128, null=True)), - ("doc_serie", models.CharField(blank=True, max_length=64, null=True)), - ("doc_number", models.CharField(blank=True, max_length=64, null=True)), - ( - "doc_issue_date", - models.CharField(blank=True, max_length=64, null=True), - ), - ( - "imported_individual", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="diia_individuals", - to="registration_datahub.importedindividual", - ), - ), - ( - "registration_data_import", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="diia_individuals", - to="registration_datahub.registrationdataimportdatahub", - ), - ), - ], - ), - migrations.AlterField( - model_name="importedindividual", - name="deduplication_golden_record_status", - field=models.CharField( - blank=True, - choices=[ - ("DUPLICATE", "Duplicate"), - ("NEEDS_ADJUDICATION", "Needs Adjudication"), - ("NOT_PROCESSED", "Not Processed"), - ("POSTPONE", "Postpone"), - ("UNIQUE", "Unique"), - ], - default="UNIQUE", - max_length=50, - ), - ), - migrations.CreateModel( - name="DiiaHousehold", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "rec_id", - models.CharField( - blank=True, db_index=True, max_length=20, null=True - ), - ), - ( - "vpo_doc", - sorl.thumbnail.fields.ImageField( - blank=True, - null=True, - upload_to="", - validators=[ - django.core.validators.validate_image_file_extension - ], - ), - ), - ("vpo_doc_id", models.CharField(blank=True, max_length=128, null=True)), - ( - "vpo_doc_date", - models.CharField(blank=True, max_length=64, null=True), - ), - ("address", models.CharField(blank=True, max_length=1024, null=True)), - ("consent", models.BooleanField(null=True)), - ("source_data", models.TextField(blank=True, default="", null=True)), - ( - "imported_household", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="diia_households", - to="registration_datahub.importedhousehold", - ), - ), - ( - "registration_data_import", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="diia_households", - to="registration_datahub.registrationdataimportdatahub", - ), - ), - ( - "status", - models.CharField( - blank=True, - choices=[ - (None, "To import"), - ("IMPORTED", "Imported"), - ("ERROR", "Error"), - ("TAX_ID_ERROR", "Tax ID Error"), - ], - max_length=16, - null=True, - ), - ), - ], - ), - migrations.AlterModelOptions( - name="registrationdataimportdatahub", - options={ - "ordering": ("name",), - "permissions": (["api_upload", "Can upload"],), - }, - ), - migrations.AlterField( - model_name="importedhousehold", - name="collect_individual_data", - field=models.CharField( - choices=[ - ("", "Unknown"), - ("2", "Partial individuals collected"), - ("1", "Full individual collected"), - ("0", "No individual data"), - ], - default="", - max_length=250, - ), - ), - migrations.AlterField( - model_name="registrationdataimportdatahub", - name="import_done", - field=models.CharField( - choices=[ - ("LOADING", "Loading"), - ("NOT_STARTED", "Not Started"), - ("STARTED", "Started"), - ("DONE", "Done"), - ], - default="NOT_STARTED", - max_length=15, - ), - ), - migrations.AddField( - model_name="importeddocument", - name="country", - field=django_countries.fields.CountryField(default="U", max_length=2), - ), - migrations.AlterUniqueTogether( - name="importeddocumenttype", - unique_together=set(), - ), - migrations.RemoveField( - model_name="importeddocumenttype", - name="country", - ), - migrations.AddField( - model_name="importedindividual", - name="phone_no_alternative_valid", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="importedindividual", - name="phone_no_valid", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="importedindividualidentity", - name="country", - field=django_countries.fields.CountryField(default="U", max_length=2), - ), - migrations.AddField( - model_name="importedindividualidentity", - name="partner", - field=models.CharField(max_length=100, null=True), - ), - migrations.RemoveField( - model_name="importedindividualidentity", - name="agency", - ), - migrations.DeleteModel( - name="ImportedAgency", - ), - migrations.AddField( - model_name="importedindividual", - name="preferred_language", - field=models.CharField( - blank=True, - choices=[ - ("aa", "Afar"), - ("ab", "Abkhazian"), - ("af", "Afrikaans"), - ("ak", "Akan"), - ("sq", "Albanian"), - ("am", "Amharic"), - ("ar", "Arabic"), - ("an", "Aragonese"), - ("hy", "Armenian"), - ("as", "Assamese"), - ("av", "Avaric"), - ("ae", "Avestan"), - ("ay", "Aymara"), - ("az", "Azerbaijani"), - ("ba", "Bashkir"), - ("bm", "Bambara"), - ("eu", "Basque"), - ("be", "Belarusian"), - ("bn", "Bengali"), - ("bh", "Bihari languages"), - ("bi", "Bislama"), - ("bs", "Bosnian"), - ("br", "Breton"), - ("bg", "Bulgarian"), - ("my", "Burmese"), - ("ca", "Catalan; Valencian"), - ("ch", "Chamorro"), - ("ce", "Chechen"), - ("zh", "Chinese"), - ( - "cu", - "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic", - ), - ("cv", "Chuvash"), - ("kw", "Cornish"), - ("co", "Corsican"), - ("cr", "Cree"), - ("cs", "Czech"), - ("da", "Danish"), - ("dv", "Divehi; Dhivehi; Maldivian"), - ("nl", "Dutch; Flemish"), - ("dz", "Dzongkha"), - ("en", "English"), - ("eo", "Esperanto"), - ("et", "Estonian"), - ("ee", "Ewe"), - ("fo", "Faroese"), - ("fj", "Fijian"), - ("fi", "Finnish"), - ("fr", "French"), - ("fy", "Western Frisian"), - ("ff", "Fulah"), - ("ka", "Georgian"), - ("de", "German"), - ("gd", "Gaelic; Scottish Gaelic"), - ("ga", "Irish"), - ("gl", "Galician"), - ("gv", "Manx"), - ("el", "Greek, Modern (1453-)"), - ("gn", "Guarani"), - ("gu", "Gujarati"), - ("ht", "Haitian; Haitian Creole"), - ("ha", "Hausa"), - ("he", "Hebrew"), - ("hz", "Herero"), - ("hi", "Hindi"), - ("ho", "Hiri Motu"), - ("hr", "Croatian"), - ("hu", "Hungarian"), - ("ig", "Igbo"), - ("is", "Icelandic"), - ("io", "Ido"), - ("ii", "Sichuan Yi; Nuosu"), - ("iu", "Inuktitut"), - ("ie", "Interlingue; Occidental"), - ( - "ia", - "Interlingua (International Auxiliary Language Association)", - ), - ("id", "Indonesian"), - ("ik", "Inupiaq"), - ("it", "Italian"), - ("jv", "Javanese"), - ("ja", "Japanese"), - ("kl", "Kalaallisut; Greenlandic"), - ("kn", "Kannada"), - ("ks", "Kashmiri"), - ("kr", "Kanuri"), - ("kk", "Kazakh"), - ("km", "Central Khmer"), - ("ki", "Kikuyu; Gikuyu"), - ("rw", "Kinyarwanda"), - ("ky", "Kirghiz; Kyrgyz"), - ("kv", "Komi"), - ("kg", "Kongo"), - ("ko", "Korean"), - ("kj", "Kuanyama; Kwanyama"), - ("ku", "Kurdish"), - ("lo", "Lao"), - ("la", "Latin"), - ("lv", "Latvian"), - ("li", "Limburgan; Limburger; Limburgish"), - ("ln", "Lingala"), - ("lt", "Lithuanian"), - ("lb", "Luxembourgish; Letzeburgesch"), - ("lu", "Luba-Katanga"), - ("lg", "Ganda"), - ("mk", "Macedonian"), - ("mh", "Marshallese"), - ("ml", "Malayalam"), - ("mi", "Maori"), - ("mr", "Marathi"), - ("ms", "Malay"), - ("mg", "Malagasy"), - ("mt", "Maltese"), - ("mn", "Mongolian"), - ("na", "Nauru"), - ("nv", "Navajo; Navaho"), - ("nr", "Ndebele, South; South Ndebele"), - ("nd", "Ndebele, North; North Ndebele"), - ("ng", "Ndonga"), - ("ne", "Nepali"), - ("nn", "Norwegian Nynorsk; Nynorsk, Norwegian"), - ("nb", "Bokmål, Norwegian; Norwegian Bokmål"), - ("no", "Norwegian"), - ("ny", "Chichewa; Chewa; Nyanja"), - ("oc", "Occitan (post 1500)"), - ("oj", "Ojibwa"), - ("or", "Oriya"), - ("om", "Oromo"), - ("os", "Ossetian; Ossetic"), - ("pa", "Panjabi; Punjabi"), - ("fa", "Persian"), - ("pi", "Pali"), - ("pl", "Polish"), - ("pt", "Portuguese"), - ("ps", "Pushto; Pashto"), - ("qu", "Quechua"), - ("rm", "Romansh"), - ("ro", "Romanian; Moldavian; Moldovan"), - ("rn", "Rundi"), - ("ru", "Russian"), - ("sg", "Sango"), - ("sa", "Sanskrit"), - ("si", "Sinhala; Sinhalese"), - ("sk", "Slovak"), - ("sl", "Slovenian"), - ("se", "Northern Sami"), - ("sm", "Samoan"), - ("sn", "Shona"), - ("sd", "Sindhi"), - ("so", "Somali"), - ("st", "Sotho, Southern"), - ("es", "Spanish; Castilian"), - ("sc", "Sardinian"), - ("sr", "Serbian"), - ("ss", "Swati"), - ("su", "Sundanese"), - ("sw", "Swahili"), - ("sv", "Swedish"), - ("ty", "Tahitian"), - ("ta", "Tamil"), - ("tt", "Tatar"), - ("te", "Telugu"), - ("tg", "Tajik"), - ("tl", "Tagalog"), - ("th", "Thai"), - ("bo", "Tibetan"), - ("ti", "Tigrinya"), - ("to", "Tonga (Tonga Islands)"), - ("tn", "Tswana"), - ("ts", "Tsonga"), - ("tk", "Turkmen"), - ("tr", "Turkish"), - ("tw", "Twi"), - ("ug", "Uighur; Uyghur"), - ("uk", "Ukrainian"), - ("ur", "Urdu"), - ("uz", "Uzbek"), - ("ve", "Venda"), - ("vi", "Vietnamese"), - ("vo", "Volapük"), - ("cy", "Welsh"), - ("wa", "Walloon"), - ("wo", "Wolof"), - ("xh", "Xhosa"), - ("yi", "Yiddish"), - ("yo", "Yoruba"), - ("za", "Zhuang; Chuang"), - ("zu", "Zulu"), - ], - max_length=3, - null=True, - ), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin3", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin3_title", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin4", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin4_title", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin_area", - field=models.CharField(blank=True, default="", max_length=255), - ), - migrations.AddField( - model_name="importedhousehold", - name="admin_area_title", - field=models.CharField(blank=True, default="", max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0089_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0089_migration.py deleted file mode 100644 index 32034ca01d..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0089_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2023-01-25 11:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0001_migration_squashed_0088_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='importedindividual', - name='preferred_language', - field=models.CharField(blank=True, choices=[('en-us', 'en-us'), ('ar-ae', 'ar-ae'), ('cs-cz', 'cs-cz'), ('de-de', 'de-de'), ('es-es', 'es-es'), ('fr-fr', 'fr-fr'), ('hu-hu', 'hu-hu'), ('it-it', 'it-it'), ('pl-pl', 'pl-pl'), ('pt-pt', 'pt-pt'), ('ro-ro', 'ro-ro'), ('ru-ru', 'ru-ru'), ('si-si', 'si-si'), ('ta-ta', 'ta-ta'), ('uk-ua', 'uk-ua'), ('hi-hi', 'hi-hi')], max_length=6, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0090_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0090_migration.py deleted file mode 100644 index e789ae07b3..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0090_migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 3.2.15 on 2023-02-16 12:55 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("registration_datahub", "0089_migration"), - ] - - operations = [ - migrations.AddField( - model_name="importeddocumenttype", - name="is_identity_document", - field=models.BooleanField(default=True), - ), - migrations.AlterField( - model_name="importeddocumenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("TAX_ID", "Tax Number Identification"), - ("RESIDENCE_PERMIT_NO", "Foreigner's Residence Permit"), - ("BANK_STATEMENT", "Bank Statement"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0091_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0091_migration.py deleted file mode 100644 index e0de3af877..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0091_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.15 on 2023-02-27 18:08 -from django.contrib.postgres.operations import AddIndexConcurrently -from django.db import migrations, models - - -class Migration(migrations.Migration): - atomic = False - - dependencies = [ - ('registration_datahub', '0090_migration'), - ] - - operations = [ - migrations.SeparateDatabaseAndState( - state_operations=[ - migrations.AlterField( - model_name='record', - name='registration', - field=models.IntegerField(db_index=True), - ), - ], - database_operations=[ - AddIndexConcurrently( - model_name="record", - index=models.Index( - fields=["registration"], name="registration_datahub_record_registration_5edac906" - ) - ), - ] - ) - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0092_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0092_migration.py deleted file mode 100644 index 3fbd63d3d4..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0092_migration.py +++ /dev/null @@ -1,63 +0,0 @@ -# Generated by Django 3.2.15 on 2023-03-13 22:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("registration_datahub", "0091_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="importeddocumenttype", - name="type", - field=models.CharField( - choices=[ - ("BIRTH_CERTIFICATE", "Birth Certificate"), - ("DRIVERS_LICENSE", "Driver's License"), - ("ELECTORAL_CARD", "Electoral Card"), - ("NATIONAL_ID", "National ID"), - ("NATIONAL_PASSPORT", "National Passport"), - ("TAX_ID", "Tax Number Identification"), - ("RESIDENCE_PERMIT_NO", "Foreigner's Residence Permit"), - ("BANK_STATEMENT", "Bank Statement"), - ("DISABILITY_CERTIFICATE", "Disability Certificate"), - ("FOSTER_CHILD", "Foster Child"), - ("OTHER", "Other"), - ], - max_length=50, - ), - ), - migrations.AlterField( - model_name="importedindividual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("OTHER", "Other"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("FOSTER_CHILD", "Foster child"), - ], - default="", - max_length=255, - ), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0093_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0093_migration.py deleted file mode 100644 index 70bc605303..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0093_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-05 08:29 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0092_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedhousehold', - name='zip_code', - field=models.CharField(blank=True, max_length=12, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0094_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0094_migration.py deleted file mode 100644 index d6f0f6b368..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0094_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-04 16:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0093_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='importedindividual', - name='phone_no_alternative_valid', - field=models.BooleanField(null=True), - ), - migrations.AlterField( - model_name='importedindividual', - name='phone_no_valid', - field=models.BooleanField(null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0095_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0095_migration.py deleted file mode 100644 index 606fc718ef..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0095_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-06 10:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0094_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedindividual', - name='email', - field=models.CharField(blank=True, max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0096_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0096_migration.py deleted file mode 100644 index 57283d5211..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0096_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-06 11:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0095_migration'), - ] - - operations = [ - migrations.AddField( - model_name='diiaindividual', - name='email', - field=models.CharField(blank=True, max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0097_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0097_migration.py deleted file mode 100644 index 690ec0392f..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0097_migration.py +++ /dev/null @@ -1,26 +0,0 @@ -# Generated by Django 3.2.18 on 2023-04-04 09:30 - -from django.db import migrations, models -from django.db.models.functions import Lower - - -def update_document_type_keys(apps, schema_editor): - ImportedDocumentType = apps.get_model("registration_datahub", "ImportedDocumentType") - ImportedDocumentType.objects.all().update(key=Lower("key")) - - -class Migration(migrations.Migration): - - dependencies = [ - ("registration_datahub", "0096_migration"), - ] - - operations = [ - migrations.RenameField("ImportedDocumentType", "type", "key"), - migrations.RunPython(update_document_type_keys, reverse_code=migrations.RunPython.noop), - migrations.AlterField( - model_name="importeddocumenttype", - name="key", - field=models.CharField(max_length=50, unique=True), - ), - ] \ No newline at end of file diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0098_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0098_migration.py deleted file mode 100644 index e873f92db9..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0098_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-16 14:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0097_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedhousehold', - name='enumerator_rec_id', - field=models.PositiveIntegerField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0099_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0099_migration.py deleted file mode 100644 index 384d56ff65..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0099_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-30 13:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0098_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importeddocument', - name='expiry_date', - field=models.DateField(blank=True, db_index=True, null=True), - ), - migrations.AddField( - model_name='importeddocument', - name='issuance_date', - field=models.DateField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0100_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0100_migration.py deleted file mode 100644 index 9db2b1e2f4..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0100_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-19 08:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("registration_datahub", "0099_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="importedindividual", - name="relationship", - field=models.CharField( - blank=True, - choices=[ - ("UNKNOWN", "Unknown"), - ("AUNT_UNCLE", "Aunt / Uncle"), - ("BROTHER_SISTER", "Brother / Sister"), - ("COUSIN", "Cousin"), - ("DAUGHTERINLAW_SONINLAW", "Daughter-in-law / Son-in-law"), - ("GRANDDAUGHTER_GRANDSON", "Granddaughter / Grandson"), - ("GRANDMOTHER_GRANDFATHER", "Grandmother / Grandfather"), - ("HEAD", "Head of household (self)"), - ("MOTHER_FATHER", "Mother / Father"), - ("MOTHERINLAW_FATHERINLAW", "Mother-in-law / Father-in-law"), - ("NEPHEW_NIECE", "Nephew / Niece"), - ( - "NON_BENEFICIARY", - "Not a Family Member. Can only act as a recipient.", - ), - ("OTHER", "Other"), - ("SISTERINLAW_BROTHERINLAW", "Sister-in-law / Brother-in-law"), - ("SON_DAUGHTER", "Son / Daughter"), - ("WIFE_HUSBAND", "Wife / Husband"), - ("FOSTER_CHILD", "Foster child"), - ("FREE_UNION", "Free union"), - ], - default="", - max_length=255, - ), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0101_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0101_migration.py deleted file mode 100644 index 7483af8f55..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0101_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.20 on 2023-07-30 19:38 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0100_migration'), - ] - - operations = [ - migrations.AddField( - model_name='diiaindividual', - name='age_at_registration', - field=models.PositiveSmallIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name='importedindividual', - name='age_at_registration', - field=models.PositiveSmallIntegerField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0102_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0102_migration.py deleted file mode 100644 index 89a96a571f..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0102_migration.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-04 16:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0101_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedhousehold', - name='program_id', - field=models.UUIDField(blank=True, db_index=True, null=True), - ), - migrations.AddField( - model_name='importedindividual', - name='program_id', - field=models.UUIDField(blank=True, db_index=True, null=True), - ), - migrations.AlterField( - model_name='importedindividual', - name='relationship', - field=models.CharField(blank=True, choices=[('UNKNOWN', 'Unknown'), ('AUNT_UNCLE', 'Aunt / Uncle'), ('BROTHER_SISTER', 'Brother / Sister'), ('COUSIN', 'Cousin'), ('DAUGHTERINLAW_SONINLAW', 'Daughter-in-law / Son-in-law'), ('GRANDDAUGHER_GRANDSON', 'Granddaughter / Grandson'), ('GRANDMOTHER_GRANDFATHER', 'Grandmother / Grandfather'), ('HEAD', 'Head of household (self)'), ('MOTHER_FATHER', 'Mother / Father'), ('MOTHERINLAW_FATHERINLAW', 'Mother-in-law / Father-in-law'), ('NEPHEW_NIECE', 'Nephew / Niece'), ('NON_BENEFICIARY', 'Not a Family Member. Can only act as a recipient.'), ('OTHER', 'Other'), ('SISTERINLAW_BROTHERINLAW', 'Sister-in-law / Brother-in-law'), ('SON_DAUGHTER', 'Son / Daughter'), ('WIFE_HUSBAND', 'Wife / Husband'), ('FOSTER_CHILD', 'Foster child'), ('FREE_UNION', 'Free union')], default='', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0103_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0103_migration.py deleted file mode 100644 index e73d6b490b..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0103_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.20 on 2023-10-05 11:43 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0102_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='importedindividual', - name='preferred_language', - field=models.CharField(blank=True, choices=[('en-us', 'English | English'), ('ar-ae', ' | عربيArabic'), ('cs-cz', 'čeština | Czech'), ('de-de', 'Deutsch'), ('es-es', 'Español | Spanish'), ('fr-fr', 'Français | French'), ('hu-hu', 'Magyar | Hungarian'), ('it-it', 'Italiano'), ('pl-pl', 'Polskie | Polish'), ('pt-pt', 'Português'), ('ro-ro', 'Română'), ('ru-ru', 'Русский | Russian'), ('si-si', 'සිංහල | Sinhala'), ('ta-ta', 'தமிழ் | Tamil'), ('uk-ua', 'український | Ukrainian'), ('hi-hi', 'हिंदी')], max_length=6, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0104_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0104_migration.py deleted file mode 100644 index 23a5d0dab5..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0104_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.22 on 2023-10-18 16:43 - -from django.db import migrations -import phonenumber_field.modelfields - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0103_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedindividual', - name='payment_delivery_phone_no', - field=phonenumber_field.modelfields.PhoneNumberField(blank=True, default='', max_length=128, region=None), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0105_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0105_migration.py deleted file mode 100644 index f7b390f837..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0105_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-04 07:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0104_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='importedhousehold', - name='residence_status', - field=models.CharField(choices=[('', 'None'), ('IDP', 'Displaced | Internally Displaced People'), ('REFUGEE', 'Displaced | Refugee / Asylum Seeker'), ('OTHERS_OF_CONCERN', 'Displaced | Others of Concern'), ('HOST', 'Non-displaced | Host'), ('NON_HOST', 'Non-displaced | Non-host'), ('RETURNEE', 'Displaced | Returnee')], max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0106_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0106_migration.py deleted file mode 100644 index 35961f5058..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0106_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-08 10:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0105_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='importedhousehold', - name='size', - field=models.PositiveIntegerField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0107_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0107_migration.py deleted file mode 100644 index e68eddc7f1..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0107_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-04 13:35 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0106_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedbankaccountinfo', - name='account_holder_name', - field=models.CharField(blank=True, default='', max_length=255), - ), - migrations.AddField( - model_name='importedbankaccountinfo', - name='bank_branch_name', - field=models.CharField(blank=True, default='', max_length=255), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0108_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0108_migration.py deleted file mode 100644 index 9a4f82f7f3..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0108_migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-16 08:43 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0107_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='diiaindividual', - name='imported_individual', - ), - migrations.RemoveField( - model_name='diiaindividual', - name='registration_data_import', - ), - migrations.RemoveField( - model_name='importedhousehold', - name='diia_rec_id', - ), - migrations.AlterField( - model_name='importdata', - name='data_type', - field=models.CharField(choices=[('XLSX', 'XLSX File'), ('JSON', 'JSON File'), ('FLEX', 'Flex Registration')], default='XLSX', max_length=4), - ), - migrations.DeleteModel( - name='DiiaHousehold', - ), - migrations.DeleteModel( - name='DiiaIndividual', - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0109_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0109_migration.py deleted file mode 100644 index 17c03a6129..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0109_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-13 15:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0108_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedhousehold', - name='detail_id', - field=models.CharField(blank=True, help_text='Kobo asset ID, Xlsx row ID, Aurora source ID', max_length=150, null=True), - ), - migrations.AddField( - model_name='importedindividual', - name='detail_id', - field=models.CharField(blank=True, help_text='Kobo asset ID, Xlsx row ID, Aurora source ID', max_length=150, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0110_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0110_migration.py deleted file mode 100644 index 93e74daca1..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0110_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.24 on 2024-03-13 15:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0109_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedhousehold', - name='collect_type', - field=models.CharField(choices=[('STANDARD', 'Standard'), ('SINGLE', 'Single')], default='STANDARD', - max_length=8), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0111_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0111_migration.py deleted file mode 100644 index fb7d7cc420..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0111_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-05 14:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ('registration_datahub', '0110_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedhousehold', - name='program_registration_id', - field=models.CharField(blank=True, max_length=50, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0112_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0112_migration.py deleted file mode 100644 index ff93833ed3..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0112_migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 3.2.25 on 2024-04-26 15:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0111_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importedindividual', - name='blockchain_name', - field=models.CharField(blank=True, default='', max_length=64), - ), - migrations.AddField( - model_name='importedindividual', - name='wallet_address', - field=models.CharField(blank=True, default='', max_length=128), - ), - migrations.AddField( - model_name='importedindividual', - name='wallet_name', - field=models.CharField(blank=True, default='', max_length=64), - ), - migrations.AlterField( - model_name='importedhousehold', - name='currency', - field=models.CharField(choices=[('', 'None'), ('AED', 'United Arab Emirates dirham'), ('AFN', 'Afghan afghani'), ('ALL', 'Albanian lek'), ('AMD', 'Armenian dram'), ('ANG', 'Netherlands Antillean guilder'), ('AOA', 'Angolan kwanza'), ('ARS', 'Argentine peso'), ('AUD', 'Australian dollar'), ('AWG', 'Aruban florin'), ('AZN', 'Azerbaijani manat'), ('BAM', 'Bosnia and Herzegovina convertible mark'), ('BBD', 'Barbados dollar'), ('BDT', 'Bangladeshi taka'), ('BGN', 'Bulgarian lev'), ('BHD', 'Bahraini dinar'), ('BIF', 'Burundian franc'), ('BMD', 'Bermudian dollar'), ('BND', 'Brunei dollar'), ('BOB', 'Boliviano'), ('BOV', 'Bolivian Mvdol (funds code)'), ('BRL', 'Brazilian real'), ('BSD', 'Bahamian dollar'), ('BTN', 'Bhutanese ngultrum'), ('BWP', 'Botswana pula'), ('BYN', 'Belarusian ruble'), ('BZD', 'Belize dollar'), ('CAD', 'Canadian dollar'), ('CDF', 'Congolese franc'), ('CHF', 'Swiss franc'), ('CLP', 'Chilean peso'), ('CNY', 'Chinese yuan'), ('COP', 'Colombian peso'), ('CRC', 'Costa Rican colon'), ('CUC', 'Cuban convertible peso'), ('CUP', 'Cuban peso'), ('CVE', 'Cape Verdean escudo'), ('CZK', 'Czech koruna'), ('DJF', 'Djiboutian franc'), ('DKK', 'Danish krone'), ('DOP', 'Dominican peso'), ('DZD', 'Algerian dinar'), ('EGP', 'Egyptian pound'), ('ERN', 'Eritrean nakfa'), ('ETB', 'Ethiopian birr'), ('EUR', 'Euro'), ('FJD', 'Fiji dollar'), ('FKP', 'Falkland Islands pound'), ('GBP', 'Pound sterling'), ('GEL', 'Georgian lari'), ('GHS', 'Ghanaian cedi'), ('GIP', 'Gibraltar pound'), ('GMD', 'Gambian dalasi'), ('GNF', 'Guinean franc'), ('GTQ', 'Guatemalan quetzal'), ('GYD', 'Guyanese dollar'), ('HKD', 'Hong Kong dollar'), ('HNL', 'Honduran lempira'), ('HRK', 'Croatian kuna'), ('HTG', 'Haitian gourde'), ('HUF', 'Hungarian forint'), ('IDR', 'Indonesian rupiah'), ('ILS', 'Israeli new shekel'), ('INR', 'Indian rupee'), ('IQD', 'Iraqi dinar'), ('IRR', 'Iranian rial'), ('ISK', 'Icelandic króna'), ('JMD', 'Jamaican dollar'), ('JOD', 'Jordanian dinar'), ('JPY', 'Japanese yen'), ('KES', 'Kenyan shilling'), ('KGS', 'Kyrgyzstani som'), ('KHR', 'Cambodian riel'), ('KMF', 'Comoro franc'), ('KPW', 'North Korean won'), ('KRW', 'South Korean won'), ('KWD', 'Kuwaiti dinar'), ('KYD', 'Cayman Islands dollar'), ('KZT', 'Kazakhstani tenge'), ('LAK', 'Lao kip'), ('LBP', 'Lebanese pound'), ('LKR', 'Sri Lankan rupee'), ('LRD', 'Liberian dollar'), ('LSL', 'Lesotho loti'), ('LYD', 'Libyan dinar'), ('MAD', 'Moroccan dirham'), ('MDL', 'Moldovan leu'), ('MGA', 'Malagasy ariary'), ('MKD', 'Macedonian denar'), ('MMK', 'Myanmar kyat'), ('MNT', 'Mongolian tögrög'), ('MOP', 'Macanese pataca'), ('MRU', 'Mauritanian ouguiya'), ('MUR', 'Mauritian rupee'), ('MVR', 'Maldivian rufiyaa'), ('MWK', 'Malawian kwacha'), ('MXN', 'Mexican peso'), ('MYR', 'Malaysian ringgit'), ('MZN', 'Mozambican metical'), ('NAD', 'Namibian dollar'), ('NGN', 'Nigerian naira'), ('NIO', 'Nicaraguan córdoba'), ('NOK', 'Norwegian krone'), ('NPR', 'Nepalese rupee'), ('NZD', 'New Zealand dollar'), ('OMR', 'Omani rial'), ('PAB', 'Panamanian balboa'), ('PEN', 'Peruvian sol'), ('PGK', 'Papua New Guinean kina'), ('PHP', 'Philippine peso'), ('PKR', 'Pakistani rupee'), ('PLN', 'Polish złoty'), ('PYG', 'Paraguayan guaraní'), ('QAR', 'Qatari riyal'), ('RON', 'Romanian leu'), ('RSD', 'Serbian dinar'), ('RUB', 'Russian ruble'), ('RWF', 'Rwandan franc'), ('SAR', 'Saudi riyal'), ('SBD', 'Solomon Islands dollar'), ('SCR', 'Seychelles rupee'), ('SDG', 'Sudanese pound'), ('SEK', 'Swedish krona/kronor'), ('SGD', 'Singapore dollar'), ('SHP', 'Saint Helena pound'), ('SLL', 'Sierra Leonean leone'), ('SOS', 'Somali shilling'), ('SRD', 'Surinamese dollar'), ('SSP', 'South Sudanese pound'), ('STN', 'São Tomé and Príncipe dobra'), ('SVC', 'Salvadoran colón'), ('SYP', 'Syrian pound'), ('SZL', 'Swazi lilangeni'), ('THB', 'Thai baht'), ('TJS', 'Tajikistani somoni'), ('TMT', 'Turkmenistan manat'), ('TND', 'Tunisian dinar'), ('TOP', 'Tongan paʻanga'), ('TRY', 'Turkish lira'), ('TTD', 'Trinidad and Tobago dollar'), ('TWD', 'New Taiwan dollar'), ('TZS', 'Tanzanian shilling'), ('UAH', 'Ukrainian hryvnia'), ('UGX', 'Ugandan shilling'), ('USD', 'United States dollar'), ('UYU', 'Uruguayan peso'), ('UYW', 'Unidad previsional[14]'), ('UZS', 'Uzbekistan som'), ('VES', 'Venezuelan bolívar soberano'), ('VND', 'Vietnamese đồng'), ('VUV', 'Vanuatu vatu'), ('WST', 'Samoan tala'), ('XAF', 'CFA franc BEAC'), ('XAG', 'Silver (one troy ounce)'), ('XAU', 'Gold (one troy ounce)'), ('XCD', 'East Caribbean dollar'), ('XOF', 'CFA franc BCEAO'), ('XPF', 'CFP franc (franc Pacifique)'), ('YER', 'Yemeni rial'), ('ZAR', 'South African rand'), ('ZMW', 'Zambian kwacha'), ('ZWL', 'Zimbabwean dollar'), ('USDC', 'USD Coin')], default='', max_length=250), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0113_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0113_migration.py deleted file mode 100644 index 3ddd6aea1b..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0113_migration.py +++ /dev/null @@ -1,58 +0,0 @@ - -# Generated by Django 3.2.25 on 2024-04-23 17:25 - -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0112_migration'), - ] - - operations = [ - migrations.AddField( - model_name='importdata', - name='delivery_mechanisms_validation_errors', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='importdata', - name='status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('RUNNING', 'Running'), ('FINISHED', 'Finished'), ('ERROR', 'Error'), ('VALIDATION_ERROR', 'Validation Error'), ('DELIVERY_MECHANISMS_VALIDATION_ERROR', 'Delivery Mechanisms Validation Error')], default='FINISHED', max_length=40), - ), - migrations.CreateModel( - name='ImportedDeliveryMechanismData', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('data', models.JSONField(blank=True, default=dict)), - ('delivery_mechanism', models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), ('Cash over the counter', 'Cash over the counter')], max_length=255, verbose_name='Delivery Mechanism')), - ('is_valid', models.BooleanField(default=False)), - ('validation_errors', models.JSONField(default=dict)), - ('unique_key', models.CharField(blank=True, editable=False, max_length=256, null=True, unique=True)), - ('individual', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='delivery_mechanisms_data', to='registration_datahub.importedindividual')), - ], - options={ - 'abstract': False, - }, - bases=(models.Model, ), - ), - migrations.AlterField( - model_name='importeddeliverymechanismdata', - name='delivery_mechanism', - field=models.CharField(choices=[('Cardless cash withdrawal', 'Cardless cash withdrawal'), ('Cash', 'Cash'), - ('Cash by FSP', 'Cash by FSP'), ('Cheque', 'Cheque'), - ('Deposit to Card', 'Deposit to Card'), ('Mobile Money', 'Mobile Money'), - ('Pre-paid card', 'Pre-paid card'), ('Referral', 'Referral'), - ('Transfer', 'Transfer'), ('Transfer to Account', 'Transfer to Account'), - ('Voucher', 'Voucher'), ('ATM Card', 'ATM Card'), - ('Cash over the counter', 'Cash over the counter'), - ('Transfer to Digital Wallet', 'Transfer to Digital Wallet')], - max_length=255, verbose_name='Delivery Mechanism'), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0114_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0114_migration.py deleted file mode 100644 index 5f9649d5fd..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0114_migration.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-11 14:49 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0113_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='importedhousehold', - name='kobo_asset_id', - ), - migrations.RemoveField( - model_name='importedhousehold', - name='row_id', - ), - migrations.RemoveField( - model_name='importedindividual', - name='kobo_asset_id', - ), - migrations.RemoveField( - model_name='importedindividual', - name='row_id', - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0115_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0115_migration.py deleted file mode 100644 index a80a7769ef..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0115_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-19 11:26 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0114_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='importeddeliverymechanismdata', - name='individual', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='delivery_mechanisms_data', to='registration_datahub.importedindividual'), - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0116_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0116_migration.py deleted file mode 100644 index 7b22cb106f..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0116_migration.py +++ /dev/null @@ -1,16 +0,0 @@ -# Generated by Django 3.2.25 on 2024-06-23 22:05 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0115_migration'), - ] - - operations = [ - migrations.DeleteModel( - name='ImportedDeliveryMechanismData', - ), - ] diff --git a/src/hct_mis_api/apps/registration_datahub/migrations/0117_migration.py b/src/hct_mis_api/apps/registration_datahub/migrations/0117_migration.py deleted file mode 100644 index 90e7a95ef0..0000000000 --- a/src/hct_mis_api/apps/registration_datahub/migrations/0117_migration.py +++ /dev/null @@ -1,120 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-02 13:19 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registration_datahub', '0116_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='importedbankaccountinfo', - name='individual', - ), - migrations.RemoveField( - model_name='importeddocument', - name='individual', - ), - migrations.RemoveField( - model_name='importeddocument', - name='type', - ), - migrations.RemoveField( - model_name='importedhousehold', - name='flex_registrations_record', - ), - migrations.RemoveField( - model_name='importedhousehold', - name='head_of_household', - ), - migrations.RemoveField( - model_name='importedhousehold', - name='registration_data_import', - ), - migrations.RemoveField( - model_name='importedindividual', - name='household', - ), - migrations.RemoveField( - model_name='importedindividual', - name='registration_data_import', - ), - migrations.RemoveField( - model_name='importedindividualidentity', - name='individual', - ), - migrations.AlterUniqueTogether( - name='importedindividualroleinhousehold', - unique_together=None, - ), - migrations.RemoveField( - model_name='importedindividualroleinhousehold', - name='household', - ), - migrations.RemoveField( - model_name='importedindividualroleinhousehold', - name='individual', - ), - migrations.RemoveField( - model_name='koboimportdata', - name='importdata_ptr', - ), - migrations.RemoveField( - model_name='koboimportedsubmission', - name='imported_household', - ), - migrations.RemoveField( - model_name='koboimportedsubmission', - name='registration_data_import', - ), - migrations.RemoveField( - model_name='record', - name='registration_data_import', - ), - migrations.RemoveField( - model_name='registrationdataimportdatahub', - name='import_data', - ), - migrations.DeleteModel( - name='DocumentValidator', - ), - migrations.DeleteModel( - name='ImportData', - ), - migrations.DeleteModel( - name='ImportedBankAccountInfo', - ), - migrations.DeleteModel( - name='ImportedDocument', - ), - migrations.DeleteModel( - name='ImportedDocumentType', - ), - migrations.DeleteModel( - name='ImportedHousehold', - ), - migrations.DeleteModel( - name='ImportedIndividual', - ), - migrations.DeleteModel( - name='ImportedIndividualIdentity', - ), - migrations.DeleteModel( - name='ImportedIndividualRoleInHousehold', - ), - migrations.DeleteModel( - name='KoboImportData', - ), - migrations.DeleteModel( - name='KoboImportedSubmission', - ), - migrations.DeleteModel( - name='Record', - ), - migrations.DeleteModel( - name='RegistrationDataImportDatahub', - ), - ] diff --git a/src/hct_mis_api/apps/reporting/migrations/0005_migration_squashed_0007_migration.py b/src/hct_mis_api/apps/reporting/migrations/0001_migration.py similarity index 53% rename from src/hct_mis_api/apps/reporting/migrations/0005_migration_squashed_0007_migration.py rename to src/hct_mis_api/apps/reporting/migrations/0001_migration.py index ee5b87d46c..629193a44c 100644 --- a/src/hct_mis_api/apps/reporting/migrations/0005_migration_squashed_0007_migration.py +++ b/src/hct_mis_api/apps/reporting/migrations/0001_migration.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.19 on 2023-06-09 07:14 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.conf import settings from django.db import migrations, models @@ -10,14 +10,37 @@ class Migration(migrations.Migration): + initial = True + dependencies = [ - ('core', '0007_migration_squashed_0016_migration'), - ('reporting', '0001_migration_squashed_0004_migration'), - ('program', '0002_migration_squashed_0020_migration'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('geo', '0001_migration'), + ('core', '0001_migration'), + ('program', '0001_migration'), ] operations = [ + migrations.CreateModel( + name='Report', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('file', models.FileField(blank=True, null=True, upload_to='')), + ('status', models.IntegerField(choices=[(1, 'Processing'), (2, 'Generated'), (3, 'Failed')], default=1)), + ('report_type', models.IntegerField(choices=[(1, 'Individuals'), (2, 'Households'), (3, 'Cash Plan Verification'), (4, 'Payments'), (5, 'Payment verification'), (10, 'Payment Plan'), (6, 'Cash Plan'), (7, 'Programme'), (8, 'Individuals & Payment'), (9, 'Grievances')])), + ('date_from', models.DateField()), + ('date_to', models.DateField()), + ('number_of_records', models.IntegerField(blank=True, null=True)), + ('admin_area', models.ManyToManyField(blank=True, related_name='reports', to='geo.Area')), + ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reports', to='core.businessarea')), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reports', to=settings.AUTH_USER_MODEL)), + ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reports', to='program.program')), + ], + options={ + 'ordering': ['-created_at', 'report_type', 'status', 'created_by'], + }, + ), migrations.CreateModel( name='DashboardReport', fields=[ @@ -27,8 +50,8 @@ class Migration(migrations.Migration): ('file', models.FileField(blank=True, null=True, upload_to='')), ('status', models.PositiveSmallIntegerField(choices=[(1, 'Processing'), (2, 'Generated'), (3, 'Failed')], default=1)), ('report_type', hct_mis_api.apps.account.fields.ChoiceArrayField(base_field=models.CharField(choices=[('TOTAL_TRANSFERRED_BY_COUNTRY', 'Total transferred by country'), ('TOTAL_TRANSFERRED_BY_ADMIN_AREA', 'Total transferred by admin area'), ('BENEFICIARIES_REACHED', 'Beneficiaries reached'), ('INDIVIDUALS_REACHED', 'Individuals reached drilldown'), ('VOLUME_BY_DELIVERY_MECHANISM', 'Volume by delivery mechanism'), ('GRIEVANCES_AND_FEEDBACK', 'Grievances and Feedback'), ('PROGRAMS', 'Programmes'), ('PAYMENT_VERIFICATION', 'Payment verification')], max_length=255), size=None)), - ('year', models.PositiveSmallIntegerField(default=2021)), - ('admin_area', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dashboard_reports', to='core.adminarea')), + ('year', models.PositiveSmallIntegerField(default=2024)), + ('admin_area', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dashboard_reports', to='geo.area')), ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dashboard_reports', to='core.businessarea')), ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dashboard_reports', to=settings.AUTH_USER_MODEL)), ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dashboard_reports', to='program.program')), diff --git a/src/hct_mis_api/apps/reporting/migrations/0001_migration_squashed_0004_migration.py b/src/hct_mis_api/apps/reporting/migrations/0001_migration_squashed_0004_migration.py deleted file mode 100644 index 2d072582d1..0000000000 --- a/src/hct_mis_api/apps/reporting/migrations/0001_migration_squashed_0004_migration.py +++ /dev/null @@ -1,41 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-09 07:13 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import model_utils.fields -import uuid - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('program', '0002_migration_squashed_0020_migration'), - ('core', '0002_migration_squashed_0006_migration'), - ] - - operations = [ - migrations.CreateModel( - name='report', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('file', models.FileField(blank=True, null=True, upload_to='')), - ('status', models.IntegerField(choices=[(1, 'Processing'), (2, 'Generated'), (3, 'Failed')], default=1)), - ('report_type', models.IntegerField(choices=[(1, 'Individuals'), (2, 'Households'), (3, 'Cash Plan Verification'), (4, 'Payments'), (5, 'Payment verification'), (6, 'Cash Plan'), (7, 'Programme'), (8, 'Individuals & Payment')])), - ('date_from', models.DateField()), - ('date_to', models.DateField()), - ('business_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reports', to='core.businessarea')), - ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reports', to=settings.AUTH_USER_MODEL)), - ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reports', to='program.program')), - ('admin_area', models.ManyToManyField(blank=True, related_name='reports', to='core.AdminArea')), - ('number_of_records', models.IntegerField(blank=True, null=True)), - ], - options={ - 'abstract': False, - 'ordering': ['-created_at', 'report_type', 'status', 'created_by'], - }, - ), - ] diff --git a/src/hct_mis_api/apps/reporting/migrations/0008_migration_squashed_0014_migration.py b/src/hct_mis_api/apps/reporting/migrations/0008_migration_squashed_0014_migration.py deleted file mode 100644 index b62d51e516..0000000000 --- a/src/hct_mis_api/apps/reporting/migrations/0008_migration_squashed_0014_migration.py +++ /dev/null @@ -1,43 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-11 10:54 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('reporting', '0005_migration_squashed_0007_migration'), - ('geo', '0004_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='dashboardreport', - name='year', - field=models.PositiveSmallIntegerField(default=2022), - ), - migrations.AlterField( - model_name='report', - name='report_type', - field=models.IntegerField(choices=[(1, 'Individuals'), (2, 'Households'), (3, 'Cash Plan Verification'), (4, 'Payments'), (5, 'Payment verification'), (6, 'Cash Plan'), (7, 'Programme'), (8, 'Individuals & Payment'), (9, 'Grievances')]), - ), - migrations.RemoveField( - model_name='dashboardreport', - name='admin_area', - ), - migrations.AddField( - model_name='dashboardreport', - name='admin_area', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dashboard_reports', to='geo.area'), - ), - migrations.RemoveField( - model_name='report', - name='admin_area', - ), - migrations.AddField( - model_name='report', - name='admin_area', - field=models.ManyToManyField(blank=True, related_name='reports', to='geo.Area'), - ), - ] diff --git a/src/hct_mis_api/apps/reporting/migrations/0015_migration.py b/src/hct_mis_api/apps/reporting/migrations/0015_migration.py deleted file mode 100644 index fbe5249bbc..0000000000 --- a/src/hct_mis_api/apps/reporting/migrations/0015_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2023-01-12 18:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reporting', '0008_migration_squashed_0014_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='dashboardreport', - name='year', - field=models.PositiveSmallIntegerField(default=2023), - ), - ] diff --git a/src/hct_mis_api/apps/reporting/migrations/0015_migration_squashed_0017_migration.py b/src/hct_mis_api/apps/reporting/migrations/0015_migration_squashed_0017_migration.py deleted file mode 100644 index 75c90b4ad6..0000000000 --- a/src/hct_mis_api/apps/reporting/migrations/0015_migration_squashed_0017_migration.py +++ /dev/null @@ -1,30 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 06:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - replaces = [('reporting', '0015_migration'), ('reporting', '0016_migration'), ('reporting', '0017_migration')] - - dependencies = [ - ('reporting', '0008_migration_squashed_0014_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='dashboardreport', - name='year', - field=models.PositiveSmallIntegerField(default=2023), - ), - migrations.AlterField( - model_name='report', - name='report_type', - field=models.IntegerField(choices=[(1, 'Individuals'), (2, 'Households'), (3, 'Cash Plan Verification'), (4, 'Payments'), (5, 'Payment verification'), (10, 'Payment Plan'), (6, 'Cash Plan'), (7, 'Programme'), (8, 'Individuals & Payment'), (9, 'Grievances')]), - ), - migrations.AlterField( - model_name='dashboardreport', - name='year', - field=models.PositiveSmallIntegerField(default=2024), - ), - ] diff --git a/src/hct_mis_api/apps/reporting/migrations/0016_migration.py b/src/hct_mis_api/apps/reporting/migrations/0016_migration.py deleted file mode 100644 index 7e0d51bce4..0000000000 --- a/src/hct_mis_api/apps/reporting/migrations/0016_migration.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 3.2.13 on 2022-08-31 09:18 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("reporting", "0015_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="report", - name="report_type", - field=models.IntegerField( - choices=[ - (1, "Individuals"), - (2, "Households"), - (3, "Cash Plan Verification"), - (4, "Payments"), - (5, "Payment verification"), - (10, "Payment Plan"), - (6, "Cash Plan"), - (7, "Programme"), - (8, "Individuals & Payment"), - (9, "Grievances"), - ] - ), - ), - ] diff --git a/src/hct_mis_api/apps/reporting/migrations/0017_migration.py b/src/hct_mis_api/apps/reporting/migrations/0017_migration.py deleted file mode 100644 index 1af180233a..0000000000 --- a/src/hct_mis_api/apps/reporting/migrations/0017_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-01-04 07:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('reporting', '0016_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='dashboardreport', - name='year', - field=models.PositiveSmallIntegerField(default=2024), - ), - ] diff --git a/src/hct_mis_api/apps/sanction_list/migrations/0001_migration_squashed_0009_migration.py b/src/hct_mis_api/apps/sanction_list/migrations/0001_migration.py similarity index 58% rename from src/hct_mis_api/apps/sanction_list/migrations/0001_migration_squashed_0009_migration.py rename to src/hct_mis_api/apps/sanction_list/migrations/0001_migration.py index 233c25cec4..4116ddf7bf 100644 --- a/src/hct_mis_api/apps/sanction_list/migrations/0001_migration_squashed_0009_migration.py +++ b/src/hct_mis_api/apps/sanction_list/migrations/0001_migration.py @@ -1,21 +1,17 @@ -# Generated by Django 3.2.19 on 2023-06-09 07:15 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.db import migrations, models import django.db.models.deletion -import django_countries.fields import model_utils.fields import uuid -def remove_all(apps, schema_editor): - SanctionListIndividual = apps.get_model( - "sanction_list", "SanctionListIndividual" - ) - SanctionListIndividual.objects.all().delete() - class Migration(migrations.Migration): + initial = True + dependencies = [ + ('geo', '0001_migration'), ] operations = [ @@ -23,13 +19,14 @@ class Migration(migrations.Migration): name='SanctionListIndividual', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), ('data_id', models.PositiveIntegerField()), ('version_num', models.PositiveIntegerField()), ('first_name', models.CharField(max_length=85)), - ('second_name', models.CharField(max_length=85)), + ('second_name', models.CharField(blank=True, default='', max_length=85)), ('third_name', models.CharField(blank=True, default='', max_length=85)), + ('fourth_name', models.CharField(blank=True, default='', max_length=85)), ('full_name', models.CharField(max_length=255)), ('name_original_script', models.CharField(blank=True, default='', max_length=255)), ('un_list_type', models.CharField(blank=True, default='', max_length=100)), @@ -38,17 +35,25 @@ class Migration(migrations.Migration): ('comments', models.TextField(blank=True, default='')), ('designation', models.TextField(blank=True, default='')), ('list_type', models.CharField(max_length=50)), - ('quality', models.CharField(blank=True, default='', max_length=50)), - ('alias_name', models.CharField(blank=True, default='', max_length=255)), ('street', models.CharField(blank=True, default='', max_length=255)), ('city', models.CharField(blank=True, default='', max_length=255)), ('state_province', models.CharField(blank=True, default='', max_length=255)), ('address_note', models.CharField(blank=True, default='', max_length=255)), - ('date_of_birth', models.DateField(blank=True, default=None, null=True)), - ('year_of_birth', models.PositiveIntegerField(default=None, null=True)), - ('country_of_birth', django_countries.fields.CountryField(blank=True, default='', max_length=2)), ('active', models.BooleanField(default=True)), - ('second_year_of_birth', models.PositiveIntegerField(default=None, null=True)), + ('country_of_birth', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='UploadedXLSXFile', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('file', models.FileField(upload_to='')), + ('associated_email', models.EmailField(max_length=254)), ], options={ 'abstract': False, @@ -58,10 +63,10 @@ class Migration(migrations.Migration): name='SanctionListIndividualNationalities', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('nationality', django_countries.fields.CountryField(max_length=2)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), ('individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='nationalities', to='sanction_list.sanctionlistindividual')), + ('nationality', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country')), ], options={ 'abstract': False, @@ -71,86 +76,45 @@ class Migration(migrations.Migration): name='SanctionListIndividualDocument', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), ('document_number', models.CharField(max_length=255)), ('type_of_document', models.CharField(max_length=255)), ('date_of_issue', models.CharField(blank=True, default='', max_length=255, null=True)), - ('issuing_country', django_countries.fields.CountryField(blank=True, default='', max_length=2)), ('note', models.CharField(blank=True, default='', max_length=255)), ('individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='sanction_list.sanctionlistindividual')), + ('issuing_country', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country')), ], options={ 'abstract': False, }, ), migrations.CreateModel( - name='SanctionListIndividualCountries', + name='SanctionListIndividualDateOfBirth', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('country', django_countries.fields.CountryField(max_length=2)), - ('individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='countries', to='sanction_list.sanctionlistindividual')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('date', models.DateField()), + ('individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dates_of_birth', to='sanction_list.sanctionlistindividual')), ], options={ 'abstract': False, }, ), migrations.CreateModel( - name='UploadedXLSXFile', + name='SanctionListIndividualCountries', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('file', models.FileField(upload_to='')), - ('associated_email', models.EmailField(max_length=254)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('country', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.country')), + ('individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='countries', to='sanction_list.sanctionlistindividual')), ], options={ 'abstract': False, }, ), - migrations.RunPython(remove_all, migrations.RunPython.noop), - migrations.RemoveField( - model_name='sanctionlistindividual', - name='quality', - ), - migrations.RemoveField( - model_name='sanctionlistindividual', - name='second_year_of_birth', - ), - migrations.RemoveField( - model_name='sanctionlistindividual', - name='year_of_birth', - ), - migrations.AddField( - model_name='sanctionlistindividual', - name='fourth_name', - field=models.CharField(blank=True, default='', max_length=85), - ), - migrations.RemoveField( - model_name='sanctionlistindividual', - name='alias_name', - ), - migrations.RemoveField( - model_name='sanctionlistindividual', - name='date_of_birth', - ), - migrations.AlterField( - model_name='sanctionlistindividual', - name='second_name', - field=models.CharField(blank=True, default='', max_length=85), - ), - migrations.AlterField( - model_name='sanctionlistindividual', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='sanctionlistindividual', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), migrations.CreateModel( name='SanctionListIndividualAliasName', fields=[ @@ -164,57 +128,4 @@ class Migration(migrations.Migration): 'abstract': False, }, ), - migrations.AlterField( - model_name='sanctionlistindividualcountries', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='sanctionlistindividualcountries', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.CreateModel( - name='SanctionListIndividualDateOfBirth', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('date', models.DateField()), - ('individual', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dates_of_birth', to='sanction_list.sanctionlistindividual')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AlterField( - model_name='sanctionlistindividualdocument', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='sanctionlistindividualdocument', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='sanctionlistindividualnationalities', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='sanctionlistindividualnationalities', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='uploadedxlsxfile', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='uploadedxlsxfile', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), ] diff --git a/src/hct_mis_api/apps/sanction_list/migrations/0010_migration.py b/src/hct_mis_api/apps/sanction_list/migrations/0010_migration.py deleted file mode 100644 index 91e8d165b8..0000000000 --- a/src/hct_mis_api/apps/sanction_list/migrations/0010_migration.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 2.2.16 on 2021-09-16 17:12 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('geo', '0003_migration'), - ('sanction_list', '0001_migration_squashed_0009_migration'), - ] - - operations = [ - migrations.AddField( - model_name='sanctionlistindividual', - name='country_of_birth_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.Country'), - ), - migrations.AddField( - model_name='sanctionlistindividualcountries', - name='country_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.Country'), - ), - migrations.AddField( - model_name='sanctionlistindividualdocument', - name='issuing_country_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.Country'), - ), - migrations.AddField( - model_name='sanctionlistindividualnationalities', - name='nationality_new', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='geo.Country'), - ), - ] diff --git a/src/hct_mis_api/apps/sanction_list/migrations/0011_migration_squashed_0018_migration.py b/src/hct_mis_api/apps/sanction_list/migrations/0011_migration_squashed_0018_migration.py deleted file mode 100644 index 82f79233cf..0000000000 --- a/src/hct_mis_api/apps/sanction_list/migrations/0011_migration_squashed_0018_migration.py +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-11 12:42 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sanction_list', '0010_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='sanctionlistindividualcountries', - name='country', - ), - migrations.RenameField( - model_name='sanctionlistindividualcountries', - old_name='country_new', - new_name='country', - ), - migrations.RemoveField( - model_name='sanctionlistindividualnationalities', - name='nationality', - ), - migrations.RenameField( - model_name='sanctionlistindividualnationalities', - old_name='nationality_new', - new_name='nationality', - ), - migrations.RemoveField( - model_name='sanctionlistindividualdocument', - name='issuing_country', - ), - migrations.RenameField( - model_name='sanctionlistindividualdocument', - old_name='issuing_country_new', - new_name='issuing_country', - ), - migrations.RemoveField( - model_name='sanctionlistindividual', - name='country_of_birth', - ), - migrations.RenameField( - model_name='sanctionlistindividual', - old_name='country_of_birth_new', - new_name='country_of_birth', - ), - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0001_migration.py b/src/hct_mis_api/apps/steficon/migrations/0001_migration.py index 08974587d9..2e12e7e32e 100644 --- a/src/hct_mis_api/apps/steficon/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/steficon/migrations/0001_migration.py @@ -1,8 +1,12 @@ -# Generated by Django 2.2.16 on 2020-10-28 14:29 +# Generated by Django 3.2.25 on 2024-11-07 12:18 +import concurrency.fields +from django.conf import settings +import django.contrib.postgres.fields +import django.contrib.postgres.fields.citext +import django.core.validators from django.db import migrations, models -import model_utils.fields -import uuid +import django.db.models.deletion class Migration(migrations.Migration): @@ -10,23 +14,58 @@ class Migration(migrations.Migration): initial = True dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('core', '0001_migration'), ] operations = [ migrations.CreateModel( name='Rule', fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.CharField(max_length=100, unique=True)), - ('definition', models.TextField(blank=True)), + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('version', concurrency.fields.AutoIncVersionField(default=0, help_text='record revision number')), + ('name', django.contrib.postgres.fields.citext.CICharField(max_length=100, unique=True, validators=[django.core.validators.ProhibitNullCharactersValidator(), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True)])), + ('definition', models.TextField(blank=True, default='result.value=0')), + ('description', models.TextField(blank=True, null=True)), ('enabled', models.BooleanField(default=False)), ('deprecated', models.BooleanField(default=False)), - ('language', models.CharField(choices=[['jinja2', 'Jinja2'], ['internal', 'internal'], ['python', 'Python']], max_length=10)), + ('language', models.CharField(choices=[('python', 'Python')], default='python', max_length=10)), + ('security', models.IntegerField(choices=[(0, 'Low'), (2, 'Medium'), (4, 'High')], default=2)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('type', models.CharField(choices=[('PAYMENT_PLAN', 'Payment Plan'), ('TARGETING', 'Targeting')], default='TARGETING', help_text='Use Rule for Targeting or Payment Plan', max_length=50)), + ('flags', models.JSONField(blank=True, default=dict)), + ('allowed_business_areas', models.ManyToManyField(blank=True, to='core.BusinessArea')), + ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)), + ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)), ], options={ 'abstract': False, }, ), + migrations.CreateModel( + name='RuleCommit', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('timestamp', models.DateTimeField(auto_now=True)), + ('version', models.IntegerField()), + ('definition', models.TextField(blank=True, default='result.value=0')), + ('is_release', models.BooleanField(default=False)), + ('enabled', models.BooleanField(default=False)), + ('deprecated', models.BooleanField(default=False)), + ('language', models.CharField(choices=[('python', 'Python')], default='python', max_length=10)), + ('affected_fields', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=None)), + ('before', models.JSONField(default=dict, editable=False, help_text='The record before change')), + ('after', models.JSONField(default=dict, editable=False, help_text='The record after apply changes')), + ('rule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='history', to='steficon.rule')), + ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'RuleCommit', + 'verbose_name_plural': 'Rule Commits', + 'ordering': ('-version',), + 'get_latest_by': '-version', + 'unique_together': {('rule', 'version')}, + }, + ), ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0002_migration.py b/src/hct_mis_api/apps/steficon/migrations/0002_migration.py deleted file mode 100644 index c6d99e25b0..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0002_migration.py +++ /dev/null @@ -1,13 +0,0 @@ -# Generated by Django 2.2.16 on 2021-02-04 12:28 -from django.contrib.postgres.operations import CITextExtension -from django.db import migrations - - -class Migration(migrations.Migration): - dependencies = [ - ('steficon', '0001_migration'), - ] - - operations = [ - CITextExtension() - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0003_migration_squashed_0007_empty_rules.py b/src/hct_mis_api/apps/steficon/migrations/0003_migration_squashed_0007_empty_rules.py deleted file mode 100644 index ed4a8a77f9..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0003_migration_squashed_0007_empty_rules.py +++ /dev/null @@ -1,103 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 12:53 - -import concurrency.fields -from django.conf import settings -import django.contrib.postgres.fields -import django.contrib.postgres.fields.citext -import django.contrib.postgres.fields.jsonb -import django.core.validators -from django.db import migrations, models -import django.db.models.deletion - - -def noop(apps, schema_editor): - pass - -def remove_all_rules(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - Rule = apps.get_model("steficon", "Rule") - RuleCommit = apps.get_model("steficon", "RuleCommit") - TargetPopulation._default_manager.update(steficon_rule=None) - Rule.objects.all().delete() - RuleCommit.objects.all().delete() - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0007_migration_squashed_0028_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('steficon', '0002_migration'), - ] - - operations = [ - migrations.AddField( - model_name='rule', - name='created_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='rule', - name='updated_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='rule', - name='version', - field=concurrency.fields.AutoIncVersionField(default=0, help_text='record revision number'), - ), - migrations.AlterField( - model_name='rule', - name='definition', - field=models.TextField(blank=True, default='score.value=0'), - ), - migrations.AlterField( - model_name='rule', - name='language', - field=models.CharField(choices=[['python', 'Python'], ['jinja2', 'Jinja2'], ['internal', 'internal']], default='python', max_length=10), - ), - migrations.AlterField( - model_name='rule', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(max_length=100, unique=True), - ), - migrations.AlterField( - model_name='rule', - name='language', - field=models.CharField(choices=[['python', 'Python'], ['internal', 'internal']], default='python', max_length=10), - ), - migrations.AlterField( - model_name='rule', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(max_length=100, unique=True, validators=[django.core.validators.ProhibitNullCharactersValidator(), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True)]), - ), - migrations.CreateModel( - name='RuleCommit', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('timestamp', models.DateTimeField(auto_now=True)), - ('version', models.IntegerField()), - ('affected_fields', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=None)), - ('before', django.contrib.postgres.fields.jsonb.JSONField(editable=False, help_text='The record before change')), - ('after', django.contrib.postgres.fields.jsonb.JSONField(editable=False, help_text='The record after apply changes')), - ('rule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='history', to='steficon.rule')), - ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'verbose_name': 'Rule (History)', - 'verbose_name_plural': 'Rules (History)', - 'ordering': ('-timestamp',), - 'get_latest_by': '-timestamp', - }, - ), - migrations.AlterField( - model_name='rule', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='rule', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.RunPython(remove_all_rules, noop), - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0008_reset_id_squashed_0010_migration.py b/src/hct_mis_api/apps/steficon/migrations/0008_reset_id_squashed_0010_migration.py deleted file mode 100644 index d3d0fd454d..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0008_reset_id_squashed_0010_migration.py +++ /dev/null @@ -1,70 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 12:52 - -from django.conf import settings -import django.contrib.postgres.fields -import django.contrib.postgres.fields.jsonb -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('steficon', '0003_migration_squashed_0007_empty_rules'), - ] - - operations = [ - migrations.DeleteModel( - name='RuleCommit', - ), - migrations.RemoveField( - model_name='rule', - name='id', - ), - migrations.AddField( - model_name='rule', - name='id', - field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - preserve_default=False, - ), - migrations.AddField( - model_name='rule', - name='description', - field=models.TextField(blank=True, null=True), - ), - migrations.AddField( - model_name='rule', - name='security', - field=models.IntegerField(choices=[(0, 'Low'), (2, 'Medium'), (4, 'High')], default=2), - ), - migrations.AlterField( - model_name='rule', - name='definition', - field=models.TextField(blank=True, default='result.value=0'), - ), - migrations.CreateModel( - name='RuleCommit', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('timestamp', models.DateTimeField(auto_now=True)), - ('version', models.IntegerField()), - ('definition', models.TextField(blank=True, default='result.value=0')), - ('is_release', models.BooleanField(default=False)), - ('enabled', models.BooleanField(default=False)), - ('deprecated', models.BooleanField(default=False)), - ('language', models.CharField(choices=[['python', 'Python'], ['internal', 'internal']], default='python', max_length=10)), - ('affected_fields', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=None)), - ('before', django.contrib.postgres.fields.jsonb.JSONField(editable=False, help_text='The record before change')), - ('after', django.contrib.postgres.fields.jsonb.JSONField(editable=False, help_text='The record after apply changes')), - ('rule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='history', to='steficon.rule')), - ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to=settings.AUTH_USER_MODEL)), - ], - options={ - 'verbose_name': 'Rule (History)', - 'verbose_name_plural': 'Rules (History)', - 'ordering': ('-timestamp',), - 'get_latest_by': '-timestamp', - }, - ), - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0011_migration_squashed_0016_migration.py b/src/hct_mis_api/apps/steficon/migrations/0011_migration_squashed_0016_migration.py deleted file mode 100644 index a1c3f8fbf4..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0011_migration_squashed_0016_migration.py +++ /dev/null @@ -1,71 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 12:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('steficon', '0008_reset_id_squashed_0010_migration'), - ('targeting', '0031_migration'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='rulecommit', - unique_together={('rule', 'version')}, - ), - migrations.AlterModelOptions( - name='rulecommit', - options={'get_latest_by': '-timestamp', 'ordering': ('-timestamp',), 'verbose_name': 'RuleCommit', 'verbose_name_plural': 'Rule Commits'}, - ), - migrations.AlterField( - model_name='rule', - name='language', - field=models.CharField(choices=[['python', 'Python']], default='python', max_length=10), - ), - migrations.AlterField( - model_name='rulecommit', - name='language', - field=models.CharField(choices=[['python', 'Python']], default='python', max_length=10), - ), - migrations.AddField( - model_name='rule', - name='flags', - field=models.JSONField(blank=True, default=dict), - ), - migrations.AlterField( - model_name='rulecommit', - name='after', - field=models.JSONField(editable=False, help_text='The record after apply changes'), - ), - migrations.AlterField( - model_name='rulecommit', - name='before', - field=models.JSONField(editable=False, help_text='The record before change'), - ), - migrations.AlterField( - model_name='rulecommit', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - migrations.AlterField( - model_name='rule', - name='id', - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), - ), - migrations.AlterModelOptions( - name='rulecommit', - options={'get_latest_by': '-version', 'ordering': ('-version',), 'verbose_name': 'RuleCommit', 'verbose_name_plural': 'Rule Commits'}, - ), - migrations.AlterField( - model_name='rulecommit', - name='after', - field=models.JSONField(default=dict, editable=False, help_text='The record after apply changes'), - ), - migrations.AlterField( - model_name='rulecommit', - name='before', - field=models.JSONField(default=dict, editable=False, help_text='The record before change'), - ), - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0017_migration.py b/src/hct_mis_api/apps/steficon/migrations/0017_migration.py deleted file mode 100644 index 7472bbc4c4..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0017_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.13 on 2022-08-10 08:09 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('steficon', '0011_migration_squashed_0016_migration'), - ] - - operations = [ - migrations.AddField( - model_name='rule', - name='type', - field=models.CharField(choices=[('PAYMENT_PLAN', 'Payment Plan'), ('TARGETING', 'Targeting')], default='TARGETING', help_text='Use Rule for Targeting or Payment Plan', max_length=50), - ), - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0018_migration.py b/src/hct_mis_api/apps/steficon/migrations/0018_migration.py deleted file mode 100644 index 6568fd35e9..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0018_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.15 on 2023-02-01 06:01 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('steficon', '0017_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='rule', - name='language', - field=models.CharField(choices=[('python', 'Python')], default='python', max_length=10), - ), - migrations.AlterField( - model_name='rulecommit', - name='language', - field=models.CharField(choices=[('python', 'Python')], default='python', max_length=10), - ), - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0019_migration.py b/src/hct_mis_api/apps/steficon/migrations/0019_migration.py deleted file mode 100644 index 4b203b8afc..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0019_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-03-16 23:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0077_migration'), - ('steficon', '0018_migration'), - ] - - operations = [ - migrations.AddField( - model_name='rule', - name='allowed_business_areas', - field=models.ManyToManyField(to='core.BusinessArea'), - ), - ] diff --git a/src/hct_mis_api/apps/steficon/migrations/0020_migration.py b/src/hct_mis_api/apps/steficon/migrations/0020_migration.py deleted file mode 100644 index b7d989c2fb..0000000000 --- a/src/hct_mis_api/apps/steficon/migrations/0020_migration.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-19 23:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0087_migration'), - ('steficon', '0019_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='rule', - name='allowed_business_areas', - field=models.ManyToManyField(blank=True, to='core.BusinessArea'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0001_migration.py b/src/hct_mis_api/apps/targeting/migrations/0001_migration.py index 2d758d52c6..cc76ee9c76 100644 --- a/src/hct_mis_api/apps/targeting/migrations/0001_migration.py +++ b/src/hct_mis_api/apps/targeting/migrations/0001_migration.py @@ -1,11 +1,14 @@ -# Generated by Django 2.2.8 on 2020-04-29 08:18 +# Generated by Django 3.2.25 on 2024-11-07 12:18 +import concurrency.fields from django.conf import settings -import django.contrib.postgres.fields.jsonb +import django.contrib.postgres.fields.citext +import django.core.validators from django.db import migrations, models import django.db.models.deletion +import hct_mis_api.apps.targeting.services.targeting_service +import hct_mis_api.apps.utils.models import model_utils.fields -import hct_mis_api.apps.targeting.models import uuid @@ -15,8 +18,10 @@ class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('household', '0001_migration'), + ('steficon', '0001_migration'), ('program', '0001_migration'), + ('household', '0001_migration'), + ('core', '0002_migration'), ] operations = [ @@ -24,84 +29,151 @@ class Migration(migrations.Migration): name='HouseholdSelection', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('vulnerability_score', models.DecimalField(blank=True, decimal_places=3, help_text='Written by a tool such as Corticon.', max_digits=6, null=True)), - ('final', models.BooleanField(default=True, help_text='\n When set to True, this means the household has been selected from \n the candidate list. Only these households will be sent to\n CashAssist when a sync is run for the associated target population.\n ')), - ('household', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='selections', to='household.Household')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('vulnerability_score', models.DecimalField(blank=True, db_index=True, decimal_places=3, help_text='Written by Steficon', max_digits=6, null=True)), + ('is_original', models.BooleanField(db_index=True, default=False)), + ('is_migration_handled', models.BooleanField(default=False)), + ('household', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='selections', to='household.household')), ], options={ - 'abstract': False, + 'verbose_name': 'Household Selection', }, ), migrations.CreateModel( name='TargetingCriteria', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('flag_exclude_if_active_adjudication_ticket', models.BooleanField(default=False, help_text='Exclude households with individuals (members or collectors) that have active adjudication ticket(s).')), + ('flag_exclude_if_on_sanction_list', models.BooleanField(default=False, help_text='Exclude households with individuals (members or collectors) on sanction list.')), + ('household_ids', models.TextField(blank=True)), + ('individual_ids', models.TextField(blank=True)), ], options={ 'abstract': False, }, - bases=(models.Model, hct_mis_api.apps.targeting.models.TargetingCriteriaQueryingBase), + bases=(models.Model, hct_mis_api.apps.targeting.services.targeting_service.TargetingCriteriaQueryingBase), ), migrations.CreateModel( name='TargetingCriteriaRule', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('targeting_criteria', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rules', to='targeting.TargetingCriteria')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('targeting_criteria', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rules', to='targeting.targetingcriteria')), ], options={ 'abstract': False, }, - bases=(models.Model, hct_mis_api.apps.targeting.models.TargetingCriteriaRuleQueryingBase), + bases=(models.Model, hct_mis_api.apps.targeting.services.targeting_service.TargetingCriteriaRuleQueryingBase), ), migrations.CreateModel( name='TargetPopulation', fields=[ ('is_removed', models.BooleanField(default=False)), ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('name', models.TextField(unique=True)), - ('status', models.CharField(choices=[('DRAFT', 'Open'), ('APPROVED', 'Closed'), ('FINALIZED', 'Sent')], default='DRAFT', max_length=256)), - ('candidate_list_total_households', models.PositiveIntegerField(blank=True, null=True)), - ('candidate_list_total_individuals', models.PositiveIntegerField(blank=True, null=True)), - ('final_list_total_households', models.PositiveIntegerField(blank=True, null=True)), - ('final_list_total_individuals', models.PositiveIntegerField(blank=True, null=True)), - ('selection_computation_metadata', models.TextField(blank=True, help_text='This would be the metadata written to by say Corticon on how\n it arrived at the selection it made.', null=True)), - ('candidate_list_targeting_criteria', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='target_population_candidate', to='targeting.TargetingCriteria')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('version', concurrency.fields.IntegerVersionField(default=0, help_text='record revision number')), + ('name', django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()])), + ('ca_id', django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=255, null=True)), + ('ca_hash_id', django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=255, null=True)), + ('change_date', models.DateTimeField(blank=True, null=True)), + ('finalized_at', models.DateTimeField(blank=True, null=True)), + ('status', models.CharField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('SENDING_TO_CASH_ASSIST', 'Sending to Cash Assist'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist'), ('READY_FOR_PAYMENT_MODULE', 'Ready for payment module'), ('ASSIGNED', 'Assigned')], db_index=True, default='OPEN', max_length=256)), + ('build_status', models.CharField(choices=[('PENDING', 'Pending'), ('BUILDING', 'Building'), ('FAILED', 'Failed'), ('OK', 'Ok')], db_index=True, default='PENDING', max_length=256)), + ('built_at', models.DateTimeField(blank=True, null=True)), + ('sent_to_datahub', models.BooleanField(db_index=True, default=False, help_text='\n Flag set when TP is processed by celery task\n ')), + ('steficon_applied_date', models.DateTimeField(blank=True, null=True)), + ('vulnerability_score_min', models.DecimalField(blank=True, decimal_places=3, help_text='Written by a tool such as Corticon.', max_digits=6, null=True)), + ('vulnerability_score_max', models.DecimalField(blank=True, decimal_places=3, help_text='Written by a tool such as Corticon.', max_digits=6, null=True)), + ('excluded_ids', models.TextField(blank=True)), + ('exclusion_reason', models.TextField(blank=True)), + ('total_households_count', models.PositiveIntegerField(blank=True, null=True)), + ('total_individuals_count', models.PositiveIntegerField(blank=True, null=True)), + ('child_male_count', models.PositiveIntegerField(blank=True, null=True)), + ('child_female_count', models.PositiveIntegerField(blank=True, null=True)), + ('adult_male_count', models.PositiveIntegerField(blank=True, null=True)), + ('adult_female_count', models.PositiveIntegerField(blank=True, null=True)), + ('business_area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), + ('changed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='changed_target_populations', to=settings.AUTH_USER_MODEL)), ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='target_populations', to=settings.AUTH_USER_MODEL)), - ('final_list_targeting_criteria', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='target_population_final', to='targeting.TargetingCriteria')), + ('finalized_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='finalized_target_populations', to=settings.AUTH_USER_MODEL)), ('households', models.ManyToManyField(related_name='target_populations', through='targeting.HouseholdSelection', to='household.Household')), - ('program', models.ForeignKey(blank=True, help_text='Set only when the target population moves from draft to\n candidate list frozen state (approved)', null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.Program')), + ('program', models.ForeignKey(help_text='Set only when the target population moves from draft to\n candidate list frozen state (approved)', on_delete=django.db.models.deletion.PROTECT, to='program.program')), + ('program_cycle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='target_populations', to='program.programcycle')), + ('steficon_rule', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='target_populations', to='steficon.rulecommit')), + ('storage_file', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.storagefile')), + ('targeting_criteria', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='target_population', to='targeting.targetingcriteria')), + ], + options={ + 'verbose_name': 'Target Population', + }, + bases=(models.Model, hct_mis_api.apps.utils.models.AdminUrlMixin), + ), + migrations.CreateModel( + name='TargetingIndividualRuleFilterBlock', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('target_only_hoh', models.BooleanField(default=False)), + ('targeting_criteria_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='individuals_filters_blocks', to='targeting.targetingcriteriarule')), ], options={ 'abstract': False, }, + bases=(models.Model, hct_mis_api.apps.targeting.services.targeting_service.TargetingIndividualRuleFilterBlockBase), + ), + migrations.CreateModel( + name='TargetingIndividualBlockRuleFilter', + fields=[ + ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('comparison_method', models.CharField(choices=[('EQUALS', 'Equals'), ('NOT_EQUALS', 'Not Equals'), ('CONTAINS', 'Contains'), ('NOT_CONTAINS', 'Does not contain'), ('RANGE', 'In between <>'), ('NOT_IN_RANGE', 'Not in between <>'), ('GREATER_THAN', 'Greater than'), ('LESS_THAN', 'Less than'), ('IS_NULL', 'Is null')], max_length=20)), + ('flex_field_classification', models.CharField(choices=[('NOT_FLEX_FIELD', 'Not Flex Field'), ('FLEX_FIELD_BASIC', 'Flex Field Basic'), ('FLEX_FIELD_PDU', 'Flex Field PDU')], default='NOT_FLEX_FIELD', max_length=20)), + ('field_name', models.CharField(max_length=50)), + ('arguments', models.JSONField(help_text='\n Array of arguments\n ')), + ('round_number', models.PositiveIntegerField(blank=True, null=True)), + ('individuals_filters_block', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='individual_block_filters', to='targeting.targetingindividualrulefilterblock')), + ], + options={ + 'abstract': False, + }, + bases=(models.Model, hct_mis_api.apps.targeting.services.targeting_service.TargetingCriteriaFilterBase), ), migrations.CreateModel( name='TargetingCriteriaRuleFilter', fields=[ ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('comparision_method', models.CharField(choices=[('EQUALS', 'Equals'), ('NOT_EQUALS', 'Not Equals'), ('CONTAINS', 'Contains'), ('NOT_CONTAINS', 'Does not contain'), ('RANGE', 'In between <>'), ('NOT_IN_RANGE', 'Not in between <>'), ('GREATER_THAN', 'Greater than'), ('LESS_THAN', 'Less than')], max_length=20)), - ('is_flex_field', models.BooleanField(default=False)), - ('field_name', models.CharField(max_length=20)), - ('arguments', django.contrib.postgres.fields.jsonb.JSONField(help_text='\n Array of arguments\n ')), - ('targeting_criteria_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filters', to='targeting.TargetingCriteriaRule')), + ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), + ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), + ('comparison_method', models.CharField(choices=[('EQUALS', 'Equals'), ('NOT_EQUALS', 'Not Equals'), ('CONTAINS', 'Contains'), ('NOT_CONTAINS', 'Does not contain'), ('RANGE', 'In between <>'), ('NOT_IN_RANGE', 'Not in between <>'), ('GREATER_THAN', 'Greater than'), ('LESS_THAN', 'Less than'), ('IS_NULL', 'Is null')], max_length=20)), + ('flex_field_classification', models.CharField(choices=[('NOT_FLEX_FIELD', 'Not Flex Field'), ('FLEX_FIELD_BASIC', 'Flex Field Basic'), ('FLEX_FIELD_PDU', 'Flex Field PDU')], default='NOT_FLEX_FIELD', max_length=20)), + ('field_name', models.CharField(max_length=50)), + ('arguments', models.JSONField(help_text='\n Array of arguments\n ')), + ('round_number', models.PositiveIntegerField(blank=True, null=True)), + ('targeting_criteria_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filters', to='targeting.targetingcriteriarule')), ], options={ 'abstract': False, }, + bases=(models.Model, hct_mis_api.apps.targeting.services.targeting_service.TargetingCriteriaFilterBase), ), migrations.AddField( model_name='householdselection', name='target_population', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='selections', to='targeting.TargetPopulation'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='selections', to='targeting.targetpopulation'), + ), + migrations.AddConstraint( + model_name='targetpopulation', + constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('name', 'business_area', 'program', 'is_removed'), name='target_population_unique_if_not_removed'), + ), + migrations.AlterUniqueTogether( + name='householdselection', + unique_together={('household', 'target_population')}, ), ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0002_migration.py b/src/hct_mis_api/apps/targeting/migrations/0002_migration.py deleted file mode 100644 index 6d43f40b63..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0002_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-04-29 14:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0001_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetingcriteriarulefilter', - name='field_name', - field=models.CharField(max_length=50), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0002_migration_squashed_0006_migration.py b/src/hct_mis_api/apps/targeting/migrations/0002_migration_squashed_0006_migration.py deleted file mode 100644 index 9d4fe42318..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0002_migration_squashed_0006_migration.py +++ /dev/null @@ -1,77 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 06:25 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -def set_business_area(apps, schema_editor): - BusinessArea = apps.get_model("core", "BusinessArea") - afghanistan = BusinessArea.objects.filter(slug="afghanistan").first() - if afghanistan is None: - return - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(business_area__isnull=True).update( - business_area=afghanistan - ) - - -def set_business_area_2(apps, schema_editor): - BusinessArea = apps.get_model("core", "BusinessArea") - afghanistan = BusinessArea.objects.filter(slug="afghanistan").first() - if afghanistan is None: - return - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(business_area__isnull=True).update( - business_area=afghanistan - ) - - -class Migration(migrations.Migration): - - replaces = [('targeting', '0002_migration'), ('targeting', '0003_migration'), ('targeting', '0004_migration'), ('targeting', '0005_migration'), ('targeting', '0006_migration')] - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('core', '0002_migration_squashed_0006_migration'), - ('targeting', '0001_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetingcriteriarulefilter', - name='field_name', - field=models.CharField(max_length=50), - ), - migrations.AddField( - model_name='targetpopulation', - name='approved_at', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='approved_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_target_populations', to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='targetpopulation', - name='finalized_at', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='finalized_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='finalized_target_populations', to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='targetpopulation', - name='business_area', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.businessarea'), - ), - migrations.RunPython(set_business_area), - migrations.AlterUniqueTogether( - name='targetpopulation', - unique_together={('name', 'business_area')}, - ), - migrations.RunPython(set_business_area_2), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0003_migration.py b/src/hct_mis_api/apps/targeting/migrations/0003_migration.py deleted file mode 100644 index 95264c254f..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0003_migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 2.2.8 on 2020-04-30 08:30 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('targeting', '0002_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetpopulation', - name='approved_at', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='approved_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_target_populations', to=settings.AUTH_USER_MODEL), - ), - migrations.AddField( - model_name='targetpopulation', - name='finalized_at', - field=models.DateTimeField(null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='finalized_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='finalized_target_populations', to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0004_migration.py b/src/hct_mis_api/apps/targeting/migrations/0004_migration.py deleted file mode 100644 index 620cabf934..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0004_migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 2.2.8 on 2020-05-11 08:36 - -from django.db import migrations, models -import django.db.models.deletion - - -def set_business_area(apps, schema_editor): - BusinessArea = apps.get_model("core", "BusinessArea") - afghanistan = BusinessArea.objects.filter(slug="afghanistan").first() - if afghanistan is None: - return - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(business_area__isnull=True).update( - business_area=afghanistan - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0002_migration_squashed_0006_migration"), - ("targeting", "0003_migration"), - ] - - operations = [ - migrations.AddField( - model_name="targetpopulation", - name="business_area", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="core.BusinessArea", - ), - ), - migrations.RunPython(set_business_area), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0005_migration.py b/src/hct_mis_api/apps/targeting/migrations/0005_migration.py deleted file mode 100644 index ccb2055da2..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0005_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.8 on 2020-05-11 11:30 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0002_migration_squashed_0006_migration'), - ('targeting', '0004_migration'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='targetpopulation', - unique_together={('name', 'business_area')}, - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0006_migration.py b/src/hct_mis_api/apps/targeting/migrations/0006_migration.py deleted file mode 100644 index 092c25d638..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0006_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.8 on 2020-05-12 14:14 - -from django.db import migrations - -def set_business_area(apps, schema_editor): - BusinessArea = apps.get_model("core", "BusinessArea") - afghanistan = BusinessArea.objects.filter(slug="afghanistan").first() - if afghanistan is None: - return - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(business_area__isnull=True).update( - business_area=afghanistan - ) - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0005_migration'), - ] - - operations = [ - migrations.RunPython(set_business_area), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0007_migration_squashed_0028_migration.py b/src/hct_mis_api/apps/targeting/migrations/0007_migration_squashed_0028_migration.py deleted file mode 100644 index 29cf65e4b0..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0007_migration_squashed_0028_migration.py +++ /dev/null @@ -1,332 +0,0 @@ -# Generated by Django 3.2.19 on 2023-06-10 12:58 - -import concurrency.fields -from django.conf import settings -import django.contrib.postgres.fields.citext -import django.contrib.postgres.fields.jsonb -import django.core.validators -from django.db import migrations, models -import django.db.migrations.operations.special -import django.db.models.deletion -import hct_mis_api.apps.targeting.services.targeting_service -import model_utils.fields -import uuid - -def chunk_update(model, callback, fields): - offset = 0 - chunk_size = 100 - - while records := model.objects.all()[offset : offset + chunk_size]: - offset += chunk_size - for record in records: - callback(record) - - model.objects.bulk_update(records, fields) - -def assign_approved_by_to_changed_by(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - - def rewrite_relation(record): - record.changed_by = record.approved_by - - chunk_update(TargetPopulation, rewrite_relation, ["changed_by"]) - -def revert_assign_approved_by_to_changed_by(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - - def rewrite_relation(record): - record.approved_by = record.changed_by - - chunk_update(TargetPopulation, rewrite_relation, ["approved_by"]) - -def move_from_approved_to_locked(apps, schema_editor): - TargetPopulation = apps.get_model('targeting', 'TargetPopulation') - TargetPopulation.objects.filter(status="APPROVED").update(status="LOCKED") - -def revert_change_status(apps, schema_editor): - TargetPopulation = apps.get_model('targeting', 'TargetPopulation') - TargetPopulation.objects.filter(status="LOCKED").update(status="APPROVED") - -def change_tp_statuses(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - - for tp in TargetPopulation.objects.filter(status="FINALIZED"): - tp.status = "READY_FOR_CASH_ASSIST" if tp.sent_to_datahub else "PROCESSING" - tp.save() - - -def revert_change_tp_statuses(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - - for tp in TargetPopulation.objects.filter(status__in=["PROCESSING", "READY_FOR_CASH_ASSIST"]): - tp.status = "FINALIZED" - tp.save() - -class Migration(migrations.Migration): - - dependencies = [ - ('steficon', '0002_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('targeting', '0006_migration'), - ('steficon', '0001_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetpopulation', - name='sent_to_datahub', - field=models.BooleanField(default=False, help_text='\n Flag set when TP is processed by airflow task\n '), - ), - migrations.AddField( - model_name='targetpopulation', - name='ca_hash_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='ca_id', - field=models.CharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='householdselection', - name='final', - field=models.BooleanField(default=True, help_text='\n When set to True, this means the household has been selected from\n the candidate list. Only these households will be sent to\n CashAssist when a sync is run for the associated target population.\n '), - ), - migrations.CreateModel( - name='TargetingIndividualRuleFilterBlock', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('targeting_criteria_rule', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='individuals_filters_blocks', to='targeting.targetingcriteriarule')), - ('target_only_hoh', models.BooleanField(default=False)), - ], - options={ - 'abstract': False, - }, - bases=(models.Model, hct_mis_api.apps.targeting.services.targeting_service.TargetingIndividualRuleFilterBlockBase), - ), - migrations.AddField( - model_name='targetpopulation', - name='steficon_rule', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='target_populations', to='steficon.rule'), - ), - migrations.AddField( - model_name='targetpopulation', - name='vulnerability_score_max', - field=models.DecimalField(decimal_places=3, help_text='Written by a tool such as Corticon.', max_digits=6, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='vulnerability_score_min', - field=models.DecimalField(decimal_places=3, help_text='Written by a tool such as Corticon.', max_digits=6, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='version', - field=concurrency.fields.IntegerVersionField(default=0, help_text='record revision number'), - ), - migrations.AlterModelOptions( - name='targetpopulation', - options={'verbose_name': 'Target Population'}, - ), - migrations.AlterField( - model_name='targetpopulation', - name='steficon_rule', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='target_populations', to='steficon.rule'), - ), - migrations.AlterField( - model_name='householdselection', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='householdselection', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='targetingcriteria', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='targetingcriteria', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='targetingcriteriarule', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='targetingcriteriarule', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='targetingcriteriarulefilter', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='targetingcriteriarulefilter', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.CreateModel( - name='TargetingIndividualBlockRuleFilter', - fields=[ - ('id', model_utils.fields.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)), - ('updated_at', models.DateTimeField(auto_now=True, db_index=True)), - ('comparision_method', models.CharField(choices=[('EQUALS', 'Equals'), ('NOT_EQUALS', 'Not Equals'), ('CONTAINS', 'Contains'), ('NOT_CONTAINS', 'Does not contain'), ('RANGE', 'In between <>'), ('NOT_IN_RANGE', 'Not in between <>'), ('GREATER_THAN', 'Greater than'), ('LESS_THAN', 'Less than')], max_length=20)), - ('is_flex_field', models.BooleanField(default=False)), - ('field_name', models.CharField(max_length=50)), - ('arguments', django.contrib.postgres.fields.jsonb.JSONField(help_text='\n Array of arguments\n ')), - ('individuals_filters_block', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='individual_block_filters', to='targeting.targetingindividualrulefilterblock')), - ], - options={ - 'abstract': False, - }, - bases=(models.Model, hct_mis_api.apps.targeting.services.targeting_service.TargetingCriteriaFilterBase), - ), - migrations.AlterField( - model_name='targetpopulation', - name='ca_hash_id', - field=django.contrib.postgres.fields.citext.CICharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='ca_id', - field=django.contrib.postgres.fields.citext.CICharField(max_length=255, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='created_at', - field=models.DateTimeField(auto_now_add=True, db_index=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, unique=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='sent_to_datahub', - field=models.BooleanField(db_index=True, default=False, help_text='\n Flag set when TP is processed by airflow task\n '), - ), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('DRAFT', 'Open'), ('APPROVED', 'Closed'), ('FINALIZED', 'Sent')], db_index=True, default='DRAFT', max_length=256), - ), - migrations.AlterField( - model_name='targetpopulation', - name='updated_at', - field=models.DateTimeField(auto_now=True, db_index=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='approved_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_target_populations', to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='targetpopulation', - name='ca_hash_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='ca_id', - field=django.contrib.postgres.fields.citext.CICharField(blank=True, max_length=255, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='finalized_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='finalized_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='finalized_target_populations', to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='targetpopulation', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, unique=True, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - migrations.AlterField( - model_name='targetpopulation', - name='steficon_rule', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='target_populations', to='steficon.rule'), - ), - migrations.AlterField( - model_name='targetpopulation', - name='vulnerability_score_max', - field=models.DecimalField(blank=True, decimal_places=3, help_text='Written by a tool such as Corticon.', max_digits=6, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='vulnerability_score_min', - field=models.DecimalField(blank=True, decimal_places=3, help_text='Written by a tool such as Corticon.', max_digits=6, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='sent_to_datahub', - field=models.BooleanField(db_index=True, default=False, help_text='\n Flag set when TP is processed by celery task\n '), - ), - migrations.AddField( - model_name='targetpopulation', - name='excluded_ids', - field=models.TextField(blank=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='exclusion_reason', - field=models.TextField(blank=True), - ), - migrations.RenameField( - model_name='targetpopulation', - old_name='approved_at', - new_name='change_date', - ), - migrations.AlterField( - model_name='targetpopulation', - name='change_date', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='changed_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='locked_target_populations', to=settings.AUTH_USER_MODEL), - ), - migrations.RunPython(assign_approved_by_to_changed_by, revert_assign_approved_by_to_changed_by), - migrations.RemoveField( - model_name='targetpopulation', - name='approved_by', - ), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('DRAFT', 'Open'), ('LOCKED', 'Locked'), ('FINALIZED', 'Sent')], db_index=True, default='DRAFT', max_length=256), - ), - migrations.RunPython(move_from_approved_to_locked, revert_change_status), - migrations.AddField( - model_name='targetpopulation', - name='steficon_applied_date', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('DRAFT', 'Open'), ('LOCKED', 'Locked'), ('PROCESSING', 'Processing'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist')], db_index=True, default='DRAFT', max_length=256), - ), - migrations.RunPython(change_tp_statuses, migrations.RunPython.noop), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('DRAFT', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist')], db_index=True, default='DRAFT', max_length=256), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0029_migration.py b/src/hct_mis_api/apps/targeting/migrations/0029_migration.py deleted file mode 100644 index 7ff012ec26..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0029_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.16 on 2022-01-15 09:29 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0007_migration_squashed_0028_migration'), - ('steficon', '0003_migration_squashed_0007_empty_rules'), - ] - - operations = [ - migrations.RemoveField( - model_name='targetpopulation', - name='steficon_rule', - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0030_migration.py b/src/hct_mis_api/apps/targeting/migrations/0030_migration.py deleted file mode 100644 index b5d4a1b114..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0030_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 2.2.16 on 2022-01-15 09:31 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('steficon', '0008_reset_id_squashed_0010_migration'), - ('targeting', '0029_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetpopulation', - name='steficon_rule', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='target_populations', to='steficon.RuleCommit'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0030_migration_squashed_0039_migration.py b/src/hct_mis_api/apps/targeting/migrations/0030_migration_squashed_0039_migration.py deleted file mode 100644 index fd66c53211..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0030_migration_squashed_0039_migration.py +++ /dev/null @@ -1,215 +0,0 @@ -# Generated by Django 3.2.24 on 2024-02-16 06:19 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - -from collections import defaultdict - - -def remove_duplicate_household_selections(apps, schema_editor): - HouseholdSelectionModel = apps.get_model("targeting", "HouseholdSelection") - - subquery = ( - HouseholdSelectionModel.objects.filter( - household=models.OuterRef("household"), target_population=models.OuterRef("target_population") - ) - .values("household", "target_population") - .annotate(duplicates_count=models.Count("*")) - ) - - duplicates = ( - HouseholdSelectionModel.objects.annotate(duplicates_count=models.Subquery(subquery.values("duplicates_count"))) - .values("household", "target_population", "duplicates_count", "id") - .filter(duplicates_count__gt=1, target_population__status="LOCKED") - ) - - groups = defaultdict(list) - for row in duplicates: - key = (row["household"], row["target_population"]) - groups[key].append(row["id"]) - - for ids in groups.values(): - for id in ids[1:]: - HouseholdSelectionModel.objects.get(id=id).delete() - - -def update_status(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(status="DRAFT").update(status="OPEN") - - -def reverse_update_status(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(status="OPEN").update(status="DRAFT") - - -class Migration(migrations.Migration): - - replaces = [('targeting', '0030_migration'), ('targeting', '0031_migration'), ('targeting', '0032_migration'), ('targeting', '0033_migration'), ('targeting', '0034_migration'), ('targeting', '0035_migration'), ('targeting', '0036_migration'), ('targeting', '0037_migration'), ('targeting', '0038_migration'), ('targeting', '0039_migration')] - - dependencies = [ - ('steficon', '0008_reset_id_squashed_0010_migration'), - ('household', '0119_migration'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('core', '0044_migration_squashed_0057_migration'), - ('targeting', '0029_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetpopulation', - name='steficon_rule', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='target_populations', to='steficon.rulecommit'), - ), - migrations.AlterField( - model_name='targetingcriteriarulefilter', - name='arguments', - field=models.JSONField(help_text='\n Array of arguments\n '), - ), - migrations.AlterField( - model_name='targetingindividualblockrulefilter', - name='arguments', - field=models.JSONField(help_text='\n Array of arguments\n '), - ), - migrations.AlterModelOptions( - name='householdselection', - options={'verbose_name': 'Household Selection'}, - ), - migrations.RunPython(remove_duplicate_household_selections), - migrations.AlterUniqueTogether( - name='householdselection', - unique_together={('household', 'target_population')}, - ), - migrations.RenameField( - model_name='targetpopulation', - old_name='candidate_list_targeting_criteria', - new_name='targeting_criteria', - ), - migrations.RenameField( - model_name='targetpopulation', - old_name='final_list_total_households', - new_name='total_households_count', - ), - migrations.RenameField( - model_name='targetpopulation', - old_name='final_list_total_individuals', - new_name='total_individuals_count', - ), - migrations.RemoveField( - model_name='householdselection', - name='final', - ), - migrations.RemoveField( - model_name='targetpopulation', - name='candidate_list_total_households', - ), - migrations.RemoveField( - model_name='targetpopulation', - name='candidate_list_total_individuals', - ), - migrations.RemoveField( - model_name='targetpopulation', - name='final_list_targeting_criteria', - ), - migrations.RemoveField( - model_name='targetpopulation', - name='selection_computation_metadata', - ), - migrations.AddField( - model_name='targetpopulation', - name='adult_female_count', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='adult_male_count', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='build_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('BUILDING', 'Building'), ('FAILED', 'Failed'), ('OK', 'Ok')], db_index=True, default='PENDING', max_length=256), - ), - migrations.AddField( - model_name='targetpopulation', - name='built_at', - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='child_female_count', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name='targetpopulation', - name='child_male_count', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AlterField( - model_name='householdselection', - name='vulnerability_score', - field=models.DecimalField(blank=True, decimal_places=3, help_text='Written by Steficon', max_digits=6, null=True), - ), - migrations.AlterField( - model_name='targetpopulation', - name='changed_by', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='changed_target_populations', to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist')], db_index=True, default='OPEN', max_length=256), - ), - migrations.AlterField( - model_name='householdselection', - name='vulnerability_score', - field=models.DecimalField(blank=True, db_index=True, decimal_places=3, help_text='Written by Steficon', max_digits=6, null=True), - ), - migrations.RenameField( - model_name='targetingcriteriarulefilter', - old_name='comparision_method', - new_name='comparison_method', - ), - migrations.RenameField( - model_name='targetingindividualblockrulefilter', - old_name='comparision_method', - new_name='comparison_method', - ), - migrations.AlterField( - model_name='targetpopulation', - name='targeting_criteria', - field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='target_population', to='targeting.targetingcriteria'), - ), - migrations.RunPython(update_status, reverse_update_status), - migrations.AddField( - model_name='targetpopulation', - name='storage_file', - field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.storagefile'), - ), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('READY', 'Ready'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist'), ('READY_FOR_PAYMENT_MODULE', 'Ready for payment module'), ('ASSIGNED', 'Assigned')], db_index=True, default='OPEN', max_length=256), - ), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist'), ('READY_FOR_PAYMENT_MODULE', 'Ready for payment module'), ('ASSIGNED', 'Assigned')], db_index=True, default='OPEN', max_length=256), - ), - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('SENDING_TO_CASH_ASSIST', 'Sending to Cash Assist'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist'), ('READY_FOR_PAYMENT_MODULE', 'Ready for payment module'), ('ASSIGNED', 'Assigned')], db_index=True, default='OPEN', max_length=256), - ), - migrations.AddField( - model_name='targetingcriteria', - name='flag_exclude_if_active_adjudication_ticket', - field=models.BooleanField(default=False, help_text='Exclude households with individuals (members or collectors) that have active adjudication ticket(s).'), - ), - migrations.AddField( - model_name='targetingcriteria', - name='flag_exclude_if_on_sanction_list', - field=models.BooleanField(default=False, help_text='Exclude households with individuals (members or collectors) on sanction list.'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0031_migration.py b/src/hct_mis_api/apps/targeting/migrations/0031_migration.py deleted file mode 100644 index e6a2d3d944..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0031_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2 on 2022-02-11 19:54 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0030_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetingcriteriarulefilter', - name='arguments', - field=models.JSONField(help_text='\n Array of arguments\n '), - ), - migrations.AlterField( - model_name='targetingindividualblockrulefilter', - name='arguments', - field=models.JSONField(help_text='\n Array of arguments\n '), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0032_migration.py b/src/hct_mis_api/apps/targeting/migrations/0032_migration.py deleted file mode 100644 index 99045ce7e8..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0032_migration.py +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by Django 3.2.13 on 2022-08-12 10:45 - -from collections import defaultdict -from django.db import migrations, models - - -def remove_duplicate_household_selections(apps, schema_editor): - HouseholdSelectionModel = apps.get_model("targeting", "HouseholdSelection") - - subquery = ( - HouseholdSelectionModel.objects.filter( - household=models.OuterRef("household"), target_population=models.OuterRef("target_population") - ) - .values("household", "target_population") - .annotate(duplicates_count=models.Count("*")) - ) - - duplicates = ( - HouseholdSelectionModel.objects.annotate(duplicates_count=models.Subquery(subquery.values("duplicates_count"))) - .values("household", "target_population", "duplicates_count", "id") - .filter(duplicates_count__gt=1, target_population__status="LOCKED") - ) - - groups = defaultdict(list) - for row in duplicates: - key = (row["household"], row["target_population"]) - groups[key].append(row["id"]) - - for ids in groups.values(): - for id in ids[1:]: - HouseholdSelectionModel.objects.get(id=id).delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ("household", "0119_migration"), - ("targeting", "0031_migration"), - ] - - operations = [ - migrations.AlterModelOptions( - name="householdselection", - options={"verbose_name": "Household Selection"}, - ), - migrations.RunPython(remove_duplicate_household_selections), - migrations.AlterUniqueTogether( - name="householdselection", - unique_together={("household", "target_population")}, - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0033_migration.py b/src/hct_mis_api/apps/targeting/migrations/0033_migration.py deleted file mode 100644 index bd6452762b..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0033_migration.py +++ /dev/null @@ -1,139 +0,0 @@ -# Generated by Django 3.2.13 on 2022-08-23 13:32 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("targeting", "0032_migration"), - ] - - operations = [ - migrations.RenameField( - model_name="targetpopulation", - old_name="candidate_list_targeting_criteria", - new_name="targeting_criteria", - ), - migrations.RenameField( - model_name="targetpopulation", - old_name="final_list_total_households", - new_name="total_households_count", - ), - migrations.RenameField( - model_name="targetpopulation", - old_name="final_list_total_individuals", - new_name="total_individuals_count", - ), - migrations.RemoveField( - model_name="householdselection", - name="final", - ), - migrations.RemoveField( - model_name="targetpopulation", - name="candidate_list_total_households", - ), - migrations.RemoveField( - model_name="targetpopulation", - name="candidate_list_total_individuals", - ), - migrations.RemoveField( - model_name="targetpopulation", - name="final_list_targeting_criteria", - ), - migrations.RemoveField( - model_name="targetpopulation", - name="selection_computation_metadata", - ), - migrations.AddField( - model_name="targetpopulation", - name="adult_female_count", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name="targetpopulation", - name="adult_male_count", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name="targetpopulation", - name="build_status", - field=models.CharField( - choices=[("PENDING", "Pending"), ("BUILDING", "Building"), ("FAILED", "Failed"), ("OK", "Ok")], - db_index=True, - default="PENDING", - max_length=256, - ), - ), - migrations.AddField( - model_name="targetpopulation", - name="built_at", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.AddField( - model_name="targetpopulation", - name="child_female_count", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AddField( - model_name="targetpopulation", - name="child_male_count", - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AlterField( - model_name="householdselection", - name="vulnerability_score", - field=models.DecimalField( - blank=True, decimal_places=3, help_text="Written by Steficon", max_digits=6, null=True - ), - ), - migrations.AlterField( - model_name="targetpopulation", - name="changed_by", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="changed_target_populations", - to=settings.AUTH_USER_MODEL, - ), - ), - migrations.AlterField( - model_name="targetpopulation", - name="status", - field=models.CharField( - choices=[ - ("OPEN", "Open"), - ("LOCKED", "Locked"), - ("STEFICON_WAIT", "Waiting for Rule Engine"), - ("STEFICON_RUN", "Rule Engine Running"), - ("STEFICON_COMPLETED", "Rule Engine Completed"), - ("STEFICON_ERROR", "Rule Engine Errored"), - ("PROCESSING", "Processing"), - ("READY_FOR_CASH_ASSIST", "Ready for cash assist"), - ], - db_index=True, - default="OPEN", - max_length=256, - ), - ), - migrations.AlterField( - model_name='householdselection', - name='vulnerability_score', - field=models.DecimalField(blank=True, db_index=True, decimal_places=3, help_text='Written by Steficon', - max_digits=6, null=True), - ), - migrations.RenameField( - model_name="targetingcriteriarulefilter", - old_name="comparision_method", - new_name="comparison_method", - ), - migrations.RenameField( - model_name="targetingindividualblockrulefilter", - old_name="comparision_method", - new_name="comparison_method", - ) - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0034_migration.py b/src/hct_mis_api/apps/targeting/migrations/0034_migration.py deleted file mode 100644 index e78a8d4a73..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0034_migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 3.2.13 on 2022-08-23 13:35 - -from django.db import migrations, models -import django.db.models.deletion - - -def update_status(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(status="DRAFT").update(status="OPEN") - - -def reverse_update_status(apps, schema_editor): - TargetPopulation = apps.get_model("targeting", "TargetPopulation") - TargetPopulation.objects.filter(status="OPEN").update(status="DRAFT") - - -class Migration(migrations.Migration): - - dependencies = [ - ("targeting", "0033_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="targetpopulation", - name="targeting_criteria", - field=models.OneToOneField( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="target_population", - to="targeting.targetingcriteria", - ), - ), - migrations.RunPython(update_status, reverse_update_status), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0035_migration.py b/src/hct_mis_api/apps/targeting/migrations/0035_migration.py deleted file mode 100644 index 197b527da8..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0035_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.15 on 2022-10-19 13:21 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0044_migration_squashed_0057_migration'), - ('targeting', '0034_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetpopulation', - name='storage_file', - field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.storagefile'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0036_migration.py b/src/hct_mis_api/apps/targeting/migrations/0036_migration.py deleted file mode 100644 index 4f42bb0e46..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0036_migration.py +++ /dev/null @@ -1,35 +0,0 @@ -# Generated by Django 3.2.13 on 2022-08-30 11:30 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("targeting", "0035_migration"), - ] - - operations = [ - migrations.AlterField( - model_name="targetpopulation", - name="status", - field=models.CharField( - choices=[ - ("OPEN", "Open"), - ("LOCKED", "Locked"), - ("STEFICON_WAIT", "Waiting for Rule Engine"), - ("STEFICON_RUN", "Rule Engine Running"), - ("STEFICON_COMPLETED", "Rule Engine Completed"), - ("STEFICON_ERROR", "Rule Engine Errored"), - ("PROCESSING", "Processing"), - ("READY", "Ready"), - ("READY_FOR_CASH_ASSIST", "Ready for cash assist"), - ("READY_FOR_PAYMENT_MODULE", "Ready for payment module"), - ("ASSIGNED", "Assigned"), - ], - db_index=True, - default="OPEN", - max_length=256, - ), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0037_migration.py b/src/hct_mis_api/apps/targeting/migrations/0037_migration.py deleted file mode 100644 index 42b6398266..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0037_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2022-09-05 09:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0036_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist'), ('READY_FOR_PAYMENT_MODULE', 'Ready for payment module'), ('ASSIGNED', 'Assigned')], db_index=True, default='OPEN', max_length=256), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0038_migration.py b/src/hct_mis_api/apps/targeting/migrations/0038_migration.py deleted file mode 100644 index 61d8cdd5ab..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0038_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.18 on 2023-03-23 13:23 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0037_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetpopulation', - name='status', - field=models.CharField(choices=[('OPEN', 'Open'), ('LOCKED', 'Locked'), ('STEFICON_WAIT', 'Waiting for Rule Engine'), ('STEFICON_RUN', 'Rule Engine Running'), ('STEFICON_COMPLETED', 'Rule Engine Completed'), ('STEFICON_ERROR', 'Rule Engine Errored'), ('PROCESSING', 'Processing'), ('SENDING_TO_CASH_ASSIST', 'Sending to Cash Assist'), ('READY_FOR_CASH_ASSIST', 'Ready for cash assist'), ('READY_FOR_PAYMENT_MODULE', 'Ready for payment module'), ('ASSIGNED', 'Assigned')], db_index=True, default='OPEN', max_length=256), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0039_migration.py b/src/hct_mis_api/apps/targeting/migrations/0039_migration.py deleted file mode 100644 index 7fdd365dfa..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0039_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.18 on 2023-05-26 12:31 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0038_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetingcriteria', - name='flag_exclude_if_active_adjudication_ticket', - field=models.BooleanField(default=False, help_text='Exclude households with individuals (members or collectors) that have active adjudication ticket(s).'), - ), - migrations.AddField( - model_name='targetingcriteria', - name='flag_exclude_if_on_sanction_list', - field=models.BooleanField(default=False, help_text='Exclude households with individuals (members or collectors) on sanction list.'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0040_migration.py b/src/hct_mis_api/apps/targeting/migrations/0040_migration.py deleted file mode 100644 index db95bbd608..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0040_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.20 on 2023-09-05 06:40 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0039_migration'), - ] - - operations = [ - migrations.AddField( - model_name='householdselection', - name='is_migration_handled', - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name='householdselection', - name='is_original', - field=models.BooleanField(default=True), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0041_migration.py b/src/hct_mis_api/apps/targeting/migrations/0041_migration.py deleted file mode 100644 index 5c7c1b3846..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0041_migration.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 3.2.20 on 2023-08-28 17:00 - -import django.contrib.postgres.fields.citext -import django.core.validators -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0040_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetpopulation', - name='name', - field=django.contrib.postgres.fields.citext.CICharField(db_index=True, max_length=255, validators=[django.core.validators.MinLengthValidator(3), django.core.validators.MaxLengthValidator(255), django.core.validators.RegexValidator('\\s{2,}', 'Double spaces characters are not allowed.', code='double_spaces_characters_not_allowed', inverse_match=True), django.core.validators.RegexValidator('(^\\s+)|(\\s+$)', 'Leading or trailing spaces characters are not allowed.', code='leading_trailing_spaces_characters_not_allowed', inverse_match=True), django.core.validators.ProhibitNullCharactersValidator()]), - ), - migrations.AlterUniqueTogether( - name='targetpopulation', - unique_together=set(), - ), - migrations.AddConstraint( - model_name='targetpopulation', - constraint=models.UniqueConstraint(condition=models.Q(('is_removed', False)), fields=('name', 'business_area', 'program', 'is_removed'), name='target_population_unique_if_not_removed'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0042_migration.py b/src/hct_mis_api/apps/targeting/migrations/0042_migration.py deleted file mode 100644 index f74ce92d58..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0042_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2023-12-12 14:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0041_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='householdselection', - name='is_original', - field=models.BooleanField(default=False), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0043_migration.py b/src/hct_mis_api/apps/targeting/migrations/0043_migration.py deleted file mode 100644 index 4596031c12..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0043_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.23 on 2024-02-26 16:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0042_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='householdselection', - name='is_original', - field=models.BooleanField(db_index=True, default=False), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0044_migration.py b/src/hct_mis_api/apps/targeting/migrations/0044_migration.py deleted file mode 100644 index f9ec19dafd..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0044_migration.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.25 on 2024-03-28 06:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0043_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetingcriteria', - name='household_ids', - field=models.TextField(blank=True), - ), - migrations.AddField( - model_name='targetingcriteria', - name='individual_ids', - field=models.TextField(blank=True), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0045_migration.py b/src/hct_mis_api/apps/targeting/migrations/0045_migration.py deleted file mode 100644 index 803abfc656..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0045_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.25 on 2024-07-18 18:34 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0049_migration'), - ('targeting', '0044_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetpopulation', - name='program_cycle', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='target_populations', to='program.programcycle'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0046_migration.py b/src/hct_mis_api/apps/targeting/migrations/0046_migration.py deleted file mode 100644 index f87649645d..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0046_migration.py +++ /dev/null @@ -1,67 +0,0 @@ -# Generated by Django 3.2.25 on 2024-08-05 23:07 - -from django.db import migrations, models - - -def convert_is_flex_field_to_classification(apps, schema_editor): - TargetingCriteriaRuleFilter = apps.get_model('targeting', 'TargetingCriteriaRuleFilter') - TargetingCriteriaRuleFilter.objects.filter(is_flex_field=True).update(flex_field_classification='FLEX_FIELD_BASIC') - TargetingCriteriaRuleFilter.objects.filter(is_flex_field=False).update(flex_field_classification='NOT_FLEX_FIELD') - - TargetingIndividualBlockRuleFilter = apps.get_model('targeting', 'TargetingIndividualBlockRuleFilter') - TargetingIndividualBlockRuleFilter.objects.filter(is_flex_field=True).update(flex_field_classification='FLEX_FIELD_BASIC') - TargetingIndividualBlockRuleFilter.objects.filter(is_flex_field=False).update(flex_field_classification='NOT_FLEX_FIELD') - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0045_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetingcriteriarulefilter', - name='flex_field_classification', - field=models.CharField(choices=[('NOT_FLEX_FIELD', 'Not Flex Field'), ('FLEX_FIELD_BASIC', 'Flex Field Basic'), ('FLEX_FIELD_PDU', 'Flex Field PDU')], default='NOT_FLEX_FIELD', max_length=20), - ), - migrations.AddField( - model_name='targetingindividualblockrulefilter', - name='flex_field_classification', - field=models.CharField(choices=[('NOT_FLEX_FIELD', 'Not Flex Field'), ('FLEX_FIELD_BASIC', 'Flex Field Basic'), ('FLEX_FIELD_PDU', 'Flex Field PDU')], default='NOT_FLEX_FIELD', max_length=20), - ), - migrations.RunPython(convert_is_flex_field_to_classification), - migrations.RemoveField( - model_name='targetingcriteriarulefilter', - name='is_flex_field', - ), - migrations.RemoveField( - model_name='targetingindividualblockrulefilter', - name='is_flex_field', - ), - migrations.AddField( - model_name='targetingindividualblockrulefilter', - name='round_number', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AlterField( - model_name='targetingcriteriarulefilter', - name='comparison_method', - field=models.CharField( - choices=[('EQUALS', 'Equals'), ('NOT_EQUALS', 'Not Equals'), ('CONTAINS', 'Contains'), - ('NOT_CONTAINS', 'Does not contain'), ('RANGE', 'In between <>'), - ('NOT_IN_RANGE', 'Not in between <>'), ('GREATER_THAN', 'Greater than'), - ('LESS_THAN', 'Less than'), ('IS_NULL', 'Is null')], max_length=20), - ), - migrations.AlterField( - model_name='targetingindividualblockrulefilter', - name='comparison_method', - field=models.CharField( - choices=[('EQUALS', 'Equals'), ('NOT_EQUALS', 'Not Equals'), ('CONTAINS', 'Contains'), - ('NOT_CONTAINS', 'Does not contain'), ('RANGE', 'In between <>'), - ('NOT_IN_RANGE', 'Not in between <>'), ('GREATER_THAN', 'Greater than'), - ('LESS_THAN', 'Less than'), ('IS_NULL', 'Is null')], max_length=20), - ), - ] - - diff --git a/src/hct_mis_api/apps/targeting/migrations/0047_migration.py b/src/hct_mis_api/apps/targeting/migrations/0047_migration.py deleted file mode 100644 index f44ca17825..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0047_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-09-10 02:57 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('targeting', '0046_migration'), - ] - - operations = [ - migrations.AddField( - model_name='targetingcriteriarulefilter', - name='round_number', - field=models.PositiveIntegerField(blank=True, null=True), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0048_migration.py b/src/hct_mis_api/apps/targeting/migrations/0048_migration.py deleted file mode 100644 index fca6eed297..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0048_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-03 01:07 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0053_migration'), - ('targeting', '0047_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetpopulation', - name='program_cycle', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='target_populations', to='program.programcycle'), - ), - ] diff --git a/src/hct_mis_api/apps/targeting/migrations/0049_migration.py b/src/hct_mis_api/apps/targeting/migrations/0049_migration.py deleted file mode 100644 index 800d1e8cf5..0000000000 --- a/src/hct_mis_api/apps/targeting/migrations/0049_migration.py +++ /dev/null @@ -1,20 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-09 13:43 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('program', '0053_migration'), - ('targeting', '0048_migration'), - ] - - operations = [ - migrations.AlterField( - model_name='targetpopulation', - name='program', - field=models.ForeignKey(help_text='Set only when the target population moves from draft to\n candidate list frozen state (approved)', on_delete=django.db.models.deletion.PROTECT, to='program.program'), - ), - ] diff --git a/src/hct_mis_api/contrib/aurora/migrations/0001_migration.py b/src/hct_mis_api/contrib/aurora/migrations/0001_migration.py index 73a2d5254e..1c128c6efd 100644 --- a/src/hct_mis_api/contrib/aurora/migrations/0001_migration.py +++ b/src/hct_mis_api/contrib/aurora/migrations/0001_migration.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.15 on 2023-02-24 05:09 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.db import migrations, models import django.db.models.deletion @@ -10,13 +10,34 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('core', '0059_migration'), - ('steficon', '0011_migration_squashed_0016_migration'), - ('registration_datahub', '0001_migration_squashed_0088_migration'), - ('program', '0034_migration'), ] operations = [ + migrations.CreateModel( + name='Record', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('registration', models.IntegerField(db_index=True)), + ('timestamp', models.DateTimeField(db_index=True)), + ('storage', models.BinaryField(blank=True, null=True)), + ('ignored', models.BooleanField(blank=True, db_index=True, default=False, null=True)), + ('source_id', models.IntegerField(db_index=True)), + ('data', models.JSONField(blank=True, default=dict, null=True)), + ('error_message', models.TextField(blank=True, null=True)), + ('status', models.CharField(blank=True, choices=[('TO_IMPORT', 'To import'), ('IMPORTED', 'Imported'), ('ERROR', 'Error')], max_length=16, null=True)), + ('unique_field', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('size', models.IntegerField(blank=True, null=True)), + ('counters', models.JSONField(blank=True, null=True)), + ('fields', models.JSONField(blank=True, null=True)), + ('files', models.BinaryField(blank=True, null=True)), + ('index1', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('index2', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ('index3', models.CharField(blank=True, db_index=True, max_length=255, null=True)), + ], + options={ + 'swappable': 'AURORA_RECORD_MODEL', + }, + ), migrations.CreateModel( name='Organization', fields=[ @@ -24,7 +45,6 @@ class Migration(migrations.Migration): ('source_id', models.BigIntegerField()), ('name', models.CharField(max_length=1000)), ('slug', models.SlugField(max_length=1000)), - ('business_area', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.businessarea')), ], options={ 'abstract': False, @@ -36,24 +56,11 @@ class Migration(migrations.Migration): ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('source_id', models.BigIntegerField()), ('name', models.CharField(max_length=100)), - ('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='aurora.organization')), - ('programme', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program')), ], options={ 'abstract': False, }, ), - migrations.CreateModel( - name='Record', - fields=[ - ], - options={ - 'proxy': True, - 'indexes': [], - 'constraints': [], - }, - bases=('registration_datahub.record',), - ), migrations.CreateModel( name='Registration', fields=[ @@ -68,7 +75,6 @@ class Migration(migrations.Migration): ('mapping', models.JSONField(blank=True, null=True)), ('private_key', models.TextField(blank=True, editable=False, null=True)), ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='aurora.project')), - ('steficon_rule', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='steficon.rulecommit')), ], options={ 'abstract': False, diff --git a/src/hct_mis_api/contrib/aurora/migrations/0002_migration.py b/src/hct_mis_api/contrib/aurora/migrations/0002_migration.py index 9962a73b3b..449dc9f2e2 100644 --- a/src/hct_mis_api/contrib/aurora/migrations/0002_migration.py +++ b/src/hct_mis_api/contrib/aurora/migrations/0002_migration.py @@ -1,41 +1,39 @@ -# Generated by Django 3.2.18 on 2023-06-01 12:50 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.db import migrations, models +import django.db.models.deletion class Migration(migrations.Migration): + initial = True + dependencies = [ + ('steficon', '0001_migration'), + ('core', '0001_migration'), ('aurora', '0001_migration'), + ('program', '0001_migration'), ] operations = [ - migrations.DeleteModel( - name='Record', + migrations.AddField( + model_name='registration', + name='steficon_rule', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='steficon.rulecommit'), + ), + migrations.AddField( + model_name='project', + name='organization', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='aurora.organization'), + ), + migrations.AddField( + model_name='project', + name='programme', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='program.program'), ), - migrations.CreateModel( - name='Record', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('registration', models.IntegerField(db_index=True)), - ('timestamp', models.DateTimeField(db_index=True)), - ('storage', models.BinaryField(blank=True, null=True)), - ('ignored', models.BooleanField(blank=True, db_index=True, default=False, null=True)), - ('source_id', models.IntegerField(db_index=True)), - ('data', models.JSONField(blank=True, default=dict, null=True)), - ('error_message', models.TextField(blank=True, null=True)), - ('status', models.CharField(blank=True, choices=[('TO_IMPORT', 'To import'), ('IMPORTED', 'Imported'), ('ERROR', 'Error')], max_length=16, null=True)), - ('unique_field', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ('size', models.IntegerField(blank=True, null=True)), - ('counters', models.JSONField(blank=True, null=True)), - ('fields', models.JSONField(blank=True, null=True)), - ('files', models.BinaryField(blank=True, null=True)), - ('index1', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ('index2', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ('index3', models.CharField(blank=True, db_index=True, max_length=255, null=True)), - ], - options={ - 'swappable': 'AURORA_RECORD_MODEL', - }, + migrations.AddField( + model_name='organization', + name='business_area', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.businessarea'), ), ] diff --git a/src/hct_mis_api/contrib/vision/migrations/0001_migration.py b/src/hct_mis_api/contrib/vision/migrations/0001_migration.py index 368119e567..5a0e0cddef 100644 --- a/src/hct_mis_api/contrib/vision/migrations/0001_migration.py +++ b/src/hct_mis_api/contrib/vision/migrations/0001_migration.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.25 on 2024-10-01 11:58 +# Generated by Django 3.2.25 on 2024-11-07 12:18 from django.db import migrations, models import django.db.models.deletion @@ -9,39 +9,14 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('core', '0087_migration'), + ('core', '0001_migration'), ] operations = [ - migrations.CreateModel( - name='DownPayment', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('rec_serial_number', models.CharField(blank=True, max_length=10, null=True)), - ('business_area', models.CharField(max_length=4)), - ('down_payment_reference', models.CharField(max_length=20)), - ('document_type', models.CharField(max_length=10)), - ('consumed_fc_number', models.CharField(max_length=10)), - ('total_down_payment_amount_local', models.DecimalField(decimal_places=2, max_digits=15)), - ('total_down_payment_amount_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=15, null=True)), - ('currency_code', models.CharField(blank=True, max_length=5, null=True)), - ('posting_date', models.DateField(blank=True, null=True)), - ('doc_year', models.IntegerField(blank=True, null=True)), - ('doc_number', models.CharField(blank=True, max_length=10, null=True)), - ('doc_item_number', models.CharField(max_length=3, null=True)), - ('create_date', models.DateTimeField(auto_now_add=True, null=True)), - ('created_by', models.CharField(blank=True, default='', max_length=20, null=True)), - ('update_date', models.DateTimeField(blank=True, null=True)), - ('updated_by', models.CharField(blank=True, default='', max_length=20, null=True)), - ('business_office_code', models.CharField(blank=True, max_length=4, null=True)), - ('business_area_obj', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea')), - ], - ), migrations.CreateModel( name='FundsCommitment', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('rec_serial_number', models.CharField(max_length=10, unique=True)), + ('rec_serial_number', models.IntegerField(primary_key=True, serialize=False)), ('business_area', models.CharField(blank=True, max_length=4, null=True)), ('funds_commitment_number', models.CharField(blank=True, max_length=10, null=True)), ('document_type', models.CharField(blank=True, max_length=2, null=True)), @@ -57,23 +32,42 @@ class Migration(migrations.Migration): ('vision_approval', models.CharField(blank=True, max_length=1, null=True)), ('document_reference', models.CharField(max_length=16, null=True)), ('fc_status', models.CharField(blank=True, max_length=1, null=True)), + ('funds_commitment_item', models.CharField(blank=True, default='', max_length=3, null=True)), + ('wbs_element', models.CharField(blank=True, default='', max_length=24, null=True)), + ('grant_number', models.CharField(blank=True, default='', max_length=20, null=True)), ('create_date', models.DateTimeField(auto_now_add=True, null=True)), ('created_by', models.CharField(blank=True, default='', max_length=20, null=True)), ('update_date', models.DateTimeField(blank=True, null=True)), ('updated_by', models.CharField(blank=True, default='', max_length=20, null=True)), - ('grant_number', models.CharField(blank=True, default='', max_length=10, null=True)), ('sponsor', models.CharField(blank=True, default='', max_length=10, null=True)), ('sponsor_name', models.CharField(blank=True, default='', max_length=100, null=True)), - ('wbs_element', models.CharField(blank=True, default='', max_length=24, null=True)), ('fund', models.CharField(blank=True, default='', max_length=10, null=True)), ('funds_center', models.CharField(blank=True, default='', max_length=16, null=True)), - ('funds_commitment_item', models.CharField(blank=True, default='', max_length=3, null=True)), ('percentage', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)), - ('business_office_code', models.CharField(blank=True, max_length=4, null=True)), - ('business_area_obj', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea')), + ('office', models.ForeignKey(blank=True, help_text='This can be a business office or a business area', null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea')), + ], + ), + migrations.CreateModel( + name='DownPayment', + fields=[ + ('rec_serial_number', models.IntegerField(primary_key=True, serialize=False)), + ('business_area', models.CharField(max_length=4)), + ('down_payment_reference', models.CharField(max_length=20)), + ('document_type', models.CharField(max_length=10)), + ('consumed_fc_number', models.CharField(max_length=10)), + ('consumed_fc_item_number', models.CharField(blank=True, max_length=3, null=True)), + ('total_down_payment_amount_local', models.DecimalField(decimal_places=2, max_digits=15)), + ('total_down_payment_amount_usd', models.DecimalField(blank=True, decimal_places=2, max_digits=15, null=True)), + ('currency_code', models.CharField(blank=True, max_length=5, null=True)), + ('posting_date', models.DateField(blank=True, null=True)), + ('doc_year', models.IntegerField(blank=True, null=True)), + ('doc_number', models.CharField(blank=True, max_length=10, null=True)), + ('doc_item_number', models.CharField(max_length=3, null=True)), + ('create_date', models.DateTimeField(auto_now_add=True, null=True)), + ('created_by', models.CharField(blank=True, default='', max_length=20, null=True)), + ('update_date', models.DateTimeField(blank=True, null=True)), + ('updated_by', models.CharField(blank=True, default='', max_length=20, null=True)), + ('office', models.ForeignKey(blank=True, help_text='This can be a business office or a business area', null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea')), ], - options={ - 'unique_together': {('funds_commitment_number', 'funds_commitment_item')}, - }, ), ] diff --git a/src/hct_mis_api/contrib/vision/migrations/0002_migration.py b/src/hct_mis_api/contrib/vision/migrations/0002_migration.py deleted file mode 100644 index ce58e97709..0000000000 --- a/src/hct_mis_api/contrib/vision/migrations/0002_migration.py +++ /dev/null @@ -1,87 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-13 19:39 - -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone -import model_utils.fields - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0087_migration'), - ('vision', '0001_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='downpayment', - name='business_area_obj', - ), - migrations.RemoveField( - model_name='downpayment', - name='business_office_code', - ), - migrations.RemoveField( - model_name='downpayment', - name='id', - ), - migrations.RemoveField( - model_name='fundscommitment', - name='business_area_obj', - ), - migrations.RemoveField( - model_name='fundscommitment', - name='business_office_code', - ), - migrations.RemoveField( - model_name='fundscommitment', - name='id', - ), - migrations.AddField( - model_name='downpayment', - name='created', - field=model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created'), - ), - migrations.AddField( - model_name='downpayment', - name='modified', - field=model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified'), - ), - migrations.AddField( - model_name='downpayment', - name='office', - field=models.ForeignKey(blank=True, help_text='This can be a business office or a business area', null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea'), - ), - migrations.AddField( - model_name='fundscommitment', - name='created', - field=model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created'), - ), - migrations.AddField( - model_name='fundscommitment', - name='modified', - field=model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified'), - ), - migrations.AddField( - model_name='fundscommitment', - name='office', - field=models.ForeignKey(blank=True, help_text='This can be a business office or a business area', null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.businessarea'), - ), - migrations.AlterField( - model_name='downpayment', - name='rec_serial_number', - field=models.CharField(default='', max_length=10, primary_key=True, serialize=False), - preserve_default=False, - ), - migrations.AlterField( - model_name='fundscommitment', - name='grant_number', - field=models.CharField(blank=True, default='', max_length=20, null=True), - ), - migrations.AlterField( - model_name='fundscommitment', - name='rec_serial_number', - field=models.IntegerField(primary_key=True, serialize=False), - ), - ] diff --git a/src/hct_mis_api/contrib/vision/migrations/0003_migration.py b/src/hct_mis_api/contrib/vision/migrations/0003_migration.py deleted file mode 100644 index 06a5758999..0000000000 --- a/src/hct_mis_api/contrib/vision/migrations/0003_migration.py +++ /dev/null @@ -1,34 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-16 13:14 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('vision', '0002_migration'), - ] - - operations = [ - migrations.RemoveField( - model_name='downpayment', - name='created', - ), - migrations.RemoveField( - model_name='downpayment', - name='modified', - ), - migrations.AlterField( - model_name='downpayment', - name='rec_serial_number', - field=models.IntegerField(primary_key=True, serialize=False), - ), - migrations.RemoveField( - model_name='fundscommitment', - name='created', - ), - migrations.RemoveField( - model_name='fundscommitment', - name='modified', - ), - ] diff --git a/src/hct_mis_api/contrib/vision/migrations/0004_migration.py b/src/hct_mis_api/contrib/vision/migrations/0004_migration.py deleted file mode 100644 index 91b733591d..0000000000 --- a/src/hct_mis_api/contrib/vision/migrations/0004_migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-16 13:17 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('vision', '0003_migration'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='fundscommitment', - unique_together=set(), - ), - ] diff --git a/src/hct_mis_api/contrib/vision/migrations/0005_migration.py b/src/hct_mis_api/contrib/vision/migrations/0005_migration.py deleted file mode 100644 index cfdcc29995..0000000000 --- a/src/hct_mis_api/contrib/vision/migrations/0005_migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.25 on 2024-10-21 15:46 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('vision', '0004_migration'), - ] - - operations = [ - migrations.AddField( - model_name='downpayment', - name='consumed_fc_item_number', - field=models.CharField(blank=True, max_length=3, null=True), - ), - ] diff --git a/src/hct_mis_api/migrations_script/__init__.py b/src/hct_mis_api/migrations_script/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/hct_mis_api/migrations_script/main.py b/src/hct_mis_api/migrations_script/main.py new file mode 100644 index 0000000000..01661e247c --- /dev/null +++ b/src/hct_mis_api/migrations_script/main.py @@ -0,0 +1,50 @@ +import csv +import os +from datetime import datetime + +import django +from django.core.management import call_command +from django.db import connection + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your_project_name.settings") +django.setup() + + +def export_migration_info_to_csv(filename="migrations_info.csv"): + timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") + filename = f"migrations_info_{timestamp}.csv" + with connection.cursor() as cursor: + cursor.execute("SELECT * FROM django_migrations") + rows = cursor.fetchall() + column_names = [desc[0] for desc in cursor.description] + + with open(filename, mode="w", newline="") as file: + writer = csv.writer(file) + writer.writerow(column_names) + writer.writerows(rows) + print(f"Migration info exported to {filename}") + + +def clear_migration_table(): + with connection.cursor() as cursor: + cursor.execute("DELETE FROM django_migrations") + + +def fake_migrations(excluded_migrations): + call_command("migrate", "--fake") + with connection.cursor() as cursor: + for app, name in excluded_migrations: + cursor.execute("DELETE FROM django_migrations WHERE app = %s AND name = %s", [app, name]) + + +def apply_migrations(): + call_command("migrate") + print("Migrations applied.") + + +if __name__ == "__main__": + export_migration_info_to_csv() + clear_migration_table() + excluded_migrations = [("household", "0003_migration"), ("payment", "0002_migration")] + fake_migrations(excluded_migrations) + apply_migrations() diff --git a/tests/unit/apps/account/test_admin.py b/tests/unit/apps/account/test_admin.py index abd919d946..56cf042262 100644 --- a/tests/unit/apps/account/test_admin.py +++ b/tests/unit/apps/account/test_admin.py @@ -7,11 +7,11 @@ from django_webtest import DjangoTestApp from hct_mis_api.apps.account.fixtures import RoleFactory, UserFactory -from hct_mis_api.apps.account.models import Role, User +from hct_mis_api.apps.account.models import Partner, Role, User @pytest.fixture() -def superuser(request: pytest.FixtureRequest) -> User: +def superuser(request: pytest.FixtureRequest, partner_unicef: Partner) -> User: return UserFactory(is_superuser=True, is_staff=True) diff --git a/tests/unit/apps/grievance/test_grievance_es.py b/tests/unit/apps/grievance/test_grievance_es.py index 49f90b910f..d6a8cd63da 100644 --- a/tests/unit/apps/grievance/test_grievance_es.py +++ b/tests/unit/apps/grievance/test_grievance_es.py @@ -7,7 +7,6 @@ from django.core.management import call_command from elasticsearch import Elasticsearch - from hct_mis_api.apps.account.fixtures import UserFactory from hct_mis_api.apps.account.permissions import Permissions from hct_mis_api.apps.core.base_test_case import APITestCase diff --git a/tests/unit/apps/household/test_assign_individual_to_rdi.py b/tests/unit/apps/household/test_assign_individual_to_rdi.py deleted file mode 100644 index 1ce2f787f3..0000000000 --- a/tests/unit/apps/household/test_assign_individual_to_rdi.py +++ /dev/null @@ -1,114 +0,0 @@ -from django.db.models import Count -from django.test import TransactionTestCase - -from hct_mis_api.apps.core.fixtures import create_afghanistan -from hct_mis_api.apps.household.fixtures import create_household_and_individuals -from hct_mis_api.apps.household.models import Household, Individual -from hct_mis_api.apps.program.fixtures import ProgramFactory -from hct_mis_api.apps.program.models import Program -from hct_mis_api.apps.registration_data.models import RegistrationDataImport - - -class TestMigrationIndAssignToRDI(TransactionTestCase): - def test_assign_individual_to_rdi_migration(self) -> None: - ba_afghanistan = create_afghanistan() - program_1 = ProgramFactory(name="program_1", business_area=ba_afghanistan, biometric_deduplication_enabled=True) - program_2 = ProgramFactory(name="program_2", business_area=ba_afghanistan, biometric_deduplication_enabled=True) - create_household_and_individuals( - household_data={ - "business_area": ba_afghanistan, - "program": program_1, - }, - individuals_data=[ - { - "business_area": ba_afghanistan, - "program": program_1, - }, - ], - ) - create_household_and_individuals( - household_data={ - "business_area": ba_afghanistan, - "program": program_2, - }, - individuals_data=[ - { - "business_area": ba_afghanistan, - "program": program_2, - }, - ], - ) - # set registration_data_import to null - Household.objects.all().update(registration_data_import=None) - Individual.objects.all().update(registration_data_import=None) - # add more individuals assigned to RDI - program_3 = ProgramFactory(name="Program 333", business_area=ba_afghanistan) - create_household_and_individuals( - household_data={ - "business_area": ba_afghanistan, - "program": program_3, - }, - individuals_data=[ - { - "business_area": ba_afghanistan, - "program": program_3, - }, - { - "business_area": ba_afghanistan, - "program": program_3, - }, - ], - ) - # check before migrate data - self.assertEqual(RegistrationDataImport.objects.count(), 3) - self.assertEqual(Program.objects.count(), 3) - self.assertEqual(Individual.objects.count(), 4) - self.assertEqual(Household.objects.count(), 3) - self.assertEqual(Individual.objects.filter(program=program_1).count(), 1) - self.assertEqual(Individual.objects.filter(program=program_2).count(), 1) - self.assertEqual(Individual.objects.filter(registration_data_import__isnull=True).count(), 2) - self.assertEqual(Household.objects.filter(registration_data_import__isnull=True).count(), 2) - - # call_command("migrate", "household", "0185_migration", verbosity=0) - for program in Program.objects.all(): - # create RDI only if exists any individual without RDI - individual_qs = Individual.objects.filter(program=program, registration_data_import__isnull=True) - aggregated_data = individual_qs.aggregate( - individual_count=Count("id"), household_count=Count("household", distinct=True) - ) - if aggregated_data["individual_count"] > 0: - rdi = RegistrationDataImport.objects.create( - name=f"RDI for Individuals [data migration for Programme: {program.name}]", - status="MERGED", - imported_by=None, - data_source="XLS", - number_of_individuals=aggregated_data["individual_count"], - number_of_households=aggregated_data["household_count"], - business_area=program.business_area, - program_id=program.id, - import_data=None, - deduplication_engine_status="PENDING" if program.biometric_deduplication_enabled else None, - ) - - individual_qs.update(registration_data_import_id=rdi.id) - - # 3 old RDIs and + 2 new created - self.assertEqual(RegistrationDataImport.objects.count(), 5) - self.assertEqual(Individual.objects.filter(registration_data_import__isnull=False).count(), 4) - self.assertEqual(Household.objects.filter(registration_data_import__isnull=True).count(), 2) - - rdi_1 = RegistrationDataImport.objects.get( - name=f"RDI for Individuals [data migration for Programme: {program_1.name}]" - ) - self.assertEqual(rdi_1.status, "MERGED") - self.assertEqual(rdi_1.deduplication_engine_status, "PENDING") - self.assertEqual(rdi_1.number_of_individuals, 1) - self.assertEqual(rdi_1.number_of_households, 1) - - rdi_2 = RegistrationDataImport.objects.get( - name=f"RDI for Individuals [data migration for Programme: {program_2.name}]" - ) - self.assertEqual(rdi_2.status, "MERGED") - self.assertEqual(rdi_2.deduplication_engine_status, "PENDING") - self.assertEqual(rdi_2.number_of_individuals, 1) - self.assertEqual(rdi_2.number_of_households, 1) diff --git a/tests/unit/apps/utils/test_mailjet.py b/tests/unit/apps/utils/test_mailjet.py index c613fc0acf..704dd13393 100644 --- a/tests/unit/apps/utils/test_mailjet.py +++ b/tests/unit/apps/utils/test_mailjet.py @@ -12,6 +12,7 @@ from openpyxl import Workbook from hct_mis_api.apps.account.fixtures import UserFactory +from hct_mis_api.apps.account.models import Partner from hct_mis_api.apps.utils.mailjet import MailjetClient @@ -343,7 +344,7 @@ def test_mailjet_incorrect_body_without_template_and_without_html_and_text_body( @patch("hct_mis_api.apps.utils.mailjet.requests.post") @override_settings(EMAIL_SUBJECT_PREFIX="test") @override_config(ENABLE_MAILJET=True) - def test_email_user_via_mailjet(self, mocked_requests_post: Any) -> None: + def test_email_user_via_mailjet(self, mocked_requests_post: Any, partner_unicef: Partner) -> None: user = UserFactory(email="testuser@email.com", username="testuser") user.email_user( subject="Test subject", diff --git a/tests/unit/fixtures/account.py b/tests/unit/fixtures/account.py index fda4f5db83..45a2d69ffe 100644 --- a/tests/unit/fixtures/account.py +++ b/tests/unit/fixtures/account.py @@ -71,6 +71,6 @@ def _create_user_role_with_permissions( return _create_user_role_with_permissions -@pytest.fixture(autouse=True) +@pytest.fixture() def partner_unicef(db: Any) -> PartnerFactory: return PartnerFactory(name="UNICEF")