Skip to content

Commit

Permalink
Adds a25 step to gas processes
Browse files Browse the repository at this point in the history
Adds a25 step to gas processes
  • Loading branch information
egarciadiaz committed Mar 31, 2021
1 parent 827f9f2 commit aebf738
Show file tree
Hide file tree
Showing 9 changed files with 347 additions and 9 deletions.
80 changes: 80 additions & 0 deletions gestionatr/input/messages/A1_41.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,62 @@ def extrainfo(self):
else:
return False

# Datos paso a2541
@property
def visitdate(self):
tree = '{0}.visitdate'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def visithour(self):
tree = '{0}.visithour'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def informationtype(self):
tree = '{0}.informationtype'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def informationtypedesc(self):
tree = '{0}.informationtypedesc'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def operationnum(self):
tree = '{0}.operationnum'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def defectlist(self):
data = []
obj = get_rec_attr(self.obj, self._header, False)
if (hasattr(obj, 'defectlist') and
hasattr(obj.defectlist, 'defect')):
for d in obj.defectlist.defect:
data.append(defect(d))
return data

# Datos paso a341
@property
def atrcode(self):
Expand Down Expand Up @@ -635,6 +691,30 @@ def previousatrcode(self):
return False


class defect(object):

def __init__(self, data):
self.obj = data

@property
def code(self):
tree = 'code'
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def description(self):
tree = 'description'
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False


class counter(object):

def __init__(self, data):
Expand Down
28 changes: 28 additions & 0 deletions gestionatr/input/messages/A1_44.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,34 @@ def srcode(self):
else:
return False

# Datos paso a2544
@property
def interventiontype(self):
tree = '{0}.interventiontype'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def newoperationtype(self):
tree = '{0}.newoperationtype'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def moreinformation(self):
tree = '{0}.moreinformation'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

# Datos paso a344
@property
def reqdescription(self):
Expand Down
9 changes: 0 additions & 9 deletions gestionatr/input/messages/A1_48.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,6 @@ def sequential(self):
else:
return False

@property
def interventiontype(self):
tree = '{0}.interventiontype'.format(self._header)
data = get_rec_attr(self.obj, tree, False)
if data is not None and data is not False:
return data.text
else:
return False

@property
def newclaimtype(self):
tree = '{0}.newclaimtype'.format(self._header)
Expand Down
8 changes: 8 additions & 0 deletions gestionatr/input/messages/message_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'41': {
'A1': 'A141.xsd',
'A2': 'A241.xsd',
'A25': 'A2541.xsd',
'A3': 'A341.xsd',
'A4': 'A441.xsd',
'A3S': 'A3S41.xsd',
Expand All @@ -27,12 +28,14 @@
'05': {
'A1': 'A105.xsd',
'A2': 'A205.xsd',
'A25': 'A2505.xsd',
'A3': 'A305.xsd',
'A4': 'A405.xsd',
},
'44': {
'A1': 'A144.xsd',
'A2': 'A244.xsd',
'A25': 'A2544.xsd',
'A3': 'A344.xsd',
'A4': 'A444.xsd',
},
Expand All @@ -44,6 +47,7 @@
'04': {
'A1': 'A104.xsd',
'A2': 'A204.xsd',
'A25': 'A2504.xsd',
'A3': 'A304.xsd',
'A4': 'A404.xsd',
},
Expand Down Expand Up @@ -115,6 +119,7 @@
# 41
'A141': 'a141',
'A241': 'a241',
'A2541': 'a2541',
'A341': 'a341',
'A441': 'a441',
'A3S41': 'a3s41',
Expand All @@ -130,11 +135,13 @@
# 05
'A105': 'a105',
'A205': 'a205',
'A2505': 'a2505',
'A305': 'a305',
'A405': 'a405',
# 44
'A144': 'a1',
'A244': 'a2',
'A2544': 'a25',
'A344': 'a3',
'A444': 'a4',
# 03
Expand All @@ -150,6 +157,7 @@
# 04
'A104': 'a104',
'A204': 'a204',
'A2504': 'a2504',
'A304': 'a304',
'A404': 'a404',
# 46
Expand Down
33 changes: 33 additions & 0 deletions tests/data/a2504.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='UTF-8'?>
<sctdapplication xmlns="http://localhost/sctd/A2504">
<heading>
<dispatchingcode>GML</dispatchingcode>
<dispatchingcompany>1234</dispatchingcompany>
<destinycompany>4321</destinycompany>
<communicationsdate>2018-05-01</communicationsdate>
<communicationshour>12:00:00</communicationshour>
<processcode>04</processcode>
<messagetype>A25</messagetype>
</heading>
<a2504>
<reqcode>123456789</reqcode>
<visitdate>2018-09-24</visitdate>
<visithour>15:25:18</visithour>
<comreferencenum>987654321</comreferencenum>
<informationtype>002</informationtype>
<informationtypedesc>Orden de Trabajo pendiente</informationtypedesc>
<interventiondate>2018-09-24</interventiondate>
<interventionhourfrom>15:25:18</interventionhourfrom>
<interventionhourto>15:25:18</interventionhourto>
<cups>ES1234000000000001JN</cups>
<visitnumber>590</visitnumber>
<operationnum>741</operationnum>
<extrainfo>coments</extrainfo>
<defectlist>
<defect>
<code>001</code>
<description>FUGA DE GAS</description>
</defect>
</defectlist>
</a2504>
</sctdapplication>
33 changes: 33 additions & 0 deletions tests/data/a2505.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='UTF-8'?>
<sctdapplication xmlns="http://localhost/sctd/A2505">
<heading>
<dispatchingcode>GML</dispatchingcode>
<dispatchingcompany>1234</dispatchingcompany>
<destinycompany>4321</destinycompany>
<communicationsdate>2018-05-01</communicationsdate>
<communicationshour>12:00:00</communicationshour>
<processcode>05</processcode>
<messagetype>A25</messagetype>
</heading>
<a2505>
<reqcode>123456789</reqcode>
<cups>ES1234000000000001JN</cups>
<visitdate>2018-09-24</visitdate>
<visithour>15:25:18</visithour>
<comreferencenum>987654321</comreferencenum>
<informationtype>002</informationtype>
<informationtypedesc>Orden de Trabajo pendiente</informationtypedesc>
<interventiondate>2018-09-24</interventiondate>
<interventionhourfrom>15:25:18</interventionhourfrom>
<interventionhourto>15:25:18</interventionhourto>
<visitnumber>590</visitnumber>
<operationnum>741</operationnum>
<extrainfo>coments</extrainfo>
<defectlist>
<defect>
<code>001</code>
<description>FUGA DE GAS</description>
</defect>
</defectlist>
</a2505>
</sctdapplication>
33 changes: 33 additions & 0 deletions tests/data/a2541.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='UTF-8'?>
<sctdapplication xmlns="http://localhost/sctd/A2541">
<heading>
<dispatchingcode>GML</dispatchingcode>
<dispatchingcompany>1234</dispatchingcompany>
<destinycompany>4321</destinycompany>
<communicationsdate>2018-05-01</communicationsdate>
<communicationshour>12:00:00</communicationshour>
<processcode>41</processcode>
<messagetype>A25</messagetype>
</heading>
<a2541>
<reqcode>123456789</reqcode>
<cups>ES1234000000000001JN</cups>
<visitdate>2018-09-24</visitdate>
<visithour>15:25:18</visithour>
<comreferencenum>987654321</comreferencenum>
<informationtype>002</informationtype>
<informationtypedesc>Orden de Trabajo pendiente</informationtypedesc>
<interventiondate>2018-09-24</interventiondate>
<interventionhourfrom>15:25:18</interventionhourfrom>
<interventionhourto>15:25:18</interventionhourto>
<visitnumber>590</visitnumber>
<operationnum>741</operationnum>
<extrainfo>coments</extrainfo>
<defectlist>
<defect>
<code>001</code>
<description>FUGA DE GAS</description>
</defect>
</defectlist>
</a2541>
</sctdapplication>
39 changes: 39 additions & 0 deletions tests/data/a2544.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version='1.0' encoding='UTF-8'?>
<sctdapplication xmlns="http://localhost/sctd/A2544">
<heading>
<dispatchingcode>GML</dispatchingcode>
<dispatchingcompany>1234</dispatchingcompany>
<destinycompany>4321</destinycompany>
<communicationsdate>2018-05-01</communicationsdate>
<communicationshour>12:00:00</communicationshour>
<processcode>44</processcode>
<messagetype>A25</messagetype>
</heading>
<a25>
<reqcode>123456789</reqcode>
<comreferencenum>987654321</comreferencenum>
<cups>ES1234000000000001JN</cups>
<operationtype>A10003</operationtype>
<interventiontype>01</interventiontype>
<newoperationtype>A10010</newoperationtype>
<moreinformation>more information</moreinformation>
<operationnum>741</operationnum>
<visitdate>2018-09-24</visitdate>
<visithour>15:25:18</visithour>
<informationtype>002</informationtype>
<informationtypedesc>Orden de Trabajo pendiente</informationtypedesc>
<interventiondate>2018-09-24</interventiondate>
<interventionhourfrom>15:25:18</interventionhourfrom>
<interventionhourto>15:25:18</interventionhourto>
<resultinspection>01</resultinspection>
<resultinspectiondesc>Correcto</resultinspectiondesc>
<visitnumber>590</visitnumber>
<extrainfo>coments</extrainfo>
<defectlist>
<defect>
<code>001</code>
<description>FUGA DE GAS</description>
</defect>
</defectlist>
</a25>
</sctdapplication>
Loading

0 comments on commit aebf738

Please sign in to comment.