chore: perauset customer project
This commit is contained in:
49
e2e/tests/steps/inventory.steps.ts
Normal file
49
e2e/tests/steps/inventory.steps.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { When } from '@cucumber/cucumber'
|
||||
import type { PerausetWorld } from '../support/world.js'
|
||||
|
||||
When('I create an inventory item {string} with unit {string} quantity {int} and minimum {int}', async function (this: PerausetWorld, name: string, unit: string, currentQuantity: number, minimumQuantity: number) {
|
||||
await this.post('/inventory', {
|
||||
name,
|
||||
unit,
|
||||
currentQuantity,
|
||||
minimumQuantity,
|
||||
category: 'kitchen',
|
||||
})
|
||||
})
|
||||
|
||||
When('I update the inventory item with name {string}', async function (this: PerausetWorld, name: string) {
|
||||
const itemId = (this as any).itemId
|
||||
await this.put(`/inventory/${itemId}`, {
|
||||
itemId,
|
||||
name,
|
||||
})
|
||||
})
|
||||
|
||||
When('I list inventory items', async function (this: PerausetWorld) {
|
||||
await this.get('/inventory')
|
||||
})
|
||||
|
||||
When('I request inventory for item with quantity {int} unit {string} and purpose {string}', async function (this: PerausetWorld, quantity: number, unit: string, purpose: string) {
|
||||
const itemId = (this as any).itemId
|
||||
await this.post('/inventory/requests', {
|
||||
itemId,
|
||||
quantity,
|
||||
unit,
|
||||
purpose,
|
||||
})
|
||||
})
|
||||
|
||||
When('I review the inventory request with status {string}', async function (this: PerausetWorld, status: string) {
|
||||
const requestId = (this as any).requestId
|
||||
await this.post(`/inventory/requests/${requestId}/review`, {
|
||||
requestId,
|
||||
status,
|
||||
})
|
||||
})
|
||||
|
||||
When('I fulfill the inventory request', async function (this: PerausetWorld) {
|
||||
const requestId = (this as any).requestId
|
||||
await this.post(`/inventory/requests/${requestId}/fulfill`, {
|
||||
requestId,
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user