Skip to content

Commit

Permalink
validate user data
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmasken committed Feb 19, 2024
1 parent 1a2c512 commit 80e87d6
Show file tree
Hide file tree
Showing 105 changed files with 651 additions and 1,380 deletions.
4 changes: 2 additions & 2 deletions .dfx/local/canisters/backend/backend.did
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ type Backend =
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
create_employee: (CreateEmployeeArgs) -> (Response_4);
emailExists: (text) -> (bool);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
getCanisterBalance: () -> (text);
Expand Down Expand Up @@ -239,12 +240,11 @@ type Backend =
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
sendToOwner: (nat, text) -> (Result);
send_notifications: (text, text, text, text, text) -> ();
/// * 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);
transform: (TransformArgs) -> (CanisterHttpResponsePayload) query;
/// * Update the merchant's information
Expand Down
12 changes: 12 additions & 0 deletions .dfx/local/canisters/backend/backend.most
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ type List<T> = ?(T, List<T>);
type Notification =
{amount : Nat; id : Nat; isRead : Bool; receiver : Text; sender : Text};
type Notification__1 = Notification;
type PayrollType =
{
amount : Nat;
created_at : Int;
creator : Text;
destination : Text;
id : Nat;
successful : Bool
};
type PayrollType__1 = PayrollType;
type Transaction =
{
amount : Nat;
Expand Down Expand Up @@ -64,6 +74,8 @@ actor {
stable var latestTransactionIndex : Nat;
stable var notificationsCounter : Nat;
stable var notificationsStable : [(Nat, Notification__1)];
stable var payrollCounter : Nat;
stable var stablePayroll : [(Nat, [PayrollType__1])];
stable var transactionCounter : Nat;
stable var transactionsStable : [(Nat, Transaction__2)];
stable var userStore :
Expand Down
12 changes: 12 additions & 0 deletions .dfx/local/canisters/backend/backend.old.most
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ type List<T> = ?(T, List<T>);
type Notification =
{amount : Nat; id : Nat; isRead : Bool; receiver : Text; sender : Text};
type Notification__1 = Notification;
type PayrollType =
{
amount : Nat;
created_at : Int;
creator : Text;
destination : Text;
id : Nat;
successful : Bool
};
type PayrollType__1 = PayrollType;
type Transaction =
{
amount : Nat;
Expand Down Expand Up @@ -64,6 +74,8 @@ actor {
stable var latestTransactionIndex : Nat;
stable var notificationsCounter : Nat;
stable var notificationsStable : [(Nat, Notification__1)];
stable var payrollCounter : Nat;
stable var stablePayroll : [(Nat, [PayrollType__1])];
stable var transactionCounter : Nat;
stable var transactionsStable : [(Nat, Transaction__2)];
stable var userStore :
Expand Down
Binary file modified .dfx/local/canisters/backend/backend.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions .dfx/local/canisters/backend/constructor.did
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ type Backend =
accountIdentifierToBlob: (AccountIdentifier) ->
(AccountIdentifierToBlobResult);
create_employee: (CreateEmployeeArgs) -> (Response_4);
emailExists: (text) -> (bool);
getAddress: () -> (text);
getCanisterAddress: () -> (text);
getCanisterBalance: () -> (text);
Expand Down Expand Up @@ -239,12 +240,11 @@ type Backend =
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
sendToOwner: (nat, text) -> (Result);
send_notifications: (text, text, text, text, text) -> ();
/// * 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);
transform: (TransformArgs) -> (CanisterHttpResponsePayload) query;
/// * Update the merchant's information
Expand Down
3 changes: 1 addition & 2 deletions .dfx/local/canisters/backend/constructor.old.did
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,10 @@ service : {
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
sendToOwner: (nat, text) -> (Result);
send_notifications: (text, text, text, text, text) -> ();
setCourierApiKey: (text) -> (Response_2);
testRandom: () -> (opt bool);
transferFromCanistertoSubAccount: () -> (Result);
transferFromSubAccountToCanister: (nat) -> (Result);
transferFromSubAccountToSubAccount: (text, nat) -> (Response_1);
transform: (TransformArgs) -> (CanisterHttpResponsePayload) query;
updateUser: (User) -> (Response);
Expand Down
4 changes: 2 additions & 2 deletions .dfx/local/canisters/backend/service.did
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Backend = service {
AccountIdentifierToBlobResult,
);
create_employee : (CreateEmployeeArgs) -> (Response_4);
emailExists : (text) -> (bool);
getAddress : () -> (text);
getCanisterAddress : () -> (text);
getCanisterBalance : () -> (text);
Expand Down Expand Up @@ -47,11 +48,10 @@ type Backend = service {
runpayroll : (vec PayrollType) -> (Response_3);
save_notification : (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction : (CreateTransactionArgs) -> (CreateTransactionResult);
sendToOwner : (nat, text) -> (Result);
send_notifications : (text, text, text, text, text) -> ();
setCourierApiKey : (text) -> (Response_2);
testRandom : () -> (opt bool);
transferFromCanistertoSubAccount : () -> (Result);
transferFromSubAccountToCanister : (nat) -> (Result);
transferFromSubAccountToSubAccount : (text, nat) -> (Response_1);
transform : (TransformArgs) -> (CanisterHttpResponsePayload) query;
updateUser : (User) -> (Response);
Expand Down
4 changes: 2 additions & 2 deletions .dfx/local/canisters/backend/service.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface Backend {
AccountIdentifierToBlobResult
>,
'create_employee' : ActorMethod<[CreateEmployeeArgs], Response_4>,
'emailExists' : ActorMethod<[string], boolean>,
'getAddress' : ActorMethod<[], string>,
'getCanisterAddress' : ActorMethod<[], string>,
'getCanisterBalance' : ActorMethod<[], string>,
Expand Down Expand Up @@ -61,14 +62,13 @@ export interface Backend {
[CreateTransactionArgs],
CreateTransactionResult
>,
'sendToOwner' : ActorMethod<[bigint, string], Result>,
'send_notifications' : ActorMethod<
[string, string, string, string, string],
undefined
>,
'setCourierApiKey' : ActorMethod<[string], Response_2>,
'testRandom' : ActorMethod<[], [] | [boolean]>,
'transferFromCanistertoSubAccount' : ActorMethod<[], Result>,
'transferFromSubAccountToCanister' : ActorMethod<[bigint], Result>,
'transferFromSubAccountToSubAccount' : ActorMethod<
[string, bigint],
Response_1
Expand Down
6 changes: 3 additions & 3 deletions .dfx/local/canisters/backend/service.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ export const idlFactory = ({ IDL }) => {
'ok' : CreateTransactionSuccess,
'err' : CreateTransactionErr,
});
const Result = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
const Response_2 = IDL.Record({
'status' : IDL.Nat16,
'data' : IDL.Opt(IDL.Text),
'status_text' : IDL.Text,
'error_text' : IDL.Opt(IDL.Text),
});
const Result = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
const Response_1 = IDL.Record({
'status' : IDL.Nat16,
'data' : IDL.Opt(Transaction),
Expand Down Expand Up @@ -199,6 +199,7 @@ export const idlFactory = ({ IDL }) => {
[],
),
'create_employee' : IDL.Func([CreateEmployeeArgs], [Response_4], []),
'emailExists' : IDL.Func([IDL.Text], [IDL.Bool], []),
'getAddress' : IDL.Func([], [IDL.Text], []),
'getCanisterAddress' : IDL.Func([], [IDL.Text], []),
'getCanisterBalance' : IDL.Func([], [IDL.Text], []),
Expand Down Expand Up @@ -246,15 +247,14 @@ export const idlFactory = ({ IDL }) => {
[CreateTransactionResult],
[],
),
'sendToOwner' : IDL.Func([IDL.Nat, IDL.Text], [Result], []),
'send_notifications' : IDL.Func(
[IDL.Text, IDL.Text, IDL.Text, IDL.Text, IDL.Text],
[],
[],
),
'setCourierApiKey' : IDL.Func([IDL.Text], [Response_2], []),
'testRandom' : IDL.Func([], [IDL.Opt(IDL.Bool)], []),
'transferFromCanistertoSubAccount' : IDL.Func([], [Result], []),
'transferFromSubAccountToCanister' : IDL.Func([IDL.Nat], [Result], []),
'transferFromSubAccountToSubAccount' : IDL.Func(
[IDL.Text, IDL.Nat],
[Response_1],
Expand Down
88 changes: 0 additions & 88 deletions .dfx/local/canisters/idl/br5f7-7uaaa-aaaaa-qaaca-cai.did

This file was deleted.

Loading

0 comments on commit 80e87d6

Please sign in to comment.