-
Notifications
You must be signed in to change notification settings - Fork 1
/
price_details.go
47 lines (39 loc) · 1.42 KB
/
price_details.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package legend
import (
"fmt"
"net/url"
"strconv"
"time"
"github.com/shopspring/decimal"
)
type MembershipPriceDetailsModel struct {
CycleFee decimal.Decimal
CycleFeeProcessType int64
EnrollmentFee decimal.Decimal
EnrollmentFeeProcessType int64
FirstBillDate LegendTime
HasEligibilities bool
InductionFee decimal.Decimal
InductionFeeProcessType int64
MonthInHandFee decimal.Decimal
MonthInHandFeeProcessType int64
MonthInHandProcessType int64
ProrateFee decimal.Decimal
ProrateFeeProcessType int64
UpFrontCycleFee decimal.Decimal
UpfrontCycleFeeProcessType int64
WaiveProrateFee bool
Discounts []DiscountPriceDetails
FutureDiscounts []FutureDiscountPriceDetails
}
// GetPriceDetails fetches base price for a given membership price at a location
func (this *ApiClient) GetPriceDetails(locationId int64, priceTypeId int64, startDate time.Time, promotionCode string) (target MembershipPriceDetailsModel, err error) {
params := url.Values{}
params.Add("PriceTypeId", strconv.FormatInt(priceTypeId, 10))
params.Add("StartDate", startDate.Format(LEGEND_DATE_FORMAT))
if promotionCode != "" {
params.Add("PromotionCode", promotionCode)
}
err = this.GetApiRequest(fmt.Sprintf("/Joining/MembershipTypes/%d/PriceDetails", locationId), params, &target)
return
}