Skip to content
Open
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: 2 additions & 0 deletions lib/db/derivedtables/accelerometer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -102,6 +103,7 @@ export const accelerometerTableSpec: DerivedTableSpec<Accelerometer> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
supply_voltage_min: voltageMin,
supply_voltage_max: voltageMax,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/adc.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -115,6 +116,7 @@ export const adcTableSpec: DerivedTableSpec<Adc> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
resolution_bits: resolution,
sampling_rate_hz: samplingRate,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/analog_multiplexer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -144,6 +145,7 @@ export const analogMultiplexerTableSpec: DerivedTableSpec<AnalogMultiplexer> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
num_channels: numChannels,
num_bits: numBits,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/battery_holder.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -74,6 +75,7 @@ export const batteryHolderTableSpec: DerivedTableSpec<BatteryHolder> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
connector_type: attrs["Connector Type"] || null,
battery_type: attrs["Battery Type"] || null,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/bjt_transistor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { KyselyDatabaseInstance } from "../kysely-types"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -74,6 +75,7 @@ export const bjtTransistorTableSpec: DerivedTableSpec<BJTTransistor> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
current_gain: current_gain,
collector_current: collector_current,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/boost_converter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -117,6 +118,7 @@ export const boostConverterTableSpec: DerivedTableSpec<BoostConverter> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
input_voltage_min: inputMin,
input_voltage_max: inputMax,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/buck_boost_converter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -121,6 +122,7 @@ export const buckBoostConverterTableSpec: DerivedTableSpec<BuckBoostConverter> =
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
input_voltage_min: inputMin,
input_voltage_max: inputMax,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/capacitor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -115,6 +116,7 @@ export const capacitorTableSpec: DerivedTableSpec<Capacitor> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
capacitance_farads: capacitance,
tolerance_fraction: tolerance,
voltage_rating: voltage,
Expand Down
1 change: 1 addition & 0 deletions lib/db/derivedtables/component-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export interface BaseComponent {
in_stock: boolean
is_basic: boolean
is_preferred: boolean
is_extended_promotional: boolean
attributes: Record<string, string>
}
2 changes: 2 additions & 0 deletions lib/db/derivedtables/dac.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -129,6 +130,7 @@ export const dacTableSpec: DerivedTableSpec<Dac> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
resolution_bits: resolution,
num_channels: numChannels,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/diode.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -159,6 +160,7 @@ export const diodeTableSpec: DerivedTableSpec<Diode> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
forward_voltage: forwardVoltage,
reverse_voltage: reverseVoltage,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/fpc_connector.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -55,6 +56,7 @@ export const fpcConnectorTableSpec: DerivedTableSpec<FpcConnector> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
pitch_mm: parseNum(attrs["Pitch"]),
number_of_contacts: isNaN(contacts) ? null : contacts,
contact_type: attrs["Contact Type"] || null,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/fpga.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
import type { DerivedTableSpec } from "./types"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -99,6 +100,7 @@ export const fpgaTableSpec: DerivedTableSpec<FPGA> = {
in_stock: Boolean((c.stock ?? 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: extra?.package ?? c.package ?? "",
type: attrs["Type"] ?? null,
logic_array_blocks: parseNumericValue(attrs["Logic Array Blocks"]),
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/fuse.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { KyselyDatabaseInstance } from "../kysely-types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -90,6 +91,7 @@ export const fuseTableSpec: DerivedTableSpec<Fuse> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
current_rating: current_rating as number,
voltage_rating: voltage_rating as number,
response_time,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/gas_sensor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -82,6 +83,7 @@ export const gasSensorTableSpec: DerivedTableSpec<GasSensor> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
sensor_type: sensorType,
measures_air_quality: measuresAirQuality,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/gyroscope.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -106,6 +107,7 @@ export const gyroscopeTableSpec: DerivedTableSpec<Gyroscope> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
supply_voltage_min: voltageMin,
supply_voltage_max: voltageMax,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/header.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -197,6 +198,7 @@ export const headerTableSpec: DerivedTableSpec<Header> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
price1: extractMinQPrice(c.price)!,
package: c.package || "",
pitch_mm: pitch,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/io_expander.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -139,6 +140,7 @@ export const ioExpanderTableSpec: DerivedTableSpec<IoExpander> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
num_gpios: numGpios,
supply_voltage_min: voltageMin,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/jst_connector.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -69,6 +70,7 @@ export const jstConnectorTableSpec: DerivedTableSpec<JstConnector> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
pitch_mm: parseNum(attrs["Pitch"]),
num_rows: isNaN(numRows) ? null : numRows,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/lcd_display.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { KyselyDatabaseInstance } from "../kysely-types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -64,6 +65,7 @@ export const lcdDisplayTableSpec: DerivedTableSpec<LCDDisplay> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
display_size,
resolution,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/led.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -165,6 +166,7 @@ export const ledTableSpec: DerivedTableSpec<Led> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
forward_voltage: forwardVoltage,
forward_current: forwardCurrent,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/led_dot_matrix_display.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { KyselyDatabaseInstance } from "../kysely-types"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -57,6 +58,7 @@ export const ledDotMatrixDisplayTableSpec: DerivedTableSpec<LEDDotMatrixDisplay>
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
matrix_size,
color,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/led_driver.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { SelectQueryBuilder, Generated } from "kysely"
import type { Component } from "../generated/kysely"
Expand Down Expand Up @@ -77,6 +78,7 @@ export const ledDriverTableSpec: DerivedTableSpec<LedDriver> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
supply_voltage_min: parseValue(attrs["Input Voltage"]?.split("~")[0]),
supply_voltage_max: parseValue(attrs["Input Voltage"]?.split("~")[1]),
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/led_segment_display.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { KyselyDatabaseInstance } from "../kysely-types"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -70,6 +71,7 @@ export const ledSegmentDisplayTableSpec: DerivedTableSpec<LEDSegmentDisplay> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
positions,
type,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/led_with_ic.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import { BaseComponent } from "./component-base"
import type { SelectQueryBuilder, Generated } from "kysely"
Expand Down Expand Up @@ -99,6 +100,7 @@ export const ledWithICTableSpec: DerivedTableSpec<LEDWithIC> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
forward_voltage: forwardVoltage,
forward_current: forwardCurrent,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/microcontroller.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -228,6 +229,7 @@ export const microcontrollerTableSpec: DerivedTableSpec<Microcontroller> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: c.package || "",
cpu_core: cpuCore,
cpu_speed_hz: cpuSpeed,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/mosfet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { SelectQueryBuilder, Generated } from "kysely"
import type { Component } from "../generated/kysely"
Expand Down Expand Up @@ -68,6 +69,7 @@ export const mosfetTableSpec: DerivedTableSpec<Mosfet> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
drain_source_voltage: parseValue(
attrs["Drain Source Voltage (Vdss)"],
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/oled_display.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import type { KyselyDatabaseInstance } from "../kysely-types"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -65,6 +66,7 @@ export const oledDisplayTableSpec: DerivedTableSpec<OLEDDisplay> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
protocol: protocol || undefined,
display_width,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/pcie_m2_connector.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
import { BaseComponent } from "./component-base"
Expand Down Expand Up @@ -49,6 +50,7 @@ export const pcieM2ConnectorTableSpec: DerivedTableSpec<PcieM2Connector> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
key,
is_right_angle: isRightAngle,
attributes: attrs,
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/potentiometer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import type { DerivedTableSpec } from "./types"
import { extractMinQPrice } from "lib/util/extract-min-quantity-price"
Expand Down Expand Up @@ -54,6 +55,7 @@ export const potentiometerTableSpec: DerivedTableSpec<Potentiometer> = {
in_stock: c.stock > 0,
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
max_resistance: maxResistance,
pin_variant: pinVariant,
package: c.package || "",
Expand Down
2 changes: 2 additions & 0 deletions lib/db/derivedtables/relay.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getIsExtendedPromotional } from "lib/util/component-utils"
import { parseAndConvertSiUnit } from "lib/util/parse-and-convert-si-unit"
import { parseIntOrNull } from "lib/util/parse-int-or-null"
import type { DerivedTableSpec } from "./types"
Expand Down Expand Up @@ -62,6 +63,7 @@ export const relayTableSpec: DerivedTableSpec<Relay> = {
in_stock: Boolean((c.stock || 0) > 0),
is_basic: Boolean(c.basic),
is_preferred: Boolean(c.preferred),
is_extended_promotional: getIsExtendedPromotional(c),
package: String(c.package || ""),
relay_type: (c as any).subcategory || "",
contact_form: attrs["Contact Form"] || null,
Expand Down
Loading