Skip to content

Commit

Permalink
user notification on receiving notification
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmasken committed Feb 16, 2024
1 parent 7a33cba commit 1a2c512
Show file tree
Hide file tree
Showing 69 changed files with 262 additions and 193 deletions.
24 changes: 24 additions & 0 deletions .dfx/local/canisters/backend/backend.did
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ type User =
phone_notifications: bool;
phone_number: text;
};
type TransformArgs =
record {
context: blob;
response: HttpResponsePayload;
};
type Transaction__1 =
record {
amount: nat;
Expand Down Expand Up @@ -90,6 +95,17 @@ type Notification =
receiver: text;
sender: text;
};
type HttpResponsePayload =
record {
body: vec nat8;
headers: vec HttpHeader;
status: nat;
};
type HttpHeader =
record {
name: text;
value: text;
};
type GetTransactionSuccess = record {transaction: Transaction__1;};
type GetTransactionResult =
variant {
Expand Down Expand Up @@ -176,6 +192,12 @@ type CreateNotificationArgs =
sender: text;
};
type CreateEmployeeArgs = record {wallet: text;};
type CanisterHttpResponsePayload =
record {
body: vec nat8;
headers: vec HttpHeader;
status: nat;
};
type Backend =
service {
accountIdentifierToBlob: (AccountIdentifier) ->
Expand Down Expand Up @@ -217,12 +239,14 @@ type Backend =
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
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
updateUser: (User) -> (Response);
userLength: () -> (text) query;
Expand Down
Binary file modified .dfx/local/canisters/backend/backend.wasm
Binary file not shown.
24 changes: 24 additions & 0 deletions .dfx/local/canisters/backend/constructor.did
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ type User =
phone_notifications: bool;
phone_number: text;
};
type TransformArgs =
record {
context: blob;
response: HttpResponsePayload;
};
type Transaction__1 =
record {
amount: nat;
Expand Down Expand Up @@ -90,6 +95,17 @@ type Notification =
receiver: text;
sender: text;
};
type HttpResponsePayload =
record {
body: vec nat8;
headers: vec HttpHeader;
status: nat;
};
type HttpHeader =
record {
name: text;
value: text;
};
type GetTransactionSuccess = record {transaction: Transaction__1;};
type GetTransactionResult =
variant {
Expand Down Expand Up @@ -176,6 +192,12 @@ type CreateNotificationArgs =
sender: text;
};
type CreateEmployeeArgs = record {wallet: text;};
type CanisterHttpResponsePayload =
record {
body: vec nat8;
headers: vec HttpHeader;
status: nat;
};
type Backend =
service {
accountIdentifierToBlob: (AccountIdentifier) ->
Expand Down Expand Up @@ -217,12 +239,14 @@ type Backend =
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
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
updateUser: (User) -> (Response);
userLength: () -> (text) query;
Expand Down
24 changes: 24 additions & 0 deletions .dfx/local/canisters/backend/constructor.old.did
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ type User =
phone_notifications: bool;
phone_number: text;
};
type TransformArgs =
record {
context: blob;
response: HttpResponsePayload;
};
type Transaction__1 =
record {
amount: nat;
Expand Down Expand Up @@ -90,6 +95,17 @@ type Notification =
receiver: text;
sender: text;
};
type HttpResponsePayload =
record {
body: vec nat8;
headers: vec HttpHeader;
status: nat;
};
type HttpHeader =
record {
name: text;
value: text;
};
type GetTransactionSuccess = record {transaction: Transaction__1;};
type GetTransactionResult =
variant {
Expand Down Expand Up @@ -176,6 +192,12 @@ type CreateNotificationArgs =
sender: text;
};
type CreateEmployeeArgs = record {wallet: text;};
type CanisterHttpResponsePayload =
record {
body: vec nat8;
headers: vec HttpHeader;
status: nat;
};
type AccountIdentifierToBlobSuccess = blob;
type AccountIdentifierToBlobResult =
variant {
Expand Down Expand Up @@ -236,11 +258,13 @@ service : {
runpayroll: (vec PayrollType) -> (Response_3);
save_notification: (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction: (CreateTransactionArgs) -> (CreateTransactionResult);
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);
userLength: () -> (text) query;
whoami: () -> (principal);
Expand Down
17 changes: 17 additions & 0 deletions .dfx/local/canisters/backend/service.did
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,22 @@ type Backend = service {
runpayroll : (vec PayrollType) -> (Response_3);
save_notification : (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction : (CreateTransactionArgs) -> (CreateTransactionResult);
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);
userLength : () -> (text) query;
whoami : () -> (principal);
};
type CanisterHttpResponsePayload = record {
status : nat;
body : vec nat8;
headers : vec HttpHeader;
};
type CreateEmployeeArgs = record { wallet : text };
type CreateNotificationArgs = record {
isRead : bool;
Expand Down Expand Up @@ -124,6 +131,12 @@ type GetTransactionResult = variant {
err : GetTransactionErr;
};
type GetTransactionSuccess = record { transaction : Transaction__1 };
type HttpHeader = record { value : text; name : text };
type HttpResponsePayload = record {
status : nat;
body : vec nat8;
headers : vec HttpHeader;
};
type Notification = record {
id : nat;
isRead : bool;
Expand Down Expand Up @@ -194,6 +207,10 @@ type Transaction__1 = record {
amount : nat;
successful : bool;
};
type TransformArgs = record {
context : vec nat8;
response : HttpResponsePayload;
};
type User = record {
email_address : text;
phone_notifications : bool;
Expand Down
20 changes: 20 additions & 0 deletions .dfx/local/canisters/backend/service.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export interface Backend {
[CreateTransactionArgs],
CreateTransactionResult
>,
'send_notifications' : ActorMethod<
[string, string, string, string, string],
undefined
>,
'setCourierApiKey' : ActorMethod<[string], Response_2>,
'testRandom' : ActorMethod<[], [] | [boolean]>,
'transferFromCanistertoSubAccount' : ActorMethod<[], Result>,
Expand All @@ -69,10 +73,16 @@ export interface Backend {
[string, bigint],
Response_1
>,
'transform' : ActorMethod<[TransformArgs], CanisterHttpResponsePayload>,
'updateUser' : ActorMethod<[User], Response>,
'userLength' : ActorMethod<[], string>,
'whoami' : ActorMethod<[], Principal>,
}
export interface CanisterHttpResponsePayload {
'status' : bigint,
'body' : Uint8Array | number[],
'headers' : Array<HttpHeader>,
}
export interface CreateEmployeeArgs { 'wallet' : string }
export interface CreateNotificationArgs {
'isRead' : boolean,
Expand Down Expand Up @@ -137,6 +147,12 @@ export interface GetTransactionErr {
export type GetTransactionResult = { 'ok' : GetTransactionSuccess } |
{ 'err' : GetTransactionErr };
export interface GetTransactionSuccess { 'transaction' : Transaction__1 }
export interface HttpHeader { 'value' : string, 'name' : string }
export interface HttpResponsePayload {
'status' : bigint,
'body' : Uint8Array | number[],
'headers' : Array<HttpHeader>,
}
export interface Notification {
'id' : bigint,
'isRead' : boolean,
Expand Down Expand Up @@ -208,6 +224,10 @@ export interface Transaction__1 {
'amount' : bigint,
'successful' : boolean,
}
export interface TransformArgs {
'context' : Uint8Array | number[],
'response' : HttpResponsePayload,
}
export interface User {
'email_address' : string,
'phone_notifications' : boolean,
Expand Down
25 changes: 25 additions & 0 deletions .dfx/local/canisters/backend/service.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,21 @@ export const idlFactory = ({ IDL }) => {
'status_text' : IDL.Text,
'error_text' : IDL.Opt(IDL.Text),
});
const HttpHeader = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
const HttpResponsePayload = IDL.Record({
'status' : IDL.Nat,
'body' : IDL.Vec(IDL.Nat8),
'headers' : IDL.Vec(HttpHeader),
});
const TransformArgs = IDL.Record({
'context' : IDL.Vec(IDL.Nat8),
'response' : HttpResponsePayload,
});
const CanisterHttpResponsePayload = IDL.Record({
'status' : IDL.Nat,
'body' : IDL.Vec(IDL.Nat8),
'headers' : IDL.Vec(HttpHeader),
});
const Backend = IDL.Service({
'accountIdentifierToBlob' : IDL.Func(
[AccountIdentifier],
Expand Down Expand Up @@ -231,6 +246,11 @@ export const idlFactory = ({ IDL }) => {
[CreateTransactionResult],
[],
),
'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], []),
Expand All @@ -240,6 +260,11 @@ export const idlFactory = ({ IDL }) => {
[Response_1],
[],
),
'transform' : IDL.Func(
[TransformArgs],
[CanisterHttpResponsePayload],
['query'],
),
'updateUser' : IDL.Func([User], [Response], []),
'userLength' : IDL.Func([], [IDL.Text], ['query']),
'whoami' : IDL.Func([], [IDL.Principal], []),
Expand Down
17 changes: 17 additions & 0 deletions .dfx/local/lsp/bd3sg-teaaa-aaaaa-qaaba-cai.did
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,22 @@ type Backend = service {
runpayroll : (vec PayrollType) -> (Response_3);
save_notification : (CreateNotificationArgs) -> (CreateNotificationResult);
save_transaction : (CreateTransactionArgs) -> (CreateTransactionResult);
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);
userLength : () -> (text) query;
whoami : () -> (principal);
};
type CanisterHttpResponsePayload = record {
status : nat;
body : vec nat8;
headers : vec HttpHeader;
};
type CreateEmployeeArgs = record { wallet : text };
type CreateNotificationArgs = record {
isRead : bool;
Expand Down Expand Up @@ -124,6 +131,12 @@ type GetTransactionResult = variant {
err : GetTransactionErr;
};
type GetTransactionSuccess = record { transaction : Transaction__1 };
type HttpHeader = record { value : text; name : text };
type HttpResponsePayload = record {
status : nat;
body : vec nat8;
headers : vec HttpHeader;
};
type Notification = record {
id : nat;
isRead : bool;
Expand Down Expand Up @@ -194,6 +207,10 @@ type Transaction__1 = record {
amount : nat;
successful : bool;
};
type TransformArgs = record {
context : vec nat8;
response : HttpResponsePayload;
};
type User = record {
email_address : text;
phone_notifications : bool;
Expand Down
2 changes: 1 addition & 1 deletion .dfx/network/local/ic-https-outcalls-adapter-pid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10299
12627
2 changes: 1 addition & 1 deletion .dfx/network/local/icx-proxy-pid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10506
15724
2 changes: 1 addition & 1 deletion .dfx/network/local/replica-configuration/replica-1.port
Original file line number Diff line number Diff line change
@@ -1 +1 @@
38589
37969
2 changes: 1 addition & 1 deletion .dfx/network/local/replica-configuration/replica-pid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10306
12634
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 1a2c512

Please sign in to comment.