-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Customer_Characteristics
- Loading branch information
Showing
9 changed files
with
335 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "tmflib" | ||
version = "0.1.4" | ||
version = "0.1.5" | ||
edition = "2021" | ||
authors = ["Ryan Ruckley <[email protected]>"] | ||
description = "Interface library for processing TMF payloads" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
//! Create Quote Example | ||
use tmflib::tmf648::{quote::Quote, quote_item::QuoteItem}; | ||
use tmflib::tmf648::{quote::Quote, quote_item::QuoteItem, quote_price::{Price,QuotePrice}}; | ||
|
||
fn main() { | ||
// Create a quote | ||
let item = QuoteItem::new(); | ||
// Create a quote using various components | ||
|
||
// First create a quote item | ||
let mut item = QuoteItem::new(); | ||
// Create a price for this item | ||
let price = Price::new_ex(100.0); | ||
// Add price to QuotePrice and set period | ||
let quote_price = QuotePrice::new("Subscription").price(price).period("Monthly"); | ||
// add QuotePrice to item | ||
item.price(quote_price); | ||
// Create the new Quote | ||
let mut quote = Quote::new(); | ||
// Add the item to the quote | ||
let _result = quote.add_quote(item); | ||
let _result = quote.with_external_id(String::from("ExternalId")); | ||
// Set the external Id | ||
let _result = quote.with_external_id(String::from("EXT123")); | ||
|
||
// Create a total price for the quote | ||
let total_price = Price::new_ex(3600.0); | ||
|
||
// Create QuotePrice object for the total price and set period | ||
let quote_total_price = QuotePrice::new("Total Contract").price(total_price).period("Contract"); | ||
// Add QuotePrice to quote | ||
quote.price(quote_total_price); | ||
|
||
dbg!("e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ const MOD_PATH: &str = "tmf648/v4"; | |
|
||
pub mod quote; | ||
pub mod quote_item; | ||
pub mod quote_price; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.