UserType
Dealing With UserType
In order to deal with the User and the functionality related to User, we use the UserType interface:
interface UserType {
id?: number;
name?: string;
phone_number?: string;
email?: string;
date_of_birth?: string;
gender?: GenderType; // 'male' | 'female'
insurance_id?: string;
policy_number?: string;
nationality_number?: string;
avatar_media_id?: string;
height?: string;
weight?: string;
blood_type?: BloodType; // 'A+' | 'B+' | 'AB+' | 'O+' | 'A-' | 'B-' | 'AB-' | 'O-'
smoker?: BoolString; // 'yes' | 'no'
alcoholic?: BoolString; // 'yes' | 'no'
marital_status?: MaritalStatus; // 'single' | 'married' | 'divorced' | 'widow'
relation_type?: RelationType; // 'personal' | 'father' | 'mother' | 'sister' | 'brother' | 'child' | 'husband' | 'wife' | 'other'
created_at?: string;
updated_at?: string;
}
Not all fields are required — only send the fields relevant to the operation you're performing.
Static Dropdown Data
react-web-altibbi exports static arrays to help you build <select> dropdowns for the enum-like UserType fields:
import {
materialStatusArray,
bloodTypeArray,
boolStringArray,
genderTypeArray,
} from 'react-web-altibbi';