PartPurchaseModel
Version: v2.0.0
Stored entity
Partition key pk, sort key sk • discriminator type = "PART_PURCHASE"
Overview
PartPurchase model
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
pk | str | ✅ | — | — |
sk | str | ✅ | — | — |
created_at | str | ✅ | — | — |
updated_at | str | ✅ | — | — |
type | str | ❌ | PART_PURCHASE | — |
tenant_id | str | ✅ | — | — |
part_purchase_id | str | ✅ | — | — |
part_purchase_display_id | str | ✅ | — | — |
contact | str | ✅ | — | — |
contact_id | str | ✅ | — | — |
arrival_date | str | ❌ | — | — |
arrival_status | str | ❌ | — | — |
reference | str | ❌ | — | — |
courier | str | ❌ | — | — |
courier_id | str | ❌ | — | — |
tracking_number | str | ❌ | — | — |
line_item_tax_type | str | ✅ | — | — |
line_items | List[LineItem] | ✅ | — | — |
sub_total | float | ✅ | — | — |
total_tax | float | ✅ | — | — |
total_expenses | float | ✅ | — | — |
total | float | ✅ | — | — |
amount_paid | float | ✅ | — | — |
amount_due | float | ✅ | — | — |
payment_status | str | ✅ | — | — |
Embedded models
Models embedded in the fields above — shown inline; they have no separate page.
LineItem — v1.0.0
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
line_item_id | str | ❌ | — | — |
part_id | str | ✅ | — | — |
tag_id | str | ✅ | — | — |
arrival_status | bool | ❌ | False | — |
quantity | int | ✅ | — | — |
unit_cost | float | ✅ | — | — |
tax_type | str | ✅ | — | — |
tax_amount | float | ✅ | — | — |
expenses | float | ✅ | — | — |
actual_unit_cost | float | ✅ | — | — |
actual_total | float | ✅ | — | — |
line_amount | float | ✅ | — | — |
part_type | str | ✅ | — | — |
part_type_id | str | ✅ | — | — |
part_number | str | ❌ | — | — |
Change history
v1.0.0· 2025-04-22 · Cian (shared account) · Initial version. (71ac3af7c)
APIs / Triggers
| Trigger | Endpoint / Source | Detail | Handler |
|---|---|---|---|
| Stream | DynamoDB stream | table items where type = PART_PURCHASE | src/purchases/part_purchases_opensearch_sync.py |
| API | POST /newpartPurchases/ | — | src/purchases/part_purchases_post.py |
| API | POST /newpartPurchases/search | — | src/purchases/part_purchases_search.py |
| API | POST /newpartPurchases/searchFilters | — | src/purchases/part_purchases_search_filters.py |
| Event | EventBridge | PartPurchasesSelfHealRequested | src/part_purchases_self_heal.py |
Change history
v2.0.0 · 2025-04-22 · Cian (shared account) · 71ac3af7c
detatch
- Removed field
amount_paid_for_parts(breaking). - Removed field
contact_name(breaking). - Removed field
expenses(breaking). - Removed field
last_sent_at(breaking). - Removed field
line_amount_tax_type(breaking). - Removed field
tracking_numbers(breaking). - Added required field
contact. - Added optional field
courier_id. - Added required field
line_item_tax_type. - Added required field
total_expenses. - Added optional field
tracking_number. - Field
amount_duetype changed: Decimal → float (breaking). - Field
amount_paidtype changed: Decimal → float (breaking). - Field
amount_paidbecame required (breaking). - Field
amount_paiddefault changed: Decimal(0) → None. - Field
arrival_statustype changed: str → Optional[str] (breaking). - Field
arrival_statusdefault changed: 'NOT_ARRIVED' → None. - Field
created_atbecame required (breaking). - Field
created_atdefault changed: datetime.utcnow().isoformat() → None. - Field
line_itemstype changed: list → List[LineItem] (breaking). - Field
payment_statusbecame required (breaking). - Field
payment_statusdefault changed: 'NOT_PAID' → None. - Field
sub_totaltype changed: Decimal → float (breaking). - Field
totaltype changed: Decimal → float (breaking). - Field
total_taxtype changed: Decimal → float (breaking). - Field
typebecame optional. - Field
typedefault changed: None → 'PART_PURCHASE'. - Field
updated_atbecame required (breaking). - Field
updated_atdefault changed: datetime.utcnow().isoformat() → None.
v1.0.0 · 2025-03-15 · Olaniyi Ajayi · 338416124
fx
- Initial version.
Generated from
dismantly-backend/Microservices/PartPurchases/dependencies/models.py. Do not edit by hand.