On branch master
Initial commit Changes to be committed: new file: .gitignore new file: Cargo.lock new file: Cargo.toml new file: src/main.rs new file: src/type_crate.rs
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/target
|
||||
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "typl"
|
||||
version = "0.1.0"
|
||||
6
Cargo.toml
Normal file
6
Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "typl"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
16
src/main.rs
Normal file
16
src/main.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
mod type_crate;
|
||||
|
||||
/*implement a deferment method for client_id
|
||||
* as well as a constructor.
|
||||
* note_1 -- if no contact_name, assume client_name == contact_name
|
||||
* note_2 -- if is_biller, follow up with billing contact info.*/
|
||||
|
||||
fn main() {
|
||||
let client_id: u32 = 24799;
|
||||
let name: &str = "Jonny";
|
||||
let contact_name: &str = "Johnathon";
|
||||
let is_biller: bool = false;
|
||||
let jonny: type_crate::Client =
|
||||
type_crate::Client::new(client_id, name, contact_name, is_biller);
|
||||
println!("Test Client:: {:#?}", jonny)
|
||||
}
|
||||
48
src/type_crate.rs
Normal file
48
src/type_crate.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
#[derive(Debug)]
|
||||
pub struct Client {
|
||||
id: u32,
|
||||
name: String,
|
||||
contact: String,
|
||||
billing: bool,
|
||||
}
|
||||
|
||||
impl Client {
|
||||
pub fn new(id: u32, name: &str, contact: &str, billing: bool) -> Self {
|
||||
Self {
|
||||
id: id,
|
||||
name: name.to_owned(),
|
||||
contact: contact.to_owned(),
|
||||
billing: billing,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Fee {
|
||||
entry_date: u64,
|
||||
hours: f32,
|
||||
worked_hours: f32,
|
||||
timekeeper: u16,
|
||||
rate: u16,
|
||||
amount: f32,
|
||||
description: String,
|
||||
}
|
||||
|
||||
struct Timekeeper {
|
||||
name: String,
|
||||
number: u16,
|
||||
initials: String,
|
||||
level: u8,
|
||||
splits: Option<Vec<Self>>,
|
||||
}
|
||||
|
||||
struct Cost {
|
||||
entry_date: u64,
|
||||
tcode: u8,
|
||||
amount: f32,
|
||||
description: String,
|
||||
}
|
||||
|
||||
enum Charge {
|
||||
Cost,
|
||||
Fee,
|
||||
}
|
||||
Reference in New Issue
Block a user