From 62b79f928b1cb72846db58f301d25727dd4142d4 Mon Sep 17 00:00:00 2001 From: maiyerlee Date: Wed, 11 Dec 2024 22:20:44 -0600 Subject: [PATCH] refactor: remove authorizer and external authorizer attributes --- backend/openapi.yml | 8 - .../AgreementCANReviewAccordion.test.jsx | 235 +++++++++--------- .../CANFundingCard/CanFundingCard.test.jsx | 76 +++--- .../components/CANs/CanCard/CanCard.test.jsx | 78 +++--- frontend/src/tests/data.js | 12 +- 5 files changed, 190 insertions(+), 219 deletions(-) diff --git a/backend/openapi.yml b/backend/openapi.yml index 389b713fa9..082f6e08cf 100644 --- a/backend/openapi.yml +++ b/backend/openapi.yml @@ -1057,7 +1057,6 @@ paths: "appropriation_date": "01/10/2023", "appropriation_term": 1, "arrangement_type_id": 3, - "authorizer_id": 26, "description": "Incoming Interagency Agreements", "expiration_date": "01/09/2024", "id": 2, @@ -1071,7 +1070,6 @@ paths: "appropriation_date": "01/10/2022", "appropriation_term": 1, "arrangement_type_id": 4, - "authorizer_id": 26, "description": "Child Development Research Fellowship Grant Program", "expiration_date": "01/09/2023", "id": 4, @@ -1166,8 +1164,6 @@ paths: properties: appropriation_term: type: integer - authorizer_id: - type: integer arrangement_type_id: type: integer number: @@ -1221,7 +1217,6 @@ paths: "appropriation_date": "01/10/2022", "appropriation_term": 1, "arrangement_type_id": 4, - "authorizer_id": 26, "description": "Child Development Research Fellowship Grant Program", "expiration_date": "01/09/2023", "id": 4, @@ -4089,7 +4084,6 @@ components: - appropriation_date: "2023-09-01T00:00:00.000000Z" - appropriation_term: 1 - arrangement_type_id: 2 - - authorizer_id: 23 - description: Healthy Marriages Responsible Fatherhood - OFA - expiration_date: "2023-09-01T00:00:00.000000Z" - id: 10 @@ -4106,7 +4100,6 @@ components: "appropriation_date": "2023-09-01T00:00:00.000000Z", "appropriation_term": 1, "arrangement_type_id": 3, - "authorizer_id": 26, "description": "Incoming Interagency Agreements", "expiration_date": "2023-09-01T00:00:00.000000Z", "id": 2, @@ -4124,7 +4117,6 @@ components: "appropriation_date": "2023-09-01T00:00:00.000000Z", "appropriation_term": 1, "arrangement_type_id": 4, - "authorizer_id": 26, "description": "Child Development Research Fellowship Grant Program", "expiration_date": "2023-09-01T00:00:00.000000Z", "id": 4, diff --git a/frontend/src/components/Agreements/AgreementCANReviewAccordion/AgreementCANReviewAccordion.test.jsx b/frontend/src/components/Agreements/AgreementCANReviewAccordion/AgreementCANReviewAccordion.test.jsx index e7ab5d1c8b..1cec9935db 100644 --- a/frontend/src/components/Agreements/AgreementCANReviewAccordion/AgreementCANReviewAccordion.test.jsx +++ b/frontend/src/components/Agreements/AgreementCANReviewAccordion/AgreementCANReviewAccordion.test.jsx @@ -407,7 +407,6 @@ const selectedBudgetLines = [ can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Social Science Research and Development", display_name: "G99PHS9", expiration_date: "2024-09-01T00:00:00.000000Z", @@ -452,7 +451,6 @@ const selectedBudgetLines = [ can: { appropriation_date: "2022-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Example CAN", display_name: "G99XXX8", expiration_date: "2023-09-01T00:00:00.000000Z", @@ -1238,44 +1236,43 @@ const canData = [ const canFundingCardData = { available_funding: "14300000.00", - cans: [{ - can: { - appropriation_date: "2023-10-01T00:00:00.000000Z", - active_period: 1, - arrangement_type: "OPRE_APPROPRIATION", - authorizer: 26, - authorizer_id: 26, - budget_line_items: [15011, 15017, 15020], - can_type: null, - created_by: null, - created_by_user: null, - created_on: "2024-07-29T14:44:58.757452Z", - description: "Social Science Research and Development", - display_name: "G99PHS9", - division_id: 6, - expiration_date: "2024-09-01T00:00:00.000000Z", - external_authorizer_id: null, - funding_sources: [26], - id: 502, - managing_portfolio: 8, - portfolio_id: 8, - nick_name: "SSRD", - number: "G99PHS9", - projects: [], - shared_portfolios: [], - updated_by: null, - updated_by_user: null, - updated_on: "2024-07-29T14:44:58.757452Z", - versions: [ - { - id: 502, - transaction_id: 208 - } - ] - }, - carry_forward_label: "Carry-Forward", - expiration_date: "09/01/2024", - }], + cans: [ + { + can: { + appropriation_date: "2023-10-01T00:00:00.000000Z", + active_period: 1, + arrangement_type: "OPRE_APPROPRIATION", + budget_line_items: [15011, 15017, 15020], + can_type: null, + created_by: null, + created_by_user: null, + created_on: "2024-07-29T14:44:58.757452Z", + description: "Social Science Research and Development", + display_name: "G99PHS9", + division_id: 6, + expiration_date: "2024-09-01T00:00:00.000000Z", + funding_sources: [26], + id: 502, + managing_portfolio: 8, + portfolio_id: 8, + nick_name: "SSRD", + number: "G99PHS9", + projects: [], + shared_portfolios: [], + updated_by: null, + updated_by_user: null, + updated_on: "2024-07-29T14:44:58.757452Z", + versions: [ + { + id: 502, + transaction_id: 208 + } + ] + }, + carry_forward_label: "Carry-Forward", + expiration_date: "09/01/2024" + } + ], carry_forward_funding: 0, expected_funding: "5000000.00", in_draft_funding: 0, @@ -1289,44 +1286,43 @@ const canFundingCardData = { const canFundingCardData2 = { available_funding: "1979500.00", - cans: [{ - can: { - appropriation_date: "2022-10-01T00:00:00.000000Z", - active_period: 1, - arrangement_type: "OPRE_APPROPRIATION", - authorizer: 26, - authorizer_id: 26, - budget_line_items: [15018, 15021], - can_type: null, - created_by: null, - created_by_user: null, - created_on: "2024-07-29T14:44:58.941288Z", - description: "Example CAN", - display_name: "G99XXX8", - division_id: 4, - expiration_date: "2023-09-01T00:00:00.000000Z", - external_authorizer_id: null, - funding_sources: [26], - id: 512, - managing_portfolio: 3, - portfolio_id: 3, - nick_name: "", - number: "G99XXX8", - projects: [1000], - shared_portfolios: [], - updated_by: null, - updated_by_user: null, - updated_on: "2024-07-29T14:44:58.941288Z", - versions: [ - { - id: 512, - transaction_id: 229 - } - ] - }, - carry_forward_label: "Carry-Forward", - expiration_date: "09/01/2023", - }], + cans: [ + { + can: { + appropriation_date: "2022-10-01T00:00:00.000000Z", + active_period: 1, + arrangement_type: "OPRE_APPROPRIATION", + budget_line_items: [15018, 15021], + can_type: null, + created_by: null, + created_by_user: null, + created_on: "2024-07-29T14:44:58.941288Z", + description: "Example CAN", + display_name: "G99XXX8", + division_id: 4, + expiration_date: "2023-09-01T00:00:00.000000Z", + funding_sources: [26], + id: 512, + managing_portfolio: 3, + portfolio_id: 3, + nick_name: "", + number: "G99XXX8", + projects: [1000], + shared_portfolios: [], + updated_by: null, + updated_by_user: null, + updated_on: "2024-07-29T14:44:58.941288Z", + versions: [ + { + id: 512, + transaction_id: 229 + } + ] + }, + carry_forward_label: "Carry-Forward", + expiration_date: "09/01/2023" + } + ], carry_forward_funding: 0, expected_funding: "520000.00", in_execution_funding: 0, @@ -1338,44 +1334,43 @@ const canFundingCardData2 = { const canFundingCard_G994426 = { available_funding: "37000000.00", - cans: [{ - can: { - appropriation_date: "2023-10-01T00:00:00.000000Z", - active_period: 1, - arrangement_type: "OPRE_APPROPRIATION", - authorizer: 26, - authorizer_id: 26, - budget_line_items: [15000, 15001, 15012, 15022, 15023], - can_type: null, - created_by: null, - created_by_user: null, - created_on: "2024-08-02T13:45:56.155989Z", - description: "Head Start Research", - display_name: "G994426", - division_id: 4, - expiration_date: "2024-09-01T00:00:00.000000Z", - external_authorizer_id: null, - funding_sources: [26], - id: 504, - managing_portfolio: 2, - portfolio_id: 2, - nick_name: "HS", - number: "G994426", - projects: [], - shared_portfolios: [], - updated_by: null, - updated_by_user: null, - updated_on: "2024-08-02T13:45:56.155989Z", - versions: [ - { - id: 504, - transaction_id: 212 - } - ] - }, - carry_forward_label: "Carry-Forward", - expiration_date: "09/01/2024", - }], + cans: [ + { + can: { + appropriation_date: "2023-10-01T00:00:00.000000Z", + active_period: 1, + arrangement_type: "OPRE_APPROPRIATION", + budget_line_items: [15000, 15001, 15012, 15022, 15023], + can_type: null, + created_by: null, + created_by_user: null, + created_on: "2024-08-02T13:45:56.155989Z", + description: "Head Start Research", + display_name: "G994426", + division_id: 4, + expiration_date: "2024-09-01T00:00:00.000000Z", + funding_sources: [26], + id: 504, + managing_portfolio: 2, + portfolio_id: 2, + nick_name: "HS", + number: "G994426", + projects: [], + shared_portfolios: [], + updated_by: null, + updated_by_user: null, + updated_on: "2024-08-02T13:45:56.155989Z", + versions: [ + { + id: 504, + transaction_id: 212 + } + ] + }, + carry_forward_label: "Carry-Forward", + expiration_date: "09/01/2024" + } + ], carry_forward_funding: 0, expected_funding: "16000000.00", in_execution_funding: "2000000.00", @@ -1392,7 +1387,6 @@ const selectedBudgetLinesToAmount = [ can: { appropriation_date: "2022-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Example CAN", display_name: "G99XXX8", expiration_date: "2023-09-01T00:00:00.000000Z", @@ -1467,7 +1461,6 @@ const selectedBudgetLinesToAmount = [ can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Social Science Research and Development", display_name: "G99PHS9", expiration_date: "2024-09-01T00:00:00.000000Z", @@ -1545,7 +1538,6 @@ const selectedBudgetLinesToCans = [ can: { appropriation_date: "2022-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Example CAN", display_name: "G99XXX8", expiration_date: "2023-09-01T00:00:00.000000Z", @@ -1588,7 +1580,6 @@ const selectedBudgetLinesToCans = [ can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Social Science Research and Development", display_name: "G99PHS9", expiration_date: "2024-09-01T00:00:00.000000Z", @@ -1666,7 +1657,6 @@ const selectedBudgetLinesDRAFT_TO_PLANNED = [ can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Head Start Research", display_name: "G994426", expiration_date: "2024-09-01T00:00:00.000000Z", @@ -1721,7 +1711,6 @@ const selectedBudgetLinesDRAFT_TO_PLANNED = [ can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Head Start Research", display_name: "G994426", expiration_date: "2024-09-01T00:00:00.000000Z", @@ -1779,7 +1768,6 @@ const selectedBudgetLines_CAN_and_AMT = [ can: { appropriation_date: "2022-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Example CAN", display_name: "G99XXX8", expiration_date: "2023-09-01T00:00:00.000000Z", @@ -1822,7 +1810,6 @@ const selectedBudgetLines_CAN_and_AMT = [ can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Social Science Research and Development", display_name: "G99PHS9", expiration_date: "2024-09-01T00:00:00.000000Z", diff --git a/frontend/src/components/CANs/CANFundingCard/CanFundingCard.test.jsx b/frontend/src/components/CANs/CANFundingCard/CanFundingCard.test.jsx index 481d780bb1..3d3c8931c8 100644 --- a/frontend/src/components/CANs/CANFundingCard/CanFundingCard.test.jsx +++ b/frontend/src/components/CANs/CANFundingCard/CanFundingCard.test.jsx @@ -43,7 +43,6 @@ describe("CanFundingCard", () => { const canData = { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Social Science Research and Development", display_name: "G99PHS9", expiration_date: "2024-09-01T00:00:00.000000Z", @@ -55,44 +54,43 @@ const canData = { const canFundingCardData = { available_funding: "14300000.00", - cans: [{ - can: { - appropriation_date: "2023-10-01T00:00:00.000000Z", - active_period: 1, - arrangement_type: "OPRE_APPROPRIATION", - authorizer: 26, - authorizer_id: 26, - budget_line_items: [15011, 15017, 15020], - can_type: null, - created_by: null, - created_by_user: null, - created_on: "2024-07-29T14:44:58.757452Z", - description: "Social Science Research and Development", - display_name: "G99PHS9", - division_id: 6, - expiration_date: "2024-09-01T00:00:00.000000Z", - external_authorizer_id: null, - funding_sources: [26], - id: 502, - managing_portfolio: 8, - portfolio_id: 8, - nick_name: "SSRD", - number: "G99PHS9", - projects: [], - shared_portfolios: [], - updated_by: null, - updated_by_user: null, - updated_on: "2024-07-29T14:44:58.757452Z", - versions: [ - { - id: 502, - transaction_id: 208 - } - ] - }, - carry_forward_label: "Carry-Forward", - expiration_date: "09/01/2024", - }], + cans: [ + { + can: { + appropriation_date: "2023-10-01T00:00:00.000000Z", + active_period: 1, + arrangement_type: "OPRE_APPROPRIATION", + budget_line_items: [15011, 15017, 15020], + can_type: null, + created_by: null, + created_by_user: null, + created_on: "2024-07-29T14:44:58.757452Z", + description: "Social Science Research and Development", + display_name: "G99PHS9", + division_id: 6, + expiration_date: "2024-09-01T00:00:00.000000Z", + funding_sources: [26], + id: 502, + managing_portfolio: 8, + portfolio_id: 8, + nick_name: "SSRD", + number: "G99PHS9", + projects: [], + shared_portfolios: [], + updated_by: null, + updated_by_user: null, + updated_on: "2024-07-29T14:44:58.757452Z", + versions: [ + { + id: 502, + transaction_id: 208 + } + ] + }, + carry_forward_label: "Carry-Forward", + expiration_date: "09/01/2024" + } + ], carry_forward_funding: 0, expected_funding: "5000000.00", in_draft_funding: 0, diff --git a/frontend/src/components/CANs/CanCard/CanCard.test.jsx b/frontend/src/components/CANs/CanCard/CanCard.test.jsx index 806e812fb3..9d43f77260 100644 --- a/frontend/src/components/CANs/CanCard/CanCard.test.jsx +++ b/frontend/src/components/CANs/CanCard/CanCard.test.jsx @@ -68,7 +68,6 @@ const mockCan = { display_name: "G994426", division_id: 4, expiration_date: "2024-09-01T00:00:00.000000Z", - external_authorizer_id: null, funding_sources: [26], id: 504, managing_portfolio: 2, @@ -92,44 +91,45 @@ const mockFiscalYear = 2023; const mockCanFundingData = { available_funding: "7000000.00", - cans: [{ - can: { - appropriation_date: "2023-10-01T00:00:00.000000Z", - active_period: 1, - arrangement_type: "OPRE_APPROPRIATION", - authorizer: 26, - authorizer_id: 26, - budget_line_items: [15012, 15022, 15023, 15001, 15000], - can_type: null, - created_by: null, - created_by_user: null, - created_on: "2024-08-22T13:24:43.428178Z", - description: "Head Start Research", - display_name: "G994426", - division_id: 4, - expiration_date: "2024-09-01T00:00:00.000000Z", - external_authorizer_id: null, - funding_sources: [26], - id: 504, - managing_portfolio: 2, - portfolio_id: 2, - nick_name: "HS", - number: "G994426", - projects: [], - shared_portfolios: [], - updated_by: null, - updated_by_user: null, - updated_on: "2024-08-22T13:24:43.428178Z", - versions: [ - { - id: 504, - transaction_id: 216 - } - ] - }, - carry_forward_label: "Carry-Forward", - expiration_date: "09/01/2024", - }], + cans: [ + { + can: { + appropriation_date: "2023-10-01T00:00:00.000000Z", + active_period: 1, + arrangement_type: "OPRE_APPROPRIATION", + authorizer: 26, + authorizer_id: 26, + budget_line_items: [15012, 15022, 15023, 15001, 15000], + can_type: null, + created_by: null, + created_by_user: null, + created_on: "2024-08-22T13:24:43.428178Z", + description: "Head Start Research", + display_name: "G994426", + division_id: 4, + expiration_date: "2024-09-01T00:00:00.000000Z", + funding_sources: [26], + id: 504, + managing_portfolio: 2, + portfolio_id: 2, + nick_name: "HS", + number: "G994426", + projects: [], + shared_portfolios: [], + updated_by: null, + updated_by_user: null, + updated_on: "2024-08-22T13:24:43.428178Z", + versions: [ + { + id: 504, + transaction_id: 216 + } + ] + }, + carry_forward_label: "Carry-Forward", + expiration_date: "09/01/2024" + } + ], carry_forward_funding: 0, expected_funding: "4000000.00", in_draft_funding: 0, diff --git a/frontend/src/tests/data.js b/frontend/src/tests/data.js index 5f27357c8b..f497585536 100644 --- a/frontend/src/tests/data.js +++ b/frontend/src/tests/data.js @@ -1,15 +1,14 @@ export const budgetLine = { agreement_id: 1, agreement: { - name: "Contract #1: African American Child and Family Research Center", - agreement_type: "AgreementType.CONTRACT", - awarding_entity_id: 1 + name: "Contract #1: African American Child and Family Research Center", + agreement_type: "AgreementType.CONTRACT", + awarding_entity_id: 1 }, amount: 1_000_000, can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 525, description: "Head Start Research", expiration_date: "2024-09-01T00:00:00.000000Z", id: 5, @@ -54,7 +53,6 @@ export const agreement = { can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 525, description: "Head Start Research", expiration_date: "2024-09-01T00:00:00.000000Z", id: 5, @@ -110,7 +108,6 @@ export const agreement = { can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 525, description: "Head Start Research", expiration_date: "2024-09-01T00:00:00.000000Z", id: 5, @@ -602,7 +599,6 @@ export const budgetLineWithBudgetChangeRequest = { can: { appropriation_date: "2022-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Example CAN", display_name: "G99XXX8", expiration_date: "2023-09-01T00:00:00.000000Z", @@ -753,7 +749,6 @@ export const budgetLineWithStatusChangeRequestToPlanned = { can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Head Start Research", display_name: "G994426", expiration_date: "2024-09-01T00:00:00.000000Z", @@ -852,7 +847,6 @@ export const budgetLineWithStatusChangeRequestToExecuting = { can: { appropriation_date: "2023-10-01T00:00:00.000000Z", active_period: 1, - authorizer_id: 26, description: "Social Science Research and Development", display_name: "G99PHS9", expiration_date: "2024-09-01T00:00:00.000000Z",