Skip to content

Commit

Permalink
feat: ✨ CANs List (#2804)
Browse files Browse the repository at this point in the history
* refactor: updates CANs list

* feat: adds CANTable and friends

* docs: add docs for TS and JSDocs examples and usage
  • Loading branch information
fpigeonjr authored Sep 25, 2024
1 parent d4237dc commit fa69570
Show file tree
Hide file tree
Showing 43 changed files with 1,563 additions and 227 deletions.
93 changes: 55 additions & 38 deletions backend/data_tools/data/can_data.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,87 +5,104 @@
fiscal_year: 2023,
fund_code: "AAXXXX20231DAD",
funding_source: "OPRE",
method_of_transfer: "DIRECT",
},
{
// 2
fiscal_year: 2021,
fund_code: "BBXXXX20215DAD",
method_of_transfer: "COST_SHARE",
},
{
// 3
fiscal_year: 2022,
fund_code: "CCXXXX20225DAD"
fund_code: "CCXXXX20225DAD",
method_of_transfer: "IDDA",
},
{
// 4
fiscal_year: 2021,
fund_code: "DDXXXX20215DAD",
method_of_transfer: "IAA",
},
{
// 5
fiscal_year: 2021,
fund_code: "EEXXXX20215DAD",
method_of_transfer: "IDDA",
},
{
// 6
fiscal_year: 2021,
fund_code: "FFXXXX20215DAD"
fund_code: "FFXXXX20215DAD",
method_of_transfer: "DIRECT",
},
{
// 7
fiscal_year: 2023,
fund_code: "GGXXXX20231DAD"
fund_code: "GGXXXX20231DAD",
method_of_transfer: "DIRECT",
},
{
// 8
fiscal_year: 2023,
fund_code: "HHXXXX20231DAD"
fund_code: "HHXXXX20231DAD",
method_of_transfer: "IDDA",
},
{
// 9
fiscal_year: 2023,
fund_code: "IIXXXX20231DAD"
fund_code: "IIXXXX20231DAD",
method_of_transfer: "IAA",
},
{
// 10
fiscal_year: 2023,
fund_code: "JJXXXX20231DAD"
fund_code: "JJXXXX20231DAD",
method_of_transfer: "DIRECT",
},
{
// 11
fiscal_year: 2023,
fund_code: "KKXXXX20235DAD"
fund_code: "KKXXXX20235DAD",
method_of_transfer: "IDDA",
},
{
// 12
fiscal_year: 2022,
fund_code: "LLXXXX20225DAD"
fund_code: "LLXXXX20225DAD",
method_of_transfer: "IAA",
},
{
// 13
fiscal_year: 2023,
fund_code: "MMXXXX20235DAD"
fund_code: "MMXXXX20235DAD",
method_of_transfer: "DIRECT",
},
{
// 14
fiscal_year: 2023,
fund_code: "NNXXXX20231DAD"
fund_code: "NNXXXX20231DAD",
method_of_transfer: "IDDA",
},
{
// 15
fiscal_year: 2023,
fund_code: "OOXXXX20235DAD"
fund_code: "OOXXXX20235DAD",
method_of_transfer: "DIRECT",
},
{
// 16
fiscal_year: 2023,
fund_code: "PPXXXX20235DAD"
fund_code: "PPXXXX20235DAD",
method_of_transfer: "DIRECT",
},
{
// 17
fiscal_year: 2023,
fund_code: "QQXXXX20235DAD"
}
fund_code: "QQXXXX20235DAD",
method_of_transfer: "IDDA",
},
],
can: [
{
Expand All @@ -94,142 +111,142 @@
description: "Healthy Marriages Responsible Fatherhood - OPRE",
nick_name: "HMRF-OPRE",
portfolio_id: 6,
funding_details_id: 1
funding_details_id: 1,
},
{
// 501
number: "G99IA14",
description: "Incoming Interagency Agreements",
nick_name: "IAA-Incoming",
portfolio_id: 1,
funding_details_id: 2
funding_details_id: 2,
},
{
// 502
number: "G99PHS9",
description: "Social Science Research and Development",
nick_name: "SSRD",
portfolio_id: 8,
funding_details_id: 3
funding_details_id: 3,
},
{
// 503
number: "G990136",
description: "Child Development Research Fellowship Grant Program",
nick_name: "ASPE SRCD-IDDA",
portfolio_id: 1,
funding_details_id: 4
funding_details_id: 4,
},
{
// 504
number: "G994426",
description: "Head Start Research",
nick_name: "HS",
portfolio_id: 2,
funding_details_id: 5
funding_details_id: 5,
},
{
// 505
number: "G994648",
description: "Kinship Navigation",
nick_name: "Kin-Nav",
portfolio_id: 6,
funding_details_id: 6
funding_details_id: 6,
},
{
// 506
number: "G996125",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 7
funding_details_id: 7,
},
{
// 507
number: "G99XXX1",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 8
funding_details_id: 8,
},
{
// 508
number: "G99XXX2",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 9
funding_details_id: 9,
},
{
// 509
number: "G99XXX3",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 10
funding_details_id: 10,
},
{
// 510
number: "G99XXX4",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 11
funding_details_id: 11,
},
{
// 511
number: "G99XXX7",
description: "Healthy Marriages Responsible Fatherhood - OFA",
nick_name: "HMRF-OFA",
portfolio_id: 6,
funding_details_id: 12
funding_details_id: 12,
},
{
// 512
number: "G99XXX8",
description: "Example CAN",
nick_name: "",
nick_name: "Next Generation Leadership Program",
portfolio_id: 3,
funding_details_id: 13,
projects: [
{
"tablename": "project",
"id": 1000
}
]
tablename: "project",
id: 1000,
},
],
},
{
// 513
number: "G99MV23",
description: "MIHOPE Check-in 2023",
nick_name: "MIHOPE 23",
portfolio_id: 3,
funding_details_id: 14
funding_details_id: 14,
},
{
// 514
number: "G99MV24",
description: "MIHOPE Check-in 2024",
nick_name: "MIHOPE 24",
portfolio_id: 3,
funding_details_id: 15
funding_details_id: 15,
},
{
// 515
number: "G99MVT3",
description: "MOHOPE Long-Term",
nick_name: "MIHOPE LT",
portfolio_id: 3,
funding_details_id: 16
funding_details_id: 16,
},
{
// 516
number: "G99SHARED",
description: "Shared CAN",
nick_name: "SHARED",
portfolio_id: 3,
funding_details_id: 17
}
funding_details_id: 17,
},
],
can_funding_budget: [
{
Expand Down Expand Up @@ -386,7 +403,7 @@
fiscal_year: 2023,
can_id: 516,
budget: 500000.0,
}
},
],
can_funding_received: [
{
Expand Down Expand Up @@ -518,6 +535,6 @@
fiscal_year: 2023,
can_id: 515,
funding: 1000000.0,
}
},
],
}
1 change: 1 addition & 0 deletions backend/ops_api/ops/schemas/cans.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from marshmallow import Schema, fields

from models import CANMethodOfTransfer, PortfolioStatus

from ops_api.ops.schemas.budget_line_items import BudgetLineItemResponseSchema
from ops_api.ops.schemas.projects import ProjectSchema
from ops_api.ops.schemas.users import SafeUserSchema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_get_can_funding_summary_no_fiscal_year(loaded_db, test_can) -> None:
"funding_partner": None,
"funding_source": "OPRE",
"id": 1,
"method_of_transfer": None,
"method_of_transfer": "DIRECT",
"sub_allowance": None,
"updated_by": None,
"updated_by_user": None,
Expand Down Expand Up @@ -141,7 +141,7 @@ def test_get_can_funding_summary_with_fiscal_year(loaded_db, test_can) -> None:
"funding_partner": None,
"funding_source": "OPRE",
"id": 1,
"method_of_transfer": None,
"method_of_transfer": "DIRECT",
"sub_allowance": None,
"updated_by": None,
"updated_by_user": None,
Expand Down
Loading

0 comments on commit fa69570

Please sign in to comment.