169 lines
4.2 KiB
TypeScript
169 lines
4.2 KiB
TypeScript
import type { Attachment, Model, PageResult, User } from "timi-web-api";
|
|
import type { Customer } from "@/types/Customer";
|
|
import type { EventRecord } from "@/types/EventRecord";
|
|
|
|
export type SalesOrderType = "PACKAGE" | "DIRECT_PRODUCT";
|
|
export type SalesOrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED";
|
|
export type SalesPaymentStatus = "UNPAID" | "PARTIALLY_PAID" | "PAID";
|
|
export type SalesRefundStatus = "NOT_REQUIRED" | "PENDING" | "REFUNDED";
|
|
export type FundBizType = "SALES_ORDER";
|
|
export type FundOperationType = "RECEIVE" | "REFUND" | "CONFIRM_NO_REFUND" | "REVOKE";
|
|
export type FundRecordStatus = "PENDING" | "VERIFIED" | "REJECTED" | "CANCELLED";
|
|
|
|
export type SalesOrderItem = {
|
|
salesOrderId?: string;
|
|
productId?: string;
|
|
productUnitId?: string;
|
|
productNameSnapshot?: string;
|
|
unitSnapshot?: string;
|
|
baseQuantityPerUnitSnapshot?: number | string;
|
|
quantity?: number | string;
|
|
reservedQuantity?: number | string;
|
|
fulfilledQuantity?: number | string;
|
|
unitPrice?: number;
|
|
lineAmount?: number;
|
|
sort?: number;
|
|
remark?: string | null;
|
|
} & Model;
|
|
|
|
export type SalesOrder = {
|
|
storeId?: string;
|
|
customerId?: string;
|
|
orderNo?: string;
|
|
orderType?: SalesOrderType;
|
|
status?: SalesOrderStatus;
|
|
paymentStatus?: SalesPaymentStatus;
|
|
refundStatus?: SalesRefundStatus;
|
|
saleAmount?: number;
|
|
pendingPaidAmount?: number;
|
|
paidAmount?: number;
|
|
refundedAmount?: number;
|
|
unpaidAmount?: number;
|
|
sourceEventRecordId?: string;
|
|
requestNo?: string;
|
|
purchasedAt?: number;
|
|
paidAt?: number | null;
|
|
operatorUserId?: string;
|
|
cancelledAt?: number;
|
|
cancelOperatorUserId?: string;
|
|
cancelReason?: string | null;
|
|
remark?: string | null;
|
|
customer?: Customer;
|
|
operator?: Partial<User>;
|
|
cancelOperator?: Partial<User>;
|
|
itemList?: SalesOrderItem[];
|
|
fundRecordList?: FundRecord[];
|
|
sourceEventRecord?: EventRecord;
|
|
attachmentList?: Partial<Attachment>[];
|
|
} & Model;
|
|
|
|
export type SalesOrderPage = {
|
|
storeId?: string;
|
|
customerId?: string;
|
|
orderType?: SalesOrderType;
|
|
status?: SalesOrderStatus;
|
|
paymentStatus?: SalesPaymentStatus;
|
|
fulfilledButUnpaid?: boolean;
|
|
keyword?: string;
|
|
beginAt?: number;
|
|
endAt?: number;
|
|
index: number;
|
|
size: number;
|
|
};
|
|
|
|
export type DirectProductOrderItemRequest = {
|
|
productId: string;
|
|
productUnitId: string;
|
|
quantity: number | string;
|
|
unitPrice?: number;
|
|
sort?: number;
|
|
remark?: string | null;
|
|
};
|
|
|
|
export type DirectProductOrderCreateRequest = {
|
|
requestNo: string;
|
|
storeId?: string;
|
|
customerId: string;
|
|
purchasedAt?: number;
|
|
itemList: DirectProductOrderItemRequest[];
|
|
attachmentList?: Partial<Attachment>[];
|
|
remark?: string | null;
|
|
};
|
|
|
|
export type OrderPaymentReceiveRequest = {
|
|
salesOrderId: string;
|
|
requestNo: string;
|
|
amount: number;
|
|
occurredAt?: number;
|
|
attachmentList?: Partial<Attachment>[];
|
|
remark?: string | null;
|
|
};
|
|
|
|
export type OrderPaymentActionRequest = { fundRecordId: string; reason: string };
|
|
|
|
export type OrderPaymentRefundRequest = {
|
|
salesOrderId: string;
|
|
requestNo: string;
|
|
amount: number;
|
|
occurredAt?: number;
|
|
reason: string;
|
|
attachmentList?: Partial<Attachment>[];
|
|
remark?: string | null;
|
|
};
|
|
|
|
export type OrderPaymentNoRefundRequest = {
|
|
salesOrderId: string;
|
|
requestNo: string;
|
|
occurredAt?: number;
|
|
reason: string;
|
|
remark?: string | null;
|
|
};
|
|
|
|
export type OrderPaymentRevokeRequest = {
|
|
requestNo: string;
|
|
fundRecordId: string;
|
|
occurredAt?: number;
|
|
reason: string;
|
|
attachmentList?: Partial<Attachment>[];
|
|
remark?: string | null;
|
|
};
|
|
|
|
export type SalesOrderCancelRequest = { salesOrderId: string; reason: string };
|
|
|
|
export type FundRecord = {
|
|
storeId?: string;
|
|
customerId?: string;
|
|
bizType?: FundBizType;
|
|
bizId?: string;
|
|
operationType?: FundOperationType;
|
|
status?: FundRecordStatus;
|
|
amount?: number;
|
|
sourceRecordId?: string;
|
|
requestNo?: string;
|
|
operatorUserId?: string;
|
|
verifierUserId?: string;
|
|
verifiedAt?: number;
|
|
occurredAt?: number;
|
|
reason?: string | null;
|
|
remark?: string | null;
|
|
operator?: Partial<User>;
|
|
verifier?: Partial<User>;
|
|
customer?: Customer;
|
|
attachmentList?: Partial<Attachment>[];
|
|
} & Model;
|
|
|
|
export type FundRecordPage = {
|
|
storeId?: string;
|
|
salesOrderId?: string;
|
|
bizType?: FundBizType;
|
|
customerId?: string;
|
|
operationType?: FundOperationType;
|
|
status?: FundRecordStatus;
|
|
beginAt?: number;
|
|
endAt?: number;
|
|
index: number;
|
|
size: number;
|
|
};
|
|
|
|
export type SalesOrderPageResult<T> = PageResult<T> & { pages?: number };
|