import { IAction as IPayAction, IPaymentService as IPayObject } from '../action/trade/pay'; import { IAction as IRefundAction, IPaymentService as IRefundObject } from '../action/trade/refund'; import { IOrder, ISeller, IReferencedInvoice } from '../order'; import { OrganizationType } from '../organizationType'; export type IPayActionObject = Pick; export type IOptimizedPayAction = Pick & { object: IPayActionObject[]; }; export type IRefundActionObject = Pick; export type IOptimizedRefundAction = Pick & { object: IRefundActionObject[]; }; export type IAction = IOptimizedPayAction | IOptimizedRefundAction; /** * 経理レポートドキュメントに保管される注文 * optimize(2026-05-06~) */ export type IOrderAsMainEntity = Pick & { seller: Pick; paymentMethods: Pick[]; confirmationNumber?: never; price?: never; priceCurrency?: never; customer?: never; broker?: never; orderedItem?: never; acceptedOffers?: never; numItems?: never; }; /** * 経理レポート */ export interface IReport { mainEntity: IAction; isPartOf: { mainEntity: IOrderAsMainEntity; }; } export interface IChildReport { typeOf: 'Report'; mainEntity: IAction; } /** * DB保存形式としての経理レポート */ export interface IReportDocument { project: { id: string; typeOf: OrganizationType.Project; }; typeOf: 'Report'; hasPart: IChildReport[]; mainEntity: IOrderAsMainEntity; } /** * 検索条件 */ export interface ISearchConditions { limit?: number; page?: number; project?: { id?: { $eq?: string; }; }; order?: { orderDate?: { $gte?: Date; $lte?: Date; }; orderNumber?: { $eq?: string; }; paymentMethods?: { paymentMethodId?: { $eq?: string; }; }; seller?: { id?: { $eq?: string; }; }; }; }