def UpdateOrderShipped(self, request, context):
     order_id = request.id
     is_shipped = request.is_shipped
     if self.inventory.update_order_shipped(order_id, is_shipped):
         return inventory_system_pb2.Success(success=True)
     else:
         return inventory_system_pb2.Success(success=False)
 def UpdateOrderDate(self, request, context):
     order_id = request.id
     date = request.date
     if self.inventory.update_order_date(order_id, date):
         return inventory_system_pb2.Success(success=True)
     else:
         return inventory_system_pb2.Success(success=False)
 def UpdateOrderDestination(self, request, context):
     order_id = request.id
     destination = request.destination
     if self.inventory.update_order_destination(order_id, destination):
         return inventory_system_pb2.Success(success=True)
     else:
         return inventory_system_pb2.Success(success=False)
 def UpdateProductSaleCost(self, request, context):
     product_identifier = request.product_identifier
     name = product_identifier.name
     id_ = product_identifier.id
     sale_cost = request.sale_cost
     if self.inventory.update_sale_cost(name, id_, sale_cost):
         return inventory_system_pb2.Success(success=True)
     return inventory_system_pb2.Success(success=False)
 def UpdateProductManufacturer(self, request, context):
     product_identifier = request.product_identifier
     name = product_identifier.name
     id_ = product_identifier.id
     manufacturer = request.manufacturer
     if self.inventory.update_manufacturer(name, id_, manufacturer):
         return inventory_system_pb2.Success(success=True)
     return inventory_system_pb2.Success(success=False)
 def UpdateProductDescription(self, request, context):
     product_identifier = request.product_identifier
     name = product_identifier.name
     id_ = product_identifier.id
     description = request.description
     if self.inventory.update_description(name, id_, description):
         return inventory_system_pb2.Success(success=True)
     return inventory_system_pb2.Success(success=False)
 def DecreaseProductAmount(self, request, context):
     product_identifier = request.product_identifier
     name = product_identifier.name
     id_ = product_identifier.id
     amount = request.amount
     if self.inventory.decrease_product_amount(name, id_, amount):
         return inventory_system_pb2.Success(success=True)
     return inventory_system_pb2.Success(success=False)
 def AddProductToOrder(self, request, context):
     product_amount = request.product_amount
     product_identifier = product_amount.product_identifier
     product_name = product_identifier.name
     product_id = product_identifier.id
     product_amount = product_amount.amount
     order_id = request.id
     if self.inventory.add_product_to_order(order_id, product_name,
                                            product_id, product_amount):
         return inventory_system_pb2.Success(success=True)
     else:
         return inventory_system_pb2.Success(success=False)
 def RemoveProductFromOrder(self, request, context):
     product_amount = request.product_amount
     product_identifier = product_amount.product_identifier
     product_name = product_identifier.name
     product_id = product_identifier.id
     product_amount = product_amount.amount
     order_id = request.id
     if self.inventory.remove_product_from_order(order_id, product_name,
                                                 product_id,
                                                 product_amount):
         return inventory_system_pb2.Success(success=True)
     else:
         return inventory_system_pb2.Success(success=False)