package transfer import ( "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models" "penahub.gitlab.yandexcloud.net/pena-services/customer/internal/proto/discount" ) func TariffsToProductInformations(tarrifs []models.Tariff) []*discount.ProductInformation { productInformations := make([]*discount.ProductInformation, len(tarrifs)) for index, tariff := range tarrifs { productInformations[index] = TariffToProductInformation(tariff) } return productInformations } func TariffToProductInformation(tarrif models.Tariff) *discount.ProductInformation { return &discount.ProductInformation{ ID: tarrif.ID, Price: float64(tarrif.Price), } }