UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

95 lines (94 loc) 3.9 kB
import * as factory from '../../../factory'; import { Settings } from '../../../settings'; import type { AdvanceBookingRequirementRepo } from '../../../repo/advanceBookingRequirement'; import type { AssetTransactionRepo } from '../../../repo/assetTransaction'; import type { EventRepo } from '../../../repo/event'; import type { EventSeriesRepo } from '../../../repo/eventSeries'; import type { IssuerRepo } from '../../../repo/issuer'; import type { MemberProgramRepo } from '../../../repo/memberProgram'; import type { EventOfferRepo } from '../../../repo/offer/event'; import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog'; import type { OfferCatalogRepo } from '../../../repo/offerCatalog'; import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem'; import type { PaymentServiceRepo } from '../../../repo/paymentService'; import { SeatRepo } from '../../../repo/place/seat'; import type { PriceSpecificationRepo } from '../../../repo/priceSpecification'; import type { ProductRepo } from '../../../repo/product'; import type { ProductOfferRepo } from '../../../repo/productOffer'; import type { ProjectRepo } from '../../../repo/project'; import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer'; import type { SettingRepo } from '../../../repo/setting'; import type { StockHolderRepo } from '../../../repo/stockHolder'; import type { TaskRepo } from '../../../repo/task'; interface IStartOperationRepos { advanceBookingRequirement: AdvanceBookingRequirementRepo; stockHolder: StockHolderRepo; event: EventRepo; eventOffer: EventOfferRepo; eventSeries: EventSeriesRepo; issuer: IssuerRepo; memberProgram: MemberProgramRepo; offer: OfferRepo; offerCatalog: OfferCatalogRepo; offerCatalogItem: OfferCatalogItemRepo; offerRateLimit: OfferRateLimitRepo; paymentService: PaymentServiceRepo; product: ProductRepo; productOffer: ProductOfferRepo; priceSpecification: PriceSpecificationRepo; project: ProjectRepo; seat: SeatRepo; setting: SettingRepo; task: TaskRepo; assetTransaction: AssetTransactionRepo; } type IStartOperation<T> = (repos: IStartOperationRepos, settings: Settings) => Promise<T>; type IObjectSubReservation = factory.assetTransaction.reserve.IObjectSubReservation; type IStartParams = factory.assetTransaction.reserve.IStartParamsWithoutDetail & { /** * add(2025-02-17~) */ instrument: factory.assetTransaction.reserve.IInstrument[]; /** * 承認アクションを介した場合に検索済のイベント * discontinue preSearchedEvent(2024-07-17~) */ /** * 承認アクションを介した場合に検索済のオファーリスト */ preSearchedTicketOffers?: factory.product.ITicketOffer[]; /** * 承認アクションを介した場合に検索済の単価オファーリスト */ preSearchedUnitPriceOffers?: factory.unitPriceOffer.IUnitPriceOffer[]; /** * 販売アプリケーション */ availableAtOrFrom?: { id?: string; }; /** * イベントの販売期間を検証するかどうか */ validateEventOfferPeriod: boolean; /** * イベントのオファー(最大予約座席数)を検証するかどうか */ validateEvent: boolean; validateAppliesToMovieTicket: boolean; }; /** * 取引開始 */ declare function start(params: IStartParams & {}, options: { /** * 最大n日前から予約可能 */ maxReservationGracePeriodInDays: number; }): IStartOperation<{ transaction: Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>, 'id'>; objectSubReservations: IObjectSubReservation[]; issuedThrough: factory.assetTransaction.reserve.IIssuedThrough; reservationFor: factory.assetTransaction.reserve.IReservationFor; }>; export { start };