| @@ -20,12 +20,6 @@ import { fetchPositionCombo } from "@/app/api/positions/actions"; | |||||
| import { fetchGradeCombo } from "@/app/api/grades/actions"; | import { fetchGradeCombo } from "@/app/api/grades/actions"; | ||||
| import { fetchSkillCombo } from "@/app/api/skill/actions"; | import { fetchSkillCombo } from "@/app/api/skill/actions"; | ||||
| import { fetchSalaryCombo } from "@/app/api/salarys/actions"; | import { fetchSalaryCombo } from "@/app/api/salarys/actions"; | ||||
| // import { fetchTeamCombo } from "@/app/api/team/actions"; | |||||
| // import { fetchDepartmentCombo } from "@/app/api/departments/actions"; | |||||
| // import { fetchPositionCombo } from "@/app/api/positions/actions"; | |||||
| // import { fetchGradeCombo } from "@/app/api/grades/actions"; | |||||
| // import { fetchSkillCombo } from "@/app/api/skill/actions"; | |||||
| // import { fetchSalaryCombo } from "@/app/api/salarys/actions"; | |||||
| interface Field { | interface Field { | ||||
| // subtitle: string; | // subtitle: string; | ||||
| @@ -157,63 +151,61 @@ const CreateStaff: React.FC<formProps> = ({ Title }) => { | |||||
| id: "staffId", | id: "staffId", | ||||
| label: t("Staff ID"), | label: t("Staff ID"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "name", | id: "name", | ||||
| label: t("Staff Name"), | label: t("Staff Name"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "companyId", | id: "companyId", | ||||
| label: t("Company"), | label: t("Company"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: companyCombo, | |||||
| options: companyCombo || [], | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "teamId", | id: "teamId", | ||||
| label: t("Team"), | label: t("Team"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: teamCombo, | |||||
| options: teamCombo || [], | |||||
| required: false, | required: false, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "departmentId", | id: "departmentId", | ||||
| label: t("Department"), | label: t("Department"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: departmentCombo, | |||||
| options: departmentCombo || [], | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "gradeId", | id: "gradeId", | ||||
| label: t("Grade"), | label: t("Grade"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: gradeCombo, | |||||
| options: gradeCombo || [], | |||||
| required: false, | required: false, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "skillSetId", | id: "skillSetId", | ||||
| label: t("Skillset"), | label: t("Skillset"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: skillCombo, | |||||
| options: skillCombo || [], | |||||
| required: false, | required: false, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "currentPositionId", | id: "currentPositionId", | ||||
| label: t("Current Position"), | label: t("Current Position"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: positionCombo, | |||||
| options: positionCombo || [], | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "salaryId", | id: "salaryId", | ||||
| label: t("Salary Point"), | label: t("Salary Point"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: salaryCombo, | |||||
| options: salaryCombo || [], | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| // { | // { | ||||
| @@ -223,6 +215,12 @@ const CreateStaff: React.FC<formProps> = ({ Title }) => { | |||||
| // value: "", | // value: "", | ||||
| // required: false, | // required: false, | ||||
| // }, | // }, | ||||
| { | |||||
| id: "hourlyRate", | |||||
| label: t("Hourly Rate"), | |||||
| type: "numeric-testing", | |||||
| required: true, | |||||
| }, | |||||
| { | { | ||||
| id: "employType", | id: "employType", | ||||
| label: t("Employ Type"), | label: t("Employ Type"), | ||||
| @@ -235,7 +233,6 @@ const CreateStaff: React.FC<formProps> = ({ Title }) => { | |||||
| id: "email", | id: "email", | ||||
| label: t("Email"), | label: t("Email"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| pattern: "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$", | pattern: "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$", | ||||
| message: t("input matching format"), | message: t("input matching format"), | ||||
| required: true, | required: true, | ||||
| @@ -244,8 +241,7 @@ const CreateStaff: React.FC<formProps> = ({ Title }) => { | |||||
| id: "phone1", | id: "phone1", | ||||
| label: t("Phone1"), | label: t("Phone1"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| // pattern: "^\\d{8}$", | |||||
| pattern: "^\\d{8}$", | |||||
| message: t("input correct phone no."), | message: t("input correct phone no."), | ||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| @@ -253,8 +249,7 @@ const CreateStaff: React.FC<formProps> = ({ Title }) => { | |||||
| id: "phone2", | id: "phone2", | ||||
| label: t("Phone2"), | label: t("Phone2"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| // pattern: "^\\d{8}$", | |||||
| pattern: "^\\d{8}$", | |||||
| message: t("input correct phone no."), | message: t("input correct phone no."), | ||||
| required: false, | required: false, | ||||
| }, | }, | ||||
| @@ -264,15 +259,13 @@ const CreateStaff: React.FC<formProps> = ({ Title }) => { | |||||
| id: "emergContactName", | id: "emergContactName", | ||||
| label: t("Emergency Contact Name"), | label: t("Emergency Contact Name"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "emergContactPhone", | id: "emergContactPhone", | ||||
| label: t("Emergency Contact Phone"), | label: t("Emergency Contact Phone"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| // pattern: "^\\d{8}$", | |||||
| pattern: "^\\d{8}$", | |||||
| message: t("input correct phone no."), | message: t("input correct phone no."), | ||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| @@ -280,33 +273,29 @@ const CreateStaff: React.FC<formProps> = ({ Title }) => { | |||||
| id: "joinDate", | id: "joinDate", | ||||
| label: t("Join Date"), | label: t("Join Date"), | ||||
| type: "multiDate", | type: "multiDate", | ||||
| value: "", | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "joinPositionId", | id: "joinPositionId", | ||||
| label: t("Join Position"), | label: t("Join Position"), | ||||
| type: "combo-Obj", | type: "combo-Obj", | ||||
| options: positionCombo, | |||||
| options: positionCombo || [], | |||||
| required: true, | required: true, | ||||
| }, | }, | ||||
| { | { | ||||
| id: "departDate", | id: "departDate", | ||||
| label: t("Depart Date"), | label: t("Depart Date"), | ||||
| type: "multiDate", | type: "multiDate", | ||||
| value: "", | |||||
| }, | }, | ||||
| { | { | ||||
| id: "departReason", | id: "departReason", | ||||
| label: t("Depart Reason"), | label: t("Depart Reason"), | ||||
| type: "text", | type: "text", | ||||
| value: "", | |||||
| }, | }, | ||||
| { | { | ||||
| id: "remark", | id: "remark", | ||||
| label: t("Remark"), | label: t("Remark"), | ||||
| type: "remarks", | type: "remarks", | ||||
| value: "", | |||||
| }, | }, | ||||
| ] | ] | ||||
| ]; | ]; | ||||