Skip to content

Commit

Permalink
embedded types
Browse files Browse the repository at this point in the history
  • Loading branch information
joellensilva committed Dec 14, 2023
1 parent ab82f51 commit eac98be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions repo/database/dto/annuaISummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
)

type AnnualSummaryDTO struct {
Year int `gorm:"column:ano"`
AverageCount int `gorm:"column:media_num_membros"`
TotalCount int `gorm:"column:total_num_membros"`
BaseRemuneration float64 `gorm:"column:remuneracao_base"`
OtherRemunerations float64 `gorm:"column:outras_remuneracoes"`
Discounts float64 `gorm:"column:descontos"`
Remunerations float64 `gorm:"column:remuneracoes"`
NumMonthsWithData int `gorm:"column:meses_com_dados"`
ItemSummary
Year int `gorm:"column:ano"`
AverageCount int `gorm:"column:media_num_membros"`
TotalCount int `gorm:"column:total_num_membros"`
BaseRemuneration float64 `gorm:"column:remuneracao_base"`
OtherRemunerations float64 `gorm:"column:outras_remuneracoes"`
Discounts float64 `gorm:"column:descontos"`
Remunerations float64 `gorm:"column:remuneracoes"`
NumMonthsWithData int `gorm:"column:meses_com_dados"`
ItemSummary ItemSummary `gorm:"embedded"`
}

func NewAnnualSummaryDTO(ami models.AnnualSummary) *AnnualSummaryDTO {
Expand Down
14 changes: 7 additions & 7 deletions repo/database/dto/generalMonthlyInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
)

type GeneralMonthlyInfoDTO struct {
Month int `gorm:"column:mes"`
Count int `gorm:"column:num_membros"`
BaseRemuneration float64 `gorm:"column:remuneracao_base"`
OtherRemunerations float64 `gorm:"column:outras_remuneracoes"`
Discounts float64 `gorm:"column:descontos"`
Remunerations float64 `gorm:"column:remuneracoes"`
ItemSummary
Month int `gorm:"column:mes"`
Count int `gorm:"column:num_membros"`
BaseRemuneration float64 `gorm:"column:remuneracao_base"`
OtherRemunerations float64 `gorm:"column:outras_remuneracoes"`
Discounts float64 `gorm:"column:descontos"`
Remunerations float64 `gorm:"column:remuneracoes"`
ItemSummary ItemSummary `gorm:"embedded"`
}

type ItemSummary struct {
Expand Down

0 comments on commit eac98be

Please sign in to comment.