public.stores
Description
Labels
svc-portal
Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| id | integer | nextval('stores_id_seq'::regclass) | false | public.devices public.staff public.orders public.bills public.payments public.settlements public.bill_operation_histories public.slips | Store unique identifier. | |
| merchant_id | integer | false | public.merchants | Parent merchant ID. | ||
| store_code | varchar(50) | false | Store code (unique within merchant). | |||
| store_name | varchar(255) | false | Store display name. | |||
| address | text | true | Store physical address. | |||
| phone | varchar(20) | true | Store contact phone. | |||
| payment_config | json | true | Store-level payment config (overrides merchant). | |||
| printer_items | json | true | Printer configuration (JSON). | |||
| is_active | boolean | true | Store active status. | |||
| created_at | timestamp with time zone | true | Record creation timestamp. | |||
| updated_at | timestamp with time zone | true | Record last update timestamp. | |||
| mps_id | varchar(20) | true | PGW-generated store identifier. Returned by PGW after syncing store (create/update). Maps mpac store to PGW store. | |||
| receipt_setting | varchar(20) | true | Receipt source: merchant or store. | |||
| receipt_info | json | true | Store-level receipt information (JSON). | |||
| shipping_info | json | true | Shipping information (JSON). |
Viewpoints
| Name | Definition |
|---|---|
| Merchant Hierarchy | Multi-tenant hierarchy — PSP → Merchant → Store → Staff/Devices |
Constraints
| Name | Type | Definition |
|---|---|---|
| stores_merchant_id_fkey | FOREIGN KEY | FOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT |
| stores_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| uq_stores_merchant_store_code | UNIQUE | UNIQUE (merchant_id, store_code) |
Indexes
| Name | Definition |
|---|---|
| stores_pkey | CREATE UNIQUE INDEX stores_pkey ON public.stores USING btree (id) |
| uq_stores_merchant_store_code | CREATE UNIQUE INDEX uq_stores_merchant_store_code ON public.stores USING btree (merchant_id, store_code) |
| ix_stores_merchant_id | CREATE INDEX ix_stores_merchant_id ON public.stores USING btree (merchant_id) |
| ix_stores_mps_id | CREATE UNIQUE INDEX ix_stores_mps_id ON public.stores USING btree (mps_id) |
Relations
Generated by tbls