package mgt

import (
	"context"
	"time"

	pb "bsm/full/module/ec/order/pb"
	"git.apinb.com/bsm-sdk/core/errcode"
	"git.apinb.com/bsm-sdk/core/service"
)

// 修改订单
func OrderModify(ctx context.Context, in *pb.OrderSummaryItem) (reply *pb.StatusReply, err error) {
	// parse authorization meta.
	auth, err := service.ParseMetaCtx(ctx, &service.ParseOptions{RoleValue: "Mall_Admin"})
	if err != nil {
		return nil, err
	}

	if auth.Owner == nil {
		return nil, errcode.ErrPermissionDenied
	}

	// TODO: valid code

	// TODO: add your logic code & delete this line.

	return &pb.StatusReply{
		Code:    0,
		Message: "OK",
		Timeseq: time.Now().UnixNano(),
	}, nil

}
