Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Adjust Sampling Data Container Styling #1395

Merged
merged 10 commits into from
Nov 22, 2024
37 changes: 37 additions & 0 deletions api/src/database-models/method_technique.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { z } from 'zod';

/**
* Method Technique Model.
*
* @description Data model for `method_technique`.
*/
export const MethodTechniqueModel = z.object({
method_technique_id: z.number(),
survey_id: z.number(),
name: z.string(),
description: z.string().nullable(),
distance_threshold: z.number().nullable(),
method_lookup_id: z.number(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type MethodTechniqueModel = z.infer<typeof MethodTechniqueModel>;

/**
* Method Technique Record.
*
* @description Data record for `method_technique`.
*/
export const MethodTechniqueRecord = MethodTechniqueModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type MethodTechniqueRecord = z.infer<typeof MethodTechniqueRecord>;
38 changes: 38 additions & 0 deletions api/src/database-models/survey_block.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { z } from 'zod';

/**
* Survey Block Model.
*
* @description Data model for `survey_block`.
*/
export const SurveyBlockModel = z.object({
survey_block_id: z.number(),
survey_id: z.number(),
name: z.string().nullable(),
description: z.string().nullable(),
geometry: z.null(),
geography: z.string(),
geojson: z.any(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type SurveyBlockModel = z.infer<typeof SurveyBlockModel>;

/**
* Survey Block Record.
*
* @description Data record for `survey_block`.
*/
export const SurveyBlockRecord = SurveyBlockModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type SurveyBlockRecord = z.infer<typeof SurveyBlockRecord>;
34 changes: 34 additions & 0 deletions api/src/database-models/survey_sample_block.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { z } from 'zod';

/**
* Survey Sample Block Model.
*
* @description Data model for `survey_sample_block`.
*/
export const SurveySampleBlockModel = z.object({
survey_sample_block_id: z.number(),
survey_sample_site_id: z.number(),
survey_block_id: z.number(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type SurveySampleBlockModel = z.infer<typeof SurveySampleBlockModel>;

/**
* Survey Sample Block Record.
*
* @description Data record for `survey_sample_block`.
*/
export const SurveySampleBlockRecord = SurveySampleBlockModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type SurveySampleBlockRecord = z.infer<typeof SurveySampleBlockRecord>;
36 changes: 36 additions & 0 deletions api/src/database-models/survey_sample_method.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { z } from 'zod';

/**
* Survey Sample Method Model.
*
* @description Data model for `survey_sample_method`.
*/
export const SurveySampleMethodModel = z.object({
survey_sample_method_id: z.number(),
survey_sample_site_id: z.number(),
description: z.string().nullable(),
method_response_metric_id: z.number(),
method_technique_id: z.number(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type SurveySampleMethodModel = z.infer<typeof SurveySampleMethodModel>;

/**
* Survey Sample Method Record.
*
* @description Data record for `survey_sample_method`.
*/
export const SurveySampleMethodRecord = SurveySampleMethodModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type SurveySampleMethodRecord = z.infer<typeof SurveySampleMethodRecord>;
37 changes: 37 additions & 0 deletions api/src/database-models/survey_sample_period.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { z } from 'zod';

/**
* Survey Sample Period Model.
*
* @description Data model for `survey_sample_period`.
*/
export const SurveySamplePeriodModel = z.object({
survey_sample_period_id: z.number(),
survey_sample_method_id: z.number(),
start_date: z.string().nullable(),
end_date: z.string().nullable(),
start_time: z.string().nullable(),
end_time: z.string().nullable(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type SurveySamplePeriodModel = z.infer<typeof SurveySamplePeriodModel>;

/**
* Survey Sample Period Record.
*
* @description Data record for `survey_sample_period`.
*/
export const SurveySamplePeriodRecord = SurveySamplePeriodModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type SurveySamplePeriodRecord = z.infer<typeof SurveySamplePeriodRecord>;
38 changes: 38 additions & 0 deletions api/src/database-models/survey_sample_site.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { z } from 'zod';

/**
* Survey Sample Site Model.
*
* @description Data model for `survey_sample_site`.
*/
export const SurveySampleSiteModel = z.object({
survey_sample_site_id: z.number(),
survey_id: z.number(),
name: z.string(),
description: z.string().nullable(),
geometry: z.null(),
geography: z.string(),
geojson: z.any(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type SurveySampleSiteModel = z.infer<typeof SurveySampleSiteModel>;

/**
* Survey Sample Site Record.
*
* @description Data record for `survey_sample_site`.
*/
export const SurveySampleSiteRecord = SurveySampleSiteModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type SurveySampleSiteRecord = z.infer<typeof SurveySampleSiteRecord>;
34 changes: 34 additions & 0 deletions api/src/database-models/survey_sample_stratum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { z } from 'zod';

/**
* Survey Sample Stratum Model.
*
* @description Data model for `survey_sample_stratum`.
*/
export const SurveySampleStratumModel = z.object({
survey_sample_stratum_id: z.number(),
survey_sample_site_id: z.number(),
survey_stratum_id: z.number(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type SurveySampleStratumModel = z.infer<typeof SurveySampleStratumModel>;

/**
* Survey Sample Stratum Record.
*
* @description Data record for `survey_sample_stratum`.
*/
export const SurveySampleStratumRecord = SurveySampleStratumModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type SurveySampleStratumRecord = z.infer<typeof SurveySampleStratumRecord>;
35 changes: 35 additions & 0 deletions api/src/database-models/survey_stratum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { z } from 'zod';

/**
* Survey Stratum Model.
*
* @description Data model for `survey_stratum`.
*/
export const SurveyStratumModel = z.object({
survey_stratum_id: z.number(),
survey_id: z.number(),
name: z.string(),
description: z.string(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});

export type SurveyStratumModel = z.infer<typeof SurveyStratumModel>;

/**
* Survey Stratum Record.
*
* @description Data record for `survey_stratum`.
*/
export const SurveyStratumRecord = SurveyStratumModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type SurveyStratumRecord = z.infer<typeof SurveyStratumRecord>;
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ describe('getTechniques', () => {

expect(mockRes.jsonValue).to.eql({
techniques: [techniqueRecord],
count: 1,
pagination: {
total: 1,
per_page: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,14 @@ GET.apiDoc = {
'application/json': {
schema: {
type: 'object',
required: ['techniques', 'count'],
required: ['techniques', 'pagination'],
additionalProperties: false,
properties: {
techniques: {
type: 'array',
items: techniqueViewSchema
},
count: {
type: 'number',
description: 'Count of method techniques in the respective survey.'
},
pagination: { ...paginationResponseSchema }
pagination: paginationResponseSchema
}
}
}
Expand Down Expand Up @@ -254,7 +250,6 @@ export function getTechniques(): RequestHandler {

return res.status(200).json({
techniques,
count: techniquesCount,
pagination: makePaginationResponse(techniquesCount, paginationOptions)
});
} catch (error) {
Expand Down
Loading
Loading