Skip to content

Commit 39243a1

Browse files
Merge pull request #848 from cordada/task/sc-16109-add-rcv-tipo-compra
rcv: Add RcTipoCompra enum to represent "Tipo de Compra" in RCV
2 parents f52d0a2 + 509eb75 commit 39243a1

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/cl_sii/rcv/constants.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,19 @@ class RcEstadoContable(enum.Enum):
9797
PENDIENTE = 'PENDIENTE'
9898

9999

100+
@enum.unique
101+
class RcTipoCompra(enum.Enum):
102+
"""
103+
Enum of "Tipo de Compra" for the RCV domain.
104+
"""
105+
106+
DEL_GIRO = "DEL_GIRO"
107+
"""Del Giro"""
108+
109+
NO_CORRESPONDE_INCLUIR = "NO_CORRESPONDE_INCLUIR"
110+
"""No corresponde incluir"""
111+
112+
100113
@enum.unique
101114
class RcvTipoDocto(enum.IntEnum):
102115
"""

src/tests/test_rcv_constants.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from cl_sii.dte.constants import TipoDte # noqa: F401
44
from cl_sii.rcv import constants # noqa: F401
5-
from cl_sii.rcv.constants import RcEstadoContable, RcvKind, RcvTipoDocto # noqa: F401
5+
from cl_sii.rcv.constants import RcEstadoContable, RcTipoCompra, RcvKind, RcvTipoDocto # noqa: F401
66

77

88
class RcvKindTest(unittest.TestCase):
@@ -48,6 +48,20 @@ def test_values_type(self) -> None:
4848
self.assertSetEqual({type(x.value) for x in RcEstadoContable}, {str})
4949

5050

51+
class RcTipoCompraTest(unittest.TestCase):
52+
def test_members(self) -> None:
53+
self.assertSetEqual(
54+
{x for x in RcTipoCompra},
55+
{
56+
RcTipoCompra.DEL_GIRO,
57+
RcTipoCompra.NO_CORRESPONDE_INCLUIR,
58+
},
59+
)
60+
61+
def test_values_type(self) -> None:
62+
self.assertSetEqual({type(x.value) for x in RcTipoCompra}, {str})
63+
64+
5165
class RcvTipoDoctoTest(unittest.TestCase):
5266
def test_members(self) -> None:
5367
self.assertSetEqual(

0 commit comments

Comments
 (0)