from .grpc_lib.core_pb2 import (
    AddItemRequest,
    BasketApplyDiscountRequest,
    BasketAssignOwnerRequest,
    BasketRequest,
    BasketRetrieveRequest,
    EndTradeRequest,
    RemoveItemRequest,
    StartTradeRequest,
)
from .grpc_lib.core_pb2_grpc import BasketControllerStub, TradeControllerStub

SUCCESS_CODE = "0"


class BasketRequestMessages:
    RTRIEVE = BasketRetrieveRequest()
    CREATE = BasketRequest()
    ADD_ITEM = AddItemRequest()
    REMOVE_ITEM = RemoveItemRequest()
    ASSIGN_OWNER = BasketAssignOwnerRequest()
    APPLY_DISCOUNT = BasketApplyDiscountRequest()


class BasketRPCMethodNames:
    RTRIEVE = "Retrieve"
    CREATE = "Create"
    ADD_ITEM = "AddItem"
    REMOVE_ITEM = "RemoveItem"
    ASSIGN_OWNER = "AssignOwner"
    APPLY_DISCOUNT = "ApplyDiscount"


class TradeRequestMessages:
    START = StartTradeRequest()
    END = EndTradeRequest()


class TradeRPCMethodNames:
    START = "Start"
    END = "End"


class ControllerStubs:
    BASKET = BasketControllerStub()
    TRADE = TradeControllerStub()
