use crate::account::Account;
use crate::core::macros::{tmf_entity, tmf_patch_body, tmf_struct};
use crate::core::{
Agreement, Characteristic, CreditProfile, Party, PaymentMethod, Ref, RelatedParty, TimePeriod,
};
use crate::party::{ContactMedium, PartyRoleSpecification};
tmf_struct! {
@name = "Customer", @ref = "PartyRoleRef";
pub struct Customer {
id: String,
href: String,
name: String,
description: String,
engaged_party: Ref<Party>,
role: String,
status: String,
status_reason: String,
valid_for: TimePeriod,
party_role_specification: Ref<PartyRoleSpecification>,
account: Vec<Ref<Account>>,
agreement: Vec<Ref<Agreement>>,
payment_method: Vec<Ref<PaymentMethod>>,
credit_profile: Vec<CreditProfile>,
contact_medium: Vec<ContactMedium>,
characteristic: Vec<Characteristic>,
related_party: Vec<RelatedParty>,
}
}
tmf_entity!(Customer);
tmf_struct! {
@name = "Customer";
pub struct CustomerCreate {
@required {
name: String,
engaged_party: Ref<Party>,
}
id: String,
href: String,
description: String,
role: String,
status: String,
status_reason: String,
valid_for: TimePeriod,
party_role_specification: Ref<PartyRoleSpecification>,
account: Vec<Ref<Account>>,
agreement: Vec<Ref<Agreement>>,
payment_method: Vec<Ref<PaymentMethod>>,
credit_profile: Vec<CreditProfile>,
contact_medium: Vec<ContactMedium>,
characteristic: Vec<Characteristic>,
related_party: Vec<RelatedParty>,
}
}
tmf_struct! {
@name = "Customer";
pub struct CustomerUpdate {
@required {
name: String,
engaged_party: Ref<Party>,
}
id: String,
href: String,
description: String,
role: String,
status: String,
status_reason: String,
valid_for: TimePeriod,
party_role_specification: Ref<PartyRoleSpecification>,
account: Vec<Ref<Account>>,
agreement: Vec<Ref<Agreement>>,
payment_method: Vec<Ref<PaymentMethod>>,
credit_profile: Vec<CreditProfile>,
contact_medium: Vec<ContactMedium>,
characteristic: Vec<Characteristic>,
related_party: Vec<RelatedParty>,
}
}
tmf_patch_body!(CustomerUpdate);