import { HTTPBody } from '@fastify-modular/route'; import { pito } from 'pito'; import { NeedLogin } from '../defines'; import { SellBuyType } from '../enums'; // ========================================================================== export const CreateMarginInput = pito.Obj({ pkFkSellOrder : pito.Num(), pkFkBuyOrder : pito.Num(), pkDealOrderSeq: pito.Num(), sellBuyType : pito.Enums(SellBuyType), }); export type CreateMarginInput = pito.Type; // ========================================================================== export const CreateMarginOption = pito.Obj({}); export type CreateMarginOption = pito.Type; // ========================================================================== export const CreateMarginOutput = pito.Obj({ isCreated : pito.Bool(), transactionId: pito.Int(), expireAt : pito.Datetime(), }); export type CreateMarginOutput = pito.Type; // ========================================================================== export const CreateMargin = HTTPBody('POST', '/api/v1/product/product/margin', 'product') .body(CreateMarginInput) .query(CreateMarginOption) .response(CreateMarginOutput) .presets(NeedLogin) .build();