public.staff
Description
Labels
svc-portal
Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| id | integer | nextval('staff_id_seq'::regclass) | false | Staff unique identifier. | ||
| store_id | integer | false | public.stores | Parent store ID. | ||
| staff_code | varchar(50) | false | Staff code (unique within store). | |||
| staff_name | varchar(255) | false | Staff display name. | |||
| role | varchar(50) | true | Staff role (e.g., cashier, manager). | |||
| is_active | boolean | true | Staff active status. | |||
| created_at | timestamp with time zone | true | Record creation timestamp. | |||
| updated_at | timestamp with time zone | true | Record last update timestamp. |
Viewpoints
| Name | Definition |
|---|---|
| Merchant Hierarchy | Multi-tenant hierarchy — PSP → Merchant → Store → Staff/Devices |
Constraints
| Name | Type | Definition |
|---|---|---|
| staff_store_id_fkey | FOREIGN KEY | FOREIGN KEY (store_id) REFERENCES stores(id) ON DELETE RESTRICT |
| staff_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| uq_staff_store_staff_code | UNIQUE | UNIQUE (store_id, staff_code) |
Indexes
| Name | Definition |
|---|---|
| staff_pkey | CREATE UNIQUE INDEX staff_pkey ON public.staff USING btree (id) |
| uq_staff_store_staff_code | CREATE UNIQUE INDEX uq_staff_store_staff_code ON public.staff USING btree (store_id, staff_code) |
| ix_staff_store_id | CREATE INDEX ix_staff_store_id ON public.staff USING btree (store_id) |
Relations
Generated by tbls