#1 all ratings are maped
This commit is contained in:
@@ -1,78 +1,90 @@
|
||||
package ecalc
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
)
|
||||
|
||||
type Ecalc struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Version string `json:"version,omitempty"`
|
||||
CompanyFacts CompanyFacts `json:"companyFacts,omitempty"`
|
||||
Type string `json:"type"`
|
||||
Version string `json:"version"`
|
||||
CompanyFacts CompanyFacts `json:"companyFacts"`
|
||||
}
|
||||
|
||||
// EncodeJSON writes the JSON of the conf into the Writer
|
||||
func (e Ecalc) EncodeJSON(w io.Writer) error {
|
||||
enc := json.NewEncoder(w)
|
||||
enc.SetIndent("", " ")
|
||||
return enc.Encode(e)
|
||||
}
|
||||
|
||||
type CompanyFacts struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
TotalPurchaseFromSuppliers int `json:"totalPurchaseFromSuppliers,omitempty"`
|
||||
TotalStaffCosts int `json:"totalStaffCosts,omitempty"`
|
||||
Profit int `json:"profit,omitempty"`
|
||||
FinancialCosts int `json:"financialCosts,omitempty"`
|
||||
IncomeFromFinancialInvestments int `json:"incomeFromFinancialInvestments,omitempty"`
|
||||
AdditionsToFixedAssets int `json:"additionsToFixedAssets,omitempty"`
|
||||
Turnover int `json:"turnover,omitempty"`
|
||||
TotalAssets int `json:"totalAssets,omitempty"`
|
||||
FinancialAssetsAndCashBalance int `json:"financialAssetsAndCashBalance,omitempty"`
|
||||
SupplyFractions []SupplyFraction `json:"supplyFractions,omitempty"`
|
||||
EmployeesFractions []EmployeesFraction `json:"employeesFractions,omitempty"`
|
||||
IndustrySectors []IndustrySector `json:"industrySectors,omitempty"`
|
||||
NumberOfEmployees int `json:"numberOfEmployees,omitempty"`
|
||||
HasCanteen bool `json:"hasCanteen,omitempty"`
|
||||
IsB2B bool `json:"isB2B,omitempty"`
|
||||
AverageJourneyToWorkForStaffInKm float64 `json:"averageJourneyToWorkForStaffInKm,omitempty"`
|
||||
Rating Rating `json:"rating,omitempty"`
|
||||
TotalPurchaseFromSuppliers int `json:"totalPurchaseFromSuppliers"`
|
||||
TotalStaffCosts int `json:"totalStaffCosts"`
|
||||
Profit int `json:"profit"`
|
||||
FinancialCosts int `json:"financialCosts"`
|
||||
IncomeFromFinancialInvestments int `json:"incomeFromFinancialInvestments"`
|
||||
AdditionsToFixedAssets int `json:"additionsToFixedAssets"`
|
||||
Turnover int `json:"turnover"`
|
||||
TotalAssets int `json:"totalAssets"`
|
||||
FinancialAssetsAndCashBalance int `json:"financialAssetsAndCashBalance"`
|
||||
SupplyFractions []SupplyFraction `json:"supplyFractions"`
|
||||
EmployeesFractions []EmployeesFraction `json:"employeesFractions"`
|
||||
IndustrySectors []IndustrySector `json:"industrySectors"`
|
||||
NumberOfEmployees int `json:"numberOfEmployees"`
|
||||
HasCanteen bool `json:"hasCanteen"`
|
||||
IsB2B bool `json:"isB2B"`
|
||||
AverageJourneyToWorkForStaffInKm float64 `json:"averageJourneyToWorkForStaffInKm"`
|
||||
Rating Rating `json:"rating"`
|
||||
}
|
||||
|
||||
type SupplyFraction struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
IndustryCode string `json:"industryCode,omitempty"`
|
||||
CountryCode string `json:"countryCode,omitempty"`
|
||||
Costs int `json:"costs,omitempty"`
|
||||
IndustryCode string `json:"industryCode"`
|
||||
CountryCode string `json:"countryCode"`
|
||||
Costs int `json:"costs"`
|
||||
}
|
||||
|
||||
type EmployeesFraction struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
CountryCode string `json:"countryCode,omitempty"`
|
||||
Percentage float64 `json:"percentage,omitempty"`
|
||||
CountryCode string `json:"countryCode"`
|
||||
Percentage float64 `json:"percentage"`
|
||||
}
|
||||
|
||||
type IndustrySector struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
IndustryCode string `json:"industryCode,omitempty"`
|
||||
AmountOfTotalTurnover int `json:"amountOfTotalTurnover,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
IndustryCode string `json:"industryCode"`
|
||||
AmountOfTotalTurnover int `json:"amountOfTotalTurnover"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type Rating struct {
|
||||
Topics []Topic `json:"topics,omitempty"`
|
||||
Topics []Topic `json:"topics"`
|
||||
}
|
||||
|
||||
type Topic struct {
|
||||
Points int `json:"points,omitempty"`
|
||||
MaxPoints float64 `json:"maxPoints,omitempty"`
|
||||
Points int `json:"points"`
|
||||
MaxPoints float64 `json:"maxPoints"`
|
||||
ID int `json:"id,omitempty"`
|
||||
ShortName string `json:"shortName,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Estimations int `json:"estimations,omitempty"`
|
||||
Weight float64 `json:"weight,omitempty"`
|
||||
IsWeightSelectedByUser bool `json:"isWeightSelectedByUser,omitempty"`
|
||||
Aspects []Aspect `json:"aspects,omitempty"`
|
||||
ShortName string `json:"shortName"`
|
||||
Name string `json:"name"`
|
||||
Estimations int `json:"estimations"`
|
||||
Weight float64 `json:"weight"`
|
||||
IsWeightSelectedByUser bool `json:"isWeightSelectedByUser"`
|
||||
Aspects []Aspect `json:"aspects"`
|
||||
}
|
||||
|
||||
type Aspect struct {
|
||||
Points int `json:"points,omitempty"`
|
||||
MaxPoints float64 `json:"maxPoints,omitempty"`
|
||||
Points int `json:"points"`
|
||||
MaxPoints float64 `json:"maxPoints"`
|
||||
ID int `json:"id,omitempty"`
|
||||
ShortName string `json:"shortName,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Estimations int `json:"estimations,omitempty"`
|
||||
Weight float64 `json:"weight,omitempty"`
|
||||
IsWeightSelectedByUser bool `json:"isWeightSelectedByUser,omitempty"`
|
||||
Aspects []Aspect `json:"aspects,omitempty"`
|
||||
IsPositive bool `json:"isPositive,omitempty"`
|
||||
ShortName string `json:"shortName"`
|
||||
Name string `json:"name"`
|
||||
Estimations int `json:"estimations"`
|
||||
Weight float64 `json:"weight"`
|
||||
IsWeightSelectedByUser bool `json:"isWeightSelectedByUser"`
|
||||
Aspects []Aspect `json:"aspects"`
|
||||
IsPositive bool `json:"isPositive"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user