use super::event::{FamilyEvent, Witness};
use super::key::Somebody;
use super::person::{Person, Sex};
use crate::date::GwDate;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum RelationKind {
#[default]
Married,
NotMarried,
Engaged,
NoSexesCheckNotMarried,
NoSexesCheckMarried,
NoMention,
MarriageBann,
MarriageContract,
MarriageLicense,
Pacs,
Residence,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub enum Divorce {
#[default]
NotDivorced,
Divorced(Option<GwDate>),
Separated(Option<GwDate>),
}
#[derive(Debug, Clone, PartialEq)]
pub struct Family {
pub father: Somebody,
pub mother: Somebody,
pub father_sex: Sex,
pub mother_sex: Sex,
pub relation: RelationKind,
pub marriage: Option<GwDate>,
pub marriage_place: String,
pub marriage_note: String,
pub marriage_src: String,
pub divorce: Divorce,
pub witnesses: Vec<Witness>,
pub sources: String,
pub children_sources: String,
pub children_birth_place: String,
pub comment: String,
pub events: Vec<FamilyEvent>,
pub children: Vec<Person>,
pub origin_file: String,
}
impl Family {
#[must_use]
pub fn new(father: Somebody, mother: Somebody) -> Self {
Self {
father,
mother,
father_sex: Sex::Male,
mother_sex: Sex::Female,
relation: RelationKind::default(),
marriage: None,
marriage_place: String::new(),
marriage_note: String::new(),
marriage_src: String::new(),
divorce: Divorce::default(),
witnesses: Vec::new(),
sources: String::new(),
children_sources: String::new(),
children_birth_place: String::new(),
comment: String::new(),
events: Vec::new(),
children: Vec::new(),
origin_file: String::new(),
}
}
}