2024-05-31 14:49:04 +00:00
|
|
|
package mysqlkindboxreq
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-06-14 08:41:36 +00:00
|
|
|
"time"
|
|
|
|
|
2024-05-31 14:49:04 +00:00
|
|
|
errmsg "git.gocasts.ir/ebhomengo/niki/pkg/err_msg"
|
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (d DB) DeleteKindBoxReqByID(ctx context.Context, kindBoxReqID uint) error {
|
|
|
|
const op = richerror.Op("mysqlkindboxreq.DeleteKindBoxReqByID")
|
2024-05-31 12:36:48 +00:00
|
|
|
_, dErr := d.conn.Conn().ExecContext(ctx, "update kind_box_reqs set deleted_at = ? where id = ? and deleted_at is null", time.Now(), kindBoxReqID)
|
2024-05-31 14:49:04 +00:00
|
|
|
if dErr != nil {
|
|
|
|
return richerror.New(op).WithErr(dErr).
|
|
|
|
WithMessage(errmsg.ErrorMsgSomethingWentWrong).WithKind(richerror.KindUnexpected)
|
|
|
|
}
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-05-31 14:49:04 +00:00
|
|
|
return nil
|
|
|
|
}
|