Skip to content

Commit

Permalink
adding template staging and drafting tables. updating package-lock. a…
Browse files Browse the repository at this point in the history
…dding rds/result mappers for staging/draft tables
  • Loading branch information
siddheshraze committed Sep 25, 2024
1 parent 2decf65 commit 2462135
Show file tree
Hide file tree
Showing 6 changed files with 1,464 additions and 3,544 deletions.
8 changes: 8 additions & 0 deletions frontend/config/datamapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { PlotRDS, PlotsResult, QuadratRDS, QuadratsResult, SitesMapper } from '@
import {
AllTaxonomiesViewRDS,
AllTaxonomiesViewResult,
MeasurementsSummaryDraftRDS,
MeasurementsSummaryDraftResult,
MeasurementsSummaryRDS,
MeasurementsSummaryResult,
StemTaxonomiesViewRDS,
Expand All @@ -32,6 +34,8 @@ import {
CMVErrorResult,
CoreMeasurementsRDS,
CoreMeasurementsResult,
StagingCoreMeasurementsRDS,
StagingCoreMeasurementsResult,
UnifiedChangelogRDS,
UnifiedChangelogResult
} from '@/config/sqlrdsdefinitions/core';
Expand Down Expand Up @@ -179,10 +183,14 @@ class MapperFactory {
return new GenericMapper<CensusRDS, CensusResult>() as unknown as IDataMapper<RDS, Result>;
case 'coremeasurements':
return new GenericMapper<CoreMeasurementsRDS, CoreMeasurementsResult>() as unknown as IDataMapper<RDS, Result>;
case 'coremeasurements_staging':
return new GenericMapper<StagingCoreMeasurementsRDS, StagingCoreMeasurementsResult>() as unknown as IDataMapper<RDS, Result>;
case 'cmverrors':
return new GenericMapper<CMVErrorRDS, CMVErrorResult>() as unknown as IDataMapper<RDS, Result>;
case 'cmattributes':
return new GenericMapper<CMAttributesRDS, CMAttributesResult>() as unknown as IDataMapper<RDS, Result>;
case 'measurementssummary_draft':
return new GenericMapper<MeasurementsSummaryDraftRDS, MeasurementsSummaryDraftResult>() as unknown as IDataMapper<RDS, Result>;
case 'measurementssummary':
case 'measurementssummaryview':
return new GenericMapper<MeasurementsSummaryRDS, MeasurementsSummaryResult>() as unknown as IDataMapper<RDS, Result>;
Expand Down
37 changes: 35 additions & 2 deletions frontend/config/sqlrdsdefinitions/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,49 @@ export type CoreMeasurementsRDS = {
description?: string;
userDefinedFields?: string;
};

export type CoreMeasurementsResult = ResultType<CoreMeasurementsRDS>;
export const initialCoreMeasurementsRDSRow = createInitialObject<CoreMeasurementsRDS>();

export function getCoreMeasurementsHCs(): ColumnStates {
return {
censusID: false,
stemID: false,
description: false,
userDefinedFields: false
};
}

export type StagingCoreMeasurementsRDS = {
id?: number;
stagingMeasurementID?: number;
censusID?: number;
stemID?: number;
measuredDBH?: number;
dbhUnit?: string;
measuredHOM?: number;
homUnit?: string;
description?: string;
userDefinedFields?: string;
submittedBy?: number; // ID --> need to pull from catalog.sites
isReviewed?: boolean;
isSelected?: boolean;
submissionDate?: Date;
reviewerID?: number; // ID --> need to pull from catalog.sites
reviewedDate?: Date;
};

export type StagingCoreMeasurementsResult = ResultType<StagingCoreMeasurementsRDS>;

export function getStagingCoreMeasurementsHCs(): ColumnStates {
return {
censusID: false,
stemID: false,
description: false,
userDefinedFields: false
};
} // cmverrors custom data type
}

// cmverrors custom data type
export type CMAttributesRDS = {
id?: number;
cmaID?: number;
Expand Down
6 changes: 6 additions & 0 deletions frontend/config/sqlrdsdefinitions/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ export function getMeasurementsSummaryViewHCs(): ColumnStates {
};
}

export type MeasurementsSummaryDraftRDS = MeasurementsSummaryRDS & {
submittedBy?: number;
};

export type MeasurementsSummaryDraftResult = ResultType<MeasurementsSummaryDraftRDS>;

export type StemTaxonomiesViewRDS = {
id?: number;
stemID?: number;
Expand Down
Loading

0 comments on commit 2462135

Please sign in to comment.