CreditNoteModel
Version: v4.1.0
Stored entity
Partition key pk, sort key sk • discriminator type = "CREDIT_NOTE"
Overview
Credit note model
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
pk | str | ✅ | — | — |
sk | str | ✅ | — | — |
credit_id | str | ✅ | — | — |
credit_display_id | str | ✅ | — | — |
contact_name | str | ✅ | — | — |
contact_id | str | ✅ | — | — |
tenant_id | str | ✅ | — | — |
is_deleted | bool | ❌ | False | — |
reference | str | ❌ | — | — |
note | str | ❌ | — | — |
issue_date | str | ✅ | — | — |
reason | str | ❌ | — | — |
sales_person | str | ❌ | — | — |
sales_person_id | str | ❌ | — | — |
line_amount_tax_type | str | ✅ | — | — |
sub_total | float | ✅ | — | — |
total_tax | float | ✅ | — | — |
total | float | ✅ | — | — |
restocking_fee | float | ✅ | — | — |
last_emailed_at | str | ❌ | — | — |
updated_at | str | ✅ | — | — |
created_at | str | ✅ | — | — |
meta_data | dict | ❌ | — | — |
line_items | List[CreditNoteLineItem] | ✅ | — | — |
allocations | List[CreditNoteAllocation] | ✅ | — | — |
status | str | ✅ | — | — |
amount_refunded | float | ✅ | — | — |
amount_remaining | float | ✅ | — | — |
dont_sync_to_xero | bool | ✅ | — | — |
type | str | ❌ | CREDIT_NOTE | — |
Embedded models
Models embedded in the fields above — shown inline; they have no separate page.
CreditNoteLineItem — v1.0.1
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
item_type | str | ✅ | — | — |
item_name | str | ✅ | — | — |
description | str | ✅ | — | — |
unit_price | float | ❌ | — | — |
tax_type | str | ❌ | — | — |
quantity | int | ❌ | — | — |
account | Account | ❌ | — | Account model |
tag_id | str | ❌ | — | — |
part_id | str | ❌ | — | — |
is_restocked | bool | ❌ | False | — |
discount | float | ❌ | — | — |
tax_amount | float | ❌ | — | — |
line_amount | float | ❌ | — | — |
line_item_id | str | ❌ | — | — |
Change history
v1.0.1· 2025-09-12 · Olaniyi Ajayi · Fielddiscountdefault changed: None → Field(None, ge=0).; Fieldline_amountdefault changed: None → Field(None, ge=0).; Fieldtax_amountdefault changed: None → Field(None, ge=0).; Fieldunit_pricedefault changed: None → Field(None, ge=0). (e2ad92a30)v1.0.0· 2025-03-15 · Olaniyi Ajayi · Initial version. (338416124)
Account — v5.0.0
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
account_code | str | ❌ | — | — |
account_id | str | ✅ | — | — |
account_name | str | ✅ | — | — |
Change history
v5.0.0· 2025-05-26 · Cian (shared account) · Fieldaccount_codetype changed: str → Optional[str] (breaking).; Fieldaccount_codebecame optional. (509648ddf)v4.0.0· 2025-05-15 · Cian (shared account) · Fieldaccount_codetype changed: Optional[str] → str (breaking).; Fieldaccount_codebecame required (breaking). (bdb212c0f)v3.0.0· 2025-05-09 · Cian (shared account) · Fieldaccount_codetype changed: str → Optional[str] (breaking).; Fieldaccount_codebecame optional. (3a7865c16)v2.0.0· 2025-04-09 · Cian (shared account) · Fieldaccount_codetype changed: Optional[str] → str (breaking).; Fieldaccount_codebecame required (breaking). (6c65e2d22)v1.0.0· 2025-03-15 · Olaniyi Ajayi · Initial version. (338416124)
CreditNoteAllocation — v2.1.0
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
invoice_id | str | ✅ | — | — |
invoice_display_id | str | ✅ | — | — |
amount | float | ✅ | — | — |
date | str | ✅ | — | — |
allocation_id | str | ❌ | — | — |
Change history
v2.1.0· 2025-09-12 · Olaniyi Ajayi · Fieldamountbecame optional.; Fieldamountdefault changed: None → Field(..., ge=0). (e2ad92a30)v2.0.0· 2025-05-15 · Cian (shared account) · Fieldinvoice_display_idtype changed: int → str (breaking). (9d75bf4fd)v1.0.0· 2025-05-14 · Cian (shared account) · Initial version. (02e6bfcc7)
APIs / Triggers
| Trigger | Endpoint / Source | Detail | Handler |
|---|---|---|---|
| Stream | DynamoDB stream | table items where type is one of CREDIT_NOTE, INVOICE | src/invoice_opensearch_sync.py |
| Stream | DynamoDB stream | table items where type is one of CREDIT_NOTE, INVOICE | src/invoice_algolia_sync.py |
| Stream | DynamoDB stream | table items where type is one of CREDIT_NOTE, INVOICE | src/history/invoice_history_process.py |
Change history
v4.1.0 · 2026-06-05 · Cian (shared account) · 4465f0590
Add credit note history support
- Added optional field
meta_data.
v4.0.0 · 2026-06-02 · Cian (shared account) · 82b67e3db
Restore source files without generated outputs
- Removed field
note(breaking).
v3.4.0 · 2026-05-29 · Olaniyi Ajayi · 424792de4
Invoice: add note to credit note model
- Added optional field
note.
v3.3.0 · 2025-09-12 · Olaniyi Ajayi · e2ad92a30
account unique check
- Field
amount_refundedbecame optional. - Field
amount_refundeddefault changed: None → Field(..., ge=0). - Field
amount_remainingbecame optional. - Field
amount_remainingdefault changed: None → Field(..., ge=0). - Field
restocking_feebecame optional. - Field
restocking_feedefault changed: None → Field(..., ge=0). - Field
sub_totalbecame optional. - Field
sub_totaldefault changed: None → Field(..., ge=0). - Field
totalbecame optional. - Field
totaldefault changed: None → Field(..., ge=0). - Field
total_taxbecame optional. - Field
total_taxdefault changed: None → Field(..., ge=0).
v3.2.0 · 2025-08-04 · Cian (shared account) · b2be28a52
fx
- Added optional field
is_deleted.
v3.1.0 · 2025-05-15 · Cian (shared account) · d2498b9a1
fx
- Added required field
tenant_id.
v3.0.0 · 2025-05-14 · Cian (shared account) · 02e6bfcc7
fx
- Field
allocationstype changed: List[Allocation] → List[CreditNoteAllocation] (breaking).
v2.2.0 · 2025-04-11 · Cian (shared account) · 706dfc159
migration scripts
- Added required field
credit_display_id.
v2.1.0 · 2025-04-09 · Cian (shared account) · 6c65e2d22
fx
- Field
typebecame optional. - Field
typedefault changed: None → 'CREDIT_NOTE'.
v2.0.0 · 2025-03-18 · Olaniyi Ajayi · 3ded38209
updated
- Added required field
amount_refunded. - Added required field
amount_remaining. - Added optional field
last_emailed_at. - Added required field
pk. - Added required field
sk. - Added required field
status. - Added required field
sub_total. - Added required field
total_tax. - Field
restocking_feetype changed: Optional[float] → float (breaking). - Field
restocking_feebecame required (breaking). - Field
totaltype changed: Optional[float] → float (breaking). - Field
totalbecame required (breaking).
v1.0.0 · 2025-03-15 · Olaniyi Ajayi · 338416124
fx
- Initial version.
Generated from
dismantly-backend/Microservices/Invoice/dependencies/models.py. Do not edit by hand.