first commit

This commit is contained in:
Your NamebaishaliHolocron
2026-06-15 12:57:03 +05:30
commit b9ac5ae0b2
398 changed files with 49583 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import { baseApiRequest } from "../apiRequests/baseApiRequest";
import { WorkingDaysResponse } from "./type";
const PROJECT_MANAGEMENT_BASE_URL = `${process.env.NEXT_PUBLIC_PROJECT_MANAGEMENT_API_URL}/api/v1`;
export const getAllWorkingDays = async (): Promise<WorkingDaysResponse> => {
return await baseApiRequest(
`${PROJECT_MANAGEMENT_BASE_URL}/working-days`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
credentials: "include",
},
{
isAccessTokenRequird: true,
revalidatePaths: ["/working-days"],
},
);
};
export const getWorkingDaysByYear = async (
year: string,
): Promise<WorkingDaysResponse> => {
return await baseApiRequest(
`${PROJECT_MANAGEMENT_BASE_URL}/working-days/year/${year}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
credentials: "include",
},
{
isAccessTokenRequird: true,
revalidatePaths: [`/working-days/year/${year}`],
},
);
};

View File

@@ -0,0 +1,40 @@
export interface WorkingDaysMonthDto {
year: string;
month: string;
workingDays: number;
}
export interface WorkingDaysResponseDto {
workingId: string;
accountIdentifier: string;
workingDaysDetails: Record<string, Record<string, WorkingDaysMonthDto>>;
}
export interface WorkingDaysPageableInfo {
offset: number;
sort: SortInfo;
pageSize: number;
paged: boolean;
unpaged: boolean;
pageNumber: number;
}
export interface SortInfo {
empty: boolean;
sorted: boolean;
unsorted: boolean;
}
export interface WorkingDaysResponse {
content: WorkingDaysResponseDto[];
pageable: WorkingDaysPageableInfo;
last: boolean;
totalPages: number;
totalElements: number;
sort: SortInfo;
first: boolean;
number: number;
size: number;
numberOfElements: number;
empty: boolean;
}