diff --git a/backend/alembic/versions/2024_10_28_1947-6615ac7d4eea_remove_incumbent_from_contract_.py b/backend/alembic/versions/2024_10_28_1947-6615ac7d4eea_remove_incumbent_from_contract_.py new file mode 100644 index 0000000000..e8fbbdf647 --- /dev/null +++ b/backend/alembic/versions/2024_10_28_1947-6615ac7d4eea_remove_incumbent_from_contract_.py @@ -0,0 +1,33 @@ +"""Remove incumbent from contract agreement. Prefer to use Vendor instead + +Revision ID: 6615ac7d4eea +Revises: af64d84afb2e +Create Date: 2024-10-28 19:47:50.822292+00:00 + +""" +from typing import Sequence, Union + +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision: str = '6615ac7d4eea' +down_revision: Union[str, None] = 'af64d84afb2e' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint('contract_agreement_incumbent_id_fkey', 'contract_agreement', type_='foreignkey') + op.drop_column('contract_agreement', 'incumbent_id') + op.drop_column('contract_agreement_version', 'incumbent_id') + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('contract_agreement_version', sa.Column('incumbent_id', sa.INTEGER(), autoincrement=False, nullable=True)) + op.add_column('contract_agreement', sa.Column('incumbent_id', sa.INTEGER(), autoincrement=False, nullable=True)) + op.create_foreign_key('contract_agreement_incumbent_id_fkey', 'contract_agreement', 'vendor', ['incumbent_id'], ['id']) + # ### end Alembic commands ### diff --git a/backend/data_tools/data/agreements_and_blin_data.json5 b/backend/data_tools/data/agreements_and_blin_data.json5 index 06abf76328..d545deca11 100644 --- a/backend/data_tools/data/agreements_and_blin_data.json5 +++ b/backend/data_tools/data/agreements_and_blin_data.json5 @@ -81,7 +81,6 @@ awarding_entity_id: 4, created_by: 503, contract_number: "XXXX000000006", - incumbent_id: null, vendor_id: 100, delivered_status: false, contract_type: "FIRM_FIXED_PRICE", @@ -99,7 +98,6 @@ awarding_entity_id: 4, created_by: 503, contract_number: "XXXX000000007", - incumbent_id: null, vendor_id: 101, delivered_status: false, contract_type: "TIME_AND_MATERIALS", @@ -118,7 +116,6 @@ awarding_entity_id: 4, created_by: 503, contract_number: "XXXX000000008", - incumbent_id: null, vendor_id: 101, delivered_status: false, contract_type: "LABOR_HOUR", @@ -138,7 +135,6 @@ awarding_entity_id: 3, created_by: 503, contract_number: "XXXX000000009", - incumbent_id: null, vendor_id: 102, delivered_status: false, contract_type: "LABOR_HOUR", @@ -167,7 +163,6 @@ awarding_entity_id: 1, created_by: 503, contract_number: "XXXX000000001", - incumbent_id: 100, vendor_id: 100, delivered_status: false, contract_type: "LABOR_HOUR", @@ -204,7 +199,6 @@ awarding_entity_id: 3, created_by: 503, contract_number: "XXXX000000010", - incumbent_id: null, vendor_id: 102, delivered_status: false, contract_type: "LABOR_HOUR", diff --git a/backend/data_tools/data/first_contract_data.json5 b/backend/data_tools/data/first_contract_data.json5 index 3f54a801a7..ad1c1e663a 100644 --- a/backend/data_tools/data/first_contract_data.json5 +++ b/backend/data_tools/data/first_contract_data.json5 @@ -53,7 +53,6 @@ awarding_entity_id: 1, created_by: 503, contract_number: "XXXX000000001", - incumbent_id: 100, vendor_id: 100, delivered_status: false, contract_type: "LABOR_HOUR", diff --git a/backend/models/agreements.py b/backend/models/agreements.py index 2f5db3c188..c3f5f7608e 100644 --- a/backend/models/agreements.py +++ b/backend/models/agreements.py @@ -182,10 +182,6 @@ class ContractAgreement(Agreement): id: Mapped[int] = mapped_column(ForeignKey("agreement.id"), primary_key=True) contract_number: Mapped[Optional[str]] = mapped_column(String) - incumbent_id: Mapped[Optional[int]] = mapped_column(ForeignKey("vendor.id")) - incumbent: Mapped[Optional["Vendor"]] = relationship( - "Vendor", foreign_keys=[incumbent_id] - ) vendor_id: Mapped[Optional[int]] = mapped_column(ForeignKey("vendor.id")) vendor: Mapped[Optional["Vendor"]] = relationship( "Vendor", foreign_keys=[vendor_id] diff --git a/backend/openapi.yml b/backend/openapi.yml index 471c8150a2..c898ee4547 100644 --- a/backend/openapi.yml +++ b/backend/openapi.yml @@ -3262,9 +3262,6 @@ components: agreement_reason: type: string example: NEW_REQ - incumbent: - type: string - example: Previous Vendor vendor: type: string example: Current Vendor diff --git a/backend/ops_api/ops/resources/agreements.py b/backend/ops_api/ops/resources/agreements.py index 259045de22..b49caafbc9 100644 --- a/backend/ops_api/ops/resources/agreements.py +++ b/backend/ops_api/ops/resources/agreements.py @@ -243,7 +243,6 @@ def _create_agreement(self, data, agreement_cls): # TODO: add_vendor is here temporarily until we have vendor management # implemented in the frontend, i.e. the vendor is a drop-down instead # of a text field - add_update_vendor(data, "incumbent") add_update_vendor(data, "vendor") new_agreement = agreement_cls(**data) @@ -357,10 +356,6 @@ def update_data(agreement: Agreement, data: dict[str, Any]) -> None: if isinstance(data[item], str): add_update_vendor(data, "vendor", agreement) changed = True - case "incumbent": - if isinstance(data[item], str): - add_update_vendor(data, "incumbent", agreement) - changed = True case _: if getattr(agreement, item) != data[item]: setattr(agreement, item, data[item]) diff --git a/backend/ops_api/ops/schemas/agreements.py b/backend/ops_api/ops/schemas/agreements.py index f751d3678a..d6f23343f8 100644 --- a/backend/ops_api/ops/schemas/agreements.py +++ b/backend/ops_api/ops/schemas/agreements.py @@ -12,17 +12,12 @@ class Vendor(Schema): name = fields.String(required=True) -class Incumbent(Schema): - name = fields.String(required=True) - - class AgreementData(Schema): name = fields.String(required=True) agreement_type = fields.Enum(AgreementType, required=True) description = fields.String(allow_none=True) product_service_code_id = fields.Integer(allow_none=True) agreement_reason = fields.Enum(AgreementReason, allow_none=True) - incumbent = fields.String(allow_none=True) project_officer_id = fields.Integer(allow_none=True) team_members = fields.List(fields.Nested(TeamMembers), default=[], allow_none=True) project_id = fields.Integer(allow_none=True) @@ -33,7 +28,6 @@ class AgreementData(Schema): class ContractAgreementData(AgreementData): contract_number = fields.String(allow_none=True) - incumbent = fields.String(allow_none=True) vendor = fields.String(allow_none=True) delivered_status = fields.Bool(default=False) contract_type = fields.Enum(ContractType, allow_none=True) @@ -72,8 +66,6 @@ class AgreementResponse(AgreementData): class ContractAgreementResponse(AgreementResponse): contract_number = fields.String(allow_none=True) - incumbent = fields.Pluck("Incumbent", "name") - incumbent_id = fields.Integer(allow_none=True) vendor_id = fields.Integer(allow_none=True) vendor = fields.Pluck("Vendor", "name") delivered_status = fields.Bool(default=False) diff --git a/backend/ops_api/ops/schemas/budget_line_items.py b/backend/ops_api/ops/schemas/budget_line_items.py index 85bf88528b..af5efbccb0 100644 --- a/backend/ops_api/ops/schemas/budget_line_items.py +++ b/backend/ops_api/ops/schemas/budget_line_items.py @@ -125,22 +125,20 @@ def validate_agreement_reason(self, data, **kwargs): raise ValidationError("BLI's Agreement must have an AgreementReason when status is not DRAFT") @validates_schema - def validate_agreement_reason_must_not_have_incumbent(self, data, **kwargs): + def validate_agreement_reason_must_not_have_vendor(self, data, **kwargs): if self.status_is_changing_beyond_draft(data): bli = self.get_current_budget_line_item() if ( bli and bli.agreement_id - and isinstance(bli.agreement, ContractAgreement) # only contracts have incumbents + and isinstance(bli.agreement, ContractAgreement) # only contracts have vendors and bli.agreement.agreement_reason == AgreementReason.NEW_REQ - and bli.agreement.incumbent_id + and bli.agreement.vendor_id ): - raise ValidationError( - "BLI's Agreement cannot have an Incumbent if it has an Agreement Reason of NEW_REQ" - ) + raise ValidationError("BLI's Agreement cannot have a Vendor if it has an Agreement Reason of NEW_REQ") @validates_schema - def validate_agreement_reason_must_have_incumbent(self, data, **kwargs): + def validate_agreement_reason_must_have_vendor(self, data, **kwargs): if self.status_is_changing_beyond_draft(data): bli = self.get_current_budget_line_item() if ( @@ -150,10 +148,10 @@ def validate_agreement_reason_must_have_incumbent(self, data, **kwargs): bli.agreement.agreement_reason == AgreementReason.RECOMPETE or bli.agreement.agreement_reason == AgreementReason.LOGICAL_FOLLOW_ON ) - and not bli.agreement.incumbent_id + and not bli.agreement.vendor_id ): raise ValidationError( - "BLI's Agreement must have an Incumbent if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" + "BLI's Agreement must have a Vendor if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" ) @validates_schema diff --git a/backend/ops_api/tests/ops/agreement/test_agreement.py b/backend/ops_api/tests/ops/agreement/test_agreement.py index 23aea1daec..f0012b7f7e 100644 --- a/backend/ops_api/tests/ops/agreement/test_agreement.py +++ b/backend/ops_api/tests/ops/agreement/test_agreement.py @@ -35,7 +35,7 @@ def test_agreements_get_all(auth_client, loaded_db, test_project): assert response.json[0]["project"]["id"] == test_project.id assert numpy.isclose(response.json[0]["budget_line_items"][0]["amount"], 1000000.0) assert numpy.isclose(response.json[0]["procurement_shop"]["fee"], 0.0) - assert response.json[0]["incumbent"] == "Vendor 1" + assert response.json[0]["vendor"] == "Vendor 1" assert "budget_line_items" in response.json[0] assert "can_id" in response.json[0]["budget_line_items"][0] assert "can" in response.json[0]["budget_line_items"][0] @@ -88,7 +88,6 @@ def test_agreements_serialization(auth_client, loaded_db): assert response.json["support_contacts"] == agreement.support_contacts assert len(response.json["team_members"]) == len(agreement.team_members) assert response.json["vendor_id"] == agreement.vendor_id - assert response.json["incumbent_id"] == agreement.incumbent_id assert response.json["vendor"] == agreement.vendor.name @@ -248,7 +247,6 @@ def test_contract(loaded_db, test_vendor, test_admin_user, test_project): project_id=test_project.id, created_by=test_admin_user.id, vendor_id=test_vendor.id, - incumbent_id=test_vendor.id, ) loaded_db.add(contract_agreement) @@ -538,7 +536,6 @@ def test_agreements_post_contract_with_service_requirement_type(auth_client, loa "name": "FRANK TEST", "description": "test description", "product_service_code_id": 1, - "incumbent": None, "project_officer_id": 500, "team_members": [ { @@ -552,6 +549,7 @@ def test_agreements_post_contract_with_service_requirement_type(auth_client, loa "awarding_entity_id": 2, "contract_type": "FIRM_FIXED_PRICE", "service_requirement_type": "SEVERABLE", + "vendor": None, }, ) assert response.status_code == 201 @@ -562,7 +560,7 @@ def test_agreements_post_contract_with_service_requirement_type(auth_client, loa @pytest.mark.usefixtures("app_ctx") -def test_agreements_post_contract_with_incumbent(auth_client, loaded_db, test_user, test_project): +def test_agreements_post_contract_with_vendor(auth_client, loaded_db, test_user, test_project): response = auth_client.post( "/api/v1/agreements/", json={ @@ -571,7 +569,7 @@ def test_agreements_post_contract_with_incumbent(auth_client, loaded_db, test_us "name": "REED TEST CONTRACT", "description": "test description", "product_service_code_id": 1, - "incumbent": "Vendor 1", + "vendor": "Vendor 1", "project_officer_id": test_user.id, "team_members": [ { @@ -608,8 +606,6 @@ def test_agreements_patch_by_id_e2e(auth_client, loaded_db, test_contract, test_ "delivered_status": False, "description": "Test Description", "display_name": "Test Contract", - "incumbent": None, - "incumbent_id": None, "name": "Test Edit Title", "notes": "Test Notes test edit notes", "po_number": None, @@ -683,7 +679,7 @@ def test_agreements_patch_contract_by_id(auth_client, loaded_db, test_contract): def test_agreements_patch_contract_update_existing_vendor(auth_client, loaded_db, test_contract): response = auth_client.patch( url_for("api.agreements-item", id=test_contract.id), - json={"vendor": "Vendor 2", "incumbent": "Vendor 2"}, + json={"vendor": "Vendor 2"}, ) assert response.status_code == 200 @@ -703,15 +699,13 @@ def test_agreements_patch_contract_update_existing_vendor(auth_client, loaded_db assert data["created_by"] is test_contract.created_by assert data["vendor_id"] == 101 assert data["vendor"] == "Vendor 2" - assert data["incumbent_id"] == 101 - assert data["incumbent"] == "Vendor 2" @pytest.mark.usefixtures("app_ctx") def test_agreements_patch_contract_update_new_vendor(auth_client, loaded_db, test_contract): response = auth_client.patch( url_for("api.agreements-item", id=test_contract.id), - json={"vendor": "Random Test Vendor", "incumbent": "Random Test Vendor"}, + json={"vendor": "Random Test Vendor"}, ) assert response.status_code == 200 @@ -730,5 +724,3 @@ def test_agreements_patch_contract_update_new_vendor(auth_client, loaded_db, tes assert data["created_by"] is test_contract.created_by assert data["vendor_id"] == 103 assert data["vendor"] == "Random Test Vendor" - assert data["incumbent_id"] == 103 - assert data["incumbent"] == "Random Test Vendor" diff --git a/backend/ops_api/tests/ops/agreement/test_agreement_history.py b/backend/ops_api/tests/ops/agreement/test_agreement_history.py index 98f6a3a279..333f026c37 100644 --- a/backend/ops_api/tests/ops/agreement/test_agreement_history.py +++ b/backend/ops_api/tests/ops/agreement/test_agreement_history.py @@ -18,7 +18,7 @@ def test_agreement_history(auth_client, loaded_db, test_can): "name": "Agreement144", "description": "Description", "product_service_code_id": 1, - "incumbent": "Vendor A", + "vendor": "Vendor A", "project_officer_id": 500, "team_members": [ { @@ -123,7 +123,7 @@ def test_agreement_history_log_items(auth_client, app, test_can, utc_today): "name": "TEST: Agreement history with change requests", "description": "Description", "product_service_code_id": 1, - "incumbent": "Vendor A", + "vendor": "Vendor A", "project_officer_id": 520, "team_members": [ { diff --git a/backend/ops_api/tests/ops/features/test_validate_draft_budget_lines.py b/backend/ops_api/tests/ops/features/test_validate_draft_budget_lines.py index 6d9e44f2c9..a82c716d67 100644 --- a/backend/ops_api/tests/ops/features/test_validate_draft_budget_lines.py +++ b/backend/ops_api/tests/ops/features/test_validate_draft_budget_lines.py @@ -58,16 +58,16 @@ def test_valid_agreement_reason(loaded_db, context): ... @scenario( "validate_draft_budget_lines.feature", - "Valid Agreement Reason - NEW_REQ does not have an Incumbent", + "Valid Agreement Reason - NEW_REQ does not have a Vendor", ) -def test_valid_agreement_reason_no_incumbent(loaded_db, context): ... +def test_valid_agreement_reason_no_vendor(loaded_db, context): ... @scenario( "validate_draft_budget_lines.feature", - "Valid Agreement Reason - RECOMPETE and LOGICAL_FOLLOW_ON requires an Incumbent", + "Valid Agreement Reason - RECOMPETE and LOGICAL_FOLLOW_ON requires a Vendor", ) -def test_valid_agreement_reason_incumbent_required(loaded_db, context): ... +def test_valid_agreement_reason_vendor_required(loaded_db, context): ... @scenario( @@ -258,7 +258,7 @@ def agreement_null_procurement_shop(loaded_db, context, test_user, test_project) @given("I have an Agreement with a NULL Agreement Reason") -def agreement_null_agreement_reason(loaded_db, context, test_user, test_project): +def agreement_null_agreement_reason(loaded_db, context, test_user, test_project, test_vendor): contract_agreement = ContractAgreement( name="CTXX12399", contract_number="CT0002", @@ -267,6 +267,7 @@ def agreement_null_agreement_reason(loaded_db, context, test_user, test_project) project_id=test_project.id, product_service_code_id=2, description="Using Innovative Data...", + vendor_id=test_vendor.id, project_officer_id=test_user.id, awarding_entity_id=1, ) @@ -277,8 +278,8 @@ def agreement_null_agreement_reason(loaded_db, context, test_user, test_project) context["agreement"] = contract_agreement -@given("I have an Agreement with an AgreementReason = NEW_REQ and an Incumbent") -def agreement_reason_with_incumbent(loaded_db, context, test_user, test_vendor, test_project): +@given("I have an Agreement with an AgreementReason = NEW_REQ and a Vendor") +def agreement_reason_with_vendor(loaded_db, context, test_user, test_vendor, test_project): contract_agreement = ContractAgreement( name="CTXX12399", contract_number="CT0002", @@ -288,7 +289,7 @@ def agreement_reason_with_incumbent(loaded_db, context, test_user, test_vendor, product_service_code_id=2, description="Using Innovative Data...", agreement_reason=AgreementReason.NEW_REQ, - incumbent_id=test_vendor.id, + vendor_id=test_vendor.id, project_officer_id=test_user.id, awarding_entity_id=1, ) @@ -300,9 +301,9 @@ def agreement_reason_with_incumbent(loaded_db, context, test_user, test_vendor, @given( - "I have an Agreement with an AgreementReason = RECOMPETE or LOGICAL_FOLLOW_ON and has a NULL or empty string Incumbent" + "I have an Agreement with an AgreementReason = RECOMPETE or LOGICAL_FOLLOW_ON and has a NULL or empty string Vendor" ) -def agreement_reason_with_incumbent_required(loaded_db, context, test_user, test_project): +def agreement_reason_with_vendor_required(loaded_db, context, test_user, test_project): contract_agreement = ContractAgreement( name="CTXX12399", contract_number="CT0002", @@ -843,33 +844,33 @@ def error_message_valid_agreement_reason(context, setup_and_teardown): @then( - "I should get an error message that the BLI's Agreement cannot have an Incumbent if it has an Agreement Reason of NEW_REQ" + "I should get an error message that the BLI's Agreement cannot have a Vendor if it has an Agreement Reason of NEW_REQ" ) -def error_message_valid_agreement_reason_with_incumbent(context, setup_and_teardown): +def error_message_valid_agreement_reason_with_Vendor(context, setup_and_teardown): assert context["response_put"].status_code == 400 assert context["response_put"].json == { - "_schema": ["BLI's Agreement cannot have an Incumbent if it has an Agreement Reason of NEW_REQ"] + "_schema": ["BLI's Agreement cannot have a Vendor if it has an Agreement Reason of NEW_REQ"] } assert context["response_patch"].status_code == 400 assert context["response_patch"].json == { - "_schema": ["BLI's Agreement cannot have an Incumbent if it has an Agreement Reason of NEW_REQ"] + "_schema": ["BLI's Agreement cannot have a Vendor if it has an Agreement Reason of NEW_REQ"] } @then( - "I should get an error message that the BLI's Agreement must have an Incumbent if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" + "I should get an error message that the BLI's Agreement must have a Vendor if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" ) -def error_message_valid_agreement_reason_with_incumbent_required(context, setup_and_teardown): +def error_message_valid_agreement_reason_with_vendor_required(context, setup_and_teardown): assert context["response_put"].status_code == 400 assert context["response_put"].json == { "_schema": [ - "BLI's Agreement must have an Incumbent if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" + "BLI's Agreement must have a Vendor if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" ] } assert context["response_patch"].status_code == 400 assert context["response_patch"].json == { "_schema": [ - "BLI's Agreement must have an Incumbent if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" + "BLI's Agreement must have a Vendor if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON" ] } diff --git a/backend/ops_api/tests/ops/features/validate_draft_budget_lines.feature b/backend/ops_api/tests/ops/features/validate_draft_budget_lines.feature index e6827e3053..0972839975 100644 --- a/backend/ops_api/tests/ops/features/validate_draft_budget_lines.feature +++ b/backend/ops_api/tests/ops/features/validate_draft_budget_lines.feature @@ -55,23 +55,23 @@ Feature: Validate "Draft" Budget Lines Then I should get an error message that the BLI's Agreement must have a valid Agreement Reason - Scenario: Valid Agreement Reason - NEW_REQ does not have an Incumbent + Scenario: Valid Agreement Reason - NEW_REQ does not have a Vendor Given I am logged in as an OPS user - And I have an Agreement with an AgreementReason = NEW_REQ and an Incumbent + And I have an Agreement with an AgreementReason = NEW_REQ and a Vendor When I have a BLI in DRAFT status And I submit a BLI to move to IN_REVIEW status - Then I should get an error message that the BLI's Agreement cannot have an Incumbent if it has an Agreement Reason of NEW_REQ + Then I should get an error message that the BLI's Agreement cannot have a Vendor if it has an Agreement Reason of NEW_REQ - Scenario: Valid Agreement Reason - RECOMPETE and LOGICAL_FOLLOW_ON requires an Incumbent + Scenario: Valid Agreement Reason - RECOMPETE and LOGICAL_FOLLOW_ON requires a Vendor Given I am logged in as an OPS user - And I have an Agreement with an AgreementReason = RECOMPETE or LOGICAL_FOLLOW_ON and has a NULL or empty string Incumbent + And I have an Agreement with an AgreementReason = RECOMPETE or LOGICAL_FOLLOW_ON and has a NULL or empty string Vendor When I have a BLI in DRAFT status And I submit a BLI to move to IN_REVIEW status - Then I should get an error message that the BLI's Agreement must have an Incumbent if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON + Then I should get an error message that the BLI's Agreement must have a Vendor if it has an Agreement Reason of RECOMPETE or LOGICAL_FOLLOW_ON Scenario: Valid Project Officer Given I am logged in as an OPS user diff --git a/backend/ops_api/tests/ops/history/test_history.py b/backend/ops_api/tests/ops/history/test_history.py index cfd3fd5a1e..98013d2ddd 100644 --- a/backend/ops_api/tests/ops/history/test_history.py +++ b/backend/ops_api/tests/ops/history/test_history.py @@ -166,7 +166,7 @@ def test_history_expanded_with_web_client(auth_client, loaded_db, test_user, tes assert len(result.changes["team_members"]["added"]) == 2 assert "deleted" not in result.changes["team_members"] assert "support_contacts" not in result.changes - assert "incumbent_id" not in result.changes + assert "vendor_id" not in result.changes # PATCH: edit agreement patch_data = { @@ -212,7 +212,7 @@ def test_history_expanded_with_web_client(auth_client, loaded_db, test_user, tes assert len(result.changes["team_members"]["added"]) == 2 assert len(result.changes["team_members"]["deleted"]) == 1 assert "support_contacts" not in result.changes - assert "incumbent_id" not in result.changes + assert "vendor_id" not in result.changes # DELETE: delete agreement resp = auth_client.delete(f"/api/v1/agreements/{agreement_id}") diff --git a/backend/ops_api/tests_manual/ops/test_change_requests.py b/backend/ops_api/tests_manual/ops/test_change_requests.py index b871c52905..4ffa2f714c 100644 --- a/backend/ops_api/tests_manual/ops/test_change_requests.py +++ b/backend/ops_api/tests_manual/ops/test_change_requests.py @@ -158,7 +158,7 @@ def test_budget_line_item_change_request_history(auth_client, app): "name": "Agreement test budget line item change request history", "description": "Description", "product_service_code_id": 1, - "incumbent": "Vendor A", + "vendor": "Vendor A", "project_officer_id": 21, "team_members": [ { @@ -322,7 +322,7 @@ def test_agreement_history_with_change_requests(auth_client, app): "name": "TEST: Agreement history with change requests", "description": "Description", "product_service_code_id": 1, - "incumbent": "Vendor A", + "vendor": "Vendor A", "project_officer_id": 21, "team_members": [ { diff --git a/frontend/cypress/e2e/editAgreement.cy.js b/frontend/cypress/e2e/editAgreement.cy.js index 743a1f8f6b..fc7328de55 100644 --- a/frontend/cypress/e2e/editAgreement.cy.js +++ b/frontend/cypress/e2e/editAgreement.cy.js @@ -10,7 +10,7 @@ const testAgreement = { project_id: 1000, product_service_code_id: 1, awarding_entity_id: 1, - incumbent: "Test Vendor", + vendor: "Test Vendor", project_officer_id: 500, team_members: [ { diff --git a/frontend/src/api/postAgreements.test.js b/frontend/src/api/postAgreements.test.js index 51ff2fdc7f..b554c65bbf 100644 --- a/frontend/src/api/postAgreements.test.js +++ b/frontend/src/api/postAgreements.test.js @@ -9,7 +9,7 @@ describe("postAgreement function", () => { name: "Agreement144", description: "Description", product_service_code_id: 1, - incumbent: "Vendor A", + vendor: "Vendor A", project_officer_id: 1, team_members: [ { @@ -48,7 +48,7 @@ describe("postAgreement function", () => { name: "", description: "", product_service_id: null, - incumbent: null, + vendor: null, project_officer_id: null, team_members: [], notes: "" diff --git a/frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.jsx b/frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.jsx index edb125da4b..0987ea7a47 100644 --- a/frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.jsx +++ b/frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.jsx @@ -78,7 +78,7 @@ export const AgreementEditForm = ({ const setProductServiceCodeId = useUpdateAgreement("product_service_code_id"); const setAgreementReason = useUpdateAgreement("agreement_reason"); const setProjectOfficerId = useUpdateAgreement("project_officer_id"); - const setAgreementIncumbent = useUpdateAgreement("incumbent"); + const setAgreementVendor = useUpdateAgreement("vendor"); const setAgreementNotes = useUpdateAgreement("notes"); const setContractType = useUpdateAgreement("contract_type"); const setServiceReqType = useUpdateAgreement("service_requirement_type"); @@ -102,7 +102,7 @@ export const AgreementEditForm = ({ } = useEditAgreement(); const { notes: agreementNotes, - incumbent: agreementIncumbent, + vendor: agreementVendor, agreement_type: agreementType, name: agreementTitle, description: agreementDescription, @@ -137,7 +137,7 @@ export const AgreementEditForm = ({ let res = suite.get(); - const incumbentDisabled = agreementReason === "NEW_REQ" || agreementReason === null || agreementReason === "0"; + const vendorDisabled = agreementReason === "NEW_REQ" || agreementReason === null || agreementReason === "0"; const shouldDisableBtn = !agreementTitle || !agreementType || @@ -424,7 +424,7 @@ export const AgreementEditForm = ({ className={cn("agreement_reason")} selectedAgreementReason={agreementReason} onChange={(name, value) => { - setAgreementIncumbent(null); + setAgreementVendor(null); setAgreementReason(value); if (isReviewMode) { runValidate(name, value); @@ -432,17 +432,17 @@ export const AgreementEditForm = ({ }} />