order

Description

Order data.

Definition

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.
payment_fee INTEGER NOT NULL Payment fee. Tax included.
payment_method TEXT NOT NULL Payment method which is ID of payment module (payment_module.name). If empty, there are no payment.
payment_state INTEGER NOT NULL
  • 0: Wait for payment
  • 1: Pending (Customer paid but not confirmed)
  • 2: Payment finished
delivered INTEGER NOT NULL
  • 0: Not delivered.
  • 1: Delivered.
cancel_state INTEGER NOT NULL
  • 0: No cancellation
  • 1: Cancellation requested
  • 2: Canceled
state INTEGER NOT NULL Order state.
  • 0: Unconfirmed
  • 1: Processing
  • 2: Done
inquiry_code TEXT UNIQUE, NOT NULL Inquiry code to see detail the order.
requested_date TIMESTAMP NOT NULL Date of order requested.
delivery_date DATE Designated delivery date that the products will arrive. NULL value means, there are no assignment.
delivery_time TIME Designated delivery time that the products will arrive. NULL value means, there are no assignment.
remarks TEXT

Related tables

Query

CREATE TABLE "order"(
shop            TEXT,
id              INTEGER,
account_id      INTEGER   NOT NULL,
total           INTEGER   NOT NULL,
shipping_cost   INTEGER   NOT NULL,
payment_fee     INTEGER   NOT NULL,
payment_state            INTEGER   NOT NULL,
delivered       INTEGER   NOT NULL,
cancel_state    INTEGER   NOT NULL,
payment_method  TEXT      NOT NULL,
state           INTEGER   NOT NULL,
inquiry_code    TEXT      NOT NULL UNIQUE,
requested_date  TIMESTAMP NOT NULL,
delivery_date   DATE,
delivery_time   TIME,
remarks         TEXT,
PRIMARY KEY(shop, id));