Skip to content

Commit

Permalink
updated model
Browse files Browse the repository at this point in the history
Signed-off-by: quobix <dave@quobix.com>
  • Loading branch information
daveshanley committed Feb 21, 2024
1 parent d821df2 commit b0db352
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions model/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
)

type Commit struct {
CreatedAt time.Time
UpdatedAt time.Time
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
ID uint `gorm:"primaryKey" json:"-"`
Hash string `json:"commitHash"`
Message string `json:"message"`
Expand Down
20 changes: 17 additions & 3 deletions model/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,30 @@
package model

import (
"github.com/pb33f/libopenapi/what-changed/model"
"github.com/pb33f/libopenapi/what-changed/reports"
"time"
)

type Report struct {
ID uint `gorm:"primaryKey" json:"-"`
Summary map[string]*reports.Changed `gorm:"-" json:"reportSummary"`
CreatedAt time.Time
UpdatedAt time.Time
Commit *Commit `gorm:"foreignKey:ID" json:"commitDetails"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
Commit *Commit `gorm:"foreignKey:ID" json:"commitDetails"`
}

type FlatReport struct {
Summary map[string]*reports.Changed `json:"reportSummary"`
Changes []*model.Change `json:"changes"`
}

type FlatHistoricalReport struct {
GitRepoPath string `json:"gitRepoPath"`
GitFilePath string `json:"gitFilePath"`
Filename string `json:"filename"`
DateGenerated string `json:"dateGenerated"`
Reports []*FlatReport `json:"reports" `
}

type HistoricalReport struct {
Expand Down

0 comments on commit b0db352

Please sign in to comment.