diff --git a/CHANGES b/CHANGES index 56fd0f6d6..4e2a39619 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +3.54 + +added audit/financial-findings/ endpoint +added interventions-planned-visits endpoint + 3.53.1 ------ * fixed MR PV diff --git a/src/etools_datamart/__init__.py b/src/etools_datamart/__init__.py index 34ee31d80..14b969920 100644 --- a/src/etools_datamart/__init__.py +++ b/src/etools_datamart/__init__.py @@ -1,3 +1,3 @@ NAME = 'etools-datamart' -VERSION = __version__ = '3.53.1' +VERSION = __version__ = '3.54' __author__ = '' diff --git a/src/etools_datamart/api/endpoints/datamart/__init__.py b/src/etools_datamart/api/endpoints/datamart/__init__.py index 5e78f2c9d..b87b8312c 100644 --- a/src/etools_datamart/api/endpoints/datamart/__init__.py +++ b/src/etools_datamart/api/endpoints/datamart/__init__.py @@ -3,6 +3,7 @@ from .attachment import AttachmentViewSet from .audit_audit import AuditViewSet from .audit_engagement import EngagementDetailViewSet, EngagementViewSet +from .audit_financial_finding import AuditFinancialFindingViewSet from .audit_micro_assessment import MicroAssessmentViewSet from .audit_result import AuditResultViewSet from .audit_special import AuditSpecialViewSet @@ -18,6 +19,7 @@ from .intervention_country_programme import InterventionCPViewSet from .intervention_epd import InterventionEPDViewSet from .intervention_management_budget import InterventionBudgetMgmtViewSet +from .intervention_planned_visits import InterventionPlannedVisitsViewSet from .intervention_review import InterventionReviewViewSet from .location import LocationSiteViewSet, LocationViewSet from .office import OfficeViewSet diff --git a/src/etools_datamart/api/endpoints/datamart/audit_financial_finding.py b/src/etools_datamart/api/endpoints/datamart/audit_financial_finding.py new file mode 100644 index 000000000..a21592e1a --- /dev/null +++ b/src/etools_datamart/api/endpoints/datamart/audit_financial_finding.py @@ -0,0 +1,34 @@ +from django import forms + +from unicef_rest_framework.forms import CleareableSelect2MultipleChoiceField + +from etools_datamart.api.endpoints.datamart.serializers import DataMartSerializer +from etools_datamart.apps.mart.data import models +from etools_datamart.apps.sources.etools.enrichment.consts import AuditEngagementConsts + +from .. import common + + +class AuditFinancialFindingSerializer(DataMartSerializer): + class Meta(DataMartSerializer.Meta): + model = models.AuditFinancialFinding + + +class AuditFinancialFindingFilterForm(forms.Form): + status__in = CleareableSelect2MultipleChoiceField(required=False, + choices=AuditEngagementConsts.DISPLAY_STATUSES, + ) + + def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, *args, **kwargs): + filters = data.copy() + if 'status__in' in filters: + filters.setlist('status__in', data['status__in'].split(',')) + super().__init__(filters, files, auto_id, prefix, initial, *args, **kwargs) + + +class AuditFinancialFindingViewSet(common.DataMartViewSet): + serializer_class = AuditFinancialFindingSerializer + queryset = models.AuditFinancialFinding.objects.all() + filter_fields = ('status',) + serializers_fieldsets = {'std': AuditFinancialFindingSerializer} + querystringfilter_form_base_class = AuditFinancialFindingFilterForm diff --git a/src/etools_datamart/api/endpoints/datamart/intervention_planned_visits.py b/src/etools_datamart/api/endpoints/datamart/intervention_planned_visits.py new file mode 100644 index 000000000..3c5b114b2 --- /dev/null +++ b/src/etools_datamart/api/endpoints/datamart/intervention_planned_visits.py @@ -0,0 +1,15 @@ +from etools_datamart.apps.mart.data import models + +from .. import common +from .serializers import DataMartSerializer + + +class InterventionPlannedVisitsSerializer(DataMartSerializer): + class Meta(DataMartSerializer.Meta): + model = models.InterventionPlannedVisits + exclude = ('seen', 'source_id',) + + +class InterventionPlannedVisitsViewSet(common.DataMartViewSet): + serializer_class = InterventionPlannedVisitsSerializer + queryset = models.InterventionPlannedVisits.objects.all() diff --git a/src/etools_datamart/api/urls.py b/src/etools_datamart/api/urls.py index d53d75a66..edd1f702b 100644 --- a/src/etools_datamart/api/urls.py +++ b/src/etools_datamart/api/urls.py @@ -27,6 +27,7 @@ class ReadOnlyRouter(APIReadOnlyRouter): router.register(r'datamart/audit/audit', endpoints.AuditViewSet) router.register(r'datamart/audit/engagements', endpoints.EngagementViewSet) router.register(r'datamart/audit/engagement-details', endpoints.EngagementDetailViewSet, basename="engagement-details") +router.register(r'datamart/audit/financial-findings', endpoints.AuditFinancialFindingViewSet) router.register(r'datamart/audit/micro-assessment', endpoints.MicroAssessmentViewSet) router.register(r'datamart/audit/results', endpoints.AuditResultViewSet) router.register(r'datamart/audit/special-audit', endpoints.AuditSpecialViewSet) @@ -49,6 +50,7 @@ class ReadOnlyRouter(APIReadOnlyRouter): router.register(r'datamart/interventions-country-programmes', endpoints.InterventionCPViewSet) router.register(r'datamart/interventions-epd', endpoints.InterventionEPDViewSet) router.register(r'datamart/interventions-management-budget', endpoints.InterventionBudgetMgmtViewSet) +router.register(r'datamart/interventions-planned-visits', endpoints.InterventionPlannedVisitsViewSet) router.register(r'datamart/interventions-review', endpoints.InterventionReviewViewSet) router.register(r'datamart/pd-indicators', endpoints.PDIndicatorViewSet) diff --git a/src/etools_datamart/apps/mart/data/admin.py b/src/etools_datamart/apps/mart/data/admin.py index 3b1576ecf..2039aed67 100644 --- a/src/etools_datamart/apps/mart/data/admin.py +++ b/src/etools_datamart/apps/mart/data/admin.py @@ -202,6 +202,13 @@ class InterventionManagementBudgetAdmin(DataModelAdmin, TruncateTableMixin): search_fields = ('pd_number', 'partner') +@register(models.InterventionPlannedVisits) +class InterventionPlannedVisitsAdmin(DataModelAdmin, TruncateTableMixin): + list_display = ('partner_vendor_number', 'partner_name', 'pd_status', 'pd_reference_number') + list_filter = (SchemaFilter, ) + search_fields = ('partner_vendor_number', 'partner_name', 'pd_reference_number') + + @register(models.InterventionReview) class InterventionReviewAdmin(DataModelAdmin, TruncateTableMixin): list_display = ('country_name', 'pd_number', 'partner') @@ -480,6 +487,13 @@ class AuditAdmin(DataModelAdmin): search_fields = ('reference_number', 'source_id') +@register(models.AuditFinancialFinding) +class AuditFinancialFindingAdmin(DataModelAdmin): + list_display = ('audit_reference_number', 'audit_status', 'partner_name') + list_filter = ('partner_name', 'audit_status', ) + search_fields = ('partner_name', 'audit_reference_number', 'source_id') + + @register(models.AuditSpecial) class AuditSpecialAdmin(DataModelAdmin): list_display = ('reference_number', 'engagement_type', 'status', 'sections') diff --git a/src/etools_datamart/apps/mart/data/migrations/0018_interventionplannedvisits.py b/src/etools_datamart/apps/mart/data/migrations/0018_interventionplannedvisits.py new file mode 100644 index 000000000..3a6376211 --- /dev/null +++ b/src/etools_datamart/apps/mart/data/migrations/0018_interventionplannedvisits.py @@ -0,0 +1,40 @@ +# Generated by Django 4.1.5 on 2023-03-20 16:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('data', '0017_merge_20230206_2300'), + ] + + operations = [ + migrations.CreateModel( + name='InterventionPlannedVisits', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('source_id', models.IntegerField(blank=True, db_index=True, null=True)), + ('last_modify_date', models.DateTimeField(auto_now=True)), + ('seen', models.DateTimeField(blank=True, null=True)), + ('country_name', models.CharField(max_length=100)), + ('schema_name', models.CharField(db_index=True, max_length=63)), + ('area_code', models.CharField(db_index=True, max_length=10)), + ('created', models.DateTimeField(blank=True, null=True)), + ('modified', models.DateTimeField(blank=True, null=True)), + ('partner_vendor_number', models.CharField(blank=True, max_length=100, null=True)), + ('partner_name', models.CharField(max_length=200, null=True)), + ('pd_status', models.CharField(choices=[('draft', 'Draft'), ('signed', 'Signed'), ('active', 'Active'), ('ended', 'Ended'), ('closed', 'Closed'), ('suspended', 'Suspended'), ('terminated', 'Terminated'), ('cancelled', 'Cancelled')], db_index=True, max_length=32, null=True)), + ('pd_reference_number', models.CharField(max_length=100, null=True)), + ('year', models.IntegerField()), + ('programmatic_q1', models.IntegerField(default=0)), + ('programmatic_q2', models.IntegerField(default=0)), + ('programmatic_q3', models.IntegerField(default=0)), + ('programmatic_q4', models.IntegerField(default=0)), + ], + options={ + 'verbose_name_plural': 'Intervention Planned Visits', + 'ordering': ('-created',), + }, + ), + ] diff --git a/src/etools_datamart/apps/mart/data/migrations/0019_auditfinancialfinding.py b/src/etools_datamart/apps/mart/data/migrations/0019_auditfinancialfinding.py new file mode 100644 index 000000000..f7c688e7c --- /dev/null +++ b/src/etools_datamart/apps/mart/data/migrations/0019_auditfinancialfinding.py @@ -0,0 +1,39 @@ +# Generated by Django 4.1.5 on 2023-03-22 12:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('data', '0018_interventionplannedvisits'), + ] + + operations = [ + migrations.CreateModel( + name='AuditFinancialFinding', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('source_id', models.IntegerField(blank=True, db_index=True, null=True)), + ('last_modify_date', models.DateTimeField(auto_now=True)), + ('seen', models.DateTimeField(blank=True, null=True)), + ('country_name', models.CharField(max_length=100)), + ('schema_name', models.CharField(db_index=True, max_length=63)), + ('area_code', models.CharField(db_index=True, max_length=10)), + ('created', models.DateField(auto_now=True)), + ('partner_vendor_number', models.CharField(blank=True, max_length=50, null=True)), + ('partner_name', models.CharField(blank=True, max_length=255, null=True)), + ('audit_reference_number', models.CharField(blank=True, max_length=100, null=True)), + ('audit_status', models.CharField(blank=True, choices=[('partner_contacted', 'IP Contacted'), ('field_visit', 'Field Visit'), ('draft_issued_to_partner', 'Draft Report Issued to IP'), ('comments_received_by_partner', 'Comments Received from IP'), ('draft_issued_to_unicef', 'Draft Report Issued to UNICEF'), ('comments_received_by_unicef', 'Comments Received from UNICEF'), ('report_submitted', 'Report Submitted'), ('final', 'Final Report'), ('cancelled', 'Cancelled')], db_index=True, max_length=30, null=True)), + ('title', models.CharField(choices=[('no-supporting-documentation', 'No supporting documentation'), ('insufficient-supporting-documentation', 'Insufficient supporting documentation'), ('cut-off-error', 'Cut-off error'), ('expenditure-not-for-project-purposes', 'Expenditure not for project purposes'), ('no-proof-of-payment', 'No proof of payment'), ('no-proof-of-goods-services-received', 'No proof of goods / services received'), ('vat-incorrectly-claimed', 'VAT incorrectly claimed'), ('dsa-rates-exceeded', 'DSA rates exceeded'), ('unreasonable-price', 'Unreasonable price'), ('bank-interest-not-reported', 'Bank interest not reported'), ('support-costs-incorrectly-calculated', 'Support costs incorrectly calculated'), ('expenditure-claimed-but-activities-not-undertaken', 'Expenditure claimed but activities not undertaken'), ('advance-claimed-as-expenditure', 'Advance claimed as expenditure'), ('commitments-treated-as-expenditure', 'Commitments treated as expenditure'), ('ineligible-salary-costs', 'Ineligible salary costs'), ('ineligible-costs-other', 'Ineligible costs (other)')], max_length=255)), + ('local_amount', models.DecimalField(decimal_places=2, max_digits=20)), + ('amount', models.DecimalField(decimal_places=2, max_digits=20)), + ('description', models.TextField()), + ('recommendation', models.TextField(blank=True)), + ('ip_comments', models.TextField(blank=True)), + ], + options={ + 'ordering': ('id',), + }, + ), + ] diff --git a/src/etools_datamart/apps/mart/data/models/__init__.py b/src/etools_datamart/apps/mart/data/models/__init__.py index 9dc4a2dd9..74a77a52d 100644 --- a/src/etools_datamart/apps/mart/data/models/__init__.py +++ b/src/etools_datamart/apps/mart/data/models/__init__.py @@ -2,6 +2,7 @@ from .attachments_attachment import Attachment # noqa from .audit_audit import Audit # noqa from .audit_engagement import Engagement # noqa +from .audit_financial_finding import AuditFinancialFinding # noqa from .audit_micro_assessment import MicroAssessment from .audit_result import AuditResult # noqa from .audit_special import AuditSpecial # noqa @@ -18,6 +19,7 @@ from .intervention_country_programme import InterventionCountryProgramme # noqa from .intervention_epd import InterventionEPD # noqa from .intervention_management_budget import InterventionManagementBudget # noqa +from .intervention_planned_visits import InterventionPlannedVisits from .intervention_review import InterventionReview # noqa from .location import GeoName, Location # noqa from .partner import Partner # noqa diff --git a/src/etools_datamart/apps/mart/data/models/audit_financial_finding.py b/src/etools_datamart/apps/mart/data/models/audit_financial_finding.py new file mode 100644 index 000000000..688a70438 --- /dev/null +++ b/src/etools_datamart/apps/mart/data/models/audit_financial_finding.py @@ -0,0 +1,60 @@ +from django.db import models + +from etools_datamart.apps.mart.data.loader import EtoolsLoader +from etools_datamart.apps.mart.data.models import Audit +from etools_datamart.apps.mart.data.models.base import EtoolsDataMartModel +from etools_datamart.apps.sources.etools.enrichment.consts import AuditEngagementConsts, AuditFinancialFindingsConsts +from etools_datamart.apps.sources.etools.models import AuditFinancialfinding + + +class AuditFinancialfindingLoader(EtoolsLoader): + def process_country(self): + country = self.context['country'] + for record in self.filter_queryset(self.get_queryset()): + try: + audit = Audit.objects.get(source_id=record.audit_id, schema_name=country.schema_name) + filters = self.config.key(self, record) + values = self.get_values(record) + values['partner_vendor_number'] = audit.auditor_number + values['partner_name'] = audit.auditor + values['audit_reference_number'] = audit.reference_number + values['audit_status'] = audit.status + op = self.process_record(filters, values) + self.increment_counter(op) + except Audit.DoesNotExist: + pass + + def get_title(self, record, values, field_name): + return AuditFinancialFindingsConsts.TITLE_CHOICES[getattr(record, field_name)] + + +class AuditFinancialFinding(EtoolsDataMartModel): + created = models.DateField(auto_now=True) + + partner_vendor_number = models.CharField(max_length=50, blank=True, null=True) + partner_name = models.CharField(max_length=255, blank=True, null=True) + + audit_reference_number = models.CharField(max_length=100, blank=True, null=True) + audit_status = models.CharField(max_length=30, blank=True, null=True, + choices=AuditEngagementConsts.DISPLAY_STATUSES, + db_index=True) + + title = models.CharField(max_length=255, choices=AuditFinancialFindingsConsts.TITLE_CHOICES) + local_amount = models.DecimalField(max_digits=20, decimal_places=2) + amount = models.DecimalField(max_digits=20, decimal_places=2) + description = models.TextField() + recommendation = models.TextField(blank=True) + ip_comments = models.TextField(blank=True) + + loader = AuditFinancialfindingLoader() + + class Meta: + ordering = ("id",) + + class Options: + source = AuditFinancialfinding + depends = (Audit, ) + key = lambda loader, record: dict( + schema_name=loader.context['country'].schema_name, + source_id=record.id, + ) diff --git a/src/etools_datamart/apps/mart/data/models/intervention_planned_visits.py b/src/etools_datamart/apps/mart/data/models/intervention_planned_visits.py new file mode 100644 index 000000000..a52bf89bc --- /dev/null +++ b/src/etools_datamart/apps/mart/data/models/intervention_planned_visits.py @@ -0,0 +1,50 @@ +from etools_datamart.apps.mart.data.loader import EtoolsLoader +from etools_datamart.apps.mart.data.models.base import EtoolsDataMartModel +from etools_datamart.apps.mart.data.models.intervention import Intervention +from etools_datamart.apps.sources.etools.enrichment.consts import PartnersInterventionConst +from etools_datamart.apps.sources.etools.models import models, PartnersInterventionplannedvisits + + +class InterventionPlannedVisits(EtoolsDataMartModel): + created = models.DateTimeField(blank=True, null=True) + modified = models.DateTimeField(blank=True, null=True) + + partner_vendor_number = models.CharField(max_length=100, blank=True, null=True) + partner_name = models.CharField(max_length=200, null=True) + pd_status = models.CharField(max_length=32, null=True, db_index=True, + choices=PartnersInterventionConst.STATUSES) + pd_reference_number = models.CharField(max_length=100, null=True) + + year = models.IntegerField() + programmatic_q1 = models.IntegerField(default=0) + programmatic_q2 = models.IntegerField(default=0) + programmatic_q3 = models.IntegerField(default=0) + programmatic_q4 = models.IntegerField(default=0) + + loader = EtoolsLoader() + + class Meta: + ordering = ("-created",) + verbose_name_plural = "Intervention Planned Visits" + + class Options: + source = PartnersInterventionplannedvisits + depends = (Intervention,) + queryset = lambda: PartnersInterventionplannedvisits.objects.select_related( + 'intervention', + 'intervention__agreement', + 'intervention__agreement__partner', + ) + key = lambda loader, record: dict(schema_name=loader.context['country'].schema_name, + source_id=record.pk) + mapping = dict( + partner_vendor_number='intervention.agreement.partner.vendor_number', + partner_name='intervention.agreement.partner.name', + pd_status='intervention.status', + pd_reference_number='intervention.reference_number', + year='=', + programmatic_q1='=', + programmatic_q2='=', + programmatic_q3='=', + programmatic_q4='=' + ) diff --git a/src/etools_datamart/apps/sources/etools/enrichment/consts.py b/src/etools_datamart/apps/sources/etools/enrichment/consts.py index e2521158e..e3f3d6626 100644 --- a/src/etools_datamart/apps/sources/etools/enrichment/consts.py +++ b/src/etools_datamart/apps/sources/etools/enrichment/consts.py @@ -229,6 +229,27 @@ class AuditEngagementConsts: } +class AuditFinancialFindingsConsts: + TITLE_CHOICES = Choices( + ('no-supporting-documentation', _('No supporting documentation')), + ('insufficient-supporting-documentation', _('Insufficient supporting documentation')), + ('cut-off-error', _('Cut-off error')), + ('expenditure-not-for-project-purposes', _('Expenditure not for project purposes')), + ('no-proof-of-payment', _('No proof of payment')), + ('no-proof-of-goods-services-received', _('No proof of goods / services received')), + ('vat-incorrectly-claimed', _('VAT incorrectly claimed')), + ('dsa-rates-exceeded', _('DSA rates exceeded')), + ('unreasonable-price', _('Unreasonable price')), + ('bank-interest-not-reported', _('Bank interest not reported')), + ('support-costs-incorrectly-calculated', _('Support costs incorrectly calculated')), + ('expenditure-claimed-but-activities-not-undertaken', _('Expenditure claimed but activities not undertaken')), + ('advance-claimed-as-expenditure', _('Advance claimed as expenditure')), + ('commitments-treated-as-expenditure', _('Commitments treated as expenditure')), + ('ineligible-salary-costs', _('Ineligible salary costs')), + ('ineligible-costs-other', _('Ineligible costs (other)')), + ) + + class ActionPointConsts: MODULE_CHOICES = CategoryConsts.MODULE_CHOICES diff --git a/src/etools_datamart/apps/sources/etools/models/tenant.py b/src/etools_datamart/apps/sources/etools/models/tenant.py index f926c0603..b19b7bee6 100644 --- a/src/etools_datamart/apps/sources/etools/models/tenant.py +++ b/src/etools_datamart/apps/sources/etools/models/tenant.py @@ -1326,13 +1326,13 @@ class Meta: class PartnersInterventionplannedvisits(models.TenantModel): id = models.IntegerField(primary_key=True) year = models.IntegerField() - programmatic_q4 = models.IntegerField() intervention = models.ForeignKey(PartnersIntervention, models.DO_NOTHING, related_name='PartnersInterventionplannedvisits_intervention') created = models.DateTimeField() modified = models.DateTimeField() - programmatic_q1 = models.IntegerField() - programmatic_q2 = models.IntegerField() - programmatic_q3 = models.IntegerField() + programmatic_q1 = models.IntegerField(default=0) + programmatic_q2 = models.IntegerField(default=0) + programmatic_q3 = models.IntegerField(default=0) + programmatic_q4 = models.IntegerField(default=0) class Meta: managed = False diff --git a/tests/_test_lib/test_utilities/factories/data.py b/tests/_test_lib/test_utilities/factories/data.py index 050033030..474f797c6 100644 --- a/tests/_test_lib/test_utilities/factories/data.py +++ b/tests/_test_lib/test_utilities/factories/data.py @@ -270,6 +270,13 @@ class Meta: model = models.InterventionManagementBudget +class InterventionPlannedVisitsFactory(DataMartModelFactory): + year = datetime.now().year + + class Meta: + model = models.InterventionPlannedVisits + + class InterventionReviewFactory(DataMartModelFactory): review_created = timezone.now() review_modified = timezone.now() @@ -354,7 +361,6 @@ class Meta: model = models.AuditResult - class SpotCheckFindingsFactory(DataMartModelFactory): partner = {'name': 'Partner1', 'vendor_number': '123', @@ -385,6 +391,15 @@ class Meta: model = models.Audit +class AuditFinancialFindingFactory(DataMartModelFactory): + created = timezone.now() + local_amount = 100.0 + amount = 200.0 + + class Meta: + model = models.AuditFinancialFinding + + class AuditSpecialFactory(DataMartModelFactory): partner = {'name': 'Partner1', 'vendor_number': '123', diff --git a/tests/api/interfaces/_api_checker/test_data/data/_api_latest_datamart_audit_financial-findings_.fixture.json b/tests/api/interfaces/_api_checker/test_data/data/_api_latest_datamart_audit_financial-findings_.fixture.json new file mode 100644 index 000000000..6e3ce278e --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/data/_api_latest_datamart_audit_financial-findings_.fixture.json @@ -0,0 +1,76 @@ +{ + "data": { + "master": [ + { + "model": "data.auditfinancialfinding", + "pk": 140, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-22T14:39:27.946Z", + "seen": null, + "country_name": "bolivia", + "schema_name": "bolivia", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + } + }, + { + "model": "data.auditfinancialfinding", + "pk": 141, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-22T14:39:27.947Z", + "seen": null, + "country_name": "chad", + "schema_name": "chad", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + } + }, + { + "model": "data.auditfinancialfinding", + "pk": 142, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-22T14:39:27.950Z", + "seen": null, + "country_name": "lebanon", + "schema_name": "lebanon", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + } + } + ], + "deps": [] + } +} \ No newline at end of file diff --git a/tests/api/interfaces/_api_checker/test_data/data/_api_latest_datamart_interventions-planned-visits_.fixture.json b/tests/api/interfaces/_api_checker/test_data/data/_api_latest_datamart_interventions-planned-visits_.fixture.json new file mode 100644 index 000000000..ef5ec9aee --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/data/_api_latest_datamart_interventions-planned-visits_.fixture.json @@ -0,0 +1,76 @@ +{ + "data": { + "master": [ + { + "model": "data.interventionplannedvisits", + "pk": 1, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-20T16:55:10.073Z", + "seen": null, + "country_name": "bolivia", + "schema_name": "bolivia", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + } + }, + { + "model": "data.interventionplannedvisits", + "pk": 2, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-20T16:55:10.074Z", + "seen": null, + "country_name": "chad", + "schema_name": "chad", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + } + }, + { + "model": "data.interventionplannedvisits", + "pk": 3, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-20T16:55:10.075Z", + "seen": null, + "country_name": "lebanon", + "schema_name": "lebanon", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + } + } + ], + "deps": [] + } +} \ No newline at end of file diff --git a/tests/api/interfaces/_api_checker/test_data/record/_api_latest_datamart_audit_financial-findings_.fixture.json b/tests/api/interfaces/_api_checker/test_data/record/_api_latest_datamart_audit_financial-findings_.fixture.json new file mode 100644 index 000000000..3685bb16b --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/record/_api_latest_datamart_audit_financial-findings_.fixture.json @@ -0,0 +1,28 @@ +{ + "record": { + "master": { + "model": "data.auditfinancialfinding", + "pk": 143, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-22T14:39:32.165Z", + "seen": null, + "country_name": "bolivia", + "schema_name": "bolivia", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + } + }, + "deps": [] + } +} \ No newline at end of file diff --git a/tests/api/interfaces/_api_checker/test_data/record/_api_latest_datamart_interventions-planned-visits_.fixture.json b/tests/api/interfaces/_api_checker/test_data/record/_api_latest_datamart_interventions-planned-visits_.fixture.json new file mode 100644 index 000000000..a22a40802 --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/record/_api_latest_datamart_interventions-planned-visits_.fixture.json @@ -0,0 +1,28 @@ +{ + "record": { + "master": { + "model": "data.interventionplannedvisits", + "pk": 4, + "fields": { + "source_id": null, + "last_modify_date": "2023-03-20T16:55:13.378Z", + "seen": null, + "country_name": "bolivia", + "schema_name": "bolivia", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + } + }, + "deps": [] + } +} \ No newline at end of file diff --git a/tests/api/interfaces/_api_checker/test_data/test_list/_api_latest_datamart_audit_financial-findings_/get/197add8e52191fc33bc0669a32ea63213e8608ee9b3b24c42981397919aba411.response.json b/tests/api/interfaces/_api_checker/test_data/test_list/_api_latest_datamart_audit_financial-findings_/get/197add8e52191fc33bc0669a32ea63213e8608ee9b3b24c42981397919aba411.response.json new file mode 100644 index 000000000..38ce3ddeb --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/test_list/_api_latest_datamart_audit_financial-findings_/get/197add8e52191fc33bc0669a32ea63213e8608ee9b3b24c42981397919aba411.response.json @@ -0,0 +1,89 @@ +{ + "status_code": 200, + "headers": { + "Content-Type": "application/json", + "Vary": "Accept, Origin, Cookie", + "Allow": "GET, HEAD, OPTIONS", + "ETag": "\"2792679e04f9a5dc9a5826fb8957de27\"", + "X-Frame-Options": "DENY", + "view": "etools_datamart.api.endpoints.datamart.audit_financial_finding.AuditFinancialFindingViewSet", + "service": "etools_datamart.api.endpoints.datamart.audit_financial_finding.AuditFinancialFindingViewSet", + "cache-version": "1", + "system-filters": "", + "cache-key": "2792679e04f9a5dc9a5826fb8957de27", + "cache-hit": "False", + "qs_filter": "{}", + "qs_exclude": "{}", + "cache-ttl": "1y", + "Content-Length": "1134", + "Referrer-Policy": "same-origin", + "Cross-Origin-Opener-Policy": "same-origin" + }, + "data": { + "count": 3, + "next": null, + "current_page": 1, + "total_pages": 1, + "previous": null, + "results": [ + { + "id": 140, + "source_id": null, + "last_modify_date": "22 Mar 2023 14:39:27", + "seen": null, + "country_name": "bolivia", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + }, + { + "id": 141, + "source_id": null, + "last_modify_date": "22 Mar 2023 14:39:27", + "seen": null, + "country_name": "chad", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + }, + { + "id": 142, + "source_id": null, + "last_modify_date": "22 Mar 2023 14:39:27", + "seen": null, + "country_name": "lebanon", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + } + ] + }, + "content_type": "application/json" +} \ No newline at end of file diff --git a/tests/api/interfaces/_api_checker/test_data/test_list/_api_latest_datamart_interventions-planned-visits_/get/197add8e52191fc33bc0669a32ea63213e8608ee9b3b24c42981397919aba411.response.json b/tests/api/interfaces/_api_checker/test_data/test_list/_api_latest_datamart_interventions-planned-visits_/get/197add8e52191fc33bc0669a32ea63213e8608ee9b3b24c42981397919aba411.response.json new file mode 100644 index 000000000..27c0b2877 --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/test_list/_api_latest_datamart_interventions-planned-visits_/get/197add8e52191fc33bc0669a32ea63213e8608ee9b3b24c42981397919aba411.response.json @@ -0,0 +1,86 @@ +{ + "status_code": 200, + "headers": { + "Content-Type": "application/json", + "Vary": "Accept, Origin, Cookie", + "Allow": "GET, HEAD, OPTIONS", + "ETag": "\"fc28b699328bb079c220fb23d005754b\"", + "X-Frame-Options": "DENY", + "view": "etools_datamart.api.endpoints.datamart.intervention_planned_visits.InterventionPlannedVisitsViewSet", + "service": "etools_datamart.api.endpoints.datamart.intervention_planned_visits.InterventionPlannedVisitsViewSet", + "cache-version": "1", + "system-filters": "", + "cache-key": "fc28b699328bb079c220fb23d005754b", + "cache-hit": "False", + "qs_filter": "{}", + "qs_exclude": "{}", + "cache-ttl": "1y", + "Content-Length": "1071", + "Referrer-Policy": "same-origin", + "Cross-Origin-Opener-Policy": "same-origin" + }, + "data": { + "count": 3, + "next": null, + "current_page": 1, + "total_pages": 1, + "previous": null, + "results": [ + { + "id": 1, + "last_modify_date": "20 Mar 2023 16:55:10", + "country_name": "bolivia", + "schema_name": "bolivia", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + }, + { + "id": 2, + "last_modify_date": "20 Mar 2023 16:55:10", + "country_name": "chad", + "schema_name": "chad", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + }, + { + "id": 3, + "last_modify_date": "20 Mar 2023 16:55:10", + "country_name": "lebanon", + "schema_name": "lebanon", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + } + ] + }, + "content_type": "application/json" +} \ No newline at end of file diff --git a/tests/api/interfaces/_api_checker/test_data/test_record/_api_latest_datamart_audit_financial-findings_143_/get/dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91.response.json b/tests/api/interfaces/_api_checker/test_data/test_record/_api_latest_datamart_audit_financial-findings_143_/get/dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91.response.json new file mode 100644 index 000000000..db5d5aa94 --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/test_record/_api_latest_datamart_audit_financial-findings_143_/get/dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91.response.json @@ -0,0 +1,39 @@ +{ + "status_code": 200, + "headers": { + "Content-Type": "application/json", + "Vary": "Accept, Origin, Cookie", + "Allow": "GET, HEAD, OPTIONS", + "ETag": "\"1b4f4c69ed0ba40e973d970fcf04fdcf\"", + "X-Frame-Options": "DENY", + "view": "etools_datamart.api.endpoints.datamart.audit_financial_finding.AuditFinancialFindingViewSet", + "service": "etools_datamart.api.endpoints.datamart.audit_financial_finding.AuditFinancialFindingViewSet", + "qs_filter": "{}", + "qs_exclude": "{}", + "cache-hit": "False", + "cache-ttl": "1y", + "Content-Length": "350", + "Referrer-Policy": "same-origin", + "Cross-Origin-Opener-Policy": "same-origin" + }, + "data": { + "id": 143, + "source_id": null, + "last_modify_date": "22 Mar 2023 14:39:32", + "seen": null, + "country_name": "bolivia", + "area_code": "", + "created": "2023-03-22", + "partner_vendor_number": null, + "partner_name": null, + "audit_reference_number": null, + "audit_status": null, + "title": "", + "local_amount": "100.00", + "amount": "200.00", + "description": "", + "recommendation": "", + "ip_comments": "" + }, + "content_type": "application/json" +} \ No newline at end of file diff --git a/tests/api/interfaces/_api_checker/test_data/test_record/_api_latest_datamart_interventions-planned-visits_4_/get/dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91.response.json b/tests/api/interfaces/_api_checker/test_data/test_record/_api_latest_datamart_interventions-planned-visits_4_/get/dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91.response.json new file mode 100644 index 000000000..e751eacb2 --- /dev/null +++ b/tests/api/interfaces/_api_checker/test_data/test_record/_api_latest_datamart_interventions-planned-visits_4_/get/dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91.response.json @@ -0,0 +1,38 @@ +{ + "status_code": 200, + "headers": { + "Content-Type": "application/json", + "Vary": "Accept, Origin, Cookie", + "Allow": "GET, HEAD, OPTIONS", + "ETag": "\"51128e55835f974dca396e3b85b929d8\"", + "X-Frame-Options": "DENY", + "view": "etools_datamart.api.endpoints.datamart.intervention_planned_visits.InterventionPlannedVisitsViewSet", + "service": "etools_datamart.api.endpoints.datamart.intervention_planned_visits.InterventionPlannedVisitsViewSet", + "qs_filter": "{}", + "qs_exclude": "{}", + "cache-hit": "False", + "cache-ttl": "1y", + "Content-Length": "330", + "Referrer-Policy": "same-origin", + "Cross-Origin-Opener-Policy": "same-origin" + }, + "data": { + "id": 4, + "last_modify_date": "20 Mar 2023 16:55:13", + "country_name": "bolivia", + "schema_name": "bolivia", + "area_code": "", + "created": null, + "modified": null, + "partner_vendor_number": null, + "partner_name": null, + "pd_status": null, + "pd_reference_number": null, + "year": 2023, + "programmatic_q1": 0, + "programmatic_q2": 0, + "programmatic_q3": 0, + "programmatic_q4": 0 + }, + "content_type": "application/json" +} \ No newline at end of file