diff --git a/package.json b/package.json index c87872e..07da1e1 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "react-router-dom": "^6.24.0", "swiper": "^11.1.4", "react-kakao-maps-sdk": "^1.1.27" + "react-signature-canvas": "^1.0.6" }, "devDependencies": { "@types/react": "^18.3.3", diff --git a/src/App.tsx b/src/App.tsx index 3de3065..a0ef5bc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -18,7 +18,6 @@ import AttendanceDetail from './pages/employee/Attendance/AttendanceDeTail'; import LandingPage from './pages/LandingPage/LandingPage'; import EmployeeGreeting from './pages/LandingPage/EmployeeGreeting'; import EmployeeAddMainAccount from './pages/LandingPage/EmployeeAddMainAccount'; -import AddWorkPlace from './pages/owner/AddWorkPlace'; import ManualWorkPlaceAddition from './pages/employee/PartTimeTab/ManualWorkPlaceAddition'; function App() { diff --git a/src/api/apiClient.ts b/src/api/apiClient.ts index 1b2fa68..e39f130 100644 --- a/src/api/apiClient.ts +++ b/src/api/apiClient.ts @@ -38,18 +38,19 @@ class ApiClient implements employeeApi { public async getMonthlyPayment( year: number, month: number - ): Promise> { - const response = await this.axiosInstance.request({ - method: 'get', - url: `employee/salaries?year=${year}&month=${month}`, - }); + ): Promise { + const response: BaseResponse = + await this.axiosInstance.request({ + method: 'get', + url: `employee/salaries?year=${year}&month=${month}`, + }); return response.data; } //알바생 - 서류 목록 public async getPaperList(): Promise { - const response: BaseResponse = + const response: BaseResponse = await this.axiosInstance.request({ method: 'get', url: 'papers', @@ -58,6 +59,57 @@ class ApiClient implements employeeApi { return response.data; } + //알바생 - 대표 계좌 등록 + public async registerEmployeeAccount({ + accountNumber, + employeeNm, + }: RegisterEmployeeAccount): Promise { + const dat: RegisterEmployeeAccount = { + accountNumber, + employeeNm, + }; + + const response: BaseResponse = + await this.axiosInstance.request({ + method: 'post', + url: 'employee/accounts', + data: dat, + }); + + return response.data; + } + + //알바생 - 대표 계좌 수정 + public async employeeUpdateAccount( + prop: EmployeeAccountUpdate + ): Promise { + const dat: EmployeeAccountUpdate = { + accountNumber: prop.accountNumber, + }; + const response = await this.axiosInstance.request({ + method: 'put', + url: 'employee/accounts', + data: dat, + }); + + return response.data; + } + + //알바생 - 월별 급여 명세서 조회 + public async employeeGetPayStub( + workPlaceEmployeeId: string, + year: number, + month: number + ): Promise { + const response: BaseResponse = + await this.axiosInstance.request({ + method: 'get', + url: `papers/${workPlaceEmployeeId}/pay-stubs?year=${year}&month=${month}`, + }); + + return response.data; + } + //========================== // 생성 메소드 private static createAxiosInstance() { diff --git a/src/api/interfaces/employeeApi.ts b/src/api/interfaces/employeeApi.ts index d67a223..559b8fb 100644 --- a/src/api/interfaces/employeeApi.ts +++ b/src/api/interfaces/employeeApi.ts @@ -1,15 +1,24 @@ interface employeeApi { manualWorkPlaceAddition( req: ManualWorkPlaceAdditionRequest - ): Promise>; + ): Promise; - getConfirmReq(): Promise>; - getMonthlyPayment( - year: number, - month: number - ): Promise>; + getConfirmReq(): Promise; + getMonthlyPayment(year: number, month: number): Promise; getPaperList(): Promise; + + registerEmployeeAccount( + prop: RegisterEmployeeAccount + ): Promise; + + employeeUpdateAccount(prop: EmployeeAccountUpdate): Promise; + + employeeGetPayStub( + id: string, + yearn: number, + month: number + ): Promise; } export default employeeApi; diff --git a/src/components/BtnGray.tsx b/src/components/BtnGray.tsx index fdaca61..4ef8ba1 100644 --- a/src/components/BtnGray.tsx +++ b/src/components/BtnGray.tsx @@ -4,9 +4,10 @@ type Prop = { text: string; action: () => void; className?: string; + disabled?: boolean; }; -const BtnGray = ({ text, action, className }: Prop) => { +const BtnGray = ({ text, action, className = '', disabled = false }: Prop) => { return ( <> diff --git a/src/components/BtnPrimary.tsx b/src/components/BtnPrimary.tsx index 16f4ae2..94b54b0 100644 --- a/src/components/BtnPrimary.tsx +++ b/src/components/BtnPrimary.tsx @@ -1,14 +1,20 @@ +import clsx from 'clsx'; + type Prop = { text: string; action: () => void; + className?: string; }; -const BtnPrimary = ({ text, action }: Prop) => { +const BtnPrimary = ({ text, action, className = '' }: Prop) => { return ( <>