Skip to content

Commit

Permalink
add abd update queries for intervention related loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan committed Dec 23, 2024
1 parent cf90162 commit 6c5b5cf
Show file tree
Hide file tree
Showing 5 changed files with 449 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class InterventionCountryProgrammeLoader(EtoolsLoader):
-- Most of the fields can be dropped.
SELECT '##COUNTRY##' AS __schema,
"partners_intervention_country_programmes"."id",
"partners_intervention_country_programmes"."id", -- directly mapped to .source_id
"partners_intervention_country_programmes"."intervention_id",
"partners_intervention_country_programmes"."countryprogramme_id",
"partners_intervention"."created",
"partners_intervention"."modified",
"partners_intervention"."document_type",
"partners_intervention"."number",
"partners_intervention"."title",
"partners_intervention"."number", -- to .pd_number
"partners_intervention"."title", -- to .pd_title
"partners_intervention"."status",
"partners_intervention"."start",
"partners_intervention"."end",
Expand Down Expand Up @@ -72,16 +72,91 @@ class InterventionCountryProgrammeLoader(EtoolsLoader):
"partners_intervention"."other_info",
"partners_intervention"."other_partners_involved",
"partners_intervention"."technical_guidance",
"partners_intervention"."cash_transfer_modalities", "partners_intervention"."cancel_justification", "partners_intervention"."date_partnership_review_performed", "partners_intervention"."accepted_on_behalf_of_partner", "partners_intervention"."activation_protocol", "partners_intervention"."confidential", "partners_intervention"."has_activities_involving_children", "partners_intervention"."has_data_processing_agreement", "partners_intervention"."has_special_conditions_for_construction", "partners_intervention"."final_review_approved", "partners_intervention"."other_details", "partners_intervention"."partner_authorized_officer_signatory_id",
"partners_agreement"."id", "partners_agreement"."created", "partners_agreement"."modified", "partners_agreement"."start", "partners_agreement"."end", "partners_agreement"."agreement_type", "partners_agreement"."agreement_number", "partners_agreement"."attached_agreement", "partners_agreement"."signed_by_unicef_date", "partners_agreement"."signed_by_partner_date", "partners_agreement"."partner_id", "partners_agreement"."signed_by_id", "partners_agreement"."status", "partners_agreement"."country_programme_id", "partners_agreement"."reference_number_year", "partners_agreement"."special_conditions_pca", "partners_agreement"."terms_acknowledged_by_id", "partners_agreement"."partner_manager_id",
"partners_partnerorganization"."id", "partners_partnerorganization"."description", "partners_partnerorganization"."address", "partners_partnerorganization"."email", "partners_partnerorganization"."phone_number", "partners_partnerorganization"."alternate_id", "partners_partnerorganization"."alternate_name", "partners_partnerorganization"."rating", "partners_partnerorganization"."core_values_assessment_date", "partners_partnerorganization"."vision_synced", "partners_partnerorganization"."type_of_assessment", "partners_partnerorganization"."last_assessment_date", "partners_partnerorganization"."hidden", "partners_partnerorganization"."deleted_flag", "partners_partnerorganization"."total_ct_cp", "partners_partnerorganization"."total_ct_cy", "partners_partnerorganization"."blocked", "partners_partnerorganization"."city", "partners_partnerorganization"."country", "partners_partnerorganization"."postal_code", "partners_partnerorganization"."shared_with", "partners_partnerorganization"."street_address", "partners_partnerorganization"."hact_values", "partners_partnerorganization"."created", "partners_partnerorganization"."modified", "partners_partnerorganization"."net_ct_cy", "partners_partnerorganization"."reported_cy", "partners_partnerorganization"."total_ct_ytd", "partners_partnerorganization"."basis_for_risk_rating", "partners_partnerorganization"."manually_blocked", "partners_partnerorganization"."outstanding_dct_amount_6_to_9_months_usd", "partners_partnerorganization"."outstanding_dct_amount_more_than_9_months_usd", "partners_partnerorganization"."highest_risk_rating_name", "partners_partnerorganization"."highest_risk_rating_type", "partners_partnerorganization"."psea_assessment_date", "partners_partnerorganization"."sea_risk_rating_name", "partners_partnerorganization"."lead_office_id", "partners_partnerorganization"."lead_section_id", "partners_partnerorganization"."organization_id",
"organizations_organization"."id", "organizations_organization"."created", "organizations_organization"."modified", "organizations_organization"."name", "organizations_organization"."vendor_number", "organizations_organization"."organization_type", "organizations_organization"."cso_type", "organizations_organization"."short_name", "organizations_organization"."other", "organizations_organization"."parent_id",
"partners_intervention"."cash_transfer_modalities"
"partners_intervention"."cancel_justification",
"partners_intervention"."date_partnership_review_performed",
"partners_intervention"."accepted_on_behalf_of_partner",
"partners_intervention"."activation_protocol",
"partners_intervention"."confidential",
"partners_intervention"."has_activities_involving_children",
"partners_intervention"."has_data_processing_agreement",
"partners_intervention"."has_special_conditions_for_construction",
"partners_intervention"."final_review_approved",
"partners_intervention"."other_details",
"partners_intervention"."partner_authorized_officer_signatory_id",
"partners_agreement"."id",
"partners_agreement"."created",
"partners_agreement"."modified",
"partners_agreement"."start",
"partners_agreement"."end",
"partners_agreement"."agreement_type",
"partners_agreement"."agreement_number",
"partners_agreement"."attached_agreement",
"partners_agreement"."signed_by_unicef_date",
"partners_agreement"."signed_by_partner_date",
"partners_agreement"."partner_id",
"partners_agreement"."signed_by_id",
"partners_agreement"."status",
"partners_agreement"."country_programme_id",
"partners_agreement"."reference_number_year",
"partners_agreement"."special_conditions_pca",
"partners_agreement"."terms_acknowledged_by_id",
"partners_agreement"."partner_manager_id",
"partners_partnerorganization"."id",
"partners_partnerorganization"."description",
"partners_partnerorganization"."address",
"partners_partnerorganization"."email",
"partners_partnerorganization"."phone_number",
"partners_partnerorganization"."alternate_id",
"partners_partnerorganization"."alternate_name",
"partners_partnerorganization"."rating",
"partners_partnerorganization"."core_values_assessment_date",
"partners_partnerorganization"."vision_synced",
"partners_partnerorganization"."type_of_assessment",
"partners_partnerorganization"."last_assessment_date",
"partners_partnerorganization"."hidden",
"partners_partnerorganization"."deleted_flag",
"partners_partnerorganization"."total_ct_cp",
"partners_partnerorganization"."total_ct_cy",
"partners_partnerorganization"."blocked",
"partners_partnerorganization"."city",
"partners_partnerorganization"."country",
"partners_partnerorganization"."postal_code",
"partners_partnerorganization"."shared_with",
"partners_partnerorganization"."street_address",
"partners_partnerorganization"."hact_values",
"partners_partnerorganization"."created",
"partners_partnerorganization"."modified",
"partners_partnerorganization"."net_ct_cy",
"partners_partnerorganization"."reported_cy",
"partners_partnerorganization"."total_ct_ytd",
"partners_partnerorganization"."basis_for_risk_rating",
"partners_partnerorganization"."manually_blocked",
"partners_partnerorganization"."outstanding_dct_amount_6_to_9_months_usd",
"partners_partnerorganization"."outstanding_dct_amount_more_than_9_months_usd",
"partners_partnerorganization"."highest_risk_rating_name",
"partners_partnerorganization"."highest_risk_rating_type",
"partners_partnerorganization"."psea_assessment_date",
"partners_partnerorganization"."sea_risk_rating_name",
"partners_partnerorganization"."lead_office_id",
"partners_partnerorganization"."lead_section_id",
"partners_partnerorganization"."organization_id",
"organizations_organization"."id",
"organizations_organization"."created",
"organizations_organization"."modified",
"organizations_organization"."name", -- directly mapped to .partner
"organizations_organization"."vendor_number", -- directly mapped to .partner_vendor_number=
"organizations_organization"."organization_type", -- directly mapped to .partner_type
"organizations_organization"."cso_type", -- directly mapped to .partner_cso_type
"organizations_organization"."short_name",
"organizations_organization"."other",
"organizations_organization"."parent_id",
"reports_countryprogramme"."id",
"reports_countryprogramme"."name", --directly mapped to <target>.country_programme
"reports_countryprogramme"."name", --directly mapped to <target>.country_programme
"reports_countryprogramme"."wbs",
"reports_countryprogramme"."from_date",
"reports_countryprogramme"."to_date",
Expand Down
54 changes: 27 additions & 27 deletions src/etools_datamart/apps/mart/data/models/intervention_epd.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class InterventionEPDLoader(EtoolsLoader):
--
SELECT 'afghanistan' AS __schema,
"partners_intervention"."id",
"partners_intervention"."id", -- directly mapped to .source_id
"partners_intervention"."created",
"partners_intervention"."modified",
"partners_intervention"."document_type",
Expand Down Expand Up @@ -76,32 +76,32 @@ class InterventionEPDLoader(EtoolsLoader):
"partners_intervention"."termination_doc",
"partners_intervention"."cfei_number",
"partners_intervention"."budget_owner_id",
"partners_intervention"."context", -- directly mapped
"partners_intervention"."date_sent_to_partner", -- directly mapped
"partners_intervention"."equity_narrative", -- directly mapped
"partners_intervention"."equity_rating", -- directly mapped
"partners_intervention"."gender_narrative", -- directly mapped
"partners_intervention"."gender_rating", -- directly mapped
"partners_intervention"."hq_support_cost", -- directly mapped
"partners_intervention"."implementation_strategy", -- directly mapped
"partners_intervention"."ip_program_contribution", -- directly mapped
"partners_intervention"."partner_accepted", -- directly mapped
"partners_intervention"."sustainability_narrative", -- directly mapped
"partners_intervention"."sustainability_rating", -- directly mapped
"partners_intervention"."unicef_accepted", -- directly mapped
"partners_intervention"."unicef_court", -- directly mapped
"partners_intervention"."unicef_review_type", -- directly mapped
"partners_intervention"."humanitarian_flag", -- directly mapped
"partners_intervention"."capacity_development", -- directly mapped
"partners_intervention"."other_info", -- directly mapped
"partners_intervention"."other_partners_involved", -- directly mapped
"partners_intervention"."technical_guidance", -- directly mapped
"partners_intervention"."cash_transfer_modalities", -- directly mapped
"partners_intervention"."cancel_justification", -- directly mapped
"partners_intervention"."date_partnership_review_performed", -- directly mapped
"partners_intervention"."accepted_on_behalf_of_partner", -- directly mapped
"partners_intervention"."activation_protocol", -- directly mapped
"partners_intervention"."confidential", -- directly mapped
"partners_intervention"."context", -- directly mapped to .date_sent_to_partner
"partners_intervention"."date_sent_to_partner", -- directly mapped to .equity_narrative
"partners_intervention"."equity_narrative", -- directly mapped to .equity_narrative
"partners_intervention"."equity_rating", -- directly mapped to .equity_ratting
"partners_intervention"."gender_narrative", -- directly mapped to .gender_narrative
"partners_intervention"."gender_rating", -- directly mapped to .gender_rating
"partners_intervention"."hq_support_cost", -- directly mapped to .hq_support_cost
"partners_intervention"."implementation_strategy", -- directly mapped to .implementation_strategy
"partners_intervention"."ip_program_contribution", -- directly mapped to .ip_program_contribution
"partners_intervention"."partner_accepted", -- directly mapped to .partner_accepted
"partners_intervention"."sustainability_narrative", -- directly mapped to .sustainability_narrative
"partners_intervention"."sustainability_rating", -- directly mapped to .sustainability_rating
"partners_intervention"."unicef_accepted", -- directly mapped to .unicef_accepted
"partners_intervention"."unicef_court", -- directly mapped to .unicef_court
"partners_intervention"."unicef_review_type", -- directly mapped to .humanitarian_flag
"partners_intervention"."humanitarian_flag", -- directly mapped to .capacity_development
"partners_intervention"."capacity_development", -- directly mapped to .other_info
"partners_intervention"."other_info", -- directly mapped to .other_partners_involved
"partners_intervention"."other_partners_involved", -- directly mapped to .technical_guidance
"partners_intervention"."technical_guidance", -- directly mapped to .cash_transfer_modalities
"partners_intervention"."cash_transfer_modalities", -- directly mapped to .cancel_justification
"partners_intervention"."cancel_justification", -- directly mapped to .date_partnership_review_performed
"partners_intervention"."date_partnership_review_performed", -- directly mapped to .accepted_on_behalf_of_partner
"partners_intervention"."accepted_on_behalf_of_partner", -- directly mapped to .accepted_on_behalf_of_partner
"partners_intervention"."activation_protocol", -- directly mapped to .activation_protocol
"partners_intervention"."confidential", -- directly mapped to .confidential
"partners_intervention"."has_activities_involving_children",
"partners_intervention"."has_data_processing_agreement",
"partners_intervention"."has_special_conditions_for_construction",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class InterventionManagementBudgetLoader(EtoolsLoader):
--
SELECT '##COUNTRY##' AS __schema,
"partners_interventionmanagementbudgetitem"."id",
"partners_interventionmanagementbudgetitem"."id", -- directly mapped to source_id
"partners_interventionmanagementbudgetitem"."name",
"partners_interventionmanagementbudgetitem"."kind",
"partners_interventionmanagementbudgetitem"."unicef_cash", -- directly mapped to .unicef_cash
Expand Down
Loading

0 comments on commit 6c5b5cf

Please sign in to comment.