From a2ad9888148402b75d4f8a77da4c5fbca2f539cb Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 2 May 2013 07:42:31 +0300 Subject: Refactoring repairs --- repairs.py | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 repairs.py diff --git a/repairs.py b/repairs.py new file mode 100644 index 0000000..f829d3e --- /dev/null +++ b/repairs.py @@ -0,0 +1,84 @@ +""" +gsxws/repairs.py +""" +import sys +from gsxws import connect, SESSION + + +class GsxObject(object): + data = dict() + def __init__(self, **kwargs): + self.data = kwargs + + +class Customer(GsxObject): + """ + Customer address for GSX + + >>> Customer(adressLine1='blaa').data + {'adressLine1': 'blaa'} + """ + adressLine1 = "" + city = "" + country = "" + firstName = "" + lastName = "" + primaryPhone = "" + region = "" + state = "ZZ" + zipCode = "" + emailAddress = "" + + +class RepairOrderLine(GsxObject): + partNumber = "" + partNumber = "" + comptiaCode = "" + comptiaModifier = "" + + +class Repair(GsxObject): + """docstring for Repair""" + customerAddress = None + symptom = "" + diagnosis = "" + notes = "" + purchaseOrderNumber = "" + referenceNumber = "" + requestReview = False + serialNumber = "" + unitReceivedDate = "" + unitReceivedTime = "" + + orderLines = [] + + def get_data(self): + return {'repairData': self.data} + + def lookup(self): + pass + + +class CarryInRepair(Repair): + """ + GSX validates the information and if all of the validations go through, + it obtains a quote for the repair and creates the carry-in repair + + >>> CarryInRepair(customerAddress=Customer(firstName='Filipp')).get_data() + {} + """ + shipTo = "" + fileName = "" + fileData = "" + diagnosedByTechId = "" + + +class IndirectOnsiteRepair(Repair): + """docstring for IndirectOnsiteRepair""" + pass + + +if __name__ == '__main__': + import doctest + connect(*sys.argv[1:4]) + doctest.testmod() -- cgit v1.2.3