diff --git a/api/generated/openapi_gen.go b/api/generated/openapi_gen.go index 168fa8f5..79b537e5 100644 --- a/api/generated/openapi_gen.go +++ b/api/generated/openapi_gen.go @@ -71,11 +71,11 @@ type BuyReport struct { // BuyReportDetail 購入報告ページで表示する詳細情報 type BuyReportDetail struct { - ID *int `json:"ID,omitempty"` Amount *int `json:"amount,omitempty"` DivisionName *string `json:"divisionName,omitempty"` FestivalItemName *string `json:"festivalItemName,omitempty"` FinancialRecordName *string `json:"financialRecordName,omitempty"` + Id *int `json:"id,omitempty"` IsPacked *bool `json:"isPacked,omitempty"` IsSettled *bool `json:"isSettled,omitempty"` PaidBy *string `json:"paidBy,omitempty"` @@ -84,9 +84,9 @@ type BuyReportDetail struct { // BuyReportInformation マイページで表示する購入報告の情報 type BuyReportInformation struct { - ID *int `json:"ID,omitempty"` Amount *int `json:"amount,omitempty"` BuyReportName *string `json:"buyReportName,omitempty"` + Id *int `json:"id,omitempty"` ReportDate *string `json:"reportDate,omitempty"` Status *BuyReportInformationStatus `json:"status,omitempty"` } @@ -318,8 +318,8 @@ type PostBuyReportsMultipartBody struct { File openapi_types.File `json:"file"` } -// GetBuyReportsListParams defines parameters for GetBuyReportsList. -type GetBuyReportsListParams struct { +// GetBuyReportsDetailsParams defines parameters for GetBuyReportsDetails. +type GetBuyReportsDetailsParams struct { // Year year Year *int `form:"year,omitempty" json:"year,omitempty"` } @@ -708,8 +708,8 @@ type ServerInterface interface { // (POST /buy_reports) PostBuyReports(ctx echo.Context) error - // (GET /buy_reports/list) - GetBuyReportsList(ctx echo.Context, params GetBuyReportsListParams) error + // (GET /buy_reports/details) + GetBuyReportsDetails(ctx echo.Context, params GetBuyReportsDetailsParams) error // (DELETE /buy_reports/{id}) DeleteBuyReportsId(ctx echo.Context, id int) error @@ -1525,12 +1525,12 @@ func (w *ServerInterfaceWrapper) PostBuyReports(ctx echo.Context) error { return err } -// GetBuyReportsList converts echo context to params. -func (w *ServerInterfaceWrapper) GetBuyReportsList(ctx echo.Context) error { +// GetBuyReportsDetails converts echo context to params. +func (w *ServerInterfaceWrapper) GetBuyReportsDetails(ctx echo.Context) error { var err error // Parameter object where we will unmarshal all parameters from the context - var params GetBuyReportsListParams + var params GetBuyReportsDetailsParams // ------------- Optional query parameter "year" ------------- err = runtime.BindQueryParameter("form", true, false, "year", ctx.QueryParams(), ¶ms.Year) @@ -1539,7 +1539,7 @@ func (w *ServerInterfaceWrapper) GetBuyReportsList(ctx echo.Context) error { } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetBuyReportsList(ctx, params) + err = w.Handler.GetBuyReportsDetails(ctx, params) return err } @@ -3083,7 +3083,7 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.PUT(baseURL+"/bureaus/:id", wrapper.PutBureausId) router.PUT(baseURL+"/buy_report/status/:buy_report_id", wrapper.PutBuyReportStatusBuyReportId) router.POST(baseURL+"/buy_reports", wrapper.PostBuyReports) - router.GET(baseURL+"/buy_reports/list", wrapper.GetBuyReportsList) + router.GET(baseURL+"/buy_reports/details", wrapper.GetBuyReportsDetails) router.DELETE(baseURL+"/buy_reports/:id", wrapper.DeleteBuyReportsId) router.PUT(baseURL+"/buy_reports/:id", wrapper.PutBuyReportsId) router.GET(baseURL+"/departments", wrapper.GetDepartments) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 648c5eb3..e412613c 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -684,10 +684,9 @@ paths: required: - file - buy_report - required: true responses: "200": - description: 作成されたbuyReportが返ってくる + description: 作成されたbuy_reportが返ってくる content: application/json: schema: @@ -745,11 +744,11 @@ paths: application/json: schema: type: object - /buy_reports/list: + /buy_reports/details: get: tags: - buy_report - description: 購入報告で表示するbuyReport一覧の取得、主に財務向けのページ + description: 購入報告で表示するbuy_report一覧の取得、主に財務向けのページ parameters: - name: year in: query @@ -2605,7 +2604,7 @@ components: description: マイページで表示する購入報告の情報 type: object properties: - ID: + id: type: integer example: 1 buyReportName: @@ -2627,7 +2626,7 @@ components: description: 購入報告ページで表示する詳細情報 type: object properties: - ID: + id: type: integer example: 1 financialRecordName: diff --git a/view/next-project/src/generated/hooks.ts b/view/next-project/src/generated/hooks.ts index d8eb7f63..834b51ed 100644 --- a/view/next-project/src/generated/hooks.ts +++ b/view/next-project/src/generated/hooks.ts @@ -74,7 +74,7 @@ import type { GetBudgetsIdDetails200, GetBureaus200, GetBureausId200, - GetBuyReportsListParams, + GetBuyReportsDetailsParams, GetDepartments200, GetDepartmentsId200, GetExpenses200, @@ -2127,15 +2127,15 @@ export const useDeleteBuyReportsId = ( } /** - * 購入報告で表示するbuyReport一覧の取得、主に財務向けのページ + * 購入報告で表示するbuy_report一覧の取得、主に財務向けのページ */ -export type getBuyReportsListResponse = { +export type getBuyReportsDetailsResponse = { data: BuyReportDetail[]; status: number; headers: Headers; } -export const getGetBuyReportsListUrl = (params?: GetBuyReportsListParams,) => { +export const getGetBuyReportsDetailsUrl = (params?: GetBuyReportsDetailsParams,) => { const normalizedParams = new URLSearchParams(); Object.entries(params || {}).forEach(([key, value]) => { @@ -2145,12 +2145,12 @@ export const getGetBuyReportsListUrl = (params?: GetBuyReportsListParams,) => { } }); - return normalizedParams.size ? `/buy_reports/list?${normalizedParams.toString()}` : `/buy_reports/list` + return normalizedParams.size ? `/buy_reports/details?${normalizedParams.toString()}` : `/buy_reports/details` } -export const getBuyReportsList = async (params?: GetBuyReportsListParams, options?: RequestInit): Promise => { +export const getBuyReportsDetails = async (params?: GetBuyReportsDetailsParams, options?: RequestInit): Promise => { - return customFetch>(getGetBuyReportsListUrl(params), + return customFetch>(getGetBuyReportsDetailsUrl(params), { ...options, method: 'GET' @@ -2162,19 +2162,19 @@ export const getBuyReportsList = async (params?: GetBuyReportsListParams, option -export const getGetBuyReportsListKey = (params?: GetBuyReportsListParams,) => [`/buy_reports/list`, ...(params ? [params]: [])] as const; +export const getGetBuyReportsDetailsKey = (params?: GetBuyReportsDetailsParams,) => [`/buy_reports/details`, ...(params ? [params]: [])] as const; -export type GetBuyReportsListQueryResult = NonNullable>> -export type GetBuyReportsListQueryError = unknown +export type GetBuyReportsDetailsQueryResult = NonNullable>> +export type GetBuyReportsDetailsQueryError = unknown -export const useGetBuyReportsList = ( - params?: GetBuyReportsListParams, options?: { swr?:SWRConfiguration>, TError> & { swrKey?: Key, enabled?: boolean }, request?: SecondParameter } +export const useGetBuyReportsDetails = ( + params?: GetBuyReportsDetailsParams, options?: { swr?:SWRConfiguration>, TError> & { swrKey?: Key, enabled?: boolean }, request?: SecondParameter } ) => { const {swr: swrOptions, request: requestOptions} = options ?? {} const isEnabled = swrOptions?.enabled !== false - const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetBuyReportsListKey(params) : null); - const swrFn = () => getBuyReportsList(params, requestOptions) + const swrKey = swrOptions?.swrKey ?? (() => isEnabled ? getGetBuyReportsDetailsKey(params) : null); + const swrFn = () => getBuyReportsDetails(params, requestOptions) const query = useSwr>, TError>(swrKey, swrFn, swrOptions) diff --git a/view/next-project/src/generated/model/index.ts b/view/next-project/src/generated/model/index.ts index 1bbef43a..6d3dabd9 100644 --- a/view/next-project/src/generated/model/index.ts +++ b/view/next-project/src/generated/model/index.ts @@ -70,6 +70,7 @@ export * from './getBudgetsId200'; export * from './getBudgetsIdDetails200'; export * from './getBureaus200'; export * from './getBureausId200'; +export * from './getBuyReportsDetailsParams'; export * from './getBuyReportsListParams'; export * from './getDepartments200'; export * from './getDepartmentsId200';