bfocus 0.2.2__tar.gz → 0.2.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bfocus
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: SDK oficial em Python da API pública do bFocus: clientes, produtos, release notes, base de conhecimento e agentes de IA.
5
5
  Project-URL: Homepage, https://bfocus.com.br
6
6
  Project-URL: Repository, https://github.com/bernisoftware/bfocus-python
@@ -421,6 +421,11 @@ class Customers(_Resource):
421
421
  *,
422
422
  name: MaybeUnset[Optional[str]] = UNSET,
423
423
  document: MaybeUnset[Optional[str]] = UNSET,
424
+ kind: MaybeUnset[Optional[str]] = UNSET,
425
+ legal_name: MaybeUnset[Optional[str]] = UNSET,
426
+ state_registration: MaybeUnset[Optional[str]] = UNSET,
427
+ municipal_registration: MaybeUnset[Optional[str]] = UNSET,
428
+ id_document: MaybeUnset[Optional[str]] = UNSET,
424
429
  email: MaybeUnset[Optional[str]] = UNSET,
425
430
  phone: MaybeUnset[Optional[str]] = UNSET,
426
431
  website: MaybeUnset[Optional[str]] = UNSET,
@@ -433,12 +438,22 @@ class Customers(_Resource):
433
438
 
434
439
  ``PUT /customers/{external_id}``. Só os campos informados mudam; ``None`` limpa.
435
440
  ``custom_fields``, quando enviado, **substitui** a lista inteira.
441
+
442
+ ``kind`` é o tipo do CONTRATANTE: ``"pj"`` (empresa) ou ``"pf"`` (pessoa física). Não
443
+ enviando, o bFocus deduz do documento. ``legal_name`` (razão social),
444
+ ``state_registration`` e ``municipal_registration`` são de PJ; ``id_document`` (RG), de
445
+ PF — mandar o do outro tipo não quebra nada, só não faz sentido.
436
446
  """
437
447
  ext = path_segment(external_id, "external_id")
438
448
  body = compact(
439
449
  {
440
450
  "name": name,
441
451
  "document": document,
452
+ "kind": kind,
453
+ "legal_name": legal_name,
454
+ "state_registration": state_registration,
455
+ "municipal_registration": municipal_registration,
456
+ "id_document": id_document,
442
457
  "email": email,
443
458
  "phone": phone,
444
459
  "website": website,
@@ -1,3 +1,3 @@
1
1
  """Versão da SDK. O ``scripts/release-sdks.sh`` bumpa esta linha e o ``pyproject.toml``."""
2
2
 
3
- __version__ = "0.2.2"
3
+ __version__ = "0.2.4"
@@ -167,6 +167,11 @@ class CustomerBatchItem(_CustomerBatchItemRequired, total=False):
167
167
 
168
168
  name: Optional[str]
169
169
  document: Optional[str]
170
+ kind: Optional[Literal["pj", "pf"]]
171
+ legal_name: Optional[str]
172
+ state_registration: Optional[str]
173
+ municipal_registration: Optional[str]
174
+ id_document: Optional[str]
170
175
  email: Optional[str]
171
176
  phone: Optional[str]
172
177
  website: Optional[str]
@@ -221,7 +226,17 @@ class CustomField(TypedDict):
221
226
  class Customer(TypedDict):
222
227
  id: str
223
228
  external_id: str
229
+ #: O nome usado em tudo. Na PJ é o nome fantasia; a razão social fica em ``legal_name``.
224
230
  name: str
231
+ #: Tipo do CONTRATANTE: ``"pj"`` (empresa) ou ``"pf"`` (pessoa física); ``None`` = não dá
232
+ #: para saber. Cliente é a CONTA, não a pessoa: uma conta PF pode ter várias pessoas dentro.
233
+ kind: Optional[Literal["pj", "pf"]]
234
+ #: Só PJ.
235
+ legal_name: Optional[str]
236
+ state_registration: Optional[str]
237
+ municipal_registration: Optional[str]
238
+ #: Só PF: RG e órgão emissor (texto livre — o formato varia por estado).
239
+ id_document: Optional[str]
225
240
  document: Optional[str]
226
241
  email: Optional[str]
227
242
  phone: Optional[str]
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bfocus"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "SDK oficial em Python da API pública do bFocus: clientes, produtos, release notes, base de conhecimento e agentes de IA."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -54,6 +54,11 @@
54
54
  "id": "00000000-0000-4000-8000-000000000001",
55
55
  "external_id": "ERP 1042",
56
56
  "name": "Padaria Estrela",
57
+ "kind": null,
58
+ "legal_name": null,
59
+ "state_registration": null,
60
+ "municipal_registration": null,
61
+ "id_document": null,
57
62
  "document": null,
58
63
  "email": "contato@padaria.example",
59
64
  "phone": null,
@@ -85,6 +90,11 @@
85
90
  "id": "00000000-0000-4000-8000-000000000001",
86
91
  "external_id": "ERP 1042",
87
92
  "name": "Padaria Estrela",
93
+ "kind": null,
94
+ "legal_name": null,
95
+ "state_registration": null,
96
+ "municipal_registration": null,
97
+ "id_document": null,
88
98
  "document": null,
89
99
  "email": "contato@padaria.example",
90
100
  "phone": null,
@@ -108,6 +118,188 @@
108
118
  }
109
119
  }
110
120
  },
121
+ {
122
+ "id": "customers.upsert/pj_fields",
123
+ "op": "customers.upsert",
124
+ "args": {
125
+ "external_id": "ERP 1042",
126
+ "kind": "pj",
127
+ "name": "Padaria Estrela",
128
+ "legal_name": "Estrela Panificação e Comércio Ltda",
129
+ "document": "12345678000190",
130
+ "state_registration": "ISENTO",
131
+ "municipal_registration": "1.234.567-8"
132
+ },
133
+ "exchanges": [
134
+ {
135
+ "retry": false,
136
+ "request": {
137
+ "method": "PUT",
138
+ "path": "/api/v1/integration/customers/ERP%201042",
139
+ "query": {},
140
+ "body": {
141
+ "kind": "pj",
142
+ "name": "Padaria Estrela",
143
+ "legal_name": "Estrela Panificação e Comércio Ltda",
144
+ "document": "12345678000190",
145
+ "state_registration": "ISENTO",
146
+ "municipal_registration": "1.234.567-8"
147
+ }
148
+ },
149
+ "response": {
150
+ "status": 200,
151
+ "headers": {},
152
+ "body": {
153
+ "code": 200,
154
+ "data": {
155
+ "id": "00000000-0000-4000-8000-000000000001",
156
+ "external_id": "ERP 1042",
157
+ "name": "Padaria Estrela",
158
+ "kind": "pj",
159
+ "legal_name": "Estrela Panificação e Comércio Ltda",
160
+ "state_registration": "ISENTO",
161
+ "municipal_registration": "1.234.567-8",
162
+ "id_document": null,
163
+ "document": "12345678000190",
164
+ "email": "contato@padaria.example",
165
+ "phone": null,
166
+ "website": null,
167
+ "notes": null,
168
+ "custom_fields": [
169
+ {
170
+ "key": "plano",
171
+ "label": "Plano",
172
+ "type": "text",
173
+ "value": "ouro",
174
+ "visibility": "interno"
175
+ }
176
+ ],
177
+ "is_active": true,
178
+ "logo_url": null,
179
+ "extra_emails": [],
180
+ "extra_phones": [],
181
+ "created_at": "2026-09-13T12:00:00+00:00",
182
+ "updated_at": "2026-09-13T12:00:00+00:00"
183
+ },
184
+ "message": "Executado com sucesso"
185
+ }
186
+ }
187
+ }
188
+ ],
189
+ "expect": {
190
+ "result": {
191
+ "id": "00000000-0000-4000-8000-000000000001",
192
+ "external_id": "ERP 1042",
193
+ "name": "Padaria Estrela",
194
+ "kind": "pj",
195
+ "legal_name": "Estrela Panificação e Comércio Ltda",
196
+ "state_registration": "ISENTO",
197
+ "municipal_registration": "1.234.567-8",
198
+ "id_document": null,
199
+ "document": "12345678000190",
200
+ "email": "contato@padaria.example",
201
+ "phone": null,
202
+ "website": null,
203
+ "notes": null,
204
+ "custom_fields": [
205
+ {
206
+ "key": "plano",
207
+ "label": "Plano",
208
+ "type": "text",
209
+ "value": "ouro",
210
+ "visibility": "interno"
211
+ }
212
+ ],
213
+ "is_active": true,
214
+ "logo_url": null,
215
+ "extra_emails": [],
216
+ "extra_phones": [],
217
+ "created_at": "2026-09-13T12:00:00+00:00",
218
+ "updated_at": "2026-09-13T12:00:00+00:00"
219
+ }
220
+ }
221
+ },
222
+ {
223
+ "id": "customers.upsert/pf_fields",
224
+ "op": "customers.upsert",
225
+ "args": {
226
+ "external_id": "ERP 2001",
227
+ "kind": "pf",
228
+ "name": "João da Silva",
229
+ "document": "52998224725",
230
+ "id_document": "MG-12.345.678 SSP/MG"
231
+ },
232
+ "exchanges": [
233
+ {
234
+ "retry": false,
235
+ "request": {
236
+ "method": "PUT",
237
+ "path": "/api/v1/integration/customers/ERP%202001",
238
+ "query": {},
239
+ "body": {
240
+ "kind": "pf",
241
+ "name": "João da Silva",
242
+ "document": "52998224725",
243
+ "id_document": "MG-12.345.678 SSP/MG"
244
+ }
245
+ },
246
+ "response": {
247
+ "status": 201,
248
+ "headers": {},
249
+ "body": {
250
+ "code": 201,
251
+ "data": {
252
+ "id": "00000000-0000-4000-8000-000000000003",
253
+ "external_id": "ERP 2001",
254
+ "name": "João da Silva",
255
+ "kind": "pf",
256
+ "legal_name": null,
257
+ "state_registration": null,
258
+ "municipal_registration": null,
259
+ "id_document": "MG-12.345.678 SSP/MG",
260
+ "document": "52998224725",
261
+ "email": "contato@padaria.example",
262
+ "phone": null,
263
+ "website": null,
264
+ "notes": null,
265
+ "custom_fields": [],
266
+ "is_active": true,
267
+ "logo_url": null,
268
+ "extra_emails": [],
269
+ "extra_phones": [],
270
+ "created_at": "2026-09-13T12:00:00+00:00",
271
+ "updated_at": "2026-09-13T12:00:00+00:00"
272
+ },
273
+ "message": "Executado com sucesso"
274
+ }
275
+ }
276
+ }
277
+ ],
278
+ "expect": {
279
+ "result": {
280
+ "id": "00000000-0000-4000-8000-000000000003",
281
+ "external_id": "ERP 2001",
282
+ "name": "João da Silva",
283
+ "kind": "pf",
284
+ "legal_name": null,
285
+ "state_registration": null,
286
+ "municipal_registration": null,
287
+ "id_document": "MG-12.345.678 SSP/MG",
288
+ "document": "52998224725",
289
+ "email": "contato@padaria.example",
290
+ "phone": null,
291
+ "website": null,
292
+ "notes": null,
293
+ "custom_fields": [],
294
+ "is_active": true,
295
+ "logo_url": null,
296
+ "extra_emails": [],
297
+ "extra_phones": [],
298
+ "created_at": "2026-09-13T12:00:00+00:00",
299
+ "updated_at": "2026-09-13T12:00:00+00:00"
300
+ }
301
+ }
302
+ },
111
303
  {
112
304
  "id": "customers.upsert/null_clears_field",
113
305
  "op": "customers.upsert",
@@ -135,6 +327,11 @@
135
327
  "id": "00000000-0000-4000-8000-000000000001",
136
328
  "external_id": "ERP 1042",
137
329
  "name": "Padaria Estrela",
330
+ "kind": null,
331
+ "legal_name": null,
332
+ "state_registration": null,
333
+ "municipal_registration": null,
334
+ "id_document": null,
138
335
  "document": null,
139
336
  "email": "contato@padaria.example",
140
337
  "phone": null,
@@ -166,6 +363,11 @@
166
363
  "id": "00000000-0000-4000-8000-000000000001",
167
364
  "external_id": "ERP 1042",
168
365
  "name": "Padaria Estrela",
366
+ "kind": null,
367
+ "legal_name": null,
368
+ "state_registration": null,
369
+ "municipal_registration": null,
370
+ "id_document": null,
169
371
  "document": null,
170
372
  "email": "contato@padaria.example",
171
373
  "phone": null,
@@ -213,6 +415,11 @@
213
415
  "id": "00000000-0000-4000-8000-000000000001",
214
416
  "external_id": "ERP 1042",
215
417
  "name": "Padaria Estrela",
418
+ "kind": null,
419
+ "legal_name": null,
420
+ "state_registration": null,
421
+ "municipal_registration": null,
422
+ "id_document": null,
216
423
  "document": null,
217
424
  "email": "contato@padaria.example",
218
425
  "phone": null,
@@ -244,6 +451,11 @@
244
451
  "id": "00000000-0000-4000-8000-000000000001",
245
452
  "external_id": "ERP 1042",
246
453
  "name": "Padaria Estrela",
454
+ "kind": null,
455
+ "legal_name": null,
456
+ "state_registration": null,
457
+ "municipal_registration": null,
458
+ "id_document": null,
247
459
  "document": null,
248
460
  "email": "contato@padaria.example",
249
461
  "phone": null,
@@ -338,6 +550,11 @@
338
550
  "id": "00000000-0000-4000-8000-000000000002",
339
551
  "external_id": "ERP 1043",
340
552
  "name": "Mercado Sol",
553
+ "kind": null,
554
+ "legal_name": null,
555
+ "state_registration": null,
556
+ "municipal_registration": null,
557
+ "id_document": null,
341
558
  "document": null,
342
559
  "email": "contato@padaria.example",
343
560
  "phone": null,
@@ -370,6 +587,11 @@
370
587
  "id": "00000000-0000-4000-8000-000000000002",
371
588
  "external_id": "ERP 1043",
372
589
  "name": "Mercado Sol",
590
+ "kind": null,
591
+ "legal_name": null,
592
+ "state_registration": null,
593
+ "municipal_registration": null,
594
+ "id_document": null,
373
595
  "document": null,
374
596
  "email": "contato@padaria.example",
375
597
  "phone": null,
@@ -419,6 +641,11 @@
419
641
  "id": "00000000-0000-4000-8000-000000000001",
420
642
  "external_id": "ERP 1042",
421
643
  "name": "Padaria Estrela",
644
+ "kind": null,
645
+ "legal_name": null,
646
+ "state_registration": null,
647
+ "municipal_registration": null,
648
+ "id_document": null,
422
649
  "document": null,
423
650
  "email": "contato@padaria.example",
424
651
  "phone": null,
@@ -472,6 +699,11 @@
472
699
  "id": "00000000-0000-4000-8000-000000000002",
473
700
  "external_id": "ERP 1043",
474
701
  "name": "Mercado Sol",
702
+ "kind": null,
703
+ "legal_name": null,
704
+ "state_registration": null,
705
+ "municipal_registration": null,
706
+ "id_document": null,
475
707
  "document": null,
476
708
  "email": "contato@padaria.example",
477
709
  "phone": null,
@@ -503,6 +735,11 @@
503
735
  "id": "00000000-0000-4000-8000-000000000001",
504
736
  "external_id": "ERP 1042",
505
737
  "name": "Padaria Estrela",
738
+ "kind": null,
739
+ "legal_name": null,
740
+ "state_registration": null,
741
+ "municipal_registration": null,
742
+ "id_document": null,
506
743
  "document": null,
507
744
  "email": "contato@padaria.example",
508
745
  "phone": null,
@@ -528,6 +765,11 @@
528
765
  "id": "00000000-0000-4000-8000-000000000002",
529
766
  "external_id": "ERP 1043",
530
767
  "name": "Mercado Sol",
768
+ "kind": null,
769
+ "legal_name": null,
770
+ "state_registration": null,
771
+ "municipal_registration": null,
772
+ "id_document": null,
531
773
  "document": null,
532
774
  "email": "contato@padaria.example",
533
775
  "phone": null,
@@ -1559,6 +1801,120 @@
1559
1801
  }
1560
1802
  }
1561
1803
  },
1804
+ {
1805
+ "id": "customers.batch/typed_fields",
1806
+ "op": "customers.batch",
1807
+ "args": {
1808
+ "items": [
1809
+ {
1810
+ "external_id": "ERP 1042",
1811
+ "kind": "pj",
1812
+ "legal_name": "Estrela Panificação e Comércio Ltda",
1813
+ "state_registration": "ISENTO",
1814
+ "municipal_registration": "1.234.567-8"
1815
+ },
1816
+ {
1817
+ "external_id": "ERP 2001",
1818
+ "kind": "pf",
1819
+ "name": "João da Silva",
1820
+ "id_document": "MG-12.345.678 SSP/MG"
1821
+ }
1822
+ ]
1823
+ },
1824
+ "exchanges": [
1825
+ {
1826
+ "retry": false,
1827
+ "request": {
1828
+ "method": "POST",
1829
+ "path": "/api/v1/integration/customers/batch",
1830
+ "query": {},
1831
+ "body": {
1832
+ "items": [
1833
+ {
1834
+ "external_id": "ERP 1042",
1835
+ "kind": "pj",
1836
+ "legal_name": "Estrela Panificação e Comércio Ltda",
1837
+ "state_registration": "ISENTO",
1838
+ "municipal_registration": "1.234.567-8"
1839
+ },
1840
+ {
1841
+ "external_id": "ERP 2001",
1842
+ "kind": "pf",
1843
+ "name": "João da Silva",
1844
+ "id_document": "MG-12.345.678 SSP/MG"
1845
+ }
1846
+ ]
1847
+ }
1848
+ },
1849
+ "response": {
1850
+ "status": 200,
1851
+ "headers": {},
1852
+ "body": {
1853
+ "code": 200,
1854
+ "data": {
1855
+ "results": [
1856
+ {
1857
+ "index": 0,
1858
+ "status": "updated",
1859
+ "external_id": "ERP 1042",
1860
+ "merged_into": null,
1861
+ "linked": false,
1862
+ "error": null,
1863
+ "code": null
1864
+ },
1865
+ {
1866
+ "index": 1,
1867
+ "status": "created",
1868
+ "external_id": "ERP 2001",
1869
+ "merged_into": null,
1870
+ "linked": false,
1871
+ "error": null,
1872
+ "code": null
1873
+ }
1874
+ ],
1875
+ "summary": {
1876
+ "created": 1,
1877
+ "updated": 1,
1878
+ "unchanged": 0,
1879
+ "error": 0
1880
+ }
1881
+ },
1882
+ "message": "Executado com sucesso"
1883
+ }
1884
+ }
1885
+ }
1886
+ ],
1887
+ "expect": {
1888
+ "result": {
1889
+ "results": [
1890
+ {
1891
+ "index": 0,
1892
+ "status": "updated",
1893
+ "external_id": "ERP 1042",
1894
+ "merged_into": null,
1895
+ "linked": false,
1896
+ "error": null,
1897
+ "code": null
1898
+ },
1899
+ {
1900
+ "index": 1,
1901
+ "status": "created",
1902
+ "external_id": "ERP 2001",
1903
+ "merged_into": null,
1904
+ "linked": false,
1905
+ "error": null,
1906
+ "code": null
1907
+ }
1908
+ ],
1909
+ "summary": {
1910
+ "created": 1,
1911
+ "updated": 1,
1912
+ "unchanged": 0,
1913
+ "error": 0
1914
+ }
1915
+ }
1916
+ }
1917
+ },
1562
1918
  {
1563
1919
  "id": "people.batch/partial_failure",
1564
1920
  "op": "people.batch",
@@ -1722,6 +2078,11 @@
1722
2078
  "id": "00000000-0000-4000-8000-000000000001",
1723
2079
  "external_id": "ERP 1042",
1724
2080
  "name": "Padaria Estrela",
2081
+ "kind": null,
2082
+ "legal_name": null,
2083
+ "state_registration": null,
2084
+ "municipal_registration": null,
2085
+ "id_document": null,
1725
2086
  "document": null,
1726
2087
  "email": "contato@padaria.example",
1727
2088
  "phone": null,
@@ -1760,6 +2121,11 @@
1760
2121
  "id": "00000000-0000-4000-8000-000000000001",
1761
2122
  "external_id": "ERP 1042",
1762
2123
  "name": "Padaria Estrela",
2124
+ "kind": null,
2125
+ "legal_name": null,
2126
+ "state_registration": null,
2127
+ "municipal_registration": null,
2128
+ "id_document": null,
1763
2129
  "document": null,
1764
2130
  "email": "contato@padaria.example",
1765
2131
  "phone": null,
@@ -1861,6 +2227,11 @@
1861
2227
  "id": "00000000-0000-4000-8000-000000000001",
1862
2228
  "external_id": "ERP 1042",
1863
2229
  "name": "Padaria Estrela",
2230
+ "kind": null,
2231
+ "legal_name": null,
2232
+ "state_registration": null,
2233
+ "municipal_registration": null,
2234
+ "id_document": null,
1864
2235
  "document": null,
1865
2236
  "email": "contato@padaria.example",
1866
2237
  "phone": null,
@@ -1893,6 +2264,11 @@
1893
2264
  "id": "00000000-0000-4000-8000-000000000001",
1894
2265
  "external_id": "ERP 1042",
1895
2266
  "name": "Padaria Estrela",
2267
+ "kind": null,
2268
+ "legal_name": null,
2269
+ "state_registration": null,
2270
+ "municipal_registration": null,
2271
+ "id_document": null,
1896
2272
  "document": null,
1897
2273
  "email": "contato@padaria.example",
1898
2274
  "phone": null,
@@ -3657,6 +4033,11 @@
3657
4033
  "id": "00000000-0000-4000-8000-000000000001",
3658
4034
  "external_id": "ERP 1042",
3659
4035
  "name": "Padaria Estrela",
4036
+ "kind": null,
4037
+ "legal_name": null,
4038
+ "state_registration": null,
4039
+ "municipal_registration": null,
4040
+ "id_document": null,
3660
4041
  "document": null,
3661
4042
  "email": "contato@padaria.example",
3662
4043
  "phone": null,
@@ -3688,6 +4069,11 @@
3688
4069
  "id": "00000000-0000-4000-8000-000000000001",
3689
4070
  "external_id": "ERP 1042",
3690
4071
  "name": "Padaria Estrela",
4072
+ "kind": null,
4073
+ "legal_name": null,
4074
+ "state_registration": null,
4075
+ "municipal_registration": null,
4076
+ "id_document": null,
3691
4077
  "document": null,
3692
4078
  "email": "contato@padaria.example",
3693
4079
  "phone": null,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes