Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SIMSBIOHUB-627' into SIMSBIOHUB-…
Browse files Browse the repository at this point in the history
…627-Device-Frontend-3
  • Loading branch information
NickPhura committed Oct 25, 2024
2 parents 3a1d750 + 6e74f1f commit 60ba7f6
Show file tree
Hide file tree
Showing 27 changed files with 452 additions and 1,484 deletions.
7 changes: 1 addition & 6 deletions api/src/database-models/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const DeploymentModel = z.object({
attachment_start_timestamp: z.string(),
attachment_end_date: z.string().nullable(),
attachment_end_time: z.string().nullable(),
attachment_end_timestamp: z.string(),
attachment_end_timestamp: z.string().nullable(),
critterbase_start_capture_id: z.string().uuid().nullable(),
critterbase_end_capture_id: z.string().uuid().nullable(),
critterbase_end_mortality_id: z.string().uuid().nullable(),
Expand All @@ -37,11 +37,6 @@ export type DeploymentModel = z.infer<typeof DeploymentModel>;
* @description Data record for `deployment`.
*/
export const DeploymentRecord = DeploymentModel.omit({
// internal fields
device_key: true,
attachment_start_timestamp: true,
attachment_end_timestamp: true,
// audit fields
create_date: true,
create_user: true,
update_date: true,
Expand Down
38 changes: 38 additions & 0 deletions api/src/database-models/device_make.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { z } from 'zod';
/**
* Device Make Model.
*
* @description Data model for `device_make`.
*/
export const DeviceMakeModel = z.object({
device_make_id: z.number(),
name: z.string(),
description: z.string().nullable(),
notes: z.string().nullable(),
record_effective_date: z.string().nullable(),
record_end_date: 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 DeviceMakeModel = z.infer<typeof DeviceMakeModel>;

/**
* Device Make Record.
*
* @description Data record for `device_make`.
*/
export const DeviceMakeRecord = DeviceMakeModel.omit({
record_effective_date: true,
record_end_date: true,
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});

export type DeviceMakeRecord = z.infer<typeof DeviceMakeRecord>;
24 changes: 23 additions & 1 deletion api/src/paths/codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ GET.apiDoc = {
'site_selection_strategies',
'survey_progress',
'method_response_metrics',
'attractants'
'attractants',
'telemetry_device_makes'
],
properties: {
management_action_type: {
Expand Down Expand Up @@ -382,6 +383,27 @@ GET.apiDoc = {
}
}
}
},
telemetry_device_makes: {
type: 'array',
description: 'Active telemetry device manufacturers / makes / vendors.',
items: {
type: 'object',
additionalProperties: false,
required: ['id', 'name', 'description'],
properties: {
id: {
type: 'integer',
minimum: 1
},
name: {
type: 'string'
},
description: {
type: 'string'
}
}
}
}
}
}
Expand Down
Loading

0 comments on commit 60ba7f6

Please sign in to comment.