aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-05-02 07:42:31 +0300
committerFilipp Lepalaan <f@230.to>2013-05-02 07:42:31 +0300
commita2ad9888148402b75d4f8a77da4c5fbca2f539cb (patch)
treecf4307657a21a41474cc873f5c3c1695439b9352
parent4592078b673177fa4338fbfd2acd85179f7b5cc8 (diff)
downloadpy-gsxws-a2ad9888148402b75d4f8a77da4c5fbca2f539cb.tar.gz
py-gsxws-a2ad9888148402b75d4f8a77da4c5fbca2f539cb.tar.bz2
py-gsxws-a2ad9888148402b75d4f8a77da4c5fbca2f539cb.zip
Refactoring repairs
-rw-r--r--repairs.py84
1 files changed, 84 insertions, 0 deletions
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()