297 Commits

Author SHA1 Message Date
Sam Samai
5190278e1a Setup and tear down DB 2021-07-13 20:01:01 +10:00
Sam Samai
8bfad93d30 Manually truncate the tables for MySQL 2021-07-13 11:27:28 +10:00
Sam Samai
82b63589d3 Try mysql adaptor 2021-07-13 10:04:44 +10:00
Sam Samai
c7ff5d8d05 Setup done in TestContext 2021-07-13 10:03:47 +10:00
Chris Tsang
1e6a778a0f ValueType does not need to impl Default 2021-07-12 02:48:37 +08:00
Sam Samai
a838cf7c23
Naivedatetime for placed_at on order (#40)
* WIP use NativeDateTime for placed_at

* Use NaiveDatetime for placed_at

* Cargo fmt again

Co-authored-by: Chris Tsang <tyt2y7@gmail.com>
2021-07-11 22:17:28 +08:00
Chris Tsang
6ff5a32b7a cargo fmt 2021-07-11 22:08:37 +08:00
Sam Samai
ba77fb80aa Create TestContext for setting up and tearing down the database after each test 2021-07-11 22:08:55 +10:00
Sam Samai
1fa7c7e177 Test delete cake and bakery 2021-07-10 22:07:57 +10:00
Sam Samai
f961e6e28d Test bakery update 2021-07-10 21:27:58 +10:00
Sam Samai
7ebfddae91 Test update cake 2021-07-10 21:20:51 +10:00
Sam Samai
550d9a7bcb Cake price is decimal now 2021-07-08 22:07:08 +10:00
Sam Samai
ad4c1c813c Test create order 2021-07-08 22:00:46 +10:00
Sam Samai
1ecc8480ab Test create lineitem 2021-07-08 21:43:19 +10:00
Sam Samai
f05de487ff Use Decimal for lineitem price 2021-07-07 21:46:21 +10:00
Sam Samai
0eeb37b219 Test create cake 2021-07-05 22:14:16 +10:00
Sam Samai
cf356ecfdb Test create customer 2021-07-05 21:50:18 +10:00
Sam Samai
a40785c554 Test baker and bakery create 2021-07-05 21:43:32 +10:00
Sam Samai
c0177bffc5 Fix create order table foreign keys 2021-07-04 11:22:05 +10:00
Sam Samai
47e7914224 Remove LineitemId from cake 2021-07-04 11:05:06 +10:00
Sam Samai
23e0b3c590 Fix create table for the new relationship between Cake and Lineitem 2021-07-04 10:55:45 +10:00
Sam Samai
c5dec7e9dc Lineitem belongs to cake 2021-07-03 22:49:02 +10:00
Sam Samai
f61ed5a2cc Use DbErr instead of ExecErr 2021-07-03 22:14:13 +10:00
Sam Samai
335bdc5c7c Merge branch 'master' into ss/bakery 2021-07-03 21:56:08 +10:00
Sam Samai
76d2cbb955 Use f64 for money 2021-07-03 21:21:35 +10:00
Sam Samai
86bfcba083 Cake has many lineitems 2021-07-03 21:20:28 +10:00
Sam Samai
f60a1c32a3 Test bakery create 2021-07-03 21:18:35 +10:00
Chris Tsang
0298cfb6af Rename to DbErr 2021-06-30 21:17:23 +08:00
Billy Chan
2a1173c174
Add & use OrmError (#36)
* Add & use OrmError

* Rename to SeaErr
2021-06-30 21:08:41 +08:00
Sam Samai
c820bb66f7 Fix relationship between Cake and lineitems, add Cake schema creation test 2021-06-30 21:16:44 +10:00
Sam Samai
391fb08260 Separate schema tests 2021-06-30 21:15:12 +10:00
Sam Samai
6104770b65 Pull table creation into its own module 2021-06-29 20:12:59 +10:00
Sam Samai
c4fc1b1678 Add the rest of the relations 2021-06-29 19:57:05 +10:00
Sam Samai
d103671701 Agnostic backend for creating table 2021-06-29 19:39:17 +10:00
Sam Samai
2b0424b9d9 Update ERD jpg 2021-06-29 19:38:05 +10:00
Sam Samai
ba65d4f290 Update customer has_many relation 2021-06-29 12:27:48 +10:00
Sam Samai
8f66968724 Use find_related in place of find_xxx 2021-06-29 12:03:11 +10:00
Sam Samai
0011f5e7d1 Create Cake and CakesBakers 2021-06-27 16:32:24 +10:00
Sam Samai
c76557135e Create Lineitem 2021-06-27 15:28:04 +10:00
Sam Samai
1de4d0cd28 Create Customer and Order 2021-06-26 22:09:19 +10:00
Sam Samai
bd2e7a922f Baker belongs to a bakery 2021-06-26 17:58:37 +10:00
Sam Samai
318665d1af Start creating the table for Bakery and Baker objects 2021-06-26 16:09:43 +10:00
Sam Samai
fce0b04e58 Use more datatypes in the model 2021-06-25 18:36:38 +10:00
Sam Samai
b8f58546bd Bakery chain domain model 2021-06-25 16:41:02 +10:00
Sam Samai
255aeb7e16 ERD of the Bakery domain to begin with 2021-06-24 16:52:13 +10:00
Chris Tsang
ad3fb45253 cargo fmt 2021-06-22 01:30:26 +08:00
Chris Tsang
7158e78f65 Basic test suite (sqlite) 2021-06-20 23:05:05 +08:00