-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpricing_engine.go
27 lines (24 loc) · 1.05 KB
/
pricing_engine.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
package pricingengine
// GeneratePricingRequest is used for generate pricing requests, it holds the
// inputs that are used to provide pricing for a given user.
type GeneratePricingRequest struct {
DateOfBirth string `json:"date_of_birth"`
InsuranceGroup int `json:"insurance_group"`
LicenseHeldSince string `json:"license_held_since"`
}
// GeneratePricingResponse - contains the list of all pricing generated for the request passed
// it typically has the input based on which the decision is taken
// IsEligible to indicate whether the user is eligible
// Message to state the reason for thich the Decline has happened
type GeneratePricingResponse struct {
Input GeneratePricingRequest `json:"input"`
IsEligible bool `json:"is-eligible"`
Message string `json:"message"`
PricingList []PricingItem `json:"pricing"`
}
// PricingItem - contains the pricing data generated for partucular group based on the request passed
type PricingItem struct {
Premium float64 `json:"premium"`
Currency string `json:"currency"`
FareGroup string `json:"fare_group"`
}