<template>
  <v-container :fluid="true" class="container">
    <v-row>
      <v-col cols="12" sm="6">
        <UiInputNumber
          v-model="proxyEntity.timing"
          field="educationTiming"
          :rules="getAsserts('timing')"
        />
      </v-col>
    </v-row>
  </v-container>
</template>

<script setup lang="ts">
import { getAssertUtils } from '~/services/asserts/getAssertUtils'
import EducationTiming from '~/models/Education/EducationTiming'

const props = defineProps<{
  entity: EducationTiming
}>()

const emit = defineEmits(['update:entity'])

// Pour éviter l'erreur eslint "Unexpected mutation of "modelValue" prop"
const proxyEntity = computed({
  get: () => props.entity,
  set: (value) => emit('update:entity', value),
})

const getAsserts = (key: string) =>
  getAssertUtils(EducationTiming.getAsserts(), key)
</script>
