Skip to content

Commit

Permalink
Merge branch 'dev' into access-request-seed
Browse files Browse the repository at this point in the history
  • Loading branch information
MacQSL authored Sep 4, 2024
2 parents c7f76c6 + bb198fa commit 87c3457
Show file tree
Hide file tree
Showing 243 changed files with 10,079 additions and 9,174 deletions.
21 changes: 21 additions & 0 deletions .config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"tools": "tools",
"dev": "dev",
"test": "test",
"test-spi": "test",
"prod": "prod"
},
"version": "1.0.0",
Expand All @@ -20,17 +21,20 @@
"staticUrls": {
"dev": "dev-biohubbc.apps.silver.devops.gov.bc.ca",
"test": "test-biohubbc.apps.silver.devops.gov.bc.ca",
"test-spi": "test-spi-biohubbc.apps.silver.devops.gov.bc.ca",
"prod": "biohubbc.apps.silver.devops.gov.bc.ca",
"prodVanityUrl": "sims.nrs.gov.bc.ca"
},
"staticUrlsAPI": {
"dev": "api-dev-biohubbc.apps.silver.devops.gov.bc.ca",
"test": "api-test-biohubbc.apps.silver.devops.gov.bc.ca",
"test-spi": "api-test-spi-biohubbc.apps.silver.devops.gov.bc.ca",
"prod": "api-biohubbc.apps.silver.devops.gov.bc.ca"
},
"siteminderLogoutURL": {
"dev": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi",
"test": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi",
"test-spi": "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi",
"prod": "https://logon7.gov.bc.ca/clp-cgi/logoff.cgi"
},
"sso": {
Expand Down Expand Up @@ -68,6 +72,23 @@
"cssApiEnvironment": "test"
}
},
"test-spi": {
"host": "https://test.loginproxy.gov.bc.ca/auth",
"realm": "standard",
"clientId": "sims-4461",
"keycloakSecret": "keycloak",
"serviceClient": {
"serviceClientName": "sims-svc-4464",
"keycloakSecretServiceClientPasswordKey": "sims_svc_client_password"
},
"cssApi": {
"cssApiTokenUrl": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token",
"cssApiClientId": "service-account-team-1190-4229",
"cssApiHost": "https://api.loginproxy.gov.bc.ca/api/v1",
"keycloakSecretCssApiSecretKey": "css_api_client_secret",
"cssApiEnvironment": "test"
}
},
"prod": {
"host": "https://loginproxy.gov.bc.ca/auth",
"realm": "standard",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
types: [opened, reopened, synchronize, ready_for_review]
branches-ignore:
- test
- test-spi
- prod

concurrency:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deployStatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches:
- dev
- test
- test-spi
- prod

jobs:
Expand Down
44 changes: 43 additions & 1 deletion api/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const phases = {
build: {
namespace: 'af2668-tools',
name: `${name}`,
dbName: `${dbName}`,
phase: 'build',
changeId: changeId,
suffix: `-build-${changeId}`,
Expand Down Expand Up @@ -152,6 +151,49 @@ const phases = {
replicas: '2',
replicasMax: '2'
},
'test-spi': {
namespace: 'af2668-test',
name: `${name}-spi`,
dbName: `${dbName}-spi`,
phase: 'test-spi',
changeId: deployChangeId,
suffix: `-test-spi`,
instance: `${name}-spi-test-spi`,
version: `${version}`,
tag: `test-spi-${version}`,
host: staticUrlsAPI['test-spi'],
appHost: staticUrls['test-spi'],
backboneInternalApiHost: 'https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca',
backbonePublicApiHost: 'https://api-test-biohub-platform.apps.silver.devops.gov.bc.ca',
backboneIntakePath: '/api/submission/intake',
backboneArtifactIntakePath: '/api/artifact/intake',
biohubTaxonPath: '/api/taxonomy/taxon',
biohubTaxonTsnPath: '/api/taxonomy/taxon/tsn',
bctwApiHost: 'https://moe-bctw-api-test.apps.silver.devops.gov.bc.ca',
critterbaseApiHost: 'https://moe-critterbase-api-test.apps.silver.devops.gov.bc.ca/api',
nodeEnv: 'production',
s3KeyPrefix: 'sims',
tz: config.timezone.api,
sso: config.sso['test-spi'],
featureFlags: '',
logLevel: 'warn',
logLevelFile: 'debug',
logFileDir: 'data/logs',
logFileName: 'sims-api-%DATE%.log',
logFileDatePattern: 'YYYY-MM-DD-HH',
logFileMaxSize: '50m',
logFileMaxFiles: '10',
volumeCapacity: '500Mi',
apiResponseValidationEnabled: true,
databaseResponseValidationEnabled: true,
nodeOptions: '--max_old_space_size=3000', // 75% of memoryLimit (bytes)
cpuRequest: '50m',
cpuLimit: '1000m',
memoryRequest: '100Mi',
memoryLimit: '4Gi',
replicas: '2',
replicasMax: '2'
},
prod: {
namespace: 'af2668-prod',
name: `${name}`,
Expand Down
2 changes: 1 addition & 1 deletion api/.pipeline/templates/api.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ parameters:
value: 'debug'
description: Log level for logs written to log files (file transport)
- name: LOG_FILE_DIR
value: data
value: data/logs
description: Directory where log files are stored
- name: LOG_FILE_NAME
value: sims-api-%DATE%.log
Expand Down
24 changes: 23 additions & 1 deletion api/src/constants/attachments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
/**
* The type of project/survey attachment files.
*
* @export
* @enum {number}
*/
export enum ATTACHMENT_TYPE {
REPORT = 'Report',
KEYX = 'KeyX',
OTHER = 'Other'
}

/**
* The type of survey telemetry credential attachment files.
*
* @export
* @enum {number}
*/
export enum TELEMETRY_CREDENTIAL_ATTACHMENT_TYPE {
/**
* Lotek API key file type.
*/
KEYX = 'KeyX',
/**
* Vectronic API key file type.
*/
CFG = 'Cfg'
}
99 changes: 99 additions & 0 deletions api/src/models/bctw.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { z } from 'zod';

export const BctwDeployDevice = z.object({
device_id: z.number(),
frequency: z.number().optional(),
frequency_unit: z.string().optional(),
device_make: z.string().optional(),
device_model: z.string().optional(),
attachment_start: z.string(),
attachment_end: z.string().nullable(),
critter_id: z.string(),
critterbase_start_capture_id: z.string().uuid(),
critterbase_end_capture_id: z.string().uuid().nullable(),
critterbase_end_mortality_id: z.string().uuid().nullable()
});

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

export type BctwDevice = Omit<BctwDeployDevice, 'attachment_start' | 'attachment_end' | 'critter_id'> & {
collar_id: string;
};

export const BctwDeploymentUpdate = z.object({
deployment_id: z.string(),
attachment_start: z.string(),
attachment_end: z.string()
});

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

export const BctwUploadKeyxResponse = z.object({
errors: z.array(
z.object({
row: z.string(),
error: z.string(),
rownum: z.number()
})
),
results: z.array(
z.object({
idcollar: z.number(),
comtype: z.string(),
idcom: z.string(),
collarkey: z.string(),
collartype: z.number(),
dtlast_fetch: z.string().nullable()
})
)
});

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

export const BctwKeyXDetails = z.object({
device_id: z.number(),
keyx: z
.object({
idcom: z.string(),
comtype: z.string(),
idcollar: z.number(),
collarkey: z.string(),
collartype: z.number()
})
.nullable()
});

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

export const IManualTelemetry = z.object({
telemetry_manual_id: z.string().uuid(),
deployment_id: z.string().uuid(),
latitude: z.number(),
longitude: z.number(),
date: z.string()
});

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

export const BctwUser = z.object({
keycloak_guid: z.string(),
username: z.string()
});

export interface ICodeResponse {
code_header_title: string;
code_header_name: string;
id: number;
code: string;
description: string;
long_description: string;
}

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

export interface ICreateManualTelemetry {
deployment_id: string;
latitude: number;
longitude: number;
acquisition_date: string;
}
18 changes: 18 additions & 0 deletions api/src/models/survey-deployment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { z } from 'zod';

export const SurveyDeployment = z.object({
deployment_id: z.number().int(),
critter_id: z.number(),
critterbase_critter_id: z.string().optional(),
bctw_deployment_id: z.string().uuid(),
critterbase_start_capture_id: z.string().uuid().nullable(),
critterbase_end_capture_id: z.string().uuid().nullable(),
critterbase_end_mortality_id: z.string().uuid().nullable()
});

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

export interface ICreateSurveyDeployment extends Omit<SurveyDeployment, 'deployment_id' | 'critterbase_critter_id'> {}

export interface IUpdateSurveyDeployment
extends Omit<SurveyDeployment, 'bctw_deployment_id' | 'critterbase_critter_id'> {}
2 changes: 1 addition & 1 deletion api/src/models/telemetry-view.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface ITelemetryAdvancedFilters {
export interface IAllTelemetryAdvancedFilters {
keyword?: string;
itis_tsns?: number[];
itis_tsn?: number;
Expand Down
4 changes: 2 additions & 2 deletions api/src/openapi/schemas/critter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export const critterSchema: OpenAPIV3.SchemaObject = {
type: 'object',
additionalProperties: false,
properties: {
critter_id: {
critterbase_critter_id: {
type: 'string',
format: 'uuid'
},
survey_critter_id: {
critter_id: {
type: 'integer',
minimum: 1
},
Expand Down
Loading

0 comments on commit 87c3457

Please sign in to comment.