Skip to content

rcv: Add RvTipoVenta enum to represent "Tipo de Venta" in RCV #852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/cl_sii/rcv/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,19 @@ def as_tipo_dte(self) -> TipoDte:
) from exc

return value


@enum.unique
class RvTipoVenta(enum.Enum):
"""
Enum of "Tipo de Venta" for the RCV domain.
"""

DEL_GIRO = "DEL_GIRO"
"""Del Giro"""

BIENES_RAICES = "BIENES_RAICES"
"""Bienes Raíces"""

ACTIVO_FIJO = "ACTIVO_FIJO"
"""Activo Fijo"""
17 changes: 16 additions & 1 deletion src/tests/test_rcv_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from cl_sii.dte.constants import TipoDte # noqa: F401
from cl_sii.rcv import constants # noqa: F401
from cl_sii.rcv.constants import RcEstadoContable, RcTipoCompra, RcvKind, RcvTipoDocto # noqa: F401
from cl_sii.rcv.constants import RcEstadoContable, RcTipoCompra, RcvKind, RcvTipoDocto, RvTipoVenta


class RcvKindTest(unittest.TestCase):
Expand Down Expand Up @@ -139,3 +139,18 @@ def test_as_tipo_dte(self) -> None:
self.assertEqual(
cm.exception.args, ("There is no equivalent 'TipoDte' for 'RcvTipoDocto.FACTURA'.",)
)


class RvTipoVentaTest(unittest.TestCase):
def test_members(self) -> None:
self.assertSetEqual(
{x for x in RvTipoVenta},
{
RvTipoVenta.DEL_GIRO,
RvTipoVenta.BIENES_RAICES,
RvTipoVenta.ACTIVO_FIJO,
},
)

def test_values_type(self) -> None:
self.assertSetEqual({type(x.value) for x in RvTipoVenta}, {str})
Loading