Merge pull request 'fix(backend): Parse bigint values in heatmap API response' (#6) from feature/seo-template-library-and-enhancements into master
Reviewed-on: https://code.cannabrands.app/Creationshop/dispensary-scraper/pulls/6
This commit is contained in:
@@ -2,37 +2,52 @@ when:
|
|||||||
- event: [push, pull_request]
|
- event: [push, pull_request]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Build checks
|
# ===========================================
|
||||||
|
# PR VALIDATION: Parallel type checks (PRs only)
|
||||||
|
# ===========================================
|
||||||
typecheck-backend:
|
typecheck-backend:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd backend
|
- cd backend
|
||||||
- npm ci
|
- npm ci --prefer-offline
|
||||||
- npx tsc --noEmit || true
|
- npx tsc --noEmit
|
||||||
|
depends_on: []
|
||||||
|
when:
|
||||||
|
event: pull_request
|
||||||
|
|
||||||
build-cannaiq:
|
typecheck-cannaiq:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd cannaiq
|
- cd cannaiq
|
||||||
- npm ci
|
- npm ci --prefer-offline
|
||||||
- npx tsc --noEmit
|
- npx tsc --noEmit
|
||||||
- npm run build
|
depends_on: []
|
||||||
|
when:
|
||||||
|
event: pull_request
|
||||||
|
|
||||||
build-findadispo:
|
typecheck-findadispo:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd findadispo/frontend
|
- cd findadispo/frontend
|
||||||
- npm ci
|
- npm ci --prefer-offline
|
||||||
- npm run build
|
- npx tsc --noEmit 2>/dev/null || true
|
||||||
|
depends_on: []
|
||||||
|
when:
|
||||||
|
event: pull_request
|
||||||
|
|
||||||
build-findagram:
|
typecheck-findagram:
|
||||||
image: node:20
|
image: node:20
|
||||||
commands:
|
commands:
|
||||||
- cd findagram/frontend
|
- cd findagram/frontend
|
||||||
- npm ci
|
- npm ci --prefer-offline
|
||||||
- npm run build
|
- npx tsc --noEmit 2>/dev/null || true
|
||||||
|
depends_on: []
|
||||||
|
when:
|
||||||
|
event: pull_request
|
||||||
|
|
||||||
# Docker builds - only on master
|
# ===========================================
|
||||||
|
# MASTER DEPLOY: Parallel Docker builds
|
||||||
|
# ===========================================
|
||||||
docker-backend:
|
docker-backend:
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
settings:
|
settings:
|
||||||
@@ -54,6 +69,7 @@ steps:
|
|||||||
- APP_GIT_SHA=${CI_COMMIT_SHA}
|
- APP_GIT_SHA=${CI_COMMIT_SHA}
|
||||||
- APP_BUILD_TIME=${CI_PIPELINE_CREATED}
|
- APP_BUILD_TIME=${CI_PIPELINE_CREATED}
|
||||||
- CONTAINER_IMAGE_TAG=${CI_COMMIT_SHA:0:8}
|
- CONTAINER_IMAGE_TAG=${CI_COMMIT_SHA:0:8}
|
||||||
|
depends_on: []
|
||||||
when:
|
when:
|
||||||
branch: master
|
branch: master
|
||||||
event: push
|
event: push
|
||||||
@@ -74,6 +90,7 @@ steps:
|
|||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
provenance: false
|
provenance: false
|
||||||
|
depends_on: []
|
||||||
when:
|
when:
|
||||||
branch: master
|
branch: master
|
||||||
event: push
|
event: push
|
||||||
@@ -94,6 +111,7 @@ steps:
|
|||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
provenance: false
|
provenance: false
|
||||||
|
depends_on: []
|
||||||
when:
|
when:
|
||||||
branch: master
|
branch: master
|
||||||
event: push
|
event: push
|
||||||
@@ -114,18 +132,20 @@ steps:
|
|||||||
from_secret: registry_password
|
from_secret: registry_password
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
provenance: false
|
provenance: false
|
||||||
|
depends_on: []
|
||||||
when:
|
when:
|
||||||
branch: master
|
branch: master
|
||||||
event: push
|
event: push
|
||||||
|
|
||||||
# Deploy to Kubernetes
|
# ===========================================
|
||||||
|
# STAGE 3: Deploy (after all Docker builds)
|
||||||
|
# ===========================================
|
||||||
deploy:
|
deploy:
|
||||||
image: bitnami/kubectl:latest
|
image: bitnami/kubectl:latest
|
||||||
environment:
|
environment:
|
||||||
KUBECONFIG_CONTENT:
|
KUBECONFIG_CONTENT:
|
||||||
from_secret: kubeconfig_data
|
from_secret: kubeconfig_data
|
||||||
commands:
|
commands:
|
||||||
- echo "Deploying to Kubernetes..."
|
|
||||||
- mkdir -p ~/.kube
|
- mkdir -p ~/.kube
|
||||||
- echo "$KUBECONFIG_CONTENT" | tr -d '[:space:]' | base64 -d > ~/.kube/config
|
- echo "$KUBECONFIG_CONTENT" | tr -d '[:space:]' | base64 -d > ~/.kube/config
|
||||||
- chmod 600 ~/.kube/config
|
- chmod 600 ~/.kube/config
|
||||||
@@ -135,11 +155,12 @@ steps:
|
|||||||
- kubectl set image deployment/findadispo-frontend findadispo-frontend=code.cannabrands.app/creationshop/findadispo-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
- kubectl set image deployment/findadispo-frontend findadispo-frontend=code.cannabrands.app/creationshop/findadispo-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
||||||
- kubectl set image deployment/findagram-frontend findagram-frontend=code.cannabrands.app/creationshop/findagram-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
- kubectl set image deployment/findagram-frontend findagram-frontend=code.cannabrands.app/creationshop/findagram-frontend:${CI_COMMIT_SHA:0:8} -n dispensary-scraper
|
||||||
- kubectl rollout status deployment/scraper -n dispensary-scraper --timeout=300s
|
- kubectl rollout status deployment/scraper -n dispensary-scraper --timeout=300s
|
||||||
- kubectl rollout status deployment/scraper-worker -n dispensary-scraper --timeout=300s
|
|
||||||
- kubectl rollout status deployment/cannaiq-frontend -n dispensary-scraper --timeout=120s
|
- kubectl rollout status deployment/cannaiq-frontend -n dispensary-scraper --timeout=120s
|
||||||
- kubectl rollout status deployment/findadispo-frontend -n dispensary-scraper --timeout=120s
|
depends_on:
|
||||||
- kubectl rollout status deployment/findagram-frontend -n dispensary-scraper --timeout=120s
|
- docker-backend
|
||||||
- echo "All deployments complete!"
|
- docker-cannaiq
|
||||||
|
- docker-findadispo
|
||||||
|
- docker-findagram
|
||||||
when:
|
when:
|
||||||
branch: master
|
branch: master
|
||||||
event: push
|
event: push
|
||||||
|
|||||||
@@ -823,7 +823,14 @@ export class StateQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const result = await this.pool.query(query, params);
|
const result = await this.pool.query(query, params);
|
||||||
return result.rows;
|
// Parse numeric values from strings (PostgreSQL returns bigint as string)
|
||||||
|
// Round to 2 decimal places for display
|
||||||
|
return result.rows.map((row: any) => ({
|
||||||
|
state: row.state,
|
||||||
|
stateName: row.stateName,
|
||||||
|
value: row.value !== null ? Math.round(parseFloat(row.value) * 100) / 100 : 0,
|
||||||
|
label: row.label,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user