niki/repository/mysql/kind_box_req/scan.go

21 lines
685 B
Go

package mysqlkindboxreq
import (
"git.gocasts.ir/ebhomengo/niki/entity"
"git.gocasts.ir/ebhomengo/niki/repository/mysql"
)
func scanKindBoxReq(scanner mysql.Scanner) (entity.KindBoxReq, error) {
var kindBoxReq entity.KindBoxReq
var kindBoxStatus string
var kindBoxType string
err := scanner.Scan(&kindBoxReq.ID, &kindBoxReq.BenefactorID, &kindBoxType, &kindBoxReq.AddressID, &kindBoxReq.CountRequested, &kindBoxReq.CountAccepted,
&kindBoxReq.Description,
&kindBoxReq.ReferDate, &kindBoxStatus, &kindBoxReq.CreatedAt)
kindBoxReq.Status = entity.MapToKindBoxReqStatus(kindBoxStatus)
kindBoxReq.KindBoxType = entity.MapToKindBoxType(kindBoxType)
return kindBoxReq, err
}