import { HTTPBody } from "@fastify-modular/route"; import { pito } from "pito"; import { NeedLogin } from "../defines"; export const UpdateSellAdParam = pito.Obj({}); export type UpdateSellAdParam = pito.Type; export const UpdateSellAdInput = pito.Obj({ /* 광고기간 */ ad: pito.Arr( pito.Obj({ sellId : pito.Num(), adMonthCnt: pito.Num(), }) ), /* 쿠폰 - 코드명은 임시..아직 설계가 없다.. */ coupon: pito.Opt(pito.Num()), /* 포인트 - 코드명은 임시..아직 설계가 없다.. */ point: pito.Opt(pito.Num()), }); export type UpdateSellAdInput = pito.Type; export const UpdateSellAdOutput = pito.Obj({ pmntId: pito.Str(), sellAd: pito.Arr( pito.Obj({ sellAd: pito.Obj({ sellId : pito.Num(), startAt : pito.Date(), endAt : pito.Date(), adDayCnt: pito.Num(), price : pito.Num(), }), sellAdHistory: pito.Obj({ sellId : pito.Num(), adMonthCnt: pito.Num(), adDayCnt : pito.Num(), adDayNote : pito.Str(), procUserId: pito.Num(), }), }) ), price: pito.Obj({ pmntPrice : pito.Num(), sumPrice : pito.Num(), couponPrice: pito.Num(), salePrice : pito.Num(), pointPrice : pito.Num(), }), }); export type UpdateSellAdOutput = pito.Type; export const UpdateSellAd = HTTPBody("PATCH", "/api/v1/product/sell-ad", "ad") .params(UpdateSellAdParam) .body(UpdateSellAdInput) .response(UpdateSellAdOutput) .presets(NeedLogin) .build();