convexity-sdk 0.21.0.dev373__tar.gz → 0.21.0.dev375__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.
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/PKG-INFO +1 -1
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/logistics.py +0 -2
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/purchasing.py +11 -12
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/sales.py +8 -14
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/warehouses.py +6 -6
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/crm/004_manage_sales_reps.py +1 -1
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/005_manage_sales_orders.py +1 -1
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/007_price_list_sales_order.py +1 -1
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/uci/003_seed_sales_from_uci.py +1 -2
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/.gitignore +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/README.md +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/__init__.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/client.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/config.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/exceptions.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/http.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/models/__init__.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/__init__.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/address_book.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/analytics.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/api_keys.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/attributes.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/categories.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/classification.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/connections.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/cost_lists.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/crm.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/dashboards.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/datasets.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/email.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/environments.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/erp_config.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/imports.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/inventory.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/issues.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/olap.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/organization_invitations.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/organizations.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/pricing.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/projects.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/rbac.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/replenishment.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/runs.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/sales_channels.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/tasks.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/templates.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/usage.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/worker_tasks.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/workspace.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/pyproject.toml +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/.env.example +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/README.md +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/cancel_refresh_task.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/compare_api_key_scopes.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_csv_datasets.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_dashboards.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_databricks_connections.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_datasets.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_forecast_task.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_org_and_project.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_single_project_api_key.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/crm/001_check_crm_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/crm/002_enable_crm.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/crm/003_manage_customers.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/crm/004_disable_crm.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/getting_started.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/001_check_inventory_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/002_enable_inventory.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/003_manage_inventory_items.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/004_manage_inventory_stock.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/005_disable_inventory.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/006_manage_categories.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/007_manage_inventory_config.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/008_manage_cost_lists.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/009_list_location_items.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/010_list_item_warehouse_locations.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/inventory/011_assign_item_location.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/list_orgs_and_projects.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/manage_environments.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/manage_issues.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/project_usage.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/purchasing/001_check_purchasing_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/purchasing/002_enable_purchasing.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/purchasing/003_manage_vendors.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/purchasing/004_manage_purchase_orders.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/purchasing/005_disable_purchasing.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/query_olap.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/quickbook/001_check_quickbook_connection.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/quickbook/002_create_quickbook_datasets.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/rbac/001_manage_roles.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/rbac/002_manage_assignments.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/rbac/003_verify_rbac_access.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/001_check_sales_enabled.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/002_enable_sales.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/003_manage_sales_invoices.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/004_manage_sales_invoice_lifecycle.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/006_disable_sales.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/007_manage_customers.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/008_manage_dropship_fulfillment.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/share_dashboard.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/shopify/001_check_shopify_connection.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/shopify/002_create_shopify_datasets.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/uci/001_setup.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/uci/002_seed_inventory_from_uci.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/uci/004_seed_purchasing_from_uci.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/uci/005_run_pipelines.py +0 -0
- {convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/workspace_files.py +0 -0
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/logistics.py
RENAMED
|
@@ -58,7 +58,6 @@ class Logistics:
|
|
|
58
58
|
self,
|
|
59
59
|
*,
|
|
60
60
|
project_id: str,
|
|
61
|
-
shipment_number: str,
|
|
62
61
|
to_address_id: str,
|
|
63
62
|
lines: list[CreateShipmentLineRequest | dict[str, Any]],
|
|
64
63
|
carrier: str | None = None,
|
|
@@ -70,7 +69,6 @@ class Logistics:
|
|
|
70
69
|
) -> ShipmentResponse:
|
|
71
70
|
"""Create an originless direct shipment to the sales-order customer."""
|
|
72
71
|
body = CreateShipmentRequest(
|
|
73
|
-
shipment_number=shipment_number,
|
|
74
72
|
to_address_id=to_address_id,
|
|
75
73
|
lines=_shipment_lines(lines),
|
|
76
74
|
direction=ShipmentDirection.DIRECT_DROPSHIP,
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/purchasing.py
RENAMED
|
@@ -45,6 +45,7 @@ from convexity_api_client.models.batch_delete_purchase_orders_request import Bat
|
|
|
45
45
|
from convexity_api_client.models.batch_delete_purchase_orders_response import BatchDeletePurchaseOrdersResponse
|
|
46
46
|
from convexity_api_client.models.batch_delete_vendors_request import BatchDeleteVendorsRequest
|
|
47
47
|
from convexity_api_client.models.batch_delete_vendors_response import BatchDeleteVendorsResponse
|
|
48
|
+
from convexity_api_client.models.bulk_create_purchase_order_payload import BulkCreatePurchaseOrderPayload
|
|
48
49
|
from convexity_api_client.models.bulk_create_purchase_orders_request import BulkCreatePurchaseOrdersRequest
|
|
49
50
|
from convexity_api_client.models.bulk_create_purchase_orders_response import BulkCreatePurchaseOrdersResponse
|
|
50
51
|
from convexity_api_client.models.bulk_upsert_item_sourcing_request import BulkUpsertItemSourcingRequest
|
|
@@ -52,6 +53,7 @@ from convexity_api_client.models.bulk_upsert_item_sourcing_response import BulkU
|
|
|
52
53
|
from convexity_api_client.models.bulk_upsert_purchase_order_payload import BulkUpsertPurchaseOrderPayload
|
|
53
54
|
from convexity_api_client.models.bulk_upsert_purchase_orders_request import BulkUpsertPurchaseOrdersRequest
|
|
54
55
|
from convexity_api_client.models.bulk_upsert_purchase_orders_response import BulkUpsertPurchaseOrdersResponse
|
|
56
|
+
from convexity_api_client.models.bulk_upsert_purchase_return_payload import BulkUpsertPurchaseReturnPayload
|
|
55
57
|
from convexity_api_client.models.bulk_upsert_purchase_returns_request import (
|
|
56
58
|
BulkUpsertPurchaseReturnsRequest,
|
|
57
59
|
)
|
|
@@ -68,7 +70,6 @@ from convexity_api_client.models.cancel_purchase_order_request import CancelPurc
|
|
|
68
70
|
from convexity_api_client.models.canonical_status import CanonicalStatus
|
|
69
71
|
from convexity_api_client.models.create_item_sourcing_request import CreateItemSourcingRequest
|
|
70
72
|
from convexity_api_client.models.create_purchase_order_request import CreatePurchaseOrderRequest
|
|
71
|
-
from convexity_api_client.models.create_purchase_return_request import CreatePurchaseReturnRequest
|
|
72
73
|
from convexity_api_client.models.create_vendor_request import CreateVendorRequest
|
|
73
74
|
from convexity_api_client.models.item_sourcing_response import ItemSourcingResponse
|
|
74
75
|
from convexity_api_client.models.list_purchase_orders_response import ListPurchaseOrdersResponse
|
|
@@ -128,12 +129,12 @@ def _po_lines(lines: list[PurchaseOrderLineRequest | dict[str, Any]]) -> list[Pu
|
|
|
128
129
|
return [line if isinstance(line, PurchaseOrderLineRequest) else PurchaseOrderLineRequest(**line) for line in lines]
|
|
129
130
|
|
|
130
131
|
|
|
131
|
-
def _po_request(purchase_order:
|
|
132
|
-
if isinstance(purchase_order,
|
|
132
|
+
def _po_request(purchase_order: BulkCreatePurchaseOrderPayload | dict[str, Any]) -> BulkCreatePurchaseOrderPayload:
|
|
133
|
+
if isinstance(purchase_order, BulkCreatePurchaseOrderPayload):
|
|
133
134
|
return purchase_order
|
|
134
135
|
data = dict(purchase_order)
|
|
135
136
|
data["lines"] = _po_lines(data.get("lines") or [])
|
|
136
|
-
return
|
|
137
|
+
return BulkCreatePurchaseOrderPayload(**data)
|
|
137
138
|
|
|
138
139
|
|
|
139
140
|
def _bulk_po_payload(
|
|
@@ -145,9 +146,9 @@ def _bulk_po_payload(
|
|
|
145
146
|
|
|
146
147
|
|
|
147
148
|
def _purchase_return_payload(
|
|
148
|
-
purchase_return:
|
|
149
|
-
) ->
|
|
150
|
-
if isinstance(purchase_return,
|
|
149
|
+
purchase_return: BulkUpsertPurchaseReturnPayload | dict[str, Any],
|
|
150
|
+
) -> BulkUpsertPurchaseReturnPayload:
|
|
151
|
+
if isinstance(purchase_return, BulkUpsertPurchaseReturnPayload):
|
|
151
152
|
return purchase_return
|
|
152
153
|
serialized = dict(purchase_return)
|
|
153
154
|
for field in ("shipped_at", "credit_received_at"):
|
|
@@ -159,7 +160,7 @@ def _purchase_return_payload(
|
|
|
159
160
|
serialized["lifecycle_status"] = getattr(
|
|
160
161
|
lifecycle_status, "value", lifecycle_status
|
|
161
162
|
)
|
|
162
|
-
return
|
|
163
|
+
return BulkUpsertPurchaseReturnPayload.from_dict(serialized)
|
|
163
164
|
|
|
164
165
|
|
|
165
166
|
def _receive_lines(lines: list[ReceiveLineRequest | dict[str, Any]]) -> list[ReceiveLineRequest]:
|
|
@@ -457,7 +458,6 @@ class Purchasing:
|
|
|
457
458
|
self,
|
|
458
459
|
*,
|
|
459
460
|
project_id: str,
|
|
460
|
-
po_number: str,
|
|
461
461
|
vendor_id: str,
|
|
462
462
|
lines: list[PurchaseOrderLineRequest | dict[str, Any]],
|
|
463
463
|
currency: str = "USD",
|
|
@@ -467,7 +467,6 @@ class Purchasing:
|
|
|
467
467
|
) -> PurchaseOrderResponse:
|
|
468
468
|
"""Create a purchase order with one or more lines."""
|
|
469
469
|
body = CreatePurchaseOrderRequest(
|
|
470
|
-
po_number=po_number,
|
|
471
470
|
vendor_id=vendor_id,
|
|
472
471
|
lines=_po_lines(lines),
|
|
473
472
|
currency=currency,
|
|
@@ -508,7 +507,7 @@ class Purchasing:
|
|
|
508
507
|
self,
|
|
509
508
|
*,
|
|
510
509
|
project_id: str,
|
|
511
|
-
purchase_orders: list[
|
|
510
|
+
purchase_orders: list[BulkCreatePurchaseOrderPayload | dict[str, Any]],
|
|
512
511
|
) -> BulkCreatePurchaseOrdersResponse:
|
|
513
512
|
"""Create multiple purchase orders in one request."""
|
|
514
513
|
body = BulkCreatePurchaseOrdersRequest(purchase_orders=[_po_request(purchase_order) for purchase_order in purchase_orders])
|
|
@@ -543,7 +542,7 @@ class Purchasing:
|
|
|
543
542
|
self,
|
|
544
543
|
*,
|
|
545
544
|
project_id: str,
|
|
546
|
-
returns: list[
|
|
545
|
+
returns: list[BulkUpsertPurchaseReturnPayload | dict[str, Any]],
|
|
547
546
|
) -> BulkUpsertPurchaseReturnsResponse:
|
|
548
547
|
"""Import complete return-to-vendor snapshots by return number."""
|
|
549
548
|
body = BulkUpsertPurchaseReturnsRequest(
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/sales.py
RENAMED
|
@@ -44,6 +44,7 @@ from convexity_api_client.models.bulk_upsert_sales_invoices_response import Bulk
|
|
|
44
44
|
from convexity_api_client.models.bulk_upsert_sales_order_payload import BulkUpsertSalesOrderPayload
|
|
45
45
|
from convexity_api_client.models.bulk_upsert_sales_orders_request import BulkUpsertSalesOrdersRequest
|
|
46
46
|
from convexity_api_client.models.bulk_upsert_sales_orders_response import BulkUpsertSalesOrdersResponse
|
|
47
|
+
from convexity_api_client.models.bulk_upsert_sales_return_payload import BulkUpsertSalesReturnPayload
|
|
47
48
|
from convexity_api_client.models.bulk_upsert_sales_returns_request import BulkUpsertSalesReturnsRequest
|
|
48
49
|
from convexity_api_client.models.bulk_upsert_sales_returns_response import BulkUpsertSalesReturnsResponse
|
|
49
50
|
from convexity_api_client.models.cancel_sales_invoice_request import CancelSalesInvoiceRequest
|
|
@@ -54,7 +55,6 @@ from convexity_api_client.models.create_invoice_from_sales_order_request import
|
|
|
54
55
|
from convexity_api_client.models.create_sales_invoice_request import CreateSalesInvoiceRequest
|
|
55
56
|
from convexity_api_client.models.create_sales_order_line_request import CreateSalesOrderLineRequest
|
|
56
57
|
from convexity_api_client.models.create_sales_order_request import CreateSalesOrderRequest
|
|
57
|
-
from convexity_api_client.models.create_sales_return_request import CreateSalesReturnRequest
|
|
58
58
|
from convexity_api_client.models.dropship_fulfillment_source_request import DropshipFulfillmentSourceRequest
|
|
59
59
|
from convexity_api_client.models.list_sales_invoices_response import ListSalesInvoicesResponse
|
|
60
60
|
from convexity_api_client.models.list_sales_orders_response import ListSalesOrdersResponse
|
|
@@ -125,9 +125,9 @@ def _create_sales_invoice_payload(
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
def _bulk_sales_return_payload(
|
|
128
|
-
payload:
|
|
129
|
-
) ->
|
|
130
|
-
return payload if isinstance(payload,
|
|
128
|
+
payload: BulkUpsertSalesReturnPayload | dict[str, Any],
|
|
129
|
+
) -> BulkUpsertSalesReturnPayload:
|
|
130
|
+
return payload if isinstance(payload, BulkUpsertSalesReturnPayload) else BulkUpsertSalesReturnPayload.from_dict(payload)
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
def _update_sales_invoice_payload(
|
|
@@ -218,7 +218,6 @@ class Sales:
|
|
|
218
218
|
self,
|
|
219
219
|
*,
|
|
220
220
|
project_id: str,
|
|
221
|
-
invoice_number: str,
|
|
222
221
|
issue_date: datetime,
|
|
223
222
|
due_date: datetime,
|
|
224
223
|
lines: list[SalesInvoiceLineRequest | dict[str, Any]],
|
|
@@ -241,7 +240,6 @@ class Sales:
|
|
|
241
240
|
snapshot. ``uom_id`` on a line participates in rule matching.
|
|
242
241
|
"""
|
|
243
242
|
body = CreateSalesInvoiceRequest(
|
|
244
|
-
invoice_number=invoice_number,
|
|
245
243
|
issue_date=issue_date,
|
|
246
244
|
due_date=due_date,
|
|
247
245
|
lines=_invoice_lines(lines),
|
|
@@ -334,7 +332,6 @@ class Sales:
|
|
|
334
332
|
order_id: str,
|
|
335
333
|
*,
|
|
336
334
|
project_id: str,
|
|
337
|
-
invoice_number: str,
|
|
338
335
|
issue_date: datetime,
|
|
339
336
|
due_date: datetime,
|
|
340
337
|
customer_id: str | None = None,
|
|
@@ -353,7 +350,6 @@ class Sales:
|
|
|
353
350
|
unit price. Overridden lines are recorded as manual snapshots.
|
|
354
351
|
"""
|
|
355
352
|
body = CreateInvoiceFromSalesOrderRequest(
|
|
356
|
-
invoice_number=invoice_number,
|
|
357
353
|
issue_date=issue_date,
|
|
358
354
|
due_date=due_date,
|
|
359
355
|
customer_id=_optional(customer_id),
|
|
@@ -379,7 +375,6 @@ class Sales:
|
|
|
379
375
|
packing_slip_id: str,
|
|
380
376
|
*,
|
|
381
377
|
project_id: str,
|
|
382
|
-
invoice_number: str,
|
|
383
378
|
issue_date: datetime,
|
|
384
379
|
due_date: datetime,
|
|
385
380
|
customer_id: str | None = None,
|
|
@@ -398,7 +393,6 @@ class Sales:
|
|
|
398
393
|
unit price. Overridden lines are recorded as manual snapshots.
|
|
399
394
|
"""
|
|
400
395
|
body = CreateInvoiceFromPackingSlipRequest(
|
|
401
|
-
invoice_number=invoice_number,
|
|
402
396
|
issue_date=issue_date,
|
|
403
397
|
due_date=due_date,
|
|
404
398
|
customer_id=_optional(customer_id),
|
|
@@ -562,7 +556,6 @@ class Sales:
|
|
|
562
556
|
self,
|
|
563
557
|
*,
|
|
564
558
|
project_id: str,
|
|
565
|
-
so_number: str,
|
|
566
559
|
lines: list[CreateSalesOrderLineRequest | dict[str, Any]] | None = None,
|
|
567
560
|
customer_id: str | None = None,
|
|
568
561
|
sales_rep_id: str | None = None,
|
|
@@ -581,9 +574,10 @@ class Sales:
|
|
|
581
574
|
Omit ``price_list_id`` to use customer, channel, and project defaults.
|
|
582
575
|
A line without ``unit_price`` resolves from the selected list; a line
|
|
583
576
|
with ``unit_price`` is an intentional manual override.
|
|
577
|
+
``external_id`` is optional for internal drafts and identifies
|
|
578
|
+
replayable source records when supplied.
|
|
584
579
|
"""
|
|
585
580
|
body = CreateSalesOrderRequest(
|
|
586
|
-
so_number=so_number,
|
|
587
581
|
customer_id=_optional(customer_id),
|
|
588
582
|
sales_rep_id=_optional(sales_rep_id),
|
|
589
583
|
commission_rate_snapshot=commission_rate_snapshot,
|
|
@@ -606,7 +600,7 @@ class Sales:
|
|
|
606
600
|
project_id: str,
|
|
607
601
|
orders: list[BulkUpsertSalesOrderPayload | dict[str, Any]],
|
|
608
602
|
) -> BulkUpsertSalesOrdersResponse:
|
|
609
|
-
"""Bulk upsert sales orders by
|
|
603
|
+
"""Bulk upsert sales orders by external source and external ID."""
|
|
610
604
|
body = BulkUpsertSalesOrdersRequest(orders=[_bulk_sales_order_payload(order) for order in orders])
|
|
611
605
|
result = _bulk_upsert_orders.sync(client=self._client, body=body, project_id=project_id)
|
|
612
606
|
return _expect_response(result, BulkUpsertSalesOrdersResponse, "bulk upserting sales orders")
|
|
@@ -615,7 +609,7 @@ class Sales:
|
|
|
615
609
|
self,
|
|
616
610
|
*,
|
|
617
611
|
project_id: str,
|
|
618
|
-
returns: list[
|
|
612
|
+
returns: list[BulkUpsertSalesReturnPayload | dict[str, Any]],
|
|
619
613
|
) -> BulkUpsertSalesReturnsResponse:
|
|
620
614
|
"""Bulk upsert complete sales-return snapshots by RMA number."""
|
|
621
615
|
body = BulkUpsertSalesReturnsRequest(returns=[_bulk_sales_return_payload(item) for item in returns])
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/warehouses.py
RENAMED
|
@@ -34,13 +34,13 @@ from convexity_api_client.api.v1 import (
|
|
|
34
34
|
from convexity_api_client.models.assign_inventory_item_location_request import (
|
|
35
35
|
AssignInventoryItemLocationRequest,
|
|
36
36
|
)
|
|
37
|
+
from convexity_api_client.models.bulk_upsert_goods_receipt_payload import BulkUpsertGoodsReceiptPayload
|
|
37
38
|
from convexity_api_client.models.bulk_upsert_goods_receipts_request import (
|
|
38
39
|
BulkUpsertGoodsReceiptsRequest,
|
|
39
40
|
)
|
|
40
41
|
from convexity_api_client.models.bulk_upsert_goods_receipts_response import (
|
|
41
42
|
BulkUpsertGoodsReceiptsResponse,
|
|
42
43
|
)
|
|
43
|
-
from convexity_api_client.models.create_goods_receipt_request import CreateGoodsReceiptRequest
|
|
44
44
|
from convexity_api_client.models.create_warehouse_location_request import CreateWarehouseLocationRequest
|
|
45
45
|
from convexity_api_client.models.create_warehouse_request import CreateWarehouseRequest
|
|
46
46
|
from convexity_api_client.models.inventory_item_location_assignment_response import (
|
|
@@ -80,9 +80,9 @@ def _optional(value: Any | None) -> Any | Unset:
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
def _goods_receipt_payload(
|
|
83
|
-
value:
|
|
84
|
-
) ->
|
|
85
|
-
if isinstance(value,
|
|
83
|
+
value: BulkUpsertGoodsReceiptPayload | dict[str, Any],
|
|
84
|
+
) -> BulkUpsertGoodsReceiptPayload:
|
|
85
|
+
if isinstance(value, BulkUpsertGoodsReceiptPayload):
|
|
86
86
|
return value
|
|
87
87
|
serialized = dict(value)
|
|
88
88
|
received_at = serialized.get("received_at")
|
|
@@ -91,7 +91,7 @@ def _goods_receipt_payload(
|
|
|
91
91
|
lifecycle_status = serialized.get("lifecycle_status")
|
|
92
92
|
if lifecycle_status is not None and not isinstance(lifecycle_status, str):
|
|
93
93
|
serialized["lifecycle_status"] = getattr(lifecycle_status, "value", lifecycle_status)
|
|
94
|
-
return
|
|
94
|
+
return BulkUpsertGoodsReceiptPayload.from_dict(serialized)
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
class Warehouses:
|
|
@@ -104,7 +104,7 @@ class Warehouses:
|
|
|
104
104
|
self,
|
|
105
105
|
*,
|
|
106
106
|
project_id: str,
|
|
107
|
-
receipts: list[
|
|
107
|
+
receipts: list[BulkUpsertGoodsReceiptPayload | dict[str, Any]],
|
|
108
108
|
) -> BulkUpsertGoodsReceiptsResponse:
|
|
109
109
|
"""Import complete goods-receipt snapshots by receipt number."""
|
|
110
110
|
body = BulkUpsertGoodsReceiptsRequest(
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/005_manage_sales_orders.py
RENAMED
|
@@ -52,7 +52,7 @@ def main() -> None:
|
|
|
52
52
|
print("\n--- Create order ---")
|
|
53
53
|
order = client.sales.create_order(
|
|
54
54
|
project_id=project_id,
|
|
55
|
-
|
|
55
|
+
external_id=so_number,
|
|
56
56
|
channel="sdk-sample",
|
|
57
57
|
requested_ship_date=now + timedelta(days=7),
|
|
58
58
|
ordered_at=now,
|
|
@@ -84,7 +84,7 @@ def main() -> None:
|
|
|
84
84
|
|
|
85
85
|
order = client.sales.create_order(
|
|
86
86
|
project_id=project_id,
|
|
87
|
-
|
|
87
|
+
external_id=f"SDK-PRICE-SO-{suffix}",
|
|
88
88
|
price_list_id=price_list.id,
|
|
89
89
|
notes="Price-list-backed Sales Order SDK sample.",
|
|
90
90
|
lines=[
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/uci/003_seed_sales_from_uci.py
RENAMED
|
@@ -794,10 +794,9 @@ def seed_sales_order(
|
|
|
794
794
|
try:
|
|
795
795
|
order = client.sales.create_order(
|
|
796
796
|
project_id=project_id,
|
|
797
|
-
|
|
797
|
+
external_id=so_number,
|
|
798
798
|
customer_id=customer_id,
|
|
799
799
|
channel_id=channel_id,
|
|
800
|
-
external_id=invoice.invoice_no,
|
|
801
800
|
requested_ship_date=requested_ship_date,
|
|
802
801
|
currency="GBP",
|
|
803
802
|
notes="Synthetic sales order seeded from UCI Online Retail invoice.",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/models/__init__.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/__init__.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/address_book.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/analytics.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/api_keys.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/attributes.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/categories.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/connections.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/cost_lists.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/dashboards.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/datasets.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/email.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/environments.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/erp_config.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/imports.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/inventory.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/issues.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/organizations.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/pricing.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/projects.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/replenishment.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/tasks.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/templates.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/usage.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/worker_tasks.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/convexity_sdk/resources/workspace.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/compare_api_key_scopes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_databricks_connections.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_org_and_project.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/create_single_project_api_key.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/crm/001_check_crm_enabled.py
RENAMED
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/crm/003_manage_customers.py
RENAMED
|
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
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/list_orgs_and_projects.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/purchasing/003_manage_vendors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/rbac/001_manage_roles.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/rbac/002_manage_assignments.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/rbac/003_verify_rbac_access.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/001_check_sales_enabled.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/002_enable_sales.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/006_disable_sales.py
RENAMED
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/sales/007_manage_customers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{convexity_sdk-0.21.0.dev373 → convexity_sdk-0.21.0.dev375}/samples/uci/005_run_pipelines.py
RENAMED
|
File without changes
|
|
File without changes
|