Merge pull request 'refactor: remove suitable and surveySales API modules to streamline codebase' (#24) from feature/chore into dev
Reviewed-on: #24
This commit is contained in:
commit
d340e3d976
@ -1,95 +0,0 @@
|
||||
import { database } from '@/data'
|
||||
import { axiosInstance } from '@/libs/axios'
|
||||
|
||||
export interface Suitable {
|
||||
id?: number
|
||||
product_name: string
|
||||
manufacturer: string
|
||||
roof_material: string
|
||||
shape: string
|
||||
support_roof_tile: string
|
||||
support_roof_tile_memo: string
|
||||
support_roof_bracket: string
|
||||
support_roof_bracket_memo: string
|
||||
yg_anchor: string
|
||||
yg_anchor_memo: string
|
||||
rg_roof_tile_part: string
|
||||
rg_roof_tile_part_memo: string
|
||||
dido_hunt_support_tile_2: string
|
||||
dido_hunt_support_tile_2_memo: string
|
||||
takashima_power_base: string
|
||||
takashima_power_base_memo: string
|
||||
takashima_tile_bracket: string
|
||||
takashima_tile_bracket_memo: string
|
||||
slate_bracket_4: string
|
||||
slate_bracket_4_memo: string
|
||||
slate_single_metal_bracket: string
|
||||
slate_single_metal_bracket_memo: string
|
||||
dido_hunt_short_rack_4: string
|
||||
dido_hunt_short_rack_4_memo: string
|
||||
takashima_slate_bracket_slate_single: string
|
||||
takashima_slate_bracket_slate_single_memo: string
|
||||
df_metal_bracket: string
|
||||
df_metal_bracket_memo: string
|
||||
slate_metal_bracket: string
|
||||
slate_metal_bracket_memo: string
|
||||
takashima_slate_bracket_metal_roof: string
|
||||
takashima_slate_bracket_metal_roof_memo: string
|
||||
}
|
||||
|
||||
export const suitableApi = {
|
||||
getList: async (): Promise<Suitable[]> => {
|
||||
const response = await axiosInstance.get<Suitable[]>('/api/suitable/list')
|
||||
console.log('🚀 ~ getList: ~ response:', response)
|
||||
return response.data
|
||||
},
|
||||
|
||||
getDetails: async (roofMaterial: string): Promise<Suitable[]> => {
|
||||
const response = await axiosInstance.get<Suitable[]>(`/api/suitable/details?roof-material=${roofMaterial}`)
|
||||
return response.data
|
||||
},
|
||||
|
||||
create: async () => {
|
||||
const suitableData: Suitable[] = []
|
||||
|
||||
database.forEach((item) => {
|
||||
suitableData.push({
|
||||
product_name: item[0],
|
||||
manufacturer: item[1],
|
||||
roof_material: item[2],
|
||||
shape: item[3],
|
||||
support_roof_tile: item[4],
|
||||
support_roof_tile_memo: item[5],
|
||||
support_roof_bracket: item[6],
|
||||
support_roof_bracket_memo: item[7],
|
||||
yg_anchor: item[8],
|
||||
yg_anchor_memo: item[9],
|
||||
rg_roof_tile_part: item[10],
|
||||
rg_roof_tile_part_memo: item[11],
|
||||
dido_hunt_support_tile_2: item[12],
|
||||
dido_hunt_support_tile_2_memo: item[13],
|
||||
takashima_power_base: item[14],
|
||||
takashima_power_base_memo: item[15],
|
||||
takashima_tile_bracket: item[16],
|
||||
takashima_tile_bracket_memo: item[17],
|
||||
slate_bracket_4: item[18],
|
||||
slate_bracket_4_memo: item[19],
|
||||
slate_single_metal_bracket: item[20],
|
||||
slate_single_metal_bracket_memo: item[21],
|
||||
dido_hunt_short_rack_4: item[22],
|
||||
dido_hunt_short_rack_4_memo: item[23],
|
||||
takashima_slate_bracket_slate_single: item[24],
|
||||
takashima_slate_bracket_slate_single_memo: item[25],
|
||||
df_metal_bracket: item[26],
|
||||
df_metal_bracket_memo: item[27],
|
||||
slate_metal_bracket: item[28],
|
||||
slate_metal_bracket_memo: item[29],
|
||||
takashima_slate_bracket_metal_roof: item[30],
|
||||
takashima_slate_bracket_metal_roof_memo: item[31],
|
||||
})
|
||||
})
|
||||
|
||||
const response = await axiosInstance.post<Suitable[]>('/api/suitable', suitableData)
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
import { axiosInstance } from '@/libs/axios'
|
||||
|
||||
export interface SurveySalesBasicInfo {
|
||||
id?: number
|
||||
representative: String
|
||||
store: String | null
|
||||
construction_point: String | null
|
||||
investigation_date: String | null
|
||||
building_name: String | null
|
||||
customer_name: String | null
|
||||
post_code: String | null
|
||||
address: String | null
|
||||
address_detail: String | null
|
||||
submission_status: Boolean
|
||||
submission_date?: String | null
|
||||
detail_info?: SurveySalesDetailInfo | null
|
||||
}
|
||||
|
||||
export interface SurveySalesDetailInfo {
|
||||
id?: number
|
||||
contract_capacity: String | null
|
||||
retail_company: String | null
|
||||
supplementary_facilities: Number | null
|
||||
supplementary_facilities_etc: String | null
|
||||
installation_system: Number | null
|
||||
installation_system_etc: String | null
|
||||
construction_year: Number | null
|
||||
construction_year_etc: String | null
|
||||
roof_material: Number | null
|
||||
roof_material_etc: String | null
|
||||
roof_shape: Number | null
|
||||
roof_shape_etc: String | null
|
||||
roof_slope: String | null
|
||||
house_structure: Number | null
|
||||
house_structure_etc: String | null
|
||||
rafter_material: Number | null
|
||||
rafter_material_etc: String | null
|
||||
rafter_size: Number | null
|
||||
rafter_size_etc: String | null
|
||||
rafter_pitch: Number | null
|
||||
rafter_pitch_etc: String | null
|
||||
rafter_direction: Number | null
|
||||
open_field_plate_kind: Number | null
|
||||
open_field_plate_kind_etc: String | null
|
||||
open_field_plate_thickness: String | null
|
||||
leak_trace: Boolean | null
|
||||
waterproof_material: Number | null
|
||||
waterproof_material_etc: String | null
|
||||
insulation_presence: Number | null
|
||||
insulation_presence_etc: String | null
|
||||
structure_order: Number | null
|
||||
structure_order_etc: String | null
|
||||
installation_availability: Number | null
|
||||
installation_availability_etc: String | null
|
||||
memo: String | null
|
||||
}
|
||||
|
||||
export const surveySalesApi = {
|
||||
create: async (data: SurveySalesBasicInfo): Promise<SurveySalesBasicInfo> => {
|
||||
const response = await axiosInstance.post<SurveySalesBasicInfo>('/api/survey-sales', data)
|
||||
return response.data
|
||||
},
|
||||
getList: async (): Promise<SurveySalesBasicInfo[]> => {
|
||||
const response = await axiosInstance.get<SurveySalesBasicInfo[]>('/api/survey-sales')
|
||||
return response.data
|
||||
},
|
||||
update: async (data: SurveySalesBasicInfo): Promise<SurveySalesBasicInfo> => {
|
||||
const response = await axiosInstance.put<SurveySalesBasicInfo>(`/api/survey-sales`, data)
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user