import { passport } from '@waiter/factory'; import { ActionStatusType } from './actionStatusType'; import { IExtendId } from './autoGenerated'; import { ICustomization as IEmailICustomization } from './creativeWork/message/email'; import { ICreativeWork as IWebApplication } from './creativeWork/softwareApplication/webApplication'; import { IMultilingualString } from './multilingualString'; import { OrganizationType } from './organizationType'; import { IIdentifier, IPersonAttributes } from './person'; import { PersonType } from './personType'; import { SortType } from './sortType'; import { TransactionStatusType } from './transactionStatusType'; import { TransactionType } from './transactionType'; export interface IAgentAsWebApplication extends Pick { name?: string; } export interface IAgentAsPerson extends Pick { name?: string; } export type IAgent = IAgentAsWebApplication | IAgentAsPerson; /** * 販売者 */ export interface ISeller { typeOf: OrganizationType.Corporation; id: string; name: IMultilingualString; } /** * Eメール送信パラメータ */ export interface ISendEmailMessageParams { /** * Eメールカスタマイズ * メール本文をカスタマイズしたい場合、PUGテンプレートを指定 * 挿入変数として`order`を使用できます * {@link https://pugjs.org/api/getting-started.html} */ object?: IEmailICustomization; } export interface IPassportBeforeStart { /** * 許可証トークン */ token: passport.IEncodedPassport; } export interface IProject { id: string; typeOf: OrganizationType.Project; } export interface ITasksExportAction { actionStatus: ActionStatusType; agent?: { name: string; }; startDate?: Date; endDate?: Date; } /** * 取引開始パラメータ */ export interface IStartParams { project: IProject; /** * 取引タイプ */ typeOf: T; /** * 取引主体 */ agent: TAgent; /** * 取引物受取者 */ recipient?: TRecipient; /** * 取引対象 */ object: TObject; /** * 取引進行期限 */ expires: Date; } export type IAttributes = TStartParams & { /** * 取引状態 */ status: TransactionStatusType; /** * 取引結果 */ result?: TResult; /** * 取引エラー */ error?: TError; /** * 取引進行期限 */ expires: Date; /** * 取引開始日時 */ startDate: Date; /** * 取引終了日時 */ endDate?: Date; tasksExportAction?: ITasksExportAction; /** * 事後に発生するアクション */ potentialActions?: TPotentialActions; }; export type ITransaction = IExtendId>; /** * ソート条件 */ export interface ISortOrder { startDate?: SortType; } export interface ISearchConditions { limit?: number; page?: number; sort?: ISortOrder; project?: { id?: { $eq?: string; }; }; /** * 取引タイプ */ typeOf: T; /** * IDリスト */ ids?: string[]; /** * ステータスリスト * @deprecated use tasksExportAction */ statuses?: TransactionStatusType[]; status?: { $in?: TransactionStatusType[]; }; /** * 開始日時(から) */ startFrom?: Date; /** * 開始日時(まで) */ startThrough?: Date; /** * 終了日時(から) */ endFrom?: Date; /** * 終了日時(まで) */ endThrough?: Date; agent?: { typeOf?: PersonType.Person | IWebApplication['typeOf']; ids?: string[]; identifiers?: IIdentifier; }; tasksExportAction?: { actionStatus?: { $eq?: ActionStatusType; $in?: ActionStatusType[]; }; }; }