updates to mock content and contract view implementation

This commit is contained in:
Timur Gordon
2025-04-23 03:52:11 +02:00
parent 6060831f61
commit b56f1cbc30
9 changed files with 1453 additions and 644 deletions

View File

@@ -8,6 +8,7 @@ pub enum ContractStatus {
Draft,
PendingSignatures,
Signed,
Active,
Expired,
Cancelled
}
@@ -18,6 +19,7 @@ impl ContractStatus {
ContractStatus::Draft => "Draft",
ContractStatus::PendingSignatures => "Pending Signatures",
ContractStatus::Signed => "Signed",
ContractStatus::Active => "Active",
ContractStatus::Expired => "Expired",
ContractStatus::Cancelled => "Cancelled",
}
@@ -31,6 +33,10 @@ pub enum ContractType {
Employment,
NDA,
SLA,
Partnership,
Distribution,
License,
Membership,
Other
}
@@ -41,6 +47,10 @@ impl ContractType {
ContractType::Employment => "Employment Contract",
ContractType::NDA => "Non-Disclosure Agreement",
ContractType::SLA => "Service Level Agreement",
ContractType::Partnership => "Partnership Agreement",
ContractType::Distribution => "Distribution Agreement",
ContractType::License => "License Agreement",
ContractType::Membership => "Membership Agreement",
ContractType::Other => "Other",
}
}

View File

@@ -37,6 +37,12 @@ pub enum FlowType {
ServiceActivation,
/// Payment processing flow
PaymentProcessing,
/// Asset tokenization flow
AssetTokenization,
/// Certification flow
Certification,
/// License application flow
LicenseApplication,
}
impl std::fmt::Display for FlowType {
@@ -46,6 +52,9 @@ impl std::fmt::Display for FlowType {
FlowType::UserOnboarding => write!(f, "User Onboarding"),
FlowType::ServiceActivation => write!(f, "Service Activation"),
FlowType::PaymentProcessing => write!(f, "Payment Processing"),
FlowType::AssetTokenization => write!(f, "Asset Tokenization"),
FlowType::Certification => write!(f, "Certification"),
FlowType::LicenseApplication => write!(f, "License Application"),
}
}
}

View File

@@ -145,8 +145,8 @@ mod tests {
#[test]
fn test_new_user() {
let user = User::new("John Doe".to_string(), "john@example.com".to_string());
assert_eq!(user.name, "John Doe");
let user = User::new("Robert Callingham".to_string(), "john@example.com".to_string());
assert_eq!(user.name, "Robert Callingham");
assert_eq!(user.email, "john@example.com");
assert!(!user.is_admin());
}
@@ -161,13 +161,13 @@ mod tests {
#[test]
fn test_update_user() {
let mut user = User::new("John Doe".to_string(), "john@example.com".to_string());
user.update(Some("Jane Doe".to_string()), None);
assert_eq!(user.name, "Jane Doe");
let mut user = User::new("Robert Callingham".to_string(), "john@example.com".to_string());
user.update(Some("Mary Hewell".to_string()), None);
assert_eq!(user.name, "Mary Hewell");
assert_eq!(user.email, "john@example.com");
user.update(None, Some("jane@example.com".to_string()));
assert_eq!(user.name, "Jane Doe");
assert_eq!(user.name, "Mary Hewell");
assert_eq!(user.email, "jane@example.com");
}
}