update nozzle stuff
This commit is contained in:
@@ -156,6 +156,17 @@ router.get('/', async (req, res, next) => {
|
||||
maxGpm: parseFloat(item.max_gpm) || null,
|
||||
maxPsi: parseFloat(item.max_psi) || null,
|
||||
powerSource: item.power_source,
|
||||
// Nozzle fields
|
||||
orificeSize: item.orifice_size,
|
||||
sprayAngle: item.spray_angle,
|
||||
flowRateGpm: parseFloat(item.flow_rate_gpm) || null,
|
||||
dropletSize: item.droplet_size,
|
||||
sprayPattern: item.spray_pattern,
|
||||
pressureRangePsi: item.pressure_range_psi,
|
||||
threadSize: item.thread_size,
|
||||
material: item.material,
|
||||
colorCode: item.color_code,
|
||||
quantityOwned: item.quantity_owned,
|
||||
// General fields
|
||||
purchaseDate: item.purchase_date,
|
||||
purchasePrice: parseFloat(item.purchase_price) || null,
|
||||
@@ -232,6 +243,17 @@ router.get('/:id', validateParams(idParamSchema), async (req, res, next) => {
|
||||
maxGpm: parseFloat(item.max_gpm) || null,
|
||||
maxPsi: parseFloat(item.max_psi) || null,
|
||||
powerSource: item.power_source,
|
||||
// Nozzle fields
|
||||
orificeSize: item.orifice_size,
|
||||
sprayAngle: item.spray_angle,
|
||||
flowRateGpm: parseFloat(item.flow_rate_gpm) || null,
|
||||
dropletSize: item.droplet_size,
|
||||
sprayPattern: item.spray_pattern,
|
||||
pressureRangePsi: item.pressure_range_psi,
|
||||
threadSize: item.thread_size,
|
||||
material: item.material,
|
||||
colorCode: item.color_code,
|
||||
quantityOwned: item.quantity_owned,
|
||||
// General fields
|
||||
purchaseDate: item.purchase_date,
|
||||
purchasePrice: parseFloat(item.purchase_price) || null,
|
||||
@@ -282,6 +304,17 @@ router.post('/', async (req, res, next) => {
|
||||
maxGpm,
|
||||
maxPsi,
|
||||
powerSource,
|
||||
// Nozzle specific fields
|
||||
orificeSize,
|
||||
sprayAngle,
|
||||
flowRateGpm,
|
||||
dropletSize,
|
||||
sprayPattern,
|
||||
pressureRangePsi,
|
||||
threadSize,
|
||||
material,
|
||||
colorCode,
|
||||
quantityOwned,
|
||||
// General fields
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
@@ -331,8 +364,9 @@ router.post('/', async (req, res, next) => {
|
||||
mower_style, cutting_width_inches, engine_hp, fuel_type,
|
||||
tool_type, working_width_inches,
|
||||
pump_type, max_gpm, max_psi, power_source,
|
||||
orifice_size, spray_angle, flow_rate_gpm, droplet_size, spray_pattern, pressure_range_psi, thread_size, material, color_code, quantity_owned,
|
||||
purchase_date, purchase_price, notes)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38)
|
||||
RETURNING *`,
|
||||
[
|
||||
req.user.id, equipmentTypeId, finalCategoryId, customName, manufacturer, model,
|
||||
@@ -341,6 +375,7 @@ router.post('/', async (req, res, next) => {
|
||||
mowerStyle, cuttingWidthInches, engineHp, fuelType,
|
||||
toolType, workingWidthInches,
|
||||
pumpType, maxGpm, maxPsi, powerSource,
|
||||
orificeSize, sprayAngle, flowRateGpm, dropletSize, sprayPattern, pressureRangePsi, threadSize, material, colorCode, quantityOwned,
|
||||
purchaseDate, purchasePrice, notes
|
||||
]
|
||||
);
|
||||
@@ -422,6 +457,16 @@ router.put('/:id', validateParams(idParamSchema), async (req, res, next) => {
|
||||
maxGpm,
|
||||
maxPsi,
|
||||
powerSource,
|
||||
orificeSize,
|
||||
sprayAngle,
|
||||
flowRateGpm,
|
||||
dropletSize,
|
||||
sprayPattern,
|
||||
pressureRangePsi,
|
||||
threadSize,
|
||||
material,
|
||||
colorCode,
|
||||
quantityOwned,
|
||||
purchaseDate,
|
||||
purchasePrice,
|
||||
notes,
|
||||
@@ -446,9 +491,10 @@ router.put('/:id', validateParams(idParamSchema), async (req, res, next) => {
|
||||
mower_style = $15, cutting_width_inches = $16, engine_hp = $17, fuel_type = $18,
|
||||
tool_type = $19, working_width_inches = $20,
|
||||
pump_type = $21, max_gpm = $22, max_psi = $23, power_source = $24,
|
||||
purchase_date = $25, purchase_price = $26, notes = $27, is_active = $28,
|
||||
orifice_size = $25, spray_angle = $26, flow_rate_gpm = $27, droplet_size = $28, spray_pattern = $29, pressure_range_psi = $30, thread_size = $31, material = $32, color_code = $33, quantity_owned = $34,
|
||||
purchase_date = $35, purchase_price = $36, notes = $37, is_active = $38,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = $29
|
||||
WHERE id = $39
|
||||
RETURNING *`,
|
||||
[
|
||||
equipmentTypeId, categoryId, customName, manufacturer, model,
|
||||
@@ -457,6 +503,7 @@ router.put('/:id', validateParams(idParamSchema), async (req, res, next) => {
|
||||
mowerStyle, cuttingWidthInches, engineHp, fuelType,
|
||||
toolType, workingWidthInches,
|
||||
pumpType, maxGpm, maxPsi, powerSource,
|
||||
orificeSize, sprayAngle, flowRateGpm, dropletSize, sprayPattern, pressureRangePsi, threadSize, material, colorCode, quantityOwned,
|
||||
purchaseDate, purchasePrice, notes, isActive !== undefined ? isActive : true,
|
||||
equipmentId
|
||||
]
|
||||
@@ -494,6 +541,16 @@ router.put('/:id', validateParams(idParamSchema), async (req, res, next) => {
|
||||
maxGpm: parseFloat(equipment.max_gpm) || null,
|
||||
maxPsi: parseFloat(equipment.max_psi) || null,
|
||||
powerSource: equipment.power_source,
|
||||
orificeSize: equipment.orifice_size,
|
||||
sprayAngle: equipment.spray_angle,
|
||||
flowRateGpm: parseFloat(equipment.flow_rate_gpm) || null,
|
||||
dropletSize: equipment.droplet_size,
|
||||
sprayPattern: equipment.spray_pattern,
|
||||
pressureRangePsi: equipment.pressure_range_psi,
|
||||
threadSize: equipment.thread_size,
|
||||
material: equipment.material,
|
||||
colorCode: equipment.color_code,
|
||||
quantityOwned: equipment.quantity_owned,
|
||||
purchaseDate: equipment.purchase_date,
|
||||
purchasePrice: parseFloat(equipment.purchase_price) || null,
|
||||
notes: equipment.notes,
|
||||
|
||||
Reference in New Issue
Block a user