| # | Column Name | Nullable | Data Type | Max Length | Description |
|---|---|---|---|---|---|
| 1 | salesperson_id | integer | 0 | The primay key of the table. | |
| 2 | sales_team_id | integer | 0 | The id given to the sales person. | |
| 3 | salesperson_code | character varying | 12 | The code given to the sales person. | |
| 4 | salesperson_name | character varying | 100 | The name of the sales person, which is also a unique field. | |
| 5 | address | character varying | 100 | The address of the sales person. | |
| 6 | contact_number | character varying | 50 | The contact number of the sales person. | |
| 7 | commission_rate | decimal_strict2 | 0 | The rate of comission assigned to the sales person. | |
| 8 | account_id | bigint | 0 | Foreign key to the table core.accounts. | |
| 9 | audit_user_id | integer | 0 | Contains the id of the user who last inserted or updated the corresponding row. | |
| 10 | audit_ts | timestamp with time zone | 0 | Contains the date and timestamp of the last insert or update action. |
| # | Column Name | Key Name | References |
|---|---|---|---|
| 2 | sales_team_id | salespersons_sales_team_id_fkey | core.sales_teams.sales_team_id |
| 8 | account_id | salespersons_account_id_fkey | core.accounts.account_id |
| 9 | audit_user_id | salespersons_audit_user_id_fkey | office.users.user_id |
| Index Name | Owner | Access Method | Definition | Description |
|---|---|---|---|---|
| salespersons_pkey | postgres | btree | salesperson_id | |
| salespersons_salesperson_name_uix | postgres | btree | upper(salesperson_name::text) |
| Constraint Name | Description |
|---|
| # | Column Name | Default |
|---|---|---|
| 1 | salesperson_id | nextval('core.salespersons_salesperson_id_seq'::regclass) |
| 7 | commission_rate | 0 |
| 10 | audit_ts | now() |
| Trigger Name | Targets | On Event | Timing | Condition | Order | Orientation | Description |
|---|