import { mdiAccount, mdiChartTimelineVariant, mdiMail, mdiUpload } from '@mdi/js'
import Head from 'next/head'
import React, { ReactElement } from 'react'
import CardBox from '../../components/CardBox'
import LayoutAuthenticated from '../../layouts/Authenticated'
import SectionMain from '../../components/SectionMain'
import SectionTitleLineWithButton from '../../components/SectionTitleLineWithButton'
import { getPageTitle } from '../../config'

import { Field, Form, Formik } from 'formik'
import FormField from '../../components/FormField'
import BaseDivider from '../../components/BaseDivider'
import BaseButtons from '../../components/BaseButtons'
import BaseButton from '../../components/BaseButton'
import FormCheckRadio from '../../components/FormCheckRadio'
import FormCheckRadioGroup from '../../components/FormCheckRadioGroup'
import FormFilePicker from '../../components/FormFilePicker'
import FormImagePicker from '../../components/FormImagePicker'
import { SwitchField } from '../../components/SwitchField'

import { SelectField } from '../../components/SelectField'
import { SelectFieldMany } from "../../components/SelectFieldMany";
import {RichTextField} from "../../components/RichTextField";

import { create } from '../../stores/employee_hr_records/employee_hr_recordsSlice'
import { useAppDispatch } from '../../stores/hooks'
import { useRouter } from 'next/router'
import moment from 'moment';

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    employee: '',
    
    
    
    
    contract_number: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    hire_date: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    contract_type: 'PERMANENT',
    
    
    
    
    
    
    
    position: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    work_schedule: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    probation_days: '',
    
    
    
    
    
    
    
    
    
    
    
    
    salary: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    daily_allowance: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    bonuses: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    deductions: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    bank_account_iban: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    bank_name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    insurance_number: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    tax_number: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    tax_category: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    vacation_days: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    used_vacation_days: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    employment_status: 'ACTIVE',
    
    
    
    
    
    
    
    
    
    
    
    
    termination_date: '',
    
    
    
    
    
    
    
    
    
    
    
    termination_reason: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
}


const Employee_hr_recordsNew = () => {
  const router = useRouter()
  const dispatch = useAppDispatch()

    
    

  const handleSubmit = async (data) => {
    await dispatch(create(data))
    await router.push('/employee_hr_records/employee_hr_records-list')
  }
  return (
    <>
      <Head>
        <title>{getPageTitle('New Item')}</title>
      </Head>
      <SectionMain>
        <SectionTitleLineWithButton icon={mdiChartTimelineVariant} title="New Item" main>
        {''}
        </SectionTitleLineWithButton>
        <CardBox>
          <Formik
            initialValues={
                
                initialValues
                
            }
            onSubmit={(values) => handleSubmit(values)}
          >
            <Form>





















  <FormField label="Employee" labelFor="employee">
      <Field name="employee" id="employee" component={SelectField} options={[]} itemRef={'employees'}></Field>
  </FormField>









  <FormField
      label="ContractNumber"
  >
      <Field
          name="contract_number"
          placeholder="ContractNumber"
      />
  </FormField>





































  <FormField
      label="HireDate"
  >
      <Field
          type="datetime-local"
          name="hire_date"
          placeholder="HireDate"
      />
  </FormField>































  <FormField label="ContractType" labelFor="contract_type">
      <Field name="contract_type" id="contract_type" component="select">
      
        <option value="PERMANENT">PERMANENT</option>
      
        <option value="FIXED">FIXED</option>
      
      </Field>
  </FormField>













  <FormField
      label="Position"
  >
      <Field
          name="position"
          placeholder="Position"
      />
  </FormField>



























  <FormField
      label="WorkSchedule"
  >
      <Field
          name="work_schedule"
          placeholder="WorkSchedule"
      />
  </FormField>

































    <FormField
        label="ProbationDays"
    >
        <Field
            type="number"
            name="probation_days"
            placeholder="ProbationDays"
        />
    </FormField>



























    <FormField
        label="Salary"
    >
        <Field
            type="number"
            name="salary"
            placeholder="Salary"
        />
    </FormField>



























    <FormField
        label="DailyAllowance"
    >
        <Field
            type="number"
            name="daily_allowance"
            placeholder="DailyAllowance"
        />
    </FormField>



























    <FormField
        label="Bonuses"
    >
        <Field
            type="number"
            name="bonuses"
            placeholder="Bonuses"
        />
    </FormField>



























    <FormField
        label="Deductions"
    >
        <Field
            type="number"
            name="deductions"
            placeholder="Deductions"
        />
    </FormField>





















  <FormField
      label="BankAccountIBAN"
  >
      <Field
          name="bank_account_iban"
          placeholder="BankAccountIBAN"
      />
  </FormField>



























  <FormField
      label="BankName"
  >
      <Field
          name="bank_name"
          placeholder="BankName"
      />
  </FormField>



























  <FormField
      label="InsuranceNumber"
  >
      <Field
          name="insurance_number"
          placeholder="InsuranceNumber"
      />
  </FormField>



























  <FormField
      label="TaxNumber"
  >
      <Field
          name="tax_number"
          placeholder="TaxNumber"
      />
  </FormField>



























  <FormField
      label="TaxCategory"
  >
      <Field
          name="tax_category"
          placeholder="TaxCategory"
      />
  </FormField>

































    <FormField
        label="VacationDays"
    >
        <Field
            type="number"
            name="vacation_days"
            placeholder="VacationDays"
        />
    </FormField>



























    <FormField
        label="UsedVacationDays"
    >
        <Field
            type="number"
            name="used_vacation_days"
            placeholder="UsedVacationDays"
        />
    </FormField>



































  <FormField label="EmploymentStatus" labelFor="employment_status">
      <Field name="employment_status" id="employment_status" component="select">
      
        <option value="ACTIVE">ACTIVE</option>
      
        <option value="SICK">SICK</option>
      
        <option value="VACATION">VACATION</option>
      
        <option value="TERMINATED">TERMINATED</option>
      
      </Field>
  </FormField>























  <FormField
      label="TerminationDate"
  >
      <Field
          type="datetime-local"
          name="termination_date"
          placeholder="TerminationDate"
      />
  </FormField>



















    <FormField label="TerminationReason" hasTextareaHeight>
        <Field name="termination_reason" as="textarea" placeholder="TerminationReason" />
    </FormField>























              <BaseDivider />
              <BaseButtons>
                <BaseButton type="submit" color="info" label="Submit" />
                <BaseButton type="reset" color="info" outline label="Reset" />
                <BaseButton type='reset' color='danger' outline label='Cancel' onClick={() => router.push('/employee_hr_records/employee_hr_records-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

Employee_hr_recordsNew.getLayout = function getLayout(page: ReactElement) {
  return (
      <LayoutAuthenticated
        
          permission={'CREATE_EMPLOYEE_HR_RECORDS'}
        
      >
          {page}
      </LayoutAuthenticated>
  )
}

export default Employee_hr_recordsNew
