domain¶
도메인 모듈.
models¶
도메인 모델.
-
class
Batch(ref, sku, qty, eta=None, id=None)¶ 재고 단위(SKU)별로 예정 시간(eta)까지 지정 수량(qta)으로 한번에 구매될 상품입니다.
-
allocate(line)¶ 지정된
OrderLine을 현재Batch에 추가합니다.- Parameters
line (
OrderLine) – 배치에 추가할 OrderLine.- Return type
None
-
property
allocated_quantity¶ 할당된 주문선 수량.
- Return type
int
-
property
available_quantity¶ 사용 가능한 재고 수량.
- Return type
int
-
can_allocate(line)¶ 할당 가능 여부를 리턴합니다.
주문선의 SKU가 배치의 SKU와 동일하고 할당 가능한 수량이 주문선의 요구 수량보다 큰 경우에만 할당 가능합니다.
- Return type
bool
-
change_purchased_quantity(new_qty)¶ 구매 수량을 변경합니다.
- Return type
None
-
deallocate(line)¶ 주문선 line 을 할당 취소 합니다.
- Return type
None
-
eta¶ 예정 도착 시간(Estimated Time of Arrival).
-
id¶ 매핑된 DB가 할당한 고유 ID. 세션 commit이 될 경우에만 값이 부여됩니다.
-
sku¶ 재고 보관 단위(Stock Keeping Unit).
-
-
class
Order(id)¶ 고객이 발주하는 주문(Order) 모델입니다..
-
class
OrderLine(orderid, sku, qty)¶ 주문(
Order)에 대한 여러 주문선을 나타냅니다.Batch.allocate()를 이용해 재고Batch소스와 연결합니다.-
orderid: str¶ Order.id를 가리키는 레퍼런스 id입니다.
-
sku: str¶ 재고 보관 단위(Stock Keeping Unit).
-