|
- import { APICommonResponse, ApiId, HttpMethod, makeParam, request } from "api";
- import { getUrl } from "api/url";
-
- export type HTCustomer = {
- customer_code: string;
- name: string;
- };
- export type HTParking = {
- customer_code: string;
- parking_management_code: string;
- name: string;
- };
- export type HTAdjustData = {
- customer_code: string;
- parking_management_code: string;
- adjust_seq_no: number;
- adjust_datetime: string;
-
- tax_charge: number;
- putin_datetime: string;
- adjust_type: string;
- amount: number;
- };
-
- export type HTCustomersResponse = {
- data: {
- records: HTCustomer[];
- };
- } & APICommonResponse;
-
- export const getHTCustomers = async (data = {}) => {
- const res = await request<HTCustomersResponse>({
- url: getUrl(ApiId.HT_CUSTOM_CUSTOMERS),
- method: HttpMethod.GET,
- });
- return res;
- };
-
- export type HTParkingsRequest = {
- customer_code: string;
- };
-
- export type HTParkingsResponse = {
- data: {
- records: HTParking[];
- };
- } & APICommonResponse;
-
- export const getHTParkings = async (data: HTParkingsRequest) => {
- console.log({ data });
- const res = await request<HTParkingsResponse>({
- url: getUrl(ApiId.HT_CUSTOM_PARKINGS),
- method: HttpMethod.GET,
- data: new URLSearchParams(data),
- });
- return res;
- };
-
- export type HTAdjustDataRequest = {
- customer_code: string;
- parking_management_code: string;
- adjust_seq_no: string;
- };
-
- export type HTAdjustDataResponse = {
- data: HTAdjustData;
- } & APICommonResponse;
-
- export const getHTAdjustData = async (data: HTAdjustDataRequest) => {
- const res = await request<HTAdjustDataResponse>({
- url: getUrl(ApiId.HT_CUSTOM_ADJUST_DATA),
- method: HttpMethod.GET,
- data: new URLSearchParams(data),
- });
- return res;
- };
|