Skip to content

Commit

Permalink
add confirmAction.sameAs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovegadd committed Jun 10, 2024
1 parent aaf78cd commit 3f31499
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Added

- define action recipe
- add confirmAction.sameAs

### Changed

Expand Down
3 changes: 1 addition & 2 deletions src/action/interact/confirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { TransactionType } from '../../transactionType';
* 決済取引に関してはクライアントによる確定がありうるので拡張(2024-03-11~)
*/
export type IAgent = ActionFactory.IParticipantAsPerson | ActionFactory.IParticipantAsProject | ActionFactory.IParticipantAsWebApplication;
// export type IAgent = ActionFactory.IParticipantAsProject;
export type IObject = any;
export interface ITransactionPurpose {
typeOf: TransactionType.MoneyTransfer | TransactionType.PlaceOrder;
Expand All @@ -20,7 +19,7 @@ export type IResult = any;
export type IPotentialActions = any;
export interface IAttributes<TObject, TResult> extends Pick<
ActionFactory.IAttributes<ActionType.ConfirmAction, TObject, TResult>,
'agent' | 'error' | 'object' | 'project' | 'purpose' | 'result' | 'typeOf'
'agent' | 'error' | 'object' | 'project' | 'purpose' | 'result' | 'typeOf' | 'sameAs'
// | 'potentialActions' // 廃止(2024-03-11~)
> {
agent: IAgent;
Expand Down
12 changes: 8 additions & 4 deletions src/action/interact/confirm/reservation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ export {
};
export type IAgent = IParticipantAsProject;
export type IObject4COA = IUpdReserveArgs & {
// 取引番号は必須
/**
* 取引番号は必須
*/
transactionNumber: string;
typeOf: 'COAReserveTransaction';
};
export type IObject4Chevre = Pick<
ReserveTransactionFactory.IConfirmParams,
// 'transactionNumber' | 'object' | 'potentialActions'
'transactionNumber' | 'potentialActions'
> & {
// 取引番号は必須
/**
* 取引番号は必須
*/
transactionNumber: string;
typeOf: AssetTransactionType.Reserve;
};
Expand All @@ -29,7 +32,8 @@ export type IObject<T extends WebAPIFactory.Identifier> =
IObject4Chevre;

export type IPurpose = ISimpleOrder;
export type IResult = any;
// tslint:disable-next-line:no-empty-interface
export interface IResult { }
export type IInstrument<T extends WebAPIFactory.Identifier> = WebAPIFactory.IService<T>;
export interface IAttributes<T extends WebAPIFactory.Identifier> extends ConfirmActionFactory.IAttributes<IObject<T>, IResult> {
agent: IAgent;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ export namespace action {
export import IPurpose = ActionFactory.IPurpose;
export import ISortOrder = ActionFactory.ISortOrder;
export import ISearchConditions = ActionFactory.ISearchConditions;
export import ISameAs = ActionFactory.ISameAs;

// export import accept = AcceptActionFactory;
export namespace accept {
export import coaOffer = AcceptCOAOfferActionFactory;
export import pay = AcceptPayActionFactory;
Expand Down
3 changes: 1 addition & 2 deletions src/task/confirmReserveTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import * as WebAPIFactory from '../service/webAPI';
import * as TaskFactory from '../task';
import { TaskName } from '../taskName';

// export type IObject4COAOptimized = IObject4COA | Pick<IObject4COA, 'transactionNumber' | 'typeOf'>;
export type IObject4COAOptimized = Pick<IObject4COA, 'transactionNumber' | 'typeOf'> & {
optimized: boolean;
};
export type IObject<T extends WebAPIFactory.Identifier> =
T extends WebAPIFactory.Identifier.COA ? IObject4COAOptimized :
IObject4Chevre;

export type IData = Omit<IConfirmReservationActionAttributes<WebAPIFactory.Identifier>, 'object'> & {
export type IData = Pick<IConfirmReservationActionAttributes<WebAPIFactory.Identifier>, 'agent' | 'project' | 'purpose' | 'typeOf'> & {
object: IObject<WebAPIFactory.Identifier>;
};
export interface IAttributes extends TaskFactory.IAttributes {
Expand Down

0 comments on commit 3f31499

Please sign in to comment.