Skip to content

Commit

Permalink
added function for bulk payments
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmasken committed Feb 15, 2024
1 parent ba2447a commit c16d6fd
Show file tree
Hide file tree
Showing 115 changed files with 1,206 additions and 813 deletions.
26 changes: 23 additions & 3 deletions .dfx/local/canisters/backend/backend.did
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ type Result =
err: text;
ok: text;
};
type Response_3 =
type Response_4 =
record {
data: opt Employee;
error_text: opt text;
status: nat16;
status_text: text;
};
type Response_3 =
record {
data: opt vec PayrollType;
error_text: opt text;
status: nat16;
status_text: text;
};
type Response_2 =
record {
data: opt text;
Expand All @@ -58,6 +65,15 @@ type Response =
status: nat16;
status_text: text;
};
type PayrollType =
record {
amount: nat;
created_at: int;
creator: text;
destination: text;
id: nat;
successful: bool;
};
type Notification__1 =
record {
amount: nat;
Expand Down Expand Up @@ -104,8 +120,11 @@ type Employee =
record {
created_at: int;
creator: principal;
email_address: text;
id: nat;
modified_at: int;
name: text;
phone_number: text;
wallet: text;
};
type CreateTransactionSuccess = record {transaction: Transaction__1;};
Expand Down Expand Up @@ -161,8 +180,7 @@ type Backend =
service {
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
check_something: () -> ();
create_employee: (CreateEmployeeArgs) -> (Response_3);
create_employee: (CreateEmployeeArgs) -> (Response_4);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
getCanisterBalance: () -> (text);
Expand Down Expand Up @@ -193,10 +211,12 @@ type Backend =
get_transactions: () -> (vec Transaction) query;
/// * Check if user exists and return Bool
isRegistered: () -> (bool) query;
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
/// * Set the courier API key. Only the owner can set the courier API key.
setCourierApiKey: (text) -> (Response_2);
testRandom: () -> (opt bool);
transferFromCanistertoSubAccount: () -> (Result);
transferFromSubAccountToCanister: (nat) -> (Result);
transferFromSubAccountToSubAccount: (text, nat) -> (Response_1);
Expand Down
9 changes: 7 additions & 2 deletions .dfx/local/canisters/backend/backend.most
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@ type Employee =
{
created_at : Int;
creator : Principal;
email_address : Text;
id : Nat;
modified_at : Int;
name : Text;
phone_number : Text;
wallet : Text
};
type Employee__1 = Employee;
type Hash = Nat32;
type Invoice =
{
amount : Text;
client : Text;
created_at : Int;
creator : Text;
id : Nat;
isApproved : Bool;
isPaid : Bool;
memo : ?Text;
modified_at : Int;
payer : Text;
status : Bool
receiver : Text
};
type Invoice__1 = Invoice;
type Key__1<K> = {hash : Hash; key : K};
Expand Down
9 changes: 7 additions & 2 deletions .dfx/local/canisters/backend/backend.old.most
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@ type Employee =
{
created_at : Int;
creator : Principal;
email_address : Text;
id : Nat;
modified_at : Int;
name : Text;
phone_number : Text;
wallet : Text
};
type Employee__1 = Employee;
type Hash = Nat32;
type Invoice =
{
amount : Text;
client : Text;
created_at : Int;
creator : Text;
id : Nat;
isApproved : Bool;
isPaid : Bool;
memo : ?Text;
modified_at : Int;
payer : Text;
status : Bool
receiver : Text
};
type Invoice__1 = Invoice;
type Key__1<K> = {hash : Hash; key : K};
Expand Down
Binary file modified .dfx/local/canisters/backend/backend.wasm
Binary file not shown.
26 changes: 23 additions & 3 deletions .dfx/local/canisters/backend/constructor.did
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ type Result =
err: text;
ok: text;
};
type Response_3 =
type Response_4 =
record {
data: opt Employee;
error_text: opt text;
status: nat16;
status_text: text;
};
type Response_3 =
record {
data: opt vec PayrollType;
error_text: opt text;
status: nat16;
status_text: text;
};
type Response_2 =
record {
data: opt text;
Expand All @@ -58,6 +65,15 @@ type Response =
status: nat16;
status_text: text;
};
type PayrollType =
record {
amount: nat;
created_at: int;
creator: text;
destination: text;
id: nat;
successful: bool;
};
type Notification__1 =
record {
amount: nat;
Expand Down Expand Up @@ -104,8 +120,11 @@ type Employee =
record {
created_at: int;
creator: principal;
email_address: text;
id: nat;
modified_at: int;
name: text;
phone_number: text;
wallet: text;
};
type CreateTransactionSuccess = record {transaction: Transaction__1;};
Expand Down Expand Up @@ -161,8 +180,7 @@ type Backend =
service {
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
check_something: () -> ();
create_employee: (CreateEmployeeArgs) -> (Response_3);
create_employee: (CreateEmployeeArgs) -> (Response_4);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
getCanisterBalance: () -> (text);
Expand Down Expand Up @@ -193,10 +211,12 @@ type Backend =
get_transactions: () -> (vec Transaction) query;
/// * Check if user exists and return Bool
isRegistered: () -> (bool) query;
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
/// * Set the courier API key. Only the owner can set the courier API key.
setCourierApiKey: (text) -> (Response_2);
testRandom: () -> (opt bool);
transferFromCanistertoSubAccount: () -> (Result);
transferFromSubAccountToCanister: (nat) -> (Result);
transferFromSubAccountToSubAccount: (text, nat) -> (Response_1);
Expand Down
26 changes: 23 additions & 3 deletions .dfx/local/canisters/backend/constructor.old.did
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ type Result =
err: text;
ok: text;
};
type Response_3 =
type Response_4 =
record {
data: opt Employee;
error_text: opt text;
status: nat16;
status_text: text;
};
type Response_3 =
record {
data: opt vec PayrollType;
error_text: opt text;
status: nat16;
status_text: text;
};
type Response_2 =
record {
data: opt text;
Expand All @@ -58,6 +65,15 @@ type Response =
status: nat16;
status_text: text;
};
type PayrollType =
record {
amount: nat;
created_at: int;
creator: text;
destination: text;
id: nat;
successful: bool;
};
type Notification__1 =
record {
amount: nat;
Expand Down Expand Up @@ -104,8 +120,11 @@ type Employee =
record {
created_at: int;
creator: principal;
email_address: text;
id: nat;
modified_at: int;
name: text;
phone_number: text;
wallet: text;
};
type CreateTransactionSuccess = record {transaction: Transaction__1;};
Expand Down Expand Up @@ -185,8 +204,7 @@ type Account =
service : {
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
check_something: () -> ();
create_employee: (CreateEmployeeArgs) -> (Response_3);
create_employee: (CreateEmployeeArgs) -> (Response_4);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
getCanisterBalance: () -> (text);
Expand All @@ -213,9 +231,11 @@ service : {
get_transaction: (GetTransactionArgs) -> (GetTransactionResult) query;
get_transactions: () -> (vec Transaction) query;
isRegistered: () -> (bool) query;
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
setCourierApiKey: (text) -> (Response_2);
testRandom: () -> (opt bool);
transferFromCanistertoSubAccount: () -> (Result);
transferFromSubAccountToCanister: (nat) -> (Result);
transferFromSubAccountToSubAccount: (text, nat) -> (Response_1);
Expand Down
22 changes: 20 additions & 2 deletions .dfx/local/canisters/backend/service.did
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ type Backend = service {
accountIdentifierToBlob : (AccountIdentifier) -> (
AccountIdentifierToBlobResult,
);
check_something : () -> ();
create_employee : (CreateEmployeeArgs) -> (Response_3);
create_employee : (CreateEmployeeArgs) -> (Response_4);
getAddress : () -> (text);
getCanisterAddress : () -> (text);
getCanisterBalance : () -> (text);
Expand All @@ -43,9 +42,11 @@ type Backend = service {
get_transaction : (GetTransactionArgs) -> (GetTransactionResult) query;
get_transactions : () -> (vec Transaction) query;
isRegistered : () -> (bool) query;
runpayroll : (vec PayrollType) -> (Response_3);
save_notification : (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction : (CreateTransactionArgs) -> (CreateTransactionResult);
setCourierApiKey : (text) -> (Response_2);
testRandom : () -> (opt bool);
transferFromCanistertoSubAccount : () -> (Result);
transferFromSubAccountToCanister : (nat) -> (Result);
transferFromSubAccountToSubAccount : (text, nat) -> (Response_1);
Expand Down Expand Up @@ -94,10 +95,13 @@ type CreateTransactionResult = variant {
type CreateTransactionSuccess = record { transaction : Transaction__1 };
type Employee = record {
id : nat;
email_address : text;
creator : principal;
modified_at : int;
name : text;
created_at : int;
wallet : text;
phone_number : text;
};
type GetAccountIdentifierArgs = record { "principal" : principal };
type GetAccountIdentifierErr = record { message : opt text };
Expand Down Expand Up @@ -132,6 +136,14 @@ type Notification__1 = record {
amount : nat;
receiver : text;
};
type PayrollType = record {
id : nat;
creator : text;
destination : text;
created_at : int;
amount : nat;
successful : bool;
};
type Response = record {
status : nat16;
data : opt User;
Expand All @@ -151,6 +163,12 @@ type Response_2 = record {
error_text : opt text;
};
type Response_3 = record {
status : nat16;
data : opt vec PayrollType;
status_text : text;
error_text : opt text;
};
type Response_4 = record {
status : nat16;
data : opt Employee;
status_text : text;
Expand Down

0 comments on commit c16d6fd

Please sign in to comment.