feat(order, types): Add Credit Line to order module (#10636)

* feat(order, types): Add Credit Line to order module

* chore: add action to inject credit lines
This commit is contained in:
Riqwan Thamir
2024-12-19 10:36:59 +01:00
committed by GitHub
parent fec24aa7eb
commit 3f4d574748
15 changed files with 545 additions and 4 deletions
+55
View File
@@ -26,6 +26,7 @@ export type ChangeActionType =
| "REINSTATE_ITEM"
| "TRANSFER_CUSTOMER"
| "UPDATE_ORDER_PROPERTIES"
| "CREDIT_LINE_ADD"
export type OrderChangeStatus =
| "confirmed"
@@ -1168,6 +1169,13 @@ export interface OrderDTO {
*/
transactions?: OrderTransactionDTO[]
/**
* The credit lines for an order
*
* @expandable
*/
credit_lines?: OrderCreditLineDTO[]
/**
* The summary of the order totals.
*
@@ -3023,3 +3031,50 @@ export interface OrderPreviewDTO
})[]
return_requested_total: number
}
/**
* The order credit line details.
*/
export interface OrderCreditLineDTO {
/**
* The ID of the order credit line.
*/
id: string
/**
* The ID of the order that the credit line belongs to.
*/
order_id: string
/**
* The associated order
*
* @expandable
*/
order: OrderDTO
/**
* The reference model name that the credit line is generated from
*/
reference: string | null
/**
* The reference model id that the credit line is generated from
*/
reference_id: string | null
/**
* The metadata of the order detail
*/
metadata: Record<string, unknown> | null
/**
* The date when the order credit line was created.
*/
created_at: Date
/**
* The date when the order credit line was last updated.
*/
updated_at: Date
}
@@ -16,4 +16,5 @@ export enum ChangeActionType {
REINSTATE_ITEM = "REINSTATE_ITEM",
TRANSFER_CUSTOMER = "TRANSFER_CUSTOMER",
UPDATE_ORDER_PROPERTIES = "UPDATE_ORDER_PROPERTIES",
CREDIT_LINE_ADD = "CREDIT_LINE_ADD",
}