Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 50 additions & 89 deletions src/hope_country_report/apps/hope/models/_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ class Household(HopeModel):
unhcr_id = models.CharField(max_length=250, null=True)
internal_data = models.JSONField(null=True)
detail_id = models.CharField(max_length=150, blank=True, null=True)
registration_id = models.TextField(blank=True, null=True) # This field type is a guess.
program_registration_id = models.TextField(unique=True, blank=True, null=True) # This field type is a guess.
total_cash_received_usd = models.DecimalField(max_digits=64, decimal_places=2, blank=True, null=True)
total_cash_received = models.DecimalField(max_digits=64, decimal_places=2, blank=True, null=True)
Expand All @@ -1092,6 +1093,7 @@ class Household(HopeModel):
kobo_submission_uuid = models.UUIDField(blank=True, null=True)
kobo_submission_time = models.DateTimeField(blank=True, null=True)
enumerator_rec_id = models.IntegerField(blank=True, null=True)
mis_unicef_id = models.CharField(max_length=255, blank=True, null=True)
flex_registrations_record_id = models.IntegerField(blank=True, null=True)
admin1 = models.ForeignKey(
Area, on_delete=models.DO_NOTHING, related_name="household_admin1", blank=True, null=True
Expand Down Expand Up @@ -1130,16 +1132,16 @@ class Household(HopeModel):
blank=True,
null=True,
)
program = models.ForeignKey("Program", on_delete=models.DO_NOTHING, related_name="household_program", null=True)
program = models.ForeignKey(
"Program", on_delete=models.DO_NOTHING, related_name="household_program", blank=True, null=True
)
registration_data_import = models.ForeignKey(
"DataRegistrationdataimport",
on_delete=models.DO_NOTHING,
related_name="household_registration_data_import",
blank=True,
null=True,
)
other_sex_group_count = models.IntegerField(blank=True, null=True)
unknown_sex_group_count = models.IntegerField(blank=True, null=True)

class Meta:
managed = False
Expand All @@ -1149,6 +1151,23 @@ class Tenant:
tenant_filter_field: str = "__all__"


class HouseholdPrograms(HopeModel):
id = models.BigAutoField(primary_key=True)
household = models.ForeignKey(
Household, on_delete=models.DO_NOTHING, related_name="householdprograms_household", null=True
)
program = models.ForeignKey(
"Program", on_delete=models.DO_NOTHING, related_name="householdprograms_program", null=True
)

class Meta:
managed = False
db_table = "household_household_programs"

class Tenant:
tenant_filter_field: str = "__all__"


class HouseholdCollection(HopeModel):
id = models.BigAutoField(primary_key=True)
unicef_id = models.CharField(max_length=255, blank=True, null=True)
Expand Down Expand Up @@ -1199,6 +1218,7 @@ class Individual(HopeModel):
flex_fields = models.JSONField(null=True)
internal_data = models.JSONField(null=True)
enrolled_in_nutrition_programme = models.BooleanField(blank=True, null=True)
administration_of_rutf = models.BooleanField(blank=True, null=True)
deduplication_golden_record_status = models.CharField(max_length=50, null=True)
deduplication_batch_status = models.CharField(max_length=50, null=True)
deduplication_golden_record_results = models.JSONField(null=True)
Expand All @@ -1221,6 +1241,7 @@ class Individual(HopeModel):
fchild_hoh = models.BooleanField(null=True)
child_hoh = models.BooleanField(null=True)
detail_id = models.CharField(max_length=150, blank=True, null=True)
registration_id = models.TextField(blank=True, null=True) # This field type is a guess.
program_registration_id = models.TextField(blank=True, null=True) # This field type is a guess.
preferred_language = models.CharField(max_length=6, blank=True, null=True)
relationship_confirmed = models.BooleanField(null=True)
Expand All @@ -1231,6 +1252,7 @@ class Individual(HopeModel):
origin_unicef_id = models.CharField(max_length=100, blank=True, null=True)
is_migration_handled = models.BooleanField(null=True)
migrated_at = models.DateTimeField(blank=True, null=True)
mis_unicef_id = models.CharField(max_length=255, blank=True, null=True)
vector_column = models.TextField(blank=True, null=True) # This field type is a guess.
business_area = models.ForeignKey(
BusinessArea, on_delete=models.DO_NOTHING, related_name="individual_business_area", null=True
Expand All @@ -1248,7 +1270,9 @@ class Individual(HopeModel):
blank=True,
null=True,
)
program = models.ForeignKey("Program", on_delete=models.DO_NOTHING, related_name="individual_program", null=True)
program = models.ForeignKey(
"Program", on_delete=models.DO_NOTHING, related_name="individual_program", blank=True, null=True
)
registration_data_import = models.ForeignKey(
"DataRegistrationdataimport",
on_delete=models.DO_NOTHING,
Expand Down Expand Up @@ -1356,21 +1380,6 @@ class Tenant:
tenant_filter_field: str = "__all__"


class Accounttype(HopeModel):
id = models.BigAutoField(primary_key=True)
key = models.CharField(unique=True, max_length=255, null=True)
label = models.CharField(max_length=255, null=True)
unique_fields = models.TextField(null=True) # This field type is a guess.
payment_gateway_id = models.CharField(max_length=255, blank=True, null=True)

class Meta:
managed = False
db_table = "payment_accounttype"

class Tenant:
tenant_filter_field: str = "__all__"


class Approval(HopeModel):
id = models.UUIDField(primary_key=True)
created_at = models.DateTimeField(null=True)
Expand Down Expand Up @@ -1418,11 +1427,11 @@ class Deliverymechanism(HopeModel):
payment_gateway_id = models.CharField(unique=True, max_length=255, blank=True, null=True)
code = models.CharField(unique=True, max_length=255, null=True)
name = models.CharField(unique=True, max_length=255, null=True)
optional_fields = models.TextField(null=True) # This field type is a guess.
required_fields = models.TextField(null=True) # This field type is a guess.
unique_fields = models.TextField(null=True) # This field type is a guess.
is_active = models.BooleanField(null=True)
transfer_type = models.CharField(max_length=255, null=True)
account_type = models.ForeignKey(
Accounttype, on_delete=models.DO_NOTHING, related_name="deliverymechanism_account_type", blank=True, null=True
)

class Meta:
managed = False
Expand All @@ -1435,46 +1444,29 @@ def __str__(self) -> str:
return str(self.name)


class Deliverymechanismconfig(HopeModel):
id = models.BigAutoField(primary_key=True)
required_fields = models.TextField(null=True) # This field type is a guess.
country = models.ForeignKey(
Country, on_delete=models.DO_NOTHING, related_name="deliverymechanismconfig_country", blank=True, null=True
)
delivery_mechanism = models.ForeignKey(
Deliverymechanism,
on_delete=models.DO_NOTHING,
related_name="deliverymechanismconfig_delivery_mechanism",
null=True,
)
fsp = models.ForeignKey(
"Financialserviceprovider", on_delete=models.DO_NOTHING, related_name="deliverymechanismconfig_fsp", null=True
)

class Meta:
managed = False
db_table = "payment_deliverymechanismconfig"

class Tenant:
tenant_filter_field: str = "__all__"


class Deliverymechanismdata(HopeModel):
id = models.UUIDField(primary_key=True)
rdi_merge_status = models.CharField(max_length=10, null=True)
created_at = models.DateTimeField(null=True)
updated_at = models.DateTimeField(null=True)
signature_hash = models.CharField(max_length=40, null=True)
data = models.JSONField(null=True)
is_valid = models.BooleanField(null=True)
validation_errors = models.JSONField(null=True)
unique_key = models.CharField(unique=True, max_length=256, blank=True, null=True)
delivery_mechanism = models.ForeignKey(
Deliverymechanism,
on_delete=models.DO_NOTHING,
related_name="deliverymechanismdata_delivery_mechanism",
null=True,
)
individual = models.ForeignKey(
Individual, on_delete=models.DO_NOTHING, related_name="deliverymechanismdata_individual", null=True
)
is_unique = models.BooleanField(null=True)
account_type = models.ForeignKey(
Accounttype,
possible_duplicate_of = models.ForeignKey(
"self",
on_delete=models.DO_NOTHING,
related_name="deliverymechanismdata_account_type",
related_name="deliverymechanismdata_possible_duplicate_of",
blank=True,
null=True,
)
Expand All @@ -1491,8 +1483,11 @@ class Deliverymechanismperpaymentplan(HopeModel):
id = models.UUIDField(primary_key=True)
created_at = models.DateTimeField(null=True)
updated_at = models.DateTimeField(null=True)
sent_date = models.DateTimeField(null=True)
status = models.CharField(max_length=50, null=True)
delivery_mechanism_order = models.IntegerField(null=True)
sent_to_payment_gateway = models.BooleanField(null=True)
chosen_configuration = models.CharField(max_length=50, blank=True, null=True)
delivery_mechanism = models.ForeignKey(
Deliverymechanism,
on_delete=models.DO_NOTHING,
Expand All @@ -1507,7 +1502,7 @@ class Deliverymechanismperpaymentplan(HopeModel):
blank=True,
null=True,
)
payment_plan = models.OneToOneField(
payment_plan = models.ForeignKey(
"PaymentPlan",
on_delete=models.DO_NOTHING,
related_name="deliverymechanismperpaymentplan_payment_plan",
Expand Down Expand Up @@ -1612,23 +1607,6 @@ def __str__(self) -> str:
return str(self.name)


class Fspnamemapping(HopeModel):
id = models.BigAutoField(primary_key=True)
external_name = models.CharField(max_length=255, null=True)
hope_name = models.CharField(max_length=255, null=True)
source = models.CharField(max_length=30, null=True)
fsp = models.ForeignKey(
Financialserviceprovider, on_delete=models.DO_NOTHING, related_name="fspnamemapping_fsp", null=True
)

class Meta:
managed = False
db_table = "payment_fspnamemapping"

class Tenant:
tenant_filter_field: str = "__all__"


class Fspxlsxtemplateperdeliverymechanism(HopeModel):
id = models.UUIDField(primary_key=True)
created_at = models.DateTimeField(null=True)
Expand Down Expand Up @@ -1717,10 +1695,6 @@ class Payment(HopeModel):
is_cash_assist = models.BooleanField(null=True)
internal_data = models.JSONField(null=True)
vulnerability_score = models.DecimalField(max_digits=6, decimal_places=3, blank=True, null=True)
has_valid_wallet = models.BooleanField(null=True)
parent_split = models.ForeignKey(
"Paymentplansplit", on_delete=models.DO_NOTHING, related_name="payment_parent_split", blank=True, null=True
)

class Meta:
managed = False
Expand Down Expand Up @@ -1781,8 +1755,8 @@ class PaymentPlan(HopeModel):
imported_file_date = models.DateTimeField(blank=True, null=True)
steficon_applied_date = models.DateTimeField(blank=True, null=True)
is_follow_up = models.BooleanField(null=True)
exclusion_reason = models.TextField(blank=True, null=True)
exclude_household_error = models.TextField(blank=True, null=True)
exclusion_reason = models.TextField(null=True)
exclude_household_error = models.TextField(null=True)
name = models.CharField(max_length=255, blank=True, null=True)
business_area = models.ForeignKey(
BusinessArea, on_delete=models.DO_NOTHING, related_name="paymentplan_business_area", null=True
Expand All @@ -1797,27 +1771,13 @@ class PaymentPlan(HopeModel):
is_cash_assist = models.BooleanField(null=True)
build_status = models.CharField(max_length=50, blank=True, null=True)
built_at = models.DateTimeField(blank=True, null=True)
excluded_ids = models.TextField(blank=True, null=True)
excluded_ids = models.TextField(null=True)
steficon_targeting_applied_date = models.DateTimeField(blank=True, null=True)
targeting_criteria = models.OneToOneField(
"Targetingcriteria", on_delete=models.DO_NOTHING, related_name="paymentplan_targeting_criteria", null=True
)
vulnerability_score_max = models.DecimalField(max_digits=6, decimal_places=3, blank=True, null=True)
vulnerability_score_min = models.DecimalField(max_digits=6, decimal_places=3, blank=True, null=True)
delivery_mechanism = models.ForeignKey(
Deliverymechanism,
on_delete=models.DO_NOTHING,
related_name="paymentplan_delivery_mechanism",
blank=True,
null=True,
)
financial_service_provider = models.ForeignKey(
Financialserviceprovider,
on_delete=models.DO_NOTHING,
related_name="paymentplan_financial_service_provider",
blank=True,
null=True,
)

class Meta:
managed = False
Expand Down Expand Up @@ -2243,6 +2203,7 @@ class DataRegistrationdataimport(HopeModel):
excluded = models.BooleanField(null=True)
erased = models.BooleanField(null=True)
refuse_reason = models.CharField(max_length=100, blank=True, null=True)
allow_delivery_mechanisms_validation_errors = models.BooleanField(null=True)
deduplication_engine_status = models.CharField(max_length=255, blank=True, null=True)
business_area = models.ForeignKey(
BusinessArea,
Expand Down
Loading