Order data.
| Column | Type | Constraint | Description |
|---|---|---|---|
| shop | TEXT | PRIMARY KEY | Shop ID. (.username) |
| id | INTEGER | Identifier. | |
| account_id | INTEGER | NOT NULL | Account ID. (account.id) |
| total | INTEGER | NOT NULL | Total amout of products. Tax included. |
| shipping_cost | INTEGER | NOT NULL | Shipping cost. Tax included. |
| collection_fee | INTEGER | NOT NULL | Collection fee. Tax included. |
| payment_method | INTEGER | NOT NULL | Payment method. If the value is 0, that means there are no payment.
|
| state | INTEGER | NOT NULL | Order state.
FIXME: Minus value means that a cancellation is requested. FIXME?: If cancellation request is arrived when the value is 0, it accepts the request automatically because the value 0 means a shopkeeper did not notice the order yet. |
| inquiry_code | TEXT | UNIQUE, NOT NULL | Inquiry code to see detail the order. |
| requested_date | TIMESTAMP | NOT NULL | Date of order requested. |
| desired | DATE | Desired date that the products will arrive. NULL value means, there are no assignment. | |
| desired_time | TIME | Desired time that the products will arrive. NULL value means, there are no assignment. | |
| remarks | TEXT |
CREATE TABLE "order"( shop TEXT, id INTEGER, account_id INTEGER NOT NULL, total INTEGER NOT NULL, shipping_cost INTEGER NOT NULL, collection_fee INTEGER NOT NULL, payment_method INTEGER NOT NULL, state INTEGER NOT NULL, inquiry_code TEXT NOT NULL UNIQUE, requested_date TIMESTAMP NOT NULL, desired DATE, desired_time TIME, remarks TEXT, PRIMARY KEY(shop, id));