Skip to content

Commit

Permalink
feat: Add GetMatchDecisions method
Browse files Browse the repository at this point in the history
  • Loading branch information
bgins committed Dec 7, 2024
1 parent 4ab6517 commit 13e9a5b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/solver/store/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,17 @@ func (store *SolverStoreDatabase) GetResults() ([]data.Result, error) {
}

func (store *SolverStoreDatabase) GetMatchDecisions() ([]data.MatchDecision, error) {
var results []data.MatchDecision
return results, nil
var records []MatchDecision
if err := store.db.Find(&records).Error; err != nil {
return nil, err
}

decisions := make([]data.MatchDecision, len(records))
for i, record := range records {
decisions[i] = record.Attributes.Data()
}

return decisions, nil
}

func (store *SolverStoreDatabase) GetJobOffer(id string) (*data.JobOfferContainer, error) {
Expand Down

0 comments on commit 13e9a5b

Please sign in to comment.