aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-08-30 15:15:31 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-08-30 15:15:31 +0530
commit0d7d20829623b14c8ea5284bc24e63f7c31d61b7 (patch)
treed918be383306e88e659162f5bd5fc8249de885b6 /src/app
parenta1b3b7fb92fae98e9f6df7b9d4e3e3b4ff6b1a44 (diff)
renamed client to customer
Diffstat (limited to 'src/app')
-rw-r--r--src/app/manage/customer/list/address.rs (renamed from src/app/manage/client/list/address.rs)6
-rw-r--r--src/app/manage/customer/list/list_item.rs (renamed from src/app/manage/client/list/list_item.rs)10
-rw-r--r--src/app/manage/customer/list/mod.rs (renamed from src/app/manage/client/list/mod.rs)20
-rw-r--r--src/app/manage/customer/mod.rs (renamed from src/app/manage/client/mod.rs)24
-rw-r--r--src/app/manage/mod.rs8
-rw-r--r--src/app/mod.rs6
6 files changed, 37 insertions, 37 deletions
diff --git a/src/app/manage/client/list/address.rs b/src/app/manage/customer/list/address.rs
index 233de92..8498530 100644
--- a/src/app/manage/client/list/address.rs
+++ b/src/app/manage/customer/list/address.rs
@@ -17,11 +17,11 @@
use yew::prelude::*;
-use crate::models::client;
+use crate::models::customer;
#[derive(Properties, PartialEq)]
pub struct Props {
- pub address: client::Address,
+ pub address: customer::Address,
pub title: String,
}
@@ -29,7 +29,7 @@ pub struct Props {
pub fn address(props: &Props) -> Html {
html! {
- <div class={"client-address"}>
+ <div class={"customer-address"}>
<span class={"title"}>{props.title.clone()}</span>
<span>{props.address.address_text.clone()}</span>
</div>
diff --git a/src/app/manage/client/list/list_item.rs b/src/app/manage/customer/list/list_item.rs
index 2e6fed0..26ac51d 100644
--- a/src/app/manage/client/list/list_item.rs
+++ b/src/app/manage/customer/list/list_item.rs
@@ -17,21 +17,21 @@
use yew::prelude::*;
-use crate::models::client;
+use crate::models::customer;
#[derive(Properties, PartialEq)]
pub struct Props {
- pub client: client::Client,
+ pub customer: customer::Customer,
pub s_no: usize,
}
#[function_component(ListItem)]
pub fn list_item(props: &Props) -> Html {
html! {
- <div class={"clients-list-item"}>
+ <div class={"customers-list-item"}>
<span>{props.s_no}</span>
- <span>{props.client.name.clone()}</span>
- <span>{props.client.gstin.clone()}</span>
+ <span>{props.customer.name.clone()}</span>
+ <span>{props.customer.gstin.clone()}</span>
<span class={"options"}></span>
</div>
}
diff --git a/src/app/manage/client/list/mod.rs b/src/app/manage/customer/list/mod.rs
index 1c00f0a..00beb63 100644
--- a/src/app/manage/client/list/mod.rs
+++ b/src/app/manage/customer/list/mod.rs
@@ -20,30 +20,30 @@ mod address;
use yew::prelude::*;
-use crate::models::client;
+use crate::models::customer;
#[derive(Properties, PartialEq)]
pub struct Props {
- pub clients: Vec<client::Client>,
+ pub customers: Vec<customer::Customer>,
}
-#[function_component(ClientsList)]
-pub fn clients_list(props: &Props) -> Html {
- let list_items: Html = props.clients
+#[function_component(CustomersList)]
+pub fn customers_list(props: &Props) -> Html {
+ let list_items: Html = props.customers
.iter()
.enumerate()
- .map(|(id, c)| html!(<list_item::ListItem key={c.id} s_no={id + 1} client={c.clone()} />))
+ .map(|(id, c)| html!(<list_item::ListItem key={c.id} s_no={id + 1} customer={c.clone()} />))
.collect();
html! {
- <div class={"clients-list-wrapper"}>
- <div class={"clients-list-header"}>
+ <div class={"customers-list-wrapper"}>
+ <div class={"customers-list-header"}>
<span>{"S. No"}</span>
- <span>{"Client Name"}</span>
+ <span>{"Customer Name"}</span>
<span>{"GSTIN"}</span>
<span class={"options"}></span>
</div>
- <div class={"clients-list"}>
+ <div class={"customers-list"}>
{list_items}
</div>
</div>
diff --git a/src/app/manage/client/mod.rs b/src/app/manage/customer/mod.rs
index e81f9a5..8f5f6fb 100644
--- a/src/app/manage/client/mod.rs
+++ b/src/app/manage/customer/mod.rs
@@ -19,13 +19,13 @@ mod list;
use yew::prelude::*;
-use crate::models::client;
+use crate::models::customer;
-#[function_component(ManageClientPage)]
-pub fn manage_client_page() -> Html {
- let mut clients = Vec::new();
+#[function_component(ManageCustomerPage)]
+pub fn manage_customer() -> Html {
+ let mut customers = Vec::new();
- let mut c1: client::Client = client::Client::new();
+ let mut c1: customer::Customer = customer::Customer::new();
c1.id = 1;
c1.name = "MikunoNaka".to_string();
c1.gstin = "AKSK821KASJ123LJF".to_string();
@@ -38,16 +38,16 @@ pub fn manage_client_page() -> Html {
c1.billing_address.state = "State".to_string();
c1.billing_address.postal_code = "121212".to_string();
c1.billing_address.country = "India".to_string();
- let mut c1s1 = client::Address::new();
+ let mut c1s1 = customer::Address::new();
c1s1.address_text = "Shipping Address".to_string();
c1s1.city = "City".to_string();
c1s1.state = "State".to_string();
c1s1.postal_code = "121212".to_string();
c1s1.country = "India".to_string();
c1.add_shipping_address(c1s1);
- clients.push(c1);
+ customers.push(c1);
- let mut c2: client::Client = client::Client::new();
+ let mut c2: customer::Customer = customer::Customer::new();
c2.id = 1;
c2.name = "Google Inc.".to_string();
c2.gstin = "AKSK821KA12SJ123LJF".to_string();
@@ -60,7 +60,7 @@ pub fn manage_client_page() -> Html {
c2.billing_address.state = "State".to_string();
c2.billing_address.postal_code = "121212".to_string();
c2.billing_address.country = "India".to_string();
- let mut c2s1 = client::Address::new();
+ let mut c2s1 = customer::Address::new();
c2s1.address_text = "Address".to_string();
c2s1.city = "City".to_string();
c2s1.state = "State".to_string();
@@ -69,13 +69,13 @@ pub fn manage_client_page() -> Html {
c2.add_shipping_address(c2s1);
for _ in 0..1000 {
- clients.push(c2.clone());
+ customers.push(c2.clone());
}
html! {
- <div id={"manage-client-page"}>
+ <div id={"manage-customer-page"}>
<p>{"To Add: Searching, Viewing, Editing, Deletion, Batch Deletion"}</p>
- <list::ClientsList clients={clients}/>
+ <list::CustomersList customers={customers}/>
</div>
}
}
diff --git a/src/app/manage/mod.rs b/src/app/manage/mod.rs
index ccaddc6..354d9d3 100644
--- a/src/app/manage/mod.rs
+++ b/src/app/manage/mod.rs
@@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-pub mod client;
+pub mod customer;
use yew::prelude::*;
use yew_icons::IconId;
@@ -28,8 +28,8 @@ pub fn manage_menu_page() -> Html {
let page_menu_items = Vec::from([
menu_items::Item {
icon: IconId::FontAwesomeSolidUser,
- label: String::from("Edit Clients"),
- to: Route::ManageClients,
+ label: String::from("Edit Customers"),
+ to: Route::ManageCustomers,
},
menu_items::Item {
icon: IconId::FontAwesomeSolidIndustry,
@@ -58,7 +58,7 @@ pub fn manage_menu_page() -> Html {
<NavigationMenu>
<menu_header::MenuHeader>
<h1>{ "Manage OpenBills Data" }</h1>
- <p>{ "Here you can add/modify/delete OpenBills data (clients, invoices, etc)" }</p>
+ <p>{ "Here you can add/modify/delete OpenBills data (customers, invoices, etc)" }</p>
</menu_header::MenuHeader>
<menu_items::MenuItems items={page_menu_items}/>
diff --git a/src/app/mod.rs b/src/app/mod.rs
index 68c4d0c..ac4b57f 100644
--- a/src/app/mod.rs
+++ b/src/app/mod.rs
@@ -30,8 +30,8 @@ pub enum Route {
#[at("/manage")]
ManageMenu,
- #[at("/manage/clients")]
- ManageClients,
+ #[at("/manage/customers")]
+ ManageCustomers,
#[at("/manage/brands")]
ManageBrands,
#[at("/manage/items")]
@@ -61,7 +61,7 @@ pub fn switch(routes: Route) -> Html {
Route::Home => html! {<home::HomePage />},
Route::ManageMenu => html! {<manage::ManageMenuPage />},
- Route::ManageClients => html! {<manage::client::ManageClientPage />},
+ Route::ManageCustomers => html! {<manage::customer::ManageCustomerPage />},
Route::ManageBrands => html! {<h1>{ "Edit Brands (To Be Added)" }</h1>},
Route::ManageItems => html! {<h1>{ "Edit Items (To Be Added)" }</h1>},
Route::ManageInvoices => html! {<h1>{ "Edit Invoices (To Be Added)" }</h1>},