import { IInvoice } from './invoice'; import { OrganizationType } from './organizationType'; import { IIssuedThroughAsCreditCard, IIssuedThroughAsFaceToFace, IPermit } from './permit'; import { PersonType } from './personType'; import { ProductType } from './product'; import { IProject } from './project'; import { ReservationType } from './reservationType'; import { PaymentServiceType } from './service/paymentService'; import { SortType } from './sortType'; export interface IEventReservationAsGood { typeOf: ReservationType.EventReservation; /** * 予約ID */ id?: string; issuedThrough?: { typeOf: ProductType.EventService; }; /** * 予約番号 */ reservationNumber: string; } /** * 予約 */ export type IReservation = IEventReservationAsGood; export type IPermitIssuedThroughAsFaceToFace = Pick; export type IPermitIssuedThroughAsCreditCard = Pick; export type IPermitIssuedThrough = IPermitIssuedThroughAsFaceToFace | IPermitIssuedThroughAsCreditCard; export type IPermitAsGood = Pick & { identifier: string; issuedThrough?: IPermitIssuedThrough; name?: never; validFor?: never; }; /** * 所有対象としての請求 * 決済承認時にチケットとして利用される * @deprecated use IPaymentMethodAsGood */ export type InvoiceAsGood = Pick & { issuedThrough: { id: string; typeOf: IInvoice['paymentMethod']['typeOf']; }; }; /** * 所有対象としての決済方法 * 決済承認時にチケットとして利用される */ export interface IPaymentMethodAsGood { /** * 決済サービスID */ id: string; typeOf: PaymentServiceType.CreditCard | PaymentServiceType.MovieTicket; serviceOutput: Pick; } export interface IFaceToFacePaymentMethodAsGood { /** * 対面決済サービスIDはなし */ id?: never; typeOf: PaymentServiceType.FaceToFace; serviceOutput: Pick; } /** * 所有対象物 (Product or Service) */ export type IGood = IReservation | IPermitAsGood | InvoiceAsGood | IPaymentMethodAsGood | IFaceToFacePaymentMethodAsGood; export interface IOwnerAsPerson { typeOf: PersonType; id: string; } /** * 所有者 * 個人情報排除するように */ export type IOwner = IOwnerAsPerson; export interface IAcquiredFrom { id: string; typeOf: OrganizationType.Corporation; name: string; } export type OwnershipInfoType = 'OwnershipInfo'; /** * 所有権 */ export interface IOwnershipInfo { project: Pick; /** * object type */ typeOf: OwnershipInfoType; /** * 所有権ID */ id?: string; /** * 識別子 */ identifier?: string; /** * A person or organization who owns this Thing. * Array対応(2022-07-25~) */ ownedBy: IOwner[]; /** * The organization or person from which the product was acquired. */ acquiredFrom?: IAcquiredFrom; /** * The date and time of obtaining the product. */ ownedFrom: Date; /** * The date and time of giving up ownership on the product. */ ownedThrough?: Date; /** * 所有対象物 */ typeOfGood: T; } /** * ソート条件 */ export interface ISortOrder { /** * 所有開始日時 */ ownedFrom?: SortType; } /** * 所有対象物検索条件 */ export interface ITypeOfGoodSearchConditions { typeOf?: string | { $eq?: string; $in?: string[]; }; identifier?: { $eq?: string; }; id?: { $eq?: string; $in?: string[]; }; issuedThrough?: { id?: { $eq?: string; }; typeOf?: { $eq?: string; }; }; } /** * 所有権検索条件 */ export interface ISearchConditions { limit?: number; page?: number; sort?: ISortOrder; project?: { id?: { $eq?: string; }; }; acquiredFrom?: { id?: { $in?: string[]; }; }; ids?: string[]; identifiers?: string[]; /** * 所有者 */ ownedBy?: { id?: string | { $in?: string[]; }; typeOf?: { $eq?: string; }; }; ownedFromGte?: Date; ownedFromLte?: Date; /** * 所有期間 */ ownedFrom?: Date; /** * 所有期間 */ ownedThrough?: Date; /** * 所有対象物 */ typeOfGood?: ITypeOfGoodSearchConditions; }