-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: send emails on creation, completion and cancellation
- Loading branch information
Showing
24 changed files
with
320 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ create table transaction ( | |
item_name text not null, | ||
item_price numeric not null, | ||
seller_id integer not null, | ||
seller_email text not null, | ||
seller_nickname text, | ||
seller_avatar_url text, | ||
buyer_id integer not null, | ||
buyer_email text not null, | ||
buyer_nickname text, | ||
buyer_avatar_url text, | ||
created_at timestamptz default now() not null, | ||
|
@@ -15,9 +17,9 @@ create table transaction ( | |
check (completed_at is null or cancelled_at is null) | ||
); | ||
|
||
insert into transaction (item_id, item_name, item_price, seller_id, seller_nickname, seller_avatar_url, buyer_id, buyer_nickname, buyer_avatar_url, completed_at, cancelled_at) values | ||
('10f33906-24df-449d-b4fb-fcc6c76606b6', 'item1', 10, 1, 'nickname1', 'https://example.com/avatar1.jpg', 2, 'nickname2', 'https://example.com/avatar2.jpg', null, now()), | ||
('10f33906-24df-449d-b4fb-fcc6c76606b6', 'item1', 10, 1, 'nickname1', 'https://example.com/avatar1.jpg', 3, 'nickname3', 'https://example.com/avatar3.jpg', now(), null), | ||
('2475bad8-43ca-4d23-99ee-224d7d9e6ba7', 'item2', 20, 1, 'nickname1', 'https://example.com/avatar1.jpg', 2, 'nickname2', 'https://example.com/avatar2.jpg', null, null), | ||
('3aed59b0-0fa7-4b8b-b1fd-39b8f46a75b3', 'item3', 30, 1, 'nickname1', 'https://example.com/avatar1.jpg', 3, 'nickname3', 'https://example.com/avatar3.jpg', null, null), | ||
('4469a9e3-28d2-4926-8ffd-3ba3c10119ed', 'item4', 40, 2, 'nickname2', 'https://example.com/avatar2.jpg', 3, 'nickname3', 'https://example.com/avatar3.jpg', null, null); | ||
insert into transaction (item_id, item_name, item_price, seller_id, seller_email, seller_nickname, seller_avatar_url, buyer_id, buyer_email, buyer_nickname, buyer_avatar_url, completed_at, cancelled_at) values | ||
('10f33906-24df-449d-b4fb-fcc6c76606b6', 'item1', 10, 1, '[email protected]', 'nickname1', 'https://example.com/avatar1.jpg', 2, '[email protected]', 'nickname2', 'https://example.com/avatar2.jpg', null, now()), | ||
('10f33906-24df-449d-b4fb-fcc6c76606b6', 'item1', 10, 1, '[email protected]', 'nickname1', 'https://example.com/avatar1.jpg', 3, '[email protected]', 'nickname3', 'https://example.com/avatar3.jpg', now(), null), | ||
('2475bad8-43ca-4d23-99ee-224d7d9e6ba7', 'item2', 20, 1, '[email protected]', 'nickname1', 'https://example.com/avatar1.jpg', 2, '[email protected]', 'nickname2', 'https://example.com/avatar2.jpg', null, null), | ||
('3aed59b0-0fa7-4b8b-b1fd-39b8f46a75b3', 'item3', 30, 1, '[email protected]', 'nickname1', 'https://example.com/avatar1.jpg', 3, '[email protected]', 'nickname3', 'https://example.com/avatar3.jpg', null, null), | ||
('4469a9e3-28d2-4926-8ffd-3ba3c10119ed', 'item4', 40, 2, '[email protected]', 'nickname2', 'https://example.com/avatar2.jpg', 3, '[email protected]', 'nickname3', 'https://example.com/avatar3.jpg', null, null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,13 @@ import { sign } from "jsonwebtoken"; | |
|
||
export const participant1: Participant = { | ||
id: 1, | ||
email: "[email protected]", | ||
nickname: "nickname1", | ||
avatarUrl: "https://example.com/avatar1.jpg", | ||
}; | ||
|
||
export const account1: Account = { | ||
...participant1, | ||
email: "[email protected]", | ||
phoneCode: "65", | ||
phoneNumber: "12345678", | ||
department: { | ||
|
@@ -25,6 +25,7 @@ export const account1: Account = { | |
export const jwt1 = sign( | ||
{ | ||
id: account1.id, | ||
email: account1.email, | ||
nickname: account1.nickname, | ||
avatar_url: account1.avatarUrl, | ||
}, | ||
|
@@ -33,13 +34,13 @@ export const jwt1 = sign( | |
|
||
export const participant2: Participant = { | ||
id: 2, | ||
email: "[email protected]", | ||
nickname: "nickname2", | ||
avatarUrl: "https://example.com/avatar2.jpg", | ||
}; | ||
|
||
export const account2: Account = { | ||
...participant2, | ||
email: "[email protected]", | ||
phoneCode: "65", | ||
phoneNumber: "22345678", | ||
department: { | ||
|
@@ -55,6 +56,7 @@ export const account2: Account = { | |
export const jwt2 = sign( | ||
{ | ||
id: account2.id, | ||
email: account2.email, | ||
nickname: account2.nickname, | ||
avatar_url: account2.avatarUrl, | ||
}, | ||
|
Oops, something went wrong.