ipiranga-inovai-project-lib 1.6__py3-none-any.whl → 1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
inovai/entities.py CHANGED
@@ -6,6 +6,109 @@ from sqlalchemy.orm import relationship
6
6
  Base = declarative_base()
7
7
 
8
8
 
9
+ class ObiIntegration(Base):
10
+ __tablename__ = 'integracao_obi'
11
+ __table_args__ = {'schema': 'fiscal'}
12
+
13
+ id = Column('cd_seq_integr_obi', Integer, primary_key=True, nullable=False)
14
+ json_content = Column('aq_json', JSON, nullable=False)
15
+ integration_origin_code = Column('cd_unico_integr_obi', Numeric(precision=11, scale=0), nullable=False)
16
+ branch_code = Column('cd_filial', Numeric(precision=6, scale=0), nullable=False)
17
+ movement_employer_number = Column('cd_cnpj_movimentacao', String(14), nullable=False)
18
+ issuance_date = Column('dt_emis', Date, nullable=False)
19
+ movement_date = Column('dt_mov', DateTime, nullable=False)
20
+ created_at = Column('dt_incl', DateTime, nullable=False, server_default='NOW()')
21
+ request_id = Column('id_req', String(40), nullable=True)
22
+ origin = Column('nm_sist_orig', String(50), nullable=True)
23
+ type_id = Column('cd_tipo_param_obi', Integer, nullable=False)
24
+
25
+ integration_obi_batch = relationship('IntegrationObiBatch', back_populates='integration_obi')
26
+ kit_integration_obi_status = relationship("KitIntegrationObiStatus", back_populates="integration_obi")
27
+ type = relationship("ParamTypeObiKit", back_populates="integration_obi")
28
+
29
+ def to_dict(self):
30
+ return {
31
+ "cd_seq_integr_obi": self.id,
32
+ "aq_json": self.json_content,
33
+ "cd_unico_integr_obi": self.integration_origin_code,
34
+ "cd_filial": self.branch_code,
35
+ "cd_cnpj_movimentacao": self.movement_employer_number,
36
+ "dt_emis": self.issuance_date,
37
+ "dt_mov": self.movement_date,
38
+ "dt_incl": self.created_at,
39
+ "id_req": self.request_id,
40
+ "nm_sist_orig": self.origin,
41
+ }
42
+
43
+ def __str__(self):
44
+ return str(self.to_dict())
45
+
46
+
47
+ class ParamTypeObiKit(Base):
48
+ __tablename__ = 'tipo_param_kit_obi'
49
+ __table_args__ = {'schema': 'fiscal'}
50
+
51
+ type_id = Column('cd_tipo_param_obi', Integer, primary_key=True, nullable=False)
52
+ name = Column('nm_tipo_param_obi', String(50))
53
+ description = Column('ds_tipo_param_obi', String(200))
54
+ created_at = Column('dt_incl', DateTime, nullable=False, server_default='NOW()')
55
+ inactivation_date = Column('dt_inat', DateTime, nullable=False)
56
+
57
+ integration_obi = relationship("ObiIntegration", back_populates="type")
58
+ integration_processing = relationship("ParamProcessingKit", back_populates="type")
59
+
60
+ def __init__(self, type_id=None, name=None, description=None):
61
+ super().__init__()
62
+ self.id = type_id
63
+ self.type = name
64
+ self.description = description
65
+ self.created_at = datetime.now()
66
+
67
+
68
+ class IntegrationObiBatch(Base):
69
+ __tablename__ = 'lote_integracao_obi'
70
+ __table_args__ = {'schema': 'fiscal'}
71
+
72
+ integration_batch_id = Column('cd_integr', String(36), ForeignKey('fiscal.lote_integracao.cd_integr'),
73
+ primary_key=True, nullable=False)
74
+ integration_obi_id = Column('cd_seq_integr_obi', Integer, ForeignKey('fiscal.integracao_obi'
75
+ '.cd_seq_integr_obi'),
76
+ primary_key=True, nullable=False)
77
+ created_at = Column('dt_incl', DateTime, nullable=False)
78
+
79
+ integration_obi_batch = relationship('ObiIntegration', back_populates='integration_obi')
80
+
81
+ def __init__(self, integration_batch_id, integration_obi_id):
82
+ super().__init__()
83
+ self.integration_obi_id = integration_obi_id
84
+ self.integration_batch_id = integration_batch_id
85
+ self.created_at = datetime.now()
86
+
87
+
88
+ class KitIntegrationObiStatus(Base):
89
+ __tablename__ = 'kit_integracao_obi_status'
90
+ __table_args__ = {'schema': 'fiscal'}
91
+
92
+ integration_obi_id = Column('cd_seq_integr_obi', Integer, ForeignKey('fiscal.integracao_obi.cd_seq_integr_obi'),
93
+ primary_key=True, nullable=False)
94
+ kit_id = Column('no_seq_kit', Integer, ForeignKey('fiscal.kit_obi.no_seq_kit'),
95
+ primary_key=True, nullable=False)
96
+ integration_status = Column('ds_status_proc', String(20), nullable=False)
97
+ created_at = Column('dt_incl', DateTime, nullable=False)
98
+
99
+ integration_obi = relationship(ObiIntegration, back_populates="kit_integration_obi_status")
100
+
101
+ def __init__(self, integration_obi_id, kit_id, integration_status):
102
+ super().__init__()
103
+ self.integration_obi_id = integration_obi_id
104
+ self.kit_id = kit_id
105
+ self.integration_status = integration_status
106
+ self.created_at = datetime.now()
107
+
108
+ def __str__(self):
109
+ return f'integration_obi_id: {self.document_id}, kit_id: {self.kit_id}, integration_status: {self.integration_status}'
110
+
111
+
9
112
  class IntegrationDocument(Base):
10
113
  __tablename__ = 'documento_integracao'
11
114
  __table_args__ = {'schema': 'fiscal'}
@@ -157,16 +260,20 @@ class ParamProcessingKit(Base):
157
260
  kit_id = Column('cd_kit', Integer, ForeignKey('fiscal.kit_obi.no_seq_kit'), nullable=False)
158
261
  process_code = Column('cd_proc_obi', String(30))
159
262
  status = Column('id_status_param', Boolean, nullable=False)
263
+ type_id = Column('cd_tipo_param_obi', Integer, ForeignKey('fiscal.tipo_param_kit_obi.cd_tipo_param_obi'), nullable=False)
160
264
  document_type = Column('cd_tipo_doc_integr', String(8))
161
265
  created_at = Column('dt_incl', DateTime, nullable=False, server_default='NOW()')
162
266
 
163
- def __init__(self, param_processing_kit_id, kit_id, process_code, status, document_type):
267
+ type = relationship("ParamTypeObiKit", back_populates="integration_processing")
268
+
269
+ def __init__(self, param_processing_kit_id, kit_id, process_code, status, document_type, type_id=None):
164
270
  super().__init__()
165
271
  self.param_processing_kit_id = param_processing_kit_id
166
272
  self.kit_id = kit_id
167
273
  self.process_code = process_code
168
274
  self.status = status
169
275
  self.document_type = document_type
276
+ self.type_id = type_id
170
277
  self.created_at = datetime.now()
171
278
 
172
279
 
inovai/enums.py CHANGED
@@ -28,6 +28,17 @@ class DocumentType(Enum):
28
28
  ISS_SERVICE = "SERV_ISS"
29
29
 
30
30
 
31
+ class IntegrationType(Enum):
32
+ SERVICE = 'SERV'
33
+ PRODUCT = 'PROD'
34
+ ISS_SERVICE = "SERV_ISS"
35
+ STOCK_MOVEMENT = 'MOVIMENTACAO_ESTOQUE'
36
+ FINISHED_PRODUCT_WITHOUT_PACKAGING = 'PRODUTO_ACABADO_SEM_EMBALAGEM'
37
+ FINISHED_PRODUCT_WITH_PACKAGING = 'PRODUTO_ACABADO_COM_EMBALAGEM'
38
+ PRODUCTION_ORDER = 'ORDEM_PRODUCAO'
39
+ CORRECTION_NOTE = 'CORRECAO_APONTAMENTO'
40
+
41
+
31
42
  class TaxType:
32
43
  PIS = "PIS"
33
44
  IPI = "IPI"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ipiranga-inovai-project-lib
3
- Version: 1.6
3
+ Version: 1.7
4
4
  Summary: Projeto criado para importação genérica de entidades
5
5
  Home-page: https://gitlab.ipirangacloud.com/clayton.monteiro.ext/ipiranga-inovai-project-lib
6
6
  Author: Clayton Sandes Monteiro
@@ -1,6 +1,6 @@
1
1
  inovai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- inovai/entities.py,sha256=tsa9Fpm0kOmulP1mg2hLk6jeP4jrU5cnI01dT0QIAqY,12749
3
- inovai/enums.py,sha256=3pFRqYBy_aAYUHe_skRhVM4D0XhcYxL-6hNQAgWB7k8,927
2
+ inovai/entities.py,sha256=RDaLem3K8R6CwEsZ0Jnva3Pk-em1Kb3fkkGwu33VBNM,17824
3
+ inovai/enums.py,sha256=DbJAPsy9TXZ5Syh9L_JrteaGp1CB2PNyhW0zZnMritw,1312
4
4
  inovai/models/Endereco.py,sha256=Vft20vMwYwTXtEuh5NH7O5FxXVahnLmgaXMDOVdBxY4,3519
5
5
  inovai/models/NFe.py,sha256=3PiMvK6AODaagZU7KEpnjYfulz8PvcQYGChIa-QCvg0,13023
6
6
  inovai/models/NFeBoleto.py,sha256=tLWqsOlszA6UiJdxesJKQkgwNk_4DuI3NRBCYZh7RKc,5006
@@ -33,8 +33,8 @@ inovai/models/NFeVolume.py,sha256=_cayb-rrz1mSxQ3wFFnB4KCi524jtAsdTTcS4WQTBOc,19
33
33
  inovai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  inovai/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  inovai/utils/util.py,sha256=tEFFoYhtyZk2pxor2vb23NWr3otPzPXTiTIf-VrGik4,366
36
- ipiranga_inovai_project_lib-1.6.dist-info/LICENSE,sha256=UJ3ql8eZec9Y1kER7QSHAuvdgFPuL47asePHYmdzG_o,198
37
- ipiranga_inovai_project_lib-1.6.dist-info/METADATA,sha256=ERFApG4vdBISBopcHrYWpYAO1XWeXVEzgX1E-h6GWTk,518
38
- ipiranga_inovai_project_lib-1.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
39
- ipiranga_inovai_project_lib-1.6.dist-info/top_level.txt,sha256=BD-APH5oIEb_KDXwrfnZiu9QDsD9ttTEkYc32r9thqg,7
40
- ipiranga_inovai_project_lib-1.6.dist-info/RECORD,,
36
+ ipiranga_inovai_project_lib-1.7.dist-info/LICENSE,sha256=UJ3ql8eZec9Y1kER7QSHAuvdgFPuL47asePHYmdzG_o,198
37
+ ipiranga_inovai_project_lib-1.7.dist-info/METADATA,sha256=WvYkLZpN4yupj5FMHwIWNO3wbtDI8CkjXYPhXxGn1eI,518
38
+ ipiranga_inovai_project_lib-1.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
39
+ ipiranga_inovai_project_lib-1.7.dist-info/top_level.txt,sha256=BD-APH5oIEb_KDXwrfnZiu9QDsD9ttTEkYc32r9thqg,7
40
+ ipiranga_inovai_project_lib-1.7.dist-info/RECORD,,