import { HTTPBody } from '@fastify-modular/route'; import { pito } from 'pito'; import { FurnitureDefine, GenderType, ProductKind, ProductType } from '../enums'; import { MoveInDefine } from '../types'; import { AdminExpensesDefine } from '../types/admin-expenses'; import { ParkingDefine } from '../types/parking'; // ========================================================================== export const CreateProductByMatchInput = pito.Obj({ /* 매물 정보 */ address: pito.Str(), productKind: pito.Enums(ProductKind), // 매물 종류 (개별선택 = 01:원룸, 02:투룸, 03:쓰리룸, 04:오피스텔/도시형, 05:아파트) productType: pito.Enums(ProductType), // 건물 유형 (개별선택 : 원룸/투룸/쓰리룸 일때만 처리 => 01:단독주택, 02:다가구주택, 03:빌라/연립/다세대, 04:상가주택) moveIn: MoveInDefine, adminExpenses: AdminExpensesDefine, parking : ParkingDefine, furniture : pito.Arr(FurnitureDefine), title : pito.Str(), description : pito.Str(), note : pito.Opt(pito.Str()), characteristic: pito.Opt(pito.Str()), /* 유저 인증정보 */ userName : pito.Str(), email : pito.Opt(pito.Str()), phoneNumber: pito.Str(), genderType : pito.Enums(GenderType), }); export type CreateProductByMatchInput = pito.Type; // ========================================================================== export const CreateProductByMatchOption = pito.Obj({}); export type CreateProductByMatchOption = pito.Type; // ========================================================================== export const CreateProductByMatchOutput = pito.Obj({ productId: pito.Num(), }); export type CreateProductByMatchOutput = pito.Type; // ========================================================================== export const CreateProductByMatch = HTTPBody('POST', '/api/v1/product/product/match', 'product') .body(CreateProductByMatchInput) .query(CreateProductByMatchOption) .response(CreateProductByMatchOutput) .build(); // ==========================================================================