Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v22
2 changes: 1 addition & 1 deletion apps/node-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"pino": "^9.5.0"
},
"devDependencies": {
"pino-pretty": "^11.3.0",
"pino-pretty": "^13.0.0",
"tsx": "^4.19.2"
}
}
33 changes: 33 additions & 0 deletions db/migrations/0006_subscription_exceeded_events.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
create table
if not exists orb.subscription_usage_exceeded (
id BIGSERIAL primary key,
billable_metric_id varchar(255) not null,
subscription_id varchar(255) not null,
customer_id varchar(255) not null,
external_customer_id varchar(255),
timeframe_start timestamp not null,
timeframe_end timestamp not null,
quantity_threshold decimal not null,
created_at timestamp not null default now()
);

create index if not exists orb_subscription_usage_exceeded_subscription_idx on orb.subscription_usage_exceeded (subscription_id);
create index if not exists orb_subscription_usage_exceeded_customer_idx on orb.subscription_usage_exceeded (customer_id);
create index if not exists orb_subscription_usage_exceeded_external_customer_idx on orb.subscription_usage_exceeded (external_customer_id);

create table
if not exists orb.subscription_cost_exceeded (
id BIGSERIAL primary key,
subscription_id varchar(255) not null,
customer_id varchar(255) not null,
external_customer_id varchar(255),
timeframe_start timestamp not null,
timeframe_end timestamp not null,
amount_threshold decimal not null,
created_at timestamp not null default now()
);


create index if not exists orb_subscription_cost_exceeded_subscription_idx on orb.subscription_cost_exceeded (subscription_id);
create index if not exists orb_subscription_cost_exceeded_customer_idx on orb.subscription_cost_exceeded (customer_id);
create index if not exists orb_subscription_cost_exceeded_external_customer_idx on orb.subscription_cost_exceeded (external_customer_id);
4 changes: 2 additions & 2 deletions docker/Dockerfile.node-fastify
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Build step
FROM node:20-alpine
FROM node:22-alpine
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run build
RUN npm prune --production

## Build step complete, copy to working image
FROM node:20-alpine
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY --from=0 /app/apps/node-fastify .
Expand Down
Loading