Implement rebate calculation, idempotent record creation, frozen release handling, and tests for rebate configuration behavior.
Add affiliate rebate configuration fields, option defaults, and rebate record persistence for the rebate workflow.