알림 수정
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_VAT_RETURN } from '@/shared/api/api-url-vat-return';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
VatReturnBreakdownResponse,
|
||||
VatReturnBreakdownParams,
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const vatReturnBreakdown = (params: VatReturnBreakdownParams) => {
|
||||
return resultify(
|
||||
axios.post<VatReturnBreakdownResponse>(API_URL_VAT_RETURN.vatReturnBreakdown(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useVatReturnBreakdownMutation = (options?: UseMutationOptions<VatReturnBreakdownResponse, NiceAxiosError, VatReturnBreakdownParams>) => {
|
||||
const mutation = useMutation<VatReturnBreakdownResponse, NiceAxiosError, VatReturnBreakdownParams>({
|
||||
...options,
|
||||
mutationFn: (params: VatReturnBreakdownParams) => vatReturnBreakdown(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -32,7 +32,19 @@ export interface VatReturnListParams {
|
||||
targetType?: VatReturnTargetType;
|
||||
page?: DefaultRequestPagination;
|
||||
};
|
||||
|
||||
export interface VatReturnBreakdownParams {
|
||||
taxInvoiceNumber: string;
|
||||
};
|
||||
export interface VatReturnBreakdownResponse {
|
||||
breakdown: Array<Breakdown>;
|
||||
};
|
||||
export interface Breakdown {
|
||||
transactionDate: string;
|
||||
totalAmount: number;
|
||||
supplyAmount: number;
|
||||
vatAmount: number;
|
||||
transactionCount: number;
|
||||
};
|
||||
|
||||
export interface VatReturnListResponse extends DefaulResponsePagination {
|
||||
content: Array<VatReturnListContent>;
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import { IMAGE_ROOT } from "@/shared/constants/common";
|
||||
import { Breakdown } from "../model/types";
|
||||
|
||||
export interface VatReturnListDetailBottomSheetProps {
|
||||
bottomSheetOn: boolean;
|
||||
setBottomSheetOn: (bottomSheetOn: boolean) => void;
|
||||
breakdown: Array<Breakdown>
|
||||
};
|
||||
|
||||
export const VatReturnListDetailBottomSheet = ({
|
||||
bottomSheetOn,
|
||||
setBottomSheetOn
|
||||
setBottomSheetOn,
|
||||
breakdown
|
||||
}: VatReturnListDetailBottomSheetProps) => {
|
||||
|
||||
const onClickToClose = () => {
|
||||
|
||||
Reference in New Issue
Block a user