patch
https://sandcaas.undostres.com.mx/debit/v1/customer-program
Modifies an existing customer program by creating a new version while deactivating the previous one. All customers assigned to the old version are automatically reassigned to the new version. This endpoint implements versioning to preserve historical data and track changes over time. Important considerations
- program_code is required and must exist in the database.
- Only active programs can be modified (though inactive programs can be modified to reactivate them).
- All fields except program_code are optional; only provided fields are updated in the new version.
- program_name, if provided, must be unique and not duplicate any existing program name.
- Financial parameters must be non-negative if provided.
- cutoff_day, if provided, must be an integer between 1 and 31.
- is_guarantee and emission_fee cannot be updated—they are ignored.
- The new version number is automatically incremented (old version + 1).
- All customers assigned to the old version are automatically reassigned to the new version.
- The old version is deactivated (status = false) but not deleted, preserving historical integrity.
- All operations are performed within a database transaction and if any step fails, the entire operation is rolled back.
- The response includes the new version’s details, including the new ID and version number.