Add OSHA Form 301 and Osha page components
- Implemented Form301 component for displaying OSHA Form 301 equivalent, including employee and case information. - Created Osha component to manage OSHA recordkeeping, including tabs for 300 Log, 300A Summary, Hours & rates, and Submit to OSHA. - Added functionality for printing and downloading CSV files for OSHA submissions. - Integrated loading and error handling states for data fetching.
This commit is contained in:
1 parent
3e964d1176
commit
61c876edec
59 files changed
+9180
-183
No files matched your search
@@ -0,0 +1,41 @@
|
||||
CREATE TYPE "public"."osha_case_type" AS ENUM('injury', 'skin_disorder', 'respiratory', 'poisoning', 'hearing_loss', 'other_illness');--> statement-breakpoint
|
||||
CREATE TYPE "public"."osha_outcome" AS ENUM('death', 'days_away', 'restricted', 'other');--> statement-breakpoint
|
||||
CREATE TYPE "public"."osha_special_case" AS ENUM('none', 'needlestick', 'medical_removal', 'hearing_loss', 'tuberculosis');--> statement-breakpoint
|
||||
ALTER TABLE "hours_worked" ADD COLUMN "average_employees" integer;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "case_number" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "work_related" boolean;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "new_case" boolean;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "died" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "date_of_death" date;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "days_away_from_work" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "restricted_or_transfer" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "medical_treatment" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "loss_of_consciousness" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "significant_diagnosis" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "special_case" "osha_special_case" DEFAULT 'none' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "case_type" "osha_case_type" DEFAULT 'injury' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "recordable" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "outcome" "osha_outcome";--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "inpatient_hospitalization" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "amputation" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "loss_of_eye" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "reported_to_osha_at" timestamp with time zone;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "employee_address" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "date_of_birth" date;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "date_of_hire" date;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "sex" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "physician_name" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "treatment_facility" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "treated_in_emergency_room" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "time_started_work" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "activity_before" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "what_happened" text;--> statement-breakpoint
|
||||
ALTER TABLE "injured_persons" ADD COLUMN "object_substance" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "street_address" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "city" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "state" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "zip" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "naics_code" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "industry_description" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "ein" text;--> statement-breakpoint
|
||||
ALTER TABLE "sites" ADD COLUMN "establishment_type" integer DEFAULT 1 NOT NULL;
|
||||
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE "saved_views" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"organization_id" uuid NOT NULL,
|
||||
"user_id" uuid NOT NULL,
|
||||
"page" text NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"filters" jsonb NOT NULL,
|
||||
"shared" boolean DEFAULT false NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "saved_views" ADD CONSTRAINT "saved_views_organization_id_organizations_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organizations"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "saved_views" ADD CONSTRAINT "saved_views_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
CREATE INDEX "saved_views_organization_page_idx" ON "saved_views" USING btree ("organization_id","page");
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -22,6 +22,20 @@
|
||||
"when": 1791310953907,
|
||||
"tag": "0002_kiosks_and_offline",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "7",
|
||||
"when": 1791312050891,
|
||||
"tag": "0003_osha_recordkeeping",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 4,
|
||||
"version": "7",
|
||||
"when": 1791315152348,
|
||||
"tag": "0004_saved_views",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user