Compare commits
30 Commits
main
...
automated-
Author | SHA1 | Date |
---|---|---|
cascode _ | d85d6285d2 | |
cascode _ | 3e80545d6b | |
cascode _ | b511e5a81a | |
cascode _ | 8b5b5b539b | |
cascode _ | f5b7db930d | |
cascode _ | 8e0984e7b1 | |
cascode _ | 4957b36355 | |
cascode _ | 614d7b8a20 | |
cascode _ | c5f723210b | |
cascode _ | 691afc382d | |
cascode _ | cd4333cacd | |
cascode _ | de9d8dde88 | |
cascode _ | 55ec00d1fb | |
cascode _ | 05b6ffc807 | |
cascode _ | 7360bba00e | |
cascode _ | 8c46018fee | |
cascode _ | dc01798dfa | |
cascode _ | 2aad6e49cd | |
cascode _ | b7c37613ce | |
cascode _ | d8b6e31836 | |
cascode _ | 0babf35c1e | |
cascode _ | 57313ddf7c | |
cascode _ | 5ae1314bb7 | |
cascode _ | 0cd0e54b66 | |
cascode _ | 54db9795fe | |
cascode _ | e27d224d3d | |
cascode _ | 3b14b93d17 | |
cascode _ | 1c719b3061 | |
cascode _ | cab056ea69 | |
cascode _ | 1fbe2d6911 |
|
@ -0,0 +1,44 @@
|
|||
name: checks
|
||||
on:
|
||||
pull_request:
|
||||
paths: &CODE_PATHS
|
||||
- 'src/**'
|
||||
- 'Cargo*'
|
||||
push:
|
||||
paths: *CODE_PATHS
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
# TODO(cascode) cache checkout for build and test stages?
|
||||
lint:
|
||||
container:
|
||||
# TODO use communitymedia docker registry
|
||||
image: "cascode/aural-isle-ci:0"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
github-server-url: "https://code.communitymedia.network"
|
||||
- name: rustfmt
|
||||
run: cargo fmt --check
|
||||
build:
|
||||
container:
|
||||
# TODO use communitymedia docker registry
|
||||
image: "cascode/aural-isle-ci:2"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
github-server-url: "https://code.communitymedia.network"
|
||||
- name: build
|
||||
run: cargo build
|
||||
# TODO(cascode) cache builds for test stage
|
||||
test:
|
||||
container:
|
||||
# TODO use communitymedia docker registry
|
||||
image: "cascode/aural-isle-ci:2"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
github-server-url: "https://code.communitymedia.network"
|
||||
- name: run unit tests
|
||||
run: cargo test
|
|
@ -467,7 +467,7 @@ struct Purchase {
|
|||
id: String,
|
||||
items: Vec<LineItem>,
|
||||
state: PurchaseState,
|
||||
purchased_by: Option<Person>,
|
||||
purchased_by: Person,
|
||||
purchased_at: Option<chrono::DateTime>,
|
||||
fulfilled_by: Option<Person>,
|
||||
fulfilled_at: Option<chrono::DateTime>,
|
||||
|
|
54
SCHEMA.md
54
SCHEMA.md
|
@ -910,57 +910,3 @@ CREATE TABLE CouponCodeSkus (
|
|||
CONSTRAINT CouponCodeSkus_FK_1 FOREIGN KEY (sku_id) REFERENCES Skus(id)
|
||||
);
|
||||
```
|
||||
|
||||
# Purchases
|
||||
The Purchases table will contain Purchases!
|
||||
|
||||
``` sql
|
||||
CREATE TABLE Purchases (
|
||||
id TEXT(36),
|
||||
state TEXT,
|
||||
purchased_by TEXT(36),
|
||||
purchased_at INTEGER,
|
||||
fulfilled_by TEXT(36),
|
||||
fulfilled_at INTEGER,
|
||||
total_charge NUMERIC DEFAULT (0.00),
|
||||
CONSTRAINT Purchases_PK PRIMARY KEY (id),
|
||||
CONSTRAINT Purchases_FK FOREIGN KEY (purchased_by) REFERENCES Persons(id),
|
||||
CONSTRAINT Purchases_FK_1 FOREIGN KEY (fulfilled_by) REFERENCES Persons(id)
|
||||
);
|
||||
CREATE INDEX Purchases_state_IDX ON Purchases (state);
|
||||
CREATE INDEX Purchases_purchased_by_IDX ON Purchases (purchased_by);
|
||||
CREATE INDEX Purchases_purchased_at_IDX ON Purchases (purchased_at);
|
||||
CREATE INDEX Purchases_fulfilled_by_IDX ON Purchases (fulfilled_by);
|
||||
CREATE INDEX Purchases_fulfilled_at_IDX ON Purchases (fulfilled_at);
|
||||
CREATE INDEX Purchases_total_charge_IDX ON Purchases (total_charge);
|
||||
```
|
||||
|
||||
# PurchaseLineItems
|
||||
The PurchaseLineItems table will relate a Purchase to one or more LineItems.
|
||||
|
||||
``` sql
|
||||
CREATE TABLE PurchaseLineItems (
|
||||
purchase_id TEXT(36),
|
||||
line_item_id TEXT(36),
|
||||
CONSTRAINT PurchaseLineItems_PK PRIMARY KEY (purchase_id,line_item_id),
|
||||
CONSTRAINT PurchaseLineItems_FK FOREIGN KEY (purchase_id) REFERENCES Purchases(id),
|
||||
CONSTRAINT PurchaseLineItems_FK_1 FOREIGN KEY (line_item_id) REFERENCES LineItems(id) ON DELETE CASCADE
|
||||
);
|
||||
CREATE INDEX PurchaseLineItems_purchase_id_IDX ON PurchaseLineItems (purchase_id);
|
||||
CREATE INDEX PurchaseLineItems_line_item_id_IDX ON PurchaseLineItems (line_item_id);
|
||||
```
|
||||
|
||||
# PurchaseCouponCodes
|
||||
The PurchaseCouponCodes table will relate a Purchase to one or more CouponCodes that were successfully applied to the Purchase.
|
||||
|
||||
``` sql
|
||||
CREATE TABLE PurchaseCouponCodes (
|
||||
purchase_id TEXT(36),
|
||||
coupon_code_id TEXT(36),
|
||||
CONSTRAINT PurchaseCouponCodes_PK PRIMARY KEY (purchase_id,coupon_code_id),
|
||||
CONSTRAINT PurchaseCouponCodes_FK FOREIGN KEY (purchase_id) REFERENCES Purchases(id),
|
||||
CONSTRAINT PurchaseCouponCodes_FK_1 FOREIGN KEY (coupon_code_id) REFERENCES CouponCodes(id)
|
||||
);
|
||||
CREATE INDEX PurchaseCouponCodes_purchase_id_IDX ON PurchaseCouponCodes (purchase_id);
|
||||
CREATE INDEX PurchaseCouponCodes_coupon_code_id_IDX ON PurchaseCouponCodes (coupon_code_id);
|
||||
```
|
|
@ -0,0 +1,7 @@
|
|||
FROM rust:1.73-alpine3.18
|
||||
|
||||
#install build tooling
|
||||
RUN apk add musl-dev && rustup component add rustfmt
|
||||
|
||||
# install gitea act_runner dependencies
|
||||
RUN apk add nodejs git
|
|
@ -2,8 +2,7 @@ use warp::Filter;
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let hello = warp::get()
|
||||
.map(|| format!("Hello world!"));
|
||||
let hello = warp::get().map(|| format!("Hello world!"));
|
||||
|
||||
warp::serve(hello).run(([127, 0, 0, 1], 5309)).await;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue