Skip to content

Commit 8be5f21

Browse files
CopilotGrazulex
andcommitted
Add missing group YAML files and update examples documentation
Co-authored-by: Grazulex <[email protected]>
1 parent ef76a48 commit 8be5f21

File tree

7 files changed

+200
-63
lines changed

7 files changed

+200
-63
lines changed

examples/README.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,23 +222,64 @@ php artisan flowpipe:export user-registration --format=md --output=docs/user-reg
222222

223223
## Step Groups
224224

225-
The examples demonstrate three types of reusable step groups:
225+
The examples demonstrate multiple types of reusable step groups organized by functionality:
226226

227-
### User Validation Group (`groups/user-validation.yaml`)
227+
### User-Related Groups
228+
229+
#### User Validation Group (`groups/user-validation.yaml`)
228230
- Email format validation
229231
- Password strength checking
230232
- Required field validation
231233
- User existence checking
232234
- Terms acceptance validation
233235

234-
### Order Processing Group (`groups/order-processing.yaml`)
236+
#### User Setup Group (`groups/user-setup.yaml`)
237+
- User ID generation
238+
- Password hashing
239+
- Profile creation
240+
- Default preferences setup
241+
- API key generation
242+
243+
#### User Notifications Group (`groups/user-notifications.yaml`)
244+
- Welcome email sending
245+
- Email verification dispatch
246+
- Admin notifications
247+
- Registration event logging
248+
- User statistics updates
249+
250+
### E-commerce Groups
251+
252+
#### Order Validation Group (`groups/order-validation.yaml`)
253+
- Order structure validation
254+
- Customer information validation
255+
- Item and quantity validation
256+
- Order total verification
257+
- Business rules checking
258+
259+
#### Inventory Management Group (`groups/inventory-management.yaml`)
260+
- Item availability checking
261+
- Inventory reservation
262+
- Shipping cost calculation
263+
- Inventory level updates
264+
- Inventory reporting
265+
266+
#### Order Notifications Group (`groups/order-notifications.yaml`)
267+
- Order confirmation emails
268+
- SMS notifications
269+
- Customer account updates
270+
- Warehouse notifications
271+
- Notification event logging
272+
273+
### General Processing Groups
274+
275+
#### Order Processing Group (`groups/order-processing.yaml`)
235276
- Order data validation
236277
- Inventory checking and reservation
237278
- Payment processing
238279
- Order record creation
239280
- Confirmation generation
240281

241-
### Notifications Group (`groups/notifications.yaml`)
282+
#### Notifications Group (`groups/notifications.yaml`)
242283
- Welcome email sending
243284
- Verification email dispatch
244285
- SMS notifications
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Example: Inventory Management Group
2+
# File: groups/inventory-management.yaml
3+
4+
group: inventory-management
5+
description: Manage inventory for e-commerce orders
6+
7+
steps:
8+
# Check item availability
9+
- type: closure
10+
action: check_item_availability
11+
description: Check if all items are available in requested quantities
12+
13+
# Reserve inventory items
14+
- type: closure
15+
action: reserve_items
16+
description: Reserve items for this order
17+
18+
# Calculate shipping costs
19+
- type: closure
20+
action: calculate_shipping
21+
description: Calculate shipping costs based on items and location
22+
23+
# Update inventory levels
24+
- type: closure
25+
action: update_inventory_levels
26+
description: Update inventory levels after reservation
27+
28+
# Generate inventory report
29+
- type: closure
30+
action: generate_inventory_report
31+
description: Generate inventory status report for this order
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Example: Order Notifications Group
2+
# File: groups/order-notifications.yaml
3+
4+
group: order-notifications
5+
description: Send notifications for e-commerce orders
6+
7+
steps:
8+
# Send order confirmation email
9+
- type: closure
10+
action: send_order_confirmation
11+
description: Send order confirmation email to customer
12+
13+
# Send SMS notification
14+
- type: closure
15+
action: send_sms_notification
16+
description: Send SMS notification if customer opted in
17+
18+
# Update customer account
19+
- type: closure
20+
action: update_customer_account
21+
description: Update customer's order history
22+
23+
# Notify warehouse
24+
- type: closure
25+
action: notify_warehouse
26+
description: Notify warehouse team about new order
27+
28+
# Log notification events
29+
- type: closure
30+
action: log_notifications
31+
description: Log all notification events for auditing
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Example: Order Validation Group
2+
# File: groups/order-validation.yaml
3+
4+
group: order-validation
5+
description: Validate e-commerce order data and requirements
6+
7+
steps:
8+
# Validate order structure
9+
- type: closure
10+
action: validate_order_structure
11+
description: Ensure order contains required fields
12+
13+
# Validate customer information
14+
- type: closure
15+
action: validate_customer_info
16+
description: Validate customer name, email, and address
17+
18+
# Validate items and quantities
19+
- type: closure
20+
action: validate_items
21+
description: Validate item names, prices, and quantities
22+
23+
# Calculate and verify total
24+
- type: closure
25+
action: verify_order_total
26+
description: Calculate total and verify against provided total
27+
28+
# Check business rules
29+
- type: closure
30+
action: check_business_rules
31+
description: Apply business rules (minimum order, restrictions, etc.)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Example: User Notifications Group
2+
# File: groups/user-notifications.yaml
3+
4+
group: user-notifications
5+
description: Send notifications for new user registration
6+
7+
steps:
8+
# Send welcome email
9+
- type: closure
10+
action: send_welcome_email
11+
description: Send welcome email with account details
12+
13+
# Send verification email
14+
- type: closure
15+
action: send_verification_email
16+
description: Send email verification link
17+
18+
# Send admin notification
19+
- type: closure
20+
action: notify_admin
21+
description: Notify administrators about new user registration
22+
23+
# Log registration event
24+
- type: closure
25+
action: log_registration
26+
description: Log user registration event for analytics
27+
28+
# Update user stats
29+
- type: closure
30+
action: update_user_stats
31+
description: Update application user statistics

examples/groups/user-setup.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Example: User Setup Group
2+
# File: groups/user-setup.yaml
3+
4+
group: user-setup
5+
description: Set up new user account and profile
6+
7+
steps:
8+
# Generate user ID
9+
- type: closure
10+
action: generate_user_id
11+
description: Generate unique user identifier
12+
13+
# Hash password
14+
- type: closure
15+
action: hash_password
16+
description: Hash user password securely
17+
18+
# Create user profile
19+
- type: closure
20+
action: create_user_profile
21+
description: Create initial user profile with default settings
22+
23+
# Set default preferences
24+
- type: closure
25+
action: set_default_preferences
26+
description: Set default user preferences and settings
27+
28+
# Generate API key
29+
- type: closure
30+
action: generate_api_key
31+
description: Generate API key for user account

test_flowpipe.php

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)