coupons
Discount coupons with value, tax rate, and validity periods.
| Name | Type | Nullable | Default Value | Notes |
|---|---|---|---|---|
PKID | integer | Coupon ID | ||
fork forks.ID | integer | Fork ID (`null` for base module) | ||
ownergroup groups.ID | integer | Owner group ID (`null`=PUBLIC) | ||
creator | integer | Creator user ID (defaults to authenticated user on creation) | ||
creationdate | bigint | date_part('epoch', now()) | Creation date and time as a Unix timestamp (defaults to current date and time on creation) | |
lastmodified | bigint | date_part('epoch', now()) | Last modification date and time as a Unix timestamp (auto-reset on modification) | |
activity | smallint | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) | |
name | text | Name | ||
type | smallint | 0 | Coupon type (`0`=PROMOTION, `1`=INDIVIDUAL) | |
code | text | '' | Promotion code; only for PROMOTION | |
value | double precision | 0 | Default value | |
taxrate | double precision | Tax rate in percent | ||
neutral | smallint | 0 | Neutral in transaction | |
datefrom | bigint | Start date and time as a Unix timestamp; must be less than or equal to `dateto` | ||
dateto | bigint | End date and time as a Unix timestamp; must be greater than or equal to `datefrom` | ||
description | text | '' | Detailed general description | |
foreigntaxrates | json | Country-specific tax rates in percent; use country code as object key |
| Name | Unique | Nulls Distinct | Primary | Partial | Method | Keys |
|---|---|---|---|---|---|---|
| fk_coupons_fork | gin | fork | ||||
| fk_coupons_ownergroup | gin | ownergroup | ||||
| i_coupons_nofork | gin | fork | ||||
| i_coupons_noowner | gin | ownergroup | ||||
| pk_coupons | btree | ID | ||||
| s_coupons_name | gin | name | ||||
| u_coupons_code | btree | code |
| Name | Type |
|---|---|
| c_coupons_date | check |
| c_coupons_type | check |
| dc_coupons_activity | check |
| dc_coupons_code | check |
| dc_coupons_description | check |
| dc_coupons_foreigntaxrates | check |
| dc_coupons_name | check |
| dc_coupons_taxrate | check |
| dc_coupons_type | check |
| fk_coupons_fork | foreign_key |
| fk_coupons_ownergroup | foreign_key |
| pk_coupons | primary_key |
| Name | Type | Events | Function | Definition |
|---|---|---|---|---|
| tiu_coupons_unique | before | insert, update | ftiu_coupons_unique | |
| tu_coupons_type | before | update | ft_integrity |
Loading...