Skip to content

Commit

Permalink
chore: support for store in BDOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 9, 2023
1 parent 8118591 commit 8f38abf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

*
* Initial support for the Store information in `BDOrder`

### Changed

Expand Down
5 changes: 4 additions & 1 deletion src/eadapters/models/budy/bd_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import appier

from . import bd_store
from . import bd_common
from . import bd_address
from . import bd_voucher
Expand All @@ -21,11 +22,13 @@ def handler(model):
vouchers = model.get("vouchers", [])
shipping_address = model.get("shipping_address", {})
billing_address = model.get("billing_address", {})
store = model.get("store", {})
model.update(
lines = bd_order_line.BDOrderLine.wrap(lines),
vouchers = bd_voucher.BDVoucher.wrap(vouchers),
shipping_address = bd_address.BDAddress.wrap(shipping_address) if shipping_address else None,
billing_address = bd_address.BDAddress.wrap(billing_address) if billing_address else None
billing_address = bd_address.BDAddress.wrap(billing_address) if billing_address else None,
store = bd_store.BDStore.wrap(store) if store else None
)

return super(BDOrder, cls).wrap(
Expand Down
7 changes: 7 additions & 0 deletions src/eadapters/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ class EOrder(base.EBase):
)
)

store = appier.field(
type = appier.reference(
"EStore",
name = "id"
)
)

@classmethod
def _build(cls, model, map):
super(EOrder, cls)._build(model, map)
Expand Down

0 comments on commit 8f38abf

Please sign in to comment.