This pull request introduces the disable_on_destroy attribute to the powerplatform_record resource, along with several related changes across different files. The changes include updates to the schema, constants, and test cases.
Key Changes
New Attribute Addition
Added disable_on_destroy attribute to the powerplatform_record resource. This attribute, when set to true, will either set isdisabled to true or statecode to 1 before attempting to delete the record. (.changes/unreleased/added-20241002-142330.yaml - [1]docs/resources/data_record.md - [2]
These changes enhance the functionality of the powerplatform_record resource by allowing records to be disabled before deletion, ensuring better data integrity and compliance with business rules.
This pull request introduces the
disable_on_destroy
attribute to thepowerplatform_record
resource, along with several related changes across different files. The changes include updates to the schema, constants, and test cases.Key Changes
New Attribute Addition
disable_on_destroy
attribute to thepowerplatform_record
resource. This attribute, when set to true, will either setisdisabled
to true orstatecode
to 1 before attempting to delete the record. (.changes/unreleased/added-20241002-142330.yaml
- [1]docs/resources/data_record.md
- [2]Schema and Model Updates
resource_data_record.go
to include the newdisable_on_destroy
attribute. (internal/services/data_record/resource_data_record.go
- internal/services/data_record/resource_data_record.goR63-R91)DisableOnDestroy
field toDataRecordResourceModel
. (internal/services/data_record/models.go
- internal/services/data_record/models.goR50)Codebase Simplification
powerplatform_rest
resource used for disabling records on destroy, simplifying the example configuration. (examples/resources/powerplatform_data_record/res_business_unit/main.tf
- examples/resources/powerplatform_data_record/res_business_unit/main.tfL38-L57)New Methods and Tests
GetEntityAttributesDefinition
to fetch entity attributes. (internal/services/data_record/api_data_record.go
- internal/services/data_record/api_data_record.goR361-R375)disable_on_destroy
functionality. (internal/services/data_record/resource_data_record_test.go
- internal/services/data_record/resource_data_record_test.goR1366-R1589)Dependency Updates
>= 3.0.1
. (internal/constants/constants.go
- internal/constants/constants.goL126-R126)These changes enhance the functionality of the
powerplatform_record
resource by allowing records to be disabled before deletion, ensuring better data integrity and compliance with business rules.