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

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

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

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) =>
  getAssertUtils(AttendanceBookingReason.getAsserts(), key)
</script>
