import { required, email, numeric, sameAs, requiredUnless, requiredIf } from "vuelidate/lib/validators";
import authenticationHandler from '../authenticationHandler'
export default {
    validations: {
        parameters: {
            name: {
                required: requiredIf(function () { return this.step === 2 })
            },
            email: {
                required: requiredIf(function () { return this.step === 2 }),
                email
            },
            company_name: {
                required: requiredIf(function () { return this.parameters.type === 1 })
            },
            phone: {
                required: requiredIf(function () { return this.step === 2 }),
                numeric
            },
            wechat_id: {
                required: requiredIf(function () { return this.step === 2 }),
            },
            password: {
                required: requiredIf(function () { return this.step === 2 }),
            },
            password_confirmation: {
                required: requiredIf(function () { return this.step === 2 }),
                sameAs: sameAs('password')
            },
            identification_no:{
                required
            },
            files:{
                required
            },
        }
    },
    mixins: [authenticationHandler]
}