-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from team-inu/development
Development
- Loading branch information
Showing
11 changed files
with
155 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
package entity | ||
|
||
type PredictionStatus string | ||
|
||
const ( | ||
PredictionStatusPending PredictionStatus = "PENDING" | ||
PredictionStatusFailed PredictionStatus = "FAILED" | ||
PredictionStatusDone PredictionStatus = "DONE" | ||
) | ||
|
||
type Prediction struct { | ||
Id string `json:"id" gorm:"primaryKey;type:char(255)"` | ||
Status PredictionStatus `json:"status"` | ||
Result string `json:"result"` | ||
PredictedGPAX float64 `json:"predictedGPAX"` | ||
} | ||
|
||
type PredictionRepository interface { | ||
GetById(id string) (*Prediction, error) | ||
GetAll() ([]Prediction, error) | ||
GetLatest() (*Prediction, error) | ||
CreatePrediction(prediction *Prediction) error | ||
Update(id string, prediction *Prediction) error | ||
type PredictionRequirements struct { | ||
ProgrammeName string | ||
OldGPAX *float64 | ||
MathGPA *float64 | ||
EngGPA *float64 | ||
SciGPA *float64 | ||
School string | ||
Admission string | ||
} | ||
|
||
type PredictionUseCase interface { | ||
GetById(id string) (*Prediction, error) | ||
GetAll() ([]Prediction, error) | ||
GetLatest() (*Prediction, error) | ||
CreatePrediction() (*string, error) | ||
Update(id string, status PredictionStatus, result string) error | ||
CreatePrediction(requirements PredictionRequirements) (*Prediction, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package request | ||
|
||
type PredictPayload struct { | ||
ProgrammeName string `json:"programmeName" validate:"required"` | ||
GPAX *float64 `json:"gpax" validate:"required"` | ||
MathGPA *float64 `json:"mathGPA" validate:"required"` | ||
EngGPA *float64 `json:"engGPA" validate:"required"` | ||
SciGPA *float64 `json:"sciGPA" validate:"required"` | ||
School string `json:"school" validate:"required"` | ||
Admission string `json:"admission" validate:"required"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.