npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@verisure-italy/overbooking-types

v1.7.8

Published

Types for Overbooking service

Readme

Overbooking Types

Zod schemas and TypeScript types for Overbooking settings and allocation logic.

Features

  • ✅ Discriminated activation model (boolean vs time range)
  • ✅ Percentage allocation with invariant (sum = 100)
  • ✅ Channel / zip code scoping with * wildcard or UUID list
  • ✅ Composable with shared timestamp fields
  • ✅ Strong enums for allocation keys

Installation

pnpm add @verisure-italy/overbooking-types

Core Schemas

Allocation

Allocation keys must sum to 100.

import { allocationSchema, overbookingAllocationTypes } from '@verisure-italy/overbooking-types'

const data = { front: 25, ko: 25, telesales: 25, ecommerce: 25 }
const parsed = allocationSchema.safeParse(data)

If sum != 100 -> issue with message overbookingAllocationTypes.invalid_sum.

Activation (Discriminated Union)

import { activationSchema } from '@verisure-italy/overbooking-types'

const booleanActivation = {
  type: 'boolean',
  value: { alwaysActive: true },
}
const timeRangeActivation = {
  type: 'time_range',
  value: {
    from: new Date(),
    to: new Date(Date.now() + 3600_000),
    days: ['monday', 'tuesday'],
  },
}

Identify by type field.

Setting

import { settingSchema, type Setting } from '@verisure-italy/overbooking-types'

const result = settingSchema.safeParse({
  id: crypto.randomUUID(),
  name: 'Test Setting',
  outOfArea: false,
  channels: '*', // or [uuid1, uuid2]
  zipCodes: ['20100'],
  activation: booleanActivation,
  allocation: { front: 25, ko: 25, telesales: 25, ecommerce: 25 },
  createdAt: Date.now(),
  updatedAt: Date.now(),
})

channels: either literal * or non-empty UUID array.

Enum: Allocation Types

import { overbookingAllocationTypeSchema } from '@verisure-italy/overbooking-types'

Values: front | ko | telesales | ecommerce.

Validation Tips

  • Always check allocation sum before persisting.
  • Use discriminated union narrow:
if (activation.type === 'time_range') {
  // activation.value.from is Date
}

Related Packages

  • @verisure-italy/shared-types (daysOfWeek, timestamp fields, zip code)
  • @verisure-italy/alis-types (imports allocation type)

License

Internal Verisure Italy package