feat(loyalty): organization loyalty settings API
Adds GET and PUT /marketing/loyalty-settings and GET /marketing/loyalty-settings/history (docs/prd-point-coin.md F2, PC-302). The settings are the point value, the exchange rate, transfer limits and the stored expiry settings. PUT merges the body like the outlet settings and is limited to loyalty managers. Every response carries the impact of the change on the balances in circulation: outstanding EnakPoint and EnakCoin, their rupiah value, and the coins exchanged into points, before and after. With ?dry_run=true nothing is saved and the response lists the keys that would change, for the warning shown before saving. Saving records each change in loyalty_setting_changes with who made it; history can be filtered to one outlet. Changing the value leaves what was already written alone. The diff behind saving and previewing is shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8370851ed2
commit
fe2f459b03
@@ -627,6 +627,11 @@ func (r *Router) addAppRoutes(rg *gin.Engine) {
|
||||
}
|
||||
|
||||
// Campaign Rules
|
||||
// EnakPoint & EnakCoin settings of the organization (docs/prd-point-coin.md F2)
|
||||
gamification.GET("/loyalty-settings", r.loyaltySettingsHandler.GetOrganizationSettings)
|
||||
gamification.PUT("/loyalty-settings", r.authMiddleware.RequireLoyaltyManager(), r.loyaltySettingsHandler.UpdateOrganizationSettings)
|
||||
gamification.GET("/loyalty-settings/history", r.loyaltySettingsHandler.ListHistory)
|
||||
|
||||
// EnakPoint & EnakCoin wallet of one customer (docs/prd-point-coin.md F7)
|
||||
marketingCustomers := gamification.Group("/customers")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user