Skip to content

Commit

Permalink
remove-cv (#102)
Browse files Browse the repository at this point in the history
* remove-cv

* linter

* enum init

* other pydantic version

* setup

* v
  • Loading branch information
alexviquez authored Mar 8, 2023
1 parent 8c7b418 commit 4f39663
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
14 changes: 7 additions & 7 deletions facturapi/resources/customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import datetime as dt
from typing import ClassVar, Optional, cast

from cuenca_validations.types import SATRegimeCode
from pydantic import BaseModel
from pydantic.dataclasses import dataclass

from ..types.enums import TaxSystemType
from ..types.general import CustomerAddress
from .base import Creatable, Queryable, Retrievable, Updatable

Expand All @@ -23,7 +23,7 @@ class CustomerRequest(BaseModel):
Attributes:
legal_name (str): Full name of the customer.
tax_id (str): RFC of the customer.
tax_system: SATRegimeCode regime code from SAT
tax_system: TaxSystemType regime code from SAT
email (str): Email of the customer.
phone (str): Phone of the customer. Optional.
address (CustomerAddress): Address object of the customer. Optional.
Expand All @@ -32,7 +32,7 @@ class CustomerRequest(BaseModel):

legal_name: str
tax_id: str
tax_system: SATRegimeCode
tax_system: TaxSystemType
email: str
phone: Optional[str]
address: CustomerAddress
Expand All @@ -46,7 +46,7 @@ class CustomerUpdateRequest(BaseModel):
Attributes:
legal_name (str): Full name of the customer. Optional.
tax_id (str): RFC of the customer. Optional.
tax_system: SATRegimeCode regime code from SAT
tax_system: TaxSystemType regime code from SAT
email (str): Email of the customer. Optional.
phone (str): Phone of the customer. Optional.
address (CustomerAddress): Address object of the customer. Optional.
Expand All @@ -55,7 +55,7 @@ class CustomerUpdateRequest(BaseModel):

legal_name: Optional[str]
tax_id: Optional[str]
tax_system: Optional[SATRegimeCode]
tax_system: Optional[TaxSystemType]
email: Optional[str]
phone: Optional[str]
address: Optional[CustomerAddress]
Expand All @@ -77,7 +77,7 @@ class Customer(Creatable, Queryable, Retrievable, Updatable):
tax_id (str): RFC of the customer.
email (str): Email of the customer.
address (CustomerAddress): Address data of the model. Optional.
tax_system (SATRegimeCode): Enum from catalogue of SAT
tax_system (TaxSystemType): Enum from catalogue of SAT
phone (str): Phone of the customer. Defaults to `None`.
"""

Expand All @@ -89,7 +89,7 @@ class Customer(Creatable, Queryable, Retrievable, Updatable):
tax_id: str
email: str
address: CustomerAddress
tax_system: Optional[SATRegimeCode] = None
tax_system: Optional[TaxSystemType] = None
phone: Optional[str] = None

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions facturapi/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'PaymentForm',
'PaymentMethod',
'SanitizedDict',
'TaxSystemType',
'exc',
'general',
'validators',
Expand All @@ -22,5 +23,6 @@
InvoiceUse,
PaymentForm,
PaymentMethod,
TaxSystemType,
)
from .queries import BaseQuery, DateFilter
26 changes: 26 additions & 0 deletions facturapi/types/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,29 @@ class PaymentMethod(str, Enum):

contado = 'PUE'
parcialidades = 'PPD'


class TaxSystemType(str, Enum):
GRL_PM = "601" # General de Ley Personas Morales
PM_FN = "603" # Personas Morales con Fines no Lucrativos
SAL_IS = "605" # Sueldos y Salarios e Ingresos Asimilados a Salarios
ARR = "606" # Arrendamiento
DEM_ING = "608" # Demás ingresos
CONS = "609" # Consolidación
RES_EXT = "610" # Residentes en el Extranjero sin Establecimiento Permanente en México # noqa: E501
DIV = "611" # Ingresos por Dividendos (socios y accionistas)
PF_AEP = "612" # Personas Físicas con Actividades Empresariales y Profesionales # noqa: E501
INT = "614" # Ingresos por intereses
SIN_OBL = "616" # Sin obligaciones fiscales
SCP_DIF = "620" # Sociedades Cooperativas de Producción que optan por diferir sus ingresos # noqa: E501
INC_FISC = "621" # Incorporación Fiscal
AGRO_GAN_SILV_PES = "622" # Actividades Agrícolas, Ganaderas, Silvícolas y Pesqueras # noqa: E501
OP_GRUPO_SOC = "623" # Opcional para Grupos de Sociedades
COOR = "624" # Coordinados
HID = "628" # Hidrocarburos
ENAJ_ADQ = "607" # Régimen de Enajenación o Adquisición de Bienes
PREF_EM_MULT = "629" # De los Regímenes Fiscales Preferentes y de las Empresas Multinacionales # noqa: E501
ENAJ_ACC_BOL = "630" # Enajenación de acciones en bolsa de valores
ING_PREM = "615" # Régimen de los ingresos por obtención de premios
AE_PLAT_TEC = "625" # Régimen de las Actividades Empresariales con ingresos a través de Plataformas Tecnológicas # noqa: E501
RS_CONF = "626" # Régimen Simplificado de Confianza
2 changes: 1 addition & 1 deletion facturapi/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.1.0' # pragma: no cover
__version__ = '0.1.1' # pragma: no cover
CLIENT_VERSION = __version__
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
requests==2.28.1
pydantic==1.8.2
pydantic==1.7.3
dataclasses>=0.7;python_version<"3.7"
cuenca-validations==0.11.18
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
python_requires='>=3.6',
install_requires=[
'requests>=2.4,<2.26',
'pydantic==1.8.2',
'pydantic==1.7.3',
'dataclasses>=0.7;python_version<"3.7"',
],
classifiers=[
Expand Down

0 comments on commit 4f39663

Please sign in to comment.