Skip to content

Commit

Permalink
define action recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovegadd committed Jun 2, 2024
1 parent 55dbb1f commit 0a49013
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

### Added

- define action recipe

### Changed

### Deprecated
Expand Down
5 changes: 2 additions & 3 deletions src/action/accept/pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import * as ActionFactory from '../../action';
import { ActionType } from '../../actionType';
import { IAgent, IObjectWithoutDetail } from '../../assetTransaction/pay';
import { AssetTransactionType } from '../../assetTransactionType';
import { IRecipe } from '../../recipe/publishPaymentUrl';
import { TransactionType } from '../../transactionType';
import * as AcceptActionFactory from '../accept';

export {
IAgent
};
export { IAgent, IRecipe };
export interface IObject { // 決済取引を受け入れる
object: IObjectWithoutDetail;
transactionNumber: string;
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ import * as PropertyValueFactory from './propertyValue';
import * as LocationFeatureSpecificationFactory from './propertyValue/locationFeatureSpecification';
import * as QualitativeValueFactory from './qualitativeValue';
import * as QuantitativeValueFactory from './quantitativeValue';
import * as RecipeFactory from './recipe';
import * as AccountingReportFactory from './report/accountingReport';
import * as ReservationFactory from './reservation';
import * as BusReservationFactory from './reservation/busReservation';
Expand Down Expand Up @@ -472,6 +473,7 @@ export namespace propertyValue {

export import qualitativeValue = QualitativeValueFactory;
export import quantitativeValue = QuantitativeValueFactory;
export import recipe = RecipeFactory;

export namespace report {
export import accountingReport = AccountingReportFactory;
Expand Down
32 changes: 32 additions & 0 deletions src/recipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { ActionType } from './actionType';
import { OrganizationType } from './organizationType';

export enum RecipeCategory {
publishPaymentUrl = 'publishPaymentUrl'
}
export enum StepIdentifier {
entryTran = 'entryTran',
execTran = 'execTran'
}
export interface IHowToDirection {
typeOf: 'HowToDirection';
beforeMedia: any;
afterMedia: any;
// text: string;
}
export interface IHowToStep {
typeOf: 'HowToStep';
identifier: StepIdentifier;
itemListElement: IHowToDirection[];
}
export interface IHowToSection {
typeOf: 'HowToSection';
itemListElement: IHowToStep[];
}
export interface IRecipe {
project: { id: string; typeOf: OrganizationType.Project };
typeOf: 'Recipe';
recipeCategory: RecipeCategory;
step: IHowToSection[];
recipeFor: { id: string; typeOf: ActionType };
}
28 changes: 28 additions & 0 deletions src/recipe/publishPaymentUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { IEntryTranArgs, IEntryTranResult, IExecTran3dsResult, IExecTranArgs, IExecTranResult } from '../assetTransaction/pay';
import * as RecipeFactory from '../recipe';

export interface IDirectionEntryTran extends RecipeFactory.IHowToDirection {
beforeMedia: IEntryTranArgs;
afterMedia: IEntryTranResult;
}
export interface IDirectionExecTran extends RecipeFactory.IHowToDirection {
beforeMedia: IExecTranArgs;
afterMedia: IExecTranResult | IExecTran3dsResult;
}
export interface IStepEntryTran extends RecipeFactory.IHowToStep {
identifier: RecipeFactory.StepIdentifier.entryTran;
itemListElement: [IDirectionEntryTran];
}
export interface IStepExecTran extends RecipeFactory.IHowToStep {
identifier: RecipeFactory.StepIdentifier.execTran;
itemListElement: [IDirectionExecTran];
}
export type IHowToStep = IStepEntryTran | IStepExecTran;
export interface IHowToSection {
typeOf: 'HowToSection';
itemListElement: IHowToStep[];
}
export interface IRecipe extends RecipeFactory.IRecipe {
recipeCategory: RecipeFactory.RecipeCategory.publishPaymentUrl;
step: IHowToSection[];
}

0 comments on commit 0a49013

Please sign in to comment.