forked from ebhomengo/niki
24 lines
716 B
Go
24 lines
716 B
Go
package mysqlkindboxreq
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
entity "git.gocasts.ir/ebhomengo/niki/entity"
|
|
errmsg "git.gocasts.ir/ebhomengo/niki/pkg/err_msg"
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
)
|
|
|
|
func (d DB) DeliverKindBoxReq(ctx context.Context, kindBoxReqID uint) error {
|
|
const op = "mysqlkindboxreq.DeliverKindBoxReq"
|
|
|
|
_, err := d.conn.Conn().ExecContext(ctx, `update kind_box_reqs set status = ?, delivered_at = ?, updated_at = ?, where id = ?`,
|
|
entity.KindBoxReqDeliveredStatus.String(), time.Now(), time.Now(), kindBoxReqID)
|
|
if err != nil {
|
|
return richerror.New(op).WithErr(err).
|
|
WithMessage(errmsg.ErrorMsgSomethingWentWrong).WithKind(richerror.KindUnexpected)
|
|
}
|
|
|
|
return nil
|
|
}
|