Skip to content

Commit 6962b32

Browse files
committed
feat(rcv): Add RvTipoVenta enum to represent "Tipo de Venta" in RCV
Ref: https://app.shortcut.com/cordada/story/16108/
1 parent 029763a commit 6962b32

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
@@ -318,3 +318,16 @@ def as_tipo_dte(self) -> TipoDte:
318318
) from exc
319319

320320
return value
321+
322+
323+
@enum.unique
324+
class RvTipoVenta(enum.Enum):
325+
"""
326+
Enum of "Tipo de Venta" for the RCV domain.
327+
"""
328+
329+
DEL_GIRO = "DEL_GIRO"
330+
"""Del Giro"""
331+
332+
NO_CORRESPONDE_INCLUIR = "NO_CORRESPONDE_INCLUIR"
333+
"""No corresponde incluir"""

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, RcTipoCompra, RcvKind, RcvTipoDocto # noqa: F401
5+
from cl_sii.rcv.constants import RcEstadoContable, RcTipoCompra, RcvKind, RcvTipoDocto, RvTipoVenta
66

77

88
class RcvKindTest(unittest.TestCase):
@@ -139,3 +139,17 @@ def test_as_tipo_dte(self) -> None:
139139
self.assertEqual(
140140
cm.exception.args, ("There is no equivalent 'TipoDte' for 'RcvTipoDocto.FACTURA'.",)
141141
)
142+
143+
144+
class RvTipoVentaTest(unittest.TestCase):
145+
def test_members(self) -> None:
146+
self.assertSetEqual(
147+
{x for x in RvTipoVenta},
148+
{
149+
RvTipoVenta.DEL_GIRO,
150+
RvTipoVenta.NO_CORRESPONDE_INCLUIR,
151+
},
152+
)
153+
154+
def test_values_type(self) -> None:
155+
self.assertSetEqual({type(x.value) for x in RvTipoVenta}, {str})

0 commit comments

Comments
 (0)