Skip to content

Commit

Permalink
ui updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmasken committed Feb 14, 2024
1 parent f6887ef commit ba2447a
Show file tree
Hide file tree
Showing 102 changed files with 381 additions and 579 deletions.
18 changes: 6 additions & 12 deletions .dfx/local/canisters/backend/backend.did
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type User =
type Transaction__1 =
record {
amount: nat;
created_at: int;
creator: principal;
destination: principal;
id: nat;
Expand All @@ -17,6 +18,7 @@ type Transaction__1 =
type Transaction =
record {
amount: nat;
created_at: int;
creator: principal;
destination: principal;
id: nat;
Expand Down Expand Up @@ -102,11 +104,8 @@ type Employee =
record {
created_at: int;
creator: principal;
email: text;
id: nat;
modified_at: int;
name: text;
phone_number: text;
wallet: text;
};
type CreateTransactionSuccess = record {transaction: Transaction__1;};
Expand Down Expand Up @@ -157,17 +156,12 @@ type CreateNotificationArgs =
receiver: text;
sender: text;
};
type CreateEmployeeArgs =
record {
email: text;
name: text;
phone_number: text;
wallet: text;
};
type CreateEmployeeArgs = record {wallet: text;};
type Backend =
service {
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
check_something: () -> ();
create_employee: (CreateEmployeeArgs) -> (Response_3);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
Expand Down Expand Up @@ -197,6 +191,8 @@ type Backend =
(GetAccountIdentifierResult) query;
get_transaction: (GetTransactionArgs) -> (GetTransactionResult) query;
get_transactions: () -> (vec Transaction) query;
/// * Check if user exists and return Bool
isRegistered: () -> (bool) query;
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
/// * Set the courier API key. Only the owner can set the courier API key.
Expand All @@ -206,8 +202,6 @@ type Backend =
transferFromSubAccountToSubAccount: (text, nat) -> (Response_1);
/// * Update the merchant's information
updateUser: (User) -> (Response);
/// * Check if user exists and return Bool
userExists: () -> (bool) query;
userLength: () -> (text) query;
whoami: () -> (principal);
};
Expand Down
18 changes: 15 additions & 3 deletions .dfx/local/canisters/backend/backend.most
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@ type Employee =
{
created_at : Int;
creator : Principal;
email : Text;
id : Nat;
modified_at : Int;
name : Text;
phone_number : Text;
wallet : Text
};
type Employee__1 = Employee;
type Hash = Nat32;
type Invoice =
{
amount : Text;
created_at : Int;
creator : Text;
id : Nat;
memo : ?Text;
modified_at : Int;
payer : Text;
status : Bool
};
type Invoice__1 = Invoice;
type Key__1<K> = {hash : Hash; key : K};
type Leaf<K, V> = {keyvals : AssocList__1<Key__1<K>, V>; size : Nat};
type List<T> = ?(T, List<T>);
Expand All @@ -24,6 +33,7 @@ type Notification__1 = Notification;
type Transaction =
{
amount : Nat;
created_at : Int;
creator : Principal;
destination : Principal;
id : Nat;
Expand All @@ -44,6 +54,8 @@ actor {
stable var contactsCounter : Nat;
stable var courierApiKey : Text;
stable var entries : [(Nat, Transaction__2)];
stable var invo : [(Nat, Invoice__1)];
stable var invoiceCounter : Nat;
stable var latestTransactionIndex : Nat;
stable var notificationsCounter : Nat;
stable var notifs : [(Nat, Notification__1)];
Expand Down
23 changes: 20 additions & 3 deletions .dfx/local/canisters/backend/backend.old.most
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,34 @@ type Employee =
{
created_at : Int;
creator : Principal;
email : Text;
id : Nat;
modified_at : Int;
name : Text;
phone_number : Text;
wallet : Text
};
type Employee__1 = Employee;
type Hash = Nat32;
type Invoice =
{
amount : Text;
created_at : Int;
creator : Text;
id : Nat;
memo : ?Text;
modified_at : Int;
payer : Text;
status : Bool
};
type Invoice__1 = Invoice;
type Key__1<K> = {hash : Hash; key : K};
type Leaf<K, V> = {keyvals : AssocList__1<Key__1<K>, V>; size : Nat};
type List<T> = ?(T, List<T>);
type Notification =
{amount : Nat; id : Nat; isRead : Bool; receiver : Text; sender : Text};
type Notification__1 = Notification;
type Transaction =
{
amount : Nat;
created_at : Int;
creator : Principal;
destination : Principal;
id : Nat;
Expand All @@ -41,7 +54,11 @@ actor {
stable var contactsCounter : Nat;
stable var courierApiKey : Text;
stable var entries : [(Nat, Transaction__2)];
stable var invo : [(Nat, Invoice__1)];
stable var invoiceCounter : Nat;
stable var latestTransactionIndex : Nat;
stable var notificationsCounter : Nat;
stable var notifs : [(Nat, Notification__1)];
stable var transactionCounter : Nat;
stable var userStore :
{#branch : Branch<Text, User__1>; #empty; #leaf : Leaf<Text, User__1>};
Expand Down
Binary file modified .dfx/local/canisters/backend/backend.wasm
Binary file not shown.
18 changes: 6 additions & 12 deletions .dfx/local/canisters/backend/constructor.did
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type User =
type Transaction__1 =
record {
amount: nat;
created_at: int;
creator: principal;
destination: principal;
id: nat;
Expand All @@ -17,6 +18,7 @@ type Transaction__1 =
type Transaction =
record {
amount: nat;
created_at: int;
creator: principal;
destination: principal;
id: nat;
Expand Down Expand Up @@ -102,11 +104,8 @@ type Employee =
record {
created_at: int;
creator: principal;
email: text;
id: nat;
modified_at: int;
name: text;
phone_number: text;
wallet: text;
};
type CreateTransactionSuccess = record {transaction: Transaction__1;};
Expand Down Expand Up @@ -157,17 +156,12 @@ type CreateNotificationArgs =
receiver: text;
sender: text;
};
type CreateEmployeeArgs =
record {
email: text;
name: text;
phone_number: text;
wallet: text;
};
type CreateEmployeeArgs = record {wallet: text;};
type Backend =
service {
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
check_something: () -> ();
create_employee: (CreateEmployeeArgs) -> (Response_3);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
Expand Down Expand Up @@ -197,6 +191,8 @@ type Backend =
(GetAccountIdentifierResult) query;
get_transaction: (GetTransactionArgs) -> (GetTransactionResult) query;
get_transactions: () -> (vec Transaction) query;
/// * Check if user exists and return Bool
isRegistered: () -> (bool) query;
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
/// * Set the courier API key. Only the owner can set the courier API key.
Expand All @@ -206,8 +202,6 @@ type Backend =
transferFromSubAccountToSubAccount: (text, nat) -> (Response_1);
/// * Update the merchant's information
updateUser: (User) -> (Response);
/// * Check if user exists and return Bool
userExists: () -> (bool) query;
userLength: () -> (text) query;
whoami: () -> (principal);
};
Expand Down
53 changes: 44 additions & 9 deletions .dfx/local/canisters/backend/constructor.old.did
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type User =
type Transaction__1 =
record {
amount: nat;
created_at: int;
creator: principal;
destination: principal;
id: nat;
Expand All @@ -17,6 +18,7 @@ type Transaction__1 =
type Transaction =
record {
amount: nat;
created_at: int;
creator: principal;
destination: principal;
id: nat;
Expand Down Expand Up @@ -56,6 +58,22 @@ type Response =
status: nat16;
status_text: text;
};
type Notification__1 =
record {
amount: nat;
id: nat;
isRead: bool;
receiver: text;
sender: text;
};
type Notification =
record {
amount: nat;
id: nat;
isRead: bool;
receiver: text;
sender: text;
};
type GetTransactionSuccess = record {transaction: Transaction__1;};
type GetTransactionResult =
variant {
Expand Down Expand Up @@ -86,11 +104,8 @@ type Employee =
record {
created_at: int;
creator: principal;
email: text;
id: nat;
modified_at: int;
name: text;
phone_number: text;
wallet: text;
};
type CreateTransactionSuccess = record {transaction: Transaction__1;};
Expand Down Expand Up @@ -120,13 +135,28 @@ type CreateTransactionArgs =
destination: principal;
successful: bool;
};
type CreateEmployeeArgs =
type CreateNotificationSuccess = record {notification: Notification;};
type CreateNotificationResult =
variant {
err: CreateNotificationErr;
ok: CreateNotificationSuccess;
};
type CreateNotificationErr =
record {
email: text;
name: text;
phone_number: text;
wallet: text;
kind: variant {
InvalidNotification;
Other;
};
message: opt text;
};
type CreateNotificationArgs =
record {
amount: nat;
isRead: bool;
receiver: text;
sender: text;
};
type CreateEmployeeArgs = record {wallet: text;};
type AccountIdentifierToBlobSuccess = blob;
type AccountIdentifierToBlobResult =
variant {
Expand Down Expand Up @@ -155,6 +185,7 @@ type Account =
service : {
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
check_something: () -> ();
create_employee: (CreateEmployeeArgs) -> (Response_3);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
Expand All @@ -166,9 +197,12 @@ service : {
getMyContacts: () -> (vec Employee);
getMyContactsLength: () -> (text);
getMyTransactionLength: () -> (text);
getNotifications: () -> (vec Notification__1);
getTradingAddress: () -> (text);
getTradingBalance: () -> (text);
getTransactionLength: () -> (text) query;
getUnreadNotifications: () -> (vec Notification__1);
getUnreadNotificationsLength: () -> (text);
getUser: () -> (Response) query;
getUsersList: () -> (vec record {
text;
Expand All @@ -178,13 +212,14 @@ service : {
(GetAccountIdentifierResult) query;
get_transaction: (GetTransactionArgs) -> (GetTransactionResult) query;
get_transactions: () -> (vec Transaction) query;
isRegistered: () -> (bool) query;
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
setCourierApiKey: (text) -> (Response_2);
transferFromCanistertoSubAccount: () -> (Result);
transferFromSubAccountToCanister: (nat) -> (Result);
transferFromSubAccountToSubAccount: (text, nat) -> (Response_1);
updateUser: (User) -> (Response);
userExists: () -> (bool) query;
userLength: () -> (text) query;
whoami: () -> (principal);
}

0 comments on commit ba2447a

Please sign in to comment.