TechnologyRediscovery / codenforce

municipal code enforcement database application
GNU General Public License v3.0
2 stars 3 forks source link

Occupancy inspection revisions #207

Closed edarsow closed 2 years ago

edarsow commented 3 years ago

Make OccSpaceType do all the things that OccSpace does. OccInspectedSpace has an OccSpaceType inside it ECD to Revise database and objects Tuesday.

edarsow commented 3 years ago

NOTE that ECD just pushed a new commit to recovered that contains db patch 35.1 with oodles of occ changes in the DB, but NO changes in JavaJava land have happened yet. A bunch of new methods will be needed for the various utility tables required by the specs from Emily and Sean. Until soon!

edarsow commented 3 years ago

Implementation Notes for Patch 35.1

Start with creating new Java objects and integration methods on InspectionIntegrator to implement the occ inspection specs

Rewire business objects

update notes

edarsow commented 3 years ago

In the meantime occ inspection is now a beast! So we can start with upgrading the integration and member variable that insert and update OccInspection objects. Note that they now have additional fields, notably an Occ Inspection should have int type field for an inspection of which it is a "follow up inspection" (not an a pointer to a whole new inspection object to avoid cycle risk"

You could go ahead and make an OccInspectionCause and OccInspectionDetermination java class, one instance of each of which will be inside each occ inspection. We'll need drop-down lists on the UI to select the cause and determination as converter methods that echo PropertyUseTypeConverter.

Notes:


CREATE TABLE public.occinspection
(
  inspectionid integer NOT NULL DEFAULT nextval('occupancyinspectionid_seq'::regclass),
  occperiod_periodid integer NOT NULL,
  inspector_userid integer NOT NULL,
  publicaccesscc integer,
  enablepacc boolean DEFAULT false,
  notespreinspection text,
  thirdpartyinspector_personid integer,
  thirdpartyinspectorapprovalts timestamp with time zone,
  thirdpartyinspectorapprovalby integer,
  maxoccupantsallowed integer NOT NULL,
  numbedrooms integer,
  numbathrooms integer,
  occchecklist_checklistlistid integer,
  effectivedate timestamp with time zone,
  active boolean DEFAULT true,
  creationts timestamp with time zone,
  followupto_inspectionid integer, 
  timestart timestamp with time zone,
  timeend timestamp with time zone,
  determination_detid integer,
  determinationby_userid integer,
  determinationts timestamp with time zone,
  remarks text,
  generalcomments text,
  CONSTRAINT occinspection_pk PRIMARY KEY (inspectionid),
  CONSTRAINT occinpection_determinationby_fk FOREIGN KEY (determinationby_userid)
      REFERENCES public.login (userid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT occinspection_checklistid_fk FOREIGN KEY (occchecklist_checklistlistid)
      REFERENCES public.occchecklist (checklistid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT occinspection_determination_fk FOREIGN KEY (determination_detid)
      REFERENCES public.occinspectiondetermination (determinationid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT occinspection_followupto_fk FOREIGN KEY (followupto_inspectionid)
      REFERENCES public.occinspection (inspectionid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT occinspection_inspector_userid_fk FOREIGN KEY (inspector_userid)
      REFERENCES public.login (userid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT occinspection_periodid_fk FOREIGN KEY (occperiod_periodid)
      REFERENCES public.occperiod (periodid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT occinspection_thirdpartyuserid_fk FOREIGN KEY (thirdpartyinspector_personid)
      REFERENCES public.person (personid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT occinspectionthirdpartyapprovalby_fk FOREIGN KEY (thirdpartyinspectorapprovalby)
      REFERENCES public.login (userid) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  OIDS=FALSE
);
ALTER TABLE public.occinspection
  OWNER TO sylvia;
jurplel commented 3 years ago

OccSpace and OccSpaceTypeInspectionDirective are extremely close. Just a couple of integrator methods still use them--I'll leave that to you.

jurplel commented 3 years ago

Why is OccInspection.notes now OccInspection.notespreinspection?

Do we need general comments and remarks too?

edarsow commented 2 years ago

Completed by JURPLEL summer 2021