refactor: Rename currency parameter from 'currency' to 'curr' in currencyToModel helper method and add Service interface to rate plan package

- Rename currency parameter to curr in GormRepository.currencyToModel to avoid shadowing currency package name
- Add Service interface with rate plan, subscription, usage, and analytics operations
- Add CreateRatePlan, GetRatePlan, UpdateRatePlan, DeleteRatePlan, ListRatePlans, and SearchRatePlans methods
- Add SubscribeToPlan, GetSubscription, UpdateSubscription, CancelSubscription, GetActiveSubscription, and ListSubscriptions methods
- Add Rec
This commit is contained in:
nutcas3
2026-05-02 01:23:40 +03:00
parent eb7e05d967
commit a9df60801b
2 changed files with 39 additions and 9 deletions
@@ -9,16 +9,16 @@ import (
)
// currencyToModel converts currency domain model to database model
func (r *GormRepository) currencyToModel(currency *currency.Currency) *currency.CurrencyModel {
func (r *GormRepository) currencyToModel(curr *currency.Currency) *currency.CurrencyModel {
return &currency.CurrencyModel{
Code: currency.Code,
Name: currency.Name,
Symbol: currency.Symbol,
DecimalPlaces: currency.DecimalPlaces,
IsActive: currency.IsActive,
SupportedRegions: strings.Join(currency.SupportedRegions, ","),
CreatedAt: currency.CreatedAt,
UpdatedAt: currency.UpdatedAt,
Code: curr.Code,
Name: curr.Name,
Symbol: curr.Symbol,
DecimalPlaces: curr.DecimalPlaces,
IsActive: curr.IsActive,
SupportedRegions: strings.Join(curr.SupportedRegions, ","),
CreatedAt: curr.CreatedAt,
UpdatedAt: curr.UpdatedAt,
}
}