Replace entity relationships to discounts with an entity link

Description

The following archetypes have entity relationships to the entity.discountType and/or entity.discountGroupType:

  • party.customerperson

  • party.patientpet

  • product.medication

  • product.service

  • product.merchandise

  • entity.productType

This is a bidirectional relationship, so an entity.discountType or entity.discountGroupType may have many relationships.
This effects performance on databases that have a small no. of discounts that are heavily utilised.

A better approach would be to replace the various entityRelationship.discount* archetypes with EntityLinks.

This would require the following changes:

  • replace entityRelationship.discountCustomer with entityLink.customerDiscount

  • update party.customerperson to use entityLink.customerDiscount

  • replace entityRelationship.discountPatient with entityLink.patientDiscount

  • update party.patientpet to use entityLink.patientDiscount

  • replace entityRelationship.discountProduct with entityLink.productDiscount

  • update product.* to use entityLink.productDiscount

  • replace entityRelationship.discountProductType with entityLink.productTypeDiscount

  • update entity.productType to use entityLink.productTypeDiscount

  • replace entityRelationship.discountType with entityLink.discountType

  • update entity.discountGroupType to use entityLink.discountType

  • database migration

No reports refer to the discount relationships. Users may need to update their own custom reports.

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Components

Fix versions

Priority

Minor
Configure