hr.work_reports
Schema: hr
English table: hr.work_reports
Italian original table: hr.in_rapportino
Description: Header table for work reports, interventions, and project-based activity summaries.
Overview
- Columns: 22
- Primary key: id
- Outgoing foreign keys: 2
- Incoming foreign keys: 1
- Indexes: 8
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Internal surrogate primary key. | |
wr_id | irendrap_id | integer | NO | Unique report identifier within a tenant. | |
wr_employment_id | irendrap_rap_id | integer | NO | Reference to the employment/employee who filed the report. | |
wr_project_id | irendrap_com_id | integer | YES | Reference to the project (commessa) associated with the work. | |
wr_project_line_id | irendrap_coml_id | integer | YES | Reference to the specific project line or task. | |
wr_created_at | irendrap_dt_creato | date | NO | The date when the report was officially created in the system. | |
wr_is_accepted | irendrap_accettato | boolean | NO | Flag indicating if the customer has accepted the report. | |
wr_is_closed | irendrap_chiuso | boolean | NO | Flag indicating if the report is finalized and closed. | |
wr_customer_notes | irendrap_note_cliente | text | NO | Notes or feedback provided by the customer. | |
wr_customer_email | irendrap_email_cliente | character varying(200) | NO | Email address of the customer representative for report delivery. | |
wr_status_code | irendrap_status | numeric(1,0) | NO | Status of the report (e.g., Draft, Sent, Approved). | |
wr_contact_person | irendrap_referente | character varying(100) | NO | Name of the reference person for the customer. | |
wr_signature_file_path | irendrap_file_firma | character varying(100) | NO | Path or reference to the digital signature file. | |
wr_customer_id | irendrap_incli_id | integer | YES | Reference to the customer entity. | |
wr_customer_site_id | irendrap_inclise_id | integer | YES | Reference to the specific customer site or location. | |
wr_custom_payload | irendrap_custom | text | NO | Additional custom data or text fields. | |
wr_report_date | irendrap_dal | date | NO | The actual date of the work being reported. | |
irendrap_template | tenant_id | character varying(250) | NO | Text value. | |
irendrap_numero | colcustom | character varying(15) | NO | Text value. | |
tenant_id | _deleted | integer | YES | Tenant identifier for data isolation. | |
colcustom | `` | jsonb | YES | '{}'::jsonb | JSON field for custom data. |
_deleted | `` | boolean | YES | false | Technical soft delete flag. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_work_reports_employment | wr_employment_id, tenant_id | hr.employment_relationships | er_id, tenant_id | RESTRICT | CASCADE |
fk_work_reports_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|---|---|---|
hr.work_report_details | fk_work_report_details_work_report | wrd_work_report_id, tenant_id | wr_id, tenant_id |
Constraints
- Primary key:
pk_work_reports→id - Unique:
uk_work_reports_id→wr_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_in_rapportino_irendrap_coml_id_tenant | NO | btree | tenant_id, wr_project_line_id) WHERE (_deleted = false |
idx_in_rapportino_irendrap_inclise_id_tenant | NO | btree | tenant_id, wr_customer_site_id) WHERE (_deleted = false |
idx_wr_customer_tenant | NO | btree | tenant_id, wr_customer_id) WHERE (_deleted = false |
idx_wr_employment_tenant | NO | btree | tenant_id, wr_employment_id) WHERE (_deleted = false |
idx_wr_full_lookup_tenant | NO | btree | tenant_id, wr_employment_id, wr_project_id, wr_project_line_id, wr_customer_id, wr_customer_site_id) WHERE (_deleted = false |
idx_wr_id_tenant | NO | btree | tenant_id, wr_id) WHERE (_deleted = false |
idx_wr_project_tenant | NO | btree | tenant_id, wr_project_id) WHERE (_deleted = false |
idx_wr_tenant | NO | btree | tenant_id |
Navigation
- Back to main index
- [Back to
hrindex]../)