oneie 3.3.4 → 3.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,211 @@
1
+ # The Nine Padel Playbook: Your Business, In Plain English
2
+
3
+ Welcome to the new way of running your store. Forget needing a developer for every small change. This document is your playbook. It teaches you a simple English-based language to write "Plays"—automated strategies that your store will run for you.
4
+
5
+ Think of it like writing a recipe. You list the steps, and your intelligent store engine follows them perfectly, every time.
6
+
7
+ **The Core Concept:** Your entire business—every product, customer, and order—is organized into a simple, six-part structure called an ontology. Every command you write is checked against this structure, guaranteeing it will work as expected.
8
+
9
+ ---
10
+
11
+ ### Your Command Reference: The Building Blocks of Your Plays
12
+
13
+ These are the simple English commands you'll use to write your business strategies.
14
+
15
+ #### **CREATE** - Add Something New
16
+
17
+ Use this to add a new product, a guide, or a discount to your store.
18
+
19
+ - `CREATE product called "Head Radical MP" WITH price £180 AND FOR intermediate players.`
20
+
21
+ - `CREATE guide called "How to Prevent Padel Elbow" WITH content from our expert.`
22
+
23
+ - `CREATE discount code "SUMMER10" FOR 10% off all bags.`
24
+
25
+
26
+ #### **GET** - Find Information
27
+
28
+ Use this to find customers, products, or orders that match specific criteria.
29
+
30
+ - `GET all customers WHO BOUGHT a Nox racket.`
31
+
32
+ - `GET all orders WITH a total value OVER £200.`
33
+
34
+ - `GET the 5 most viewed products THIS MONTH.`
35
+
36
+
37
+ #### **CONNECT** - Link Two Things Together
38
+
39
+ Use this to create relationships, like assigning a review to a product.
40
+
41
+ - `CONNECT a new review TO the "Bullpadel Vertex" racket.`
42
+
43
+ - `CONNECT the "Beginner's Guide" TO all rackets FOR beginners.`
44
+
45
+
46
+ #### **RECORD** - Log That Something Happened
47
+
48
+ Use this to create a permanent record of an important action for your analytics.
49
+
50
+ - `RECORD a customer service chat WITH a positive outcome.`
51
+
52
+ - `RECORD that a customer visited our physical pop-up store.`
53
+
54
+
55
+ #### **CHECK** - Make a Decision
56
+
57
+ Use this to create rules and logic in your Plays.
58
+
59
+ - `CHECK a customer's total spending is OVER £500.`
60
+
61
+ - `CHECK the stock for the "Adidas Metalbone" is LESS THAN 10.`
62
+
63
+ - `CHECK IF a customer is in the "Loyalists" group.`
64
+
65
+
66
+ #### **NOTIFY** - Send a Message
67
+
68
+ Use this to communicate with customers or your staff.
69
+
70
+ - `NOTIFY the customer VIA email ABOUT their shipped order.`
71
+
72
+ - `NOTIFY the warehouse staff VIA Slack ABOUT a new high-value order.`
73
+
74
+
75
+ #### **WAIT** - Pause for the Perfect Moment
76
+
77
+ Use this to time your actions perfectly.
78
+
79
+ - `WAIT 24 hours after a cart is abandoned.`
80
+
81
+ - `WAIT until a customer has been inactive FOR 30 days.`
82
+
83
+
84
+ ---
85
+
86
+ ### The Playbook: Your Automated Strategies, In Action
87
+
88
+ Here are complete, real-world examples of "Plays" you can write to attract, convert, and grow your customer base.
89
+
90
+ #### **Play 1: The "Smart Content Machine" (Attraction)**
91
+
92
+ **Goal:** Automatically create helpful blog posts based on your most popular products to attract new customers from Google.
93
+
94
+ **FEATURE:** The Smart Content Machine
95
+
96
+ **WHEN** a product gets more than 100 views in one week
97
+
98
+ **FLOW:**
99
+
100
+ GET the product with over 100 views
101
+
102
+ SAVE AS popular product
103
+
104
+ CHECK IF a guide for this product already exists
105
+
106
+ OTHERWISE move to the next step
107
+
108
+ // Now, let's create a helpful guide based on the product's details.
109
+
110
+ GET the product's brand, skill level, and style
111
+
112
+ SAVE AS product details
113
+
114
+ CALL AI to write a guide titled "Is the [popular product name] Right For You?"
115
+
116
+ WITH the product details
117
+
118
+ EXPLAINING who it's for (e.g., "perfect for intermediate players who want more power")
119
+
120
+ SAVE AS new guide content
121
+
122
+ CREATE guide with the new guide content
123
+
124
+ SAVE AS new guide
125
+
126
+ **CONNECT** the new guide **TO** the popular product
127
+
128
+ **NOTIFY** the store owner **VIA** email **ABOUT** the new draft guide, ready for review.
129
+
130
+ ---
131
+
132
+ #### **Play 2: The "Intelligent Cart Saver" (Conversion)**
133
+
134
+ **Goal:** Recover abandoned carts with a helpful, personalized message instead of a generic reminder.
135
+
136
+ **FEATURE:** The Intelligent Cart Saver
137
+
138
+ **WHEN** a customer abandons their shopping cart
139
+
140
+ **FLOW:**
141
+
142
+ **WAIT** 2 hours // Give them time to come back on their own.
143
+
144
+ GET the most expensive racket in the abandoned cart
145
+
146
+ SAVE AS the target racket
147
+
148
+ GET all reviews FOR the target racket WITH a 5-star rating
149
+
150
+ SAVE AS top reviews
151
+
152
+ GET one helpful quote from the top reviews
153
+
154
+ SAVE AS best quote
155
+
156
+ NOTIFY the customer VIA email
157
+
158
+ WITH the subject "A question about the [target racket name]?"
159
+
160
+ WITH the message: "Hi, just wondering if you had any questions about the [target racket name]. A recent customer said: '[best quote]'. Let us know if we can help!"
161
+
162
+ **RECORD** that a cart recovery email was sent.
163
+
164
+ ---
165
+
166
+ #### **Play 3: The "Loyalty Reward" (Growth)**
167
+
168
+ **Goal:** Automatically identify and reward your best customers to keep them coming back.
169
+
170
+ **FEATURE:** The Loyalty Reward
171
+
172
+ **WHEN** a customer completes their third purchase
173
+
174
+ **FLOW:**
175
+
176
+ **GET** the customer who just made their third purchase
177
+
178
+ GET their total spending across all orders
179
+
180
+ SAVE AS customer lifetime value
181
+
182
+ // Let's create a special, one-time-use discount for them.
183
+
184
+ CREATE a unique discount code FOR 15% off
185
+
186
+ CONNECT this code TO the customer
187
+
188
+ NOTIFY the customer VIA email
189
+
190
+ WITH the subject "A Thank You From Nine Padel!"
191
+
192
+ WITH the message: "Wow, your third order! We're so grateful for your support. As a thank you, here is a special 15% discount code just for you on your next purchase: [unique discount code]."
193
+
194
+ **ADD** the customer **TO** the "Loyalists" customer segment.
195
+
196
+ ---
197
+
198
+ ### How It All Works: From Your Words to a Live Feature
199
+
200
+ You don't need to worry about the technical details, but here’s the simple process that happens in seconds when you write a Play:
201
+
202
+ 1. **You Write in English:** You write a feature using the commands above.
203
+
204
+ 2. **System Validates:** The system checks your Play against the six-part ontology to make sure it makes sense (e.g., you can't `CONNECT` a `product` to another `product` as `places`).
205
+
206
+ 3. **System Builds:** It automatically generates the necessary code and database logic.
207
+
208
+ 4. **Feature is Live:** Your new automated strategy is deployed and running on the edge, close to your customers, making your store smarter.
209
+
210
+
211
+ This isn't just a tool; it's your new business partner, ready to execute your best strategies, 24/7.
@@ -0,0 +1,251 @@
1
+ ## E-commerce Ontology Specification
2
+
3
+ Version: 1.0.0 (Intelligent Commerce Engine)
4
+
5
+ Status: Complete & Generic
6
+
7
+ Design Principle: This ontology models any e-commerce business in six dimensions, transforming a simple online store into a proactive, intelligent commerce engine. It is the single source of truth for all business operations, from inventory management to AI-driven marketing.
8
+
9
+ ### The Philosophy: Your Store is an Engine, Not a Shelf
10
+
11
+ A traditional e-commerce site is a digital shelf—a passive display of products. An intelligent commerce engine is a sentient system that understands its products, knows its customers, anticipates market trends, and automates its own growth.
12
+
13
+ This ontology provides the universal structure for that engine. Every command, feature, and piece of data is mapped to these six fundamental dimensions.
14
+
15
+ ---
16
+
17
+ ## 1. GROUP: The Business Entity
18
+
19
+ This is the top-level container that defines your entire store as a single, cohesive unit.
20
+
21
+ ### Group Structure
22
+
23
+ TypeScript
24
+
25
+ ```
26
+ {
27
+ _id: Id<'groups'>,
28
+ slug: 'your-store-name', // e.g., 'acme-widgets'
29
+ name: 'Your Store Name',
30
+ type: 'business',
31
+ metadata: {
32
+ domain: 'yourstore.com',
33
+ defaultCurrency: 'USD',
34
+ defaultCountry: 'USA'
35
+ },
36
+ status: 'active'
37
+ }
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 2. PEOPLE: The Actors
43
+
44
+ This dimension defines every person who interacts with your store and their specific role.
45
+
46
+ ### Person Roles
47
+
48
+ 1. **`owner`**: The business owner with full administrative privileges.
49
+
50
+ 2. **`staff`**: Employees with specific permissions (e.g., order fulfillment, customer support).
51
+
52
+ 3. **`customer`**: Any individual who browses or buys from the store, from anonymous visitor to loyal patron.
53
+
54
+
55
+ ### Person Structure
56
+
57
+ TypeScript
58
+
59
+ ```
60
+ {
61
+ _id: Id<'people'>,
62
+ email: string,
63
+ role: 'owner' | 'staff' | 'customer',
64
+ displayName?: string,
65
+ defaultShippingAddress?: { /* ... */ },
66
+ createdAt: number
67
+ }
68
+ ```
69
+
70
+ ---
71
+
72
+ ## 3. THINGS: The Nouns of Your Business 🛍️
73
+
74
+ This is the comprehensive catalog of every object, both physical and digital, that exists in your store.
75
+
76
+ ### Thing Types (`ThingType`)
77
+
78
+ - **Catalog & Inventory (6 types):**
79
+
80
+ - `product`: The core sellable item.
81
+
82
+ - `product_variant`: A specific version of a product (e.g., size, color).
83
+
84
+ - `category`: A classification for products (e.g., "T-Shirts," "Electronics").
85
+
86
+ - `brand`: The manufacturer or label of a product.
87
+
88
+ - `collection`: A curated group of products (e.g., "Summer Collection," "Holiday Gift Guide").
89
+
90
+ - `inventory_item`: Tracks the stock level for a specific product or variant at a location.
91
+
92
+ - **Commerce & Orders (5 types):**
93
+
94
+ - `order`: The official record of a customer's completed purchase.
95
+
96
+ - `shopping_cart`: A temporary container for items a customer intends to buy.
97
+
98
+ - `payment`: A record of a financial transaction.
99
+
100
+ - `discount_code`: A promotional code for a discount.
101
+
102
+ - `subscription`: A recurring order for a product or service.
103
+
104
+ - **Content & Engagement (4 types):**
105
+
106
+ - `guide`: A blog post, buying guide, or informational article.
107
+
108
+ - `customer_review`: A customer's rating and feedback.
109
+
110
+ - `faq`: A frequently asked question and its answer.
111
+
112
+ - `landing_page`: A custom page for a specific campaign or purpose.
113
+
114
+ - **Marketing & Analytics (3 types):**
115
+
116
+ - `insight`: An AI-generated observation about business performance.
117
+
118
+ - `customer_segment`: A dynamic group of customers defined by specific rules.
119
+
120
+ - `ad_campaign`: A record of a marketing campaign.
121
+
122
+ - **System & Integration (1 type):**
123
+
124
+ - `external_agent`: Represents a connection to an external platform like ChatGPT, Google Shopping, or a social media channel.
125
+
126
+
127
+ ---
128
+
129
+ ## 4. CONNECTIONS: The Relationships
130
+
131
+ This dimension maps the relationships between all your `Things` and `People`, forming a powerful knowledge graph of your business.
132
+
133
+ ### Connection Types (`ConnectionType`)
134
+
135
+ - **Catalog Structure (3):** `part_of` (product → category), `belongs_to` (product → collection), `manufactured_by` (product → brand).
136
+
137
+ - **Commerce (5):** `places` (customer → order), `contains` (order → product), `uses` (order → discount_code), `purchased` (customer → product), `subscribed_to` (customer → subscription).
138
+
139
+ - **Engagement (3):** `writes` (customer → review), `is_about` (review → product), `viewed` (customer → guide).
140
+
141
+
142
+ ---
143
+
144
+ ## 5. EVENTS: The Actions
145
+
146
+ This is the unchangeable, time-stamped log of every action that happens in your store. It's the fuel for analytics, automation, and understanding customer behavior.
147
+
148
+ ### Event Types (`EventType`)
149
+
150
+ - **Discovery Events:** `session_started`, `product_viewed`, `search_performed`, `filter_applied`.
151
+
152
+ - **Commerce Events:** `product_added_to_cart`, `cart_abandoned`, `checkout_started`, `order_placed`, `payment_processed`.
153
+
154
+ - **Post-Purchase Events:** `order_shipped`, `order_delivered`, `review_submitted`, `return_requested`.
155
+
156
+ - **System Events:** `insight_generated`, `stock_level_low`, `customer_segment_updated`.
157
+
158
+
159
+ ---
160
+
161
+ ## 6. KNOWLEDGE: The Intelligence Layer
162
+
163
+ This is the "brain" of your store. It’s a system of labels that add context and meaning to your data, powering smart search, personalization, and AI agents.
164
+
165
+ ### Key Knowledge Labels
166
+
167
+ - **Product Attributes:** `category:apparel`, `color:blue`, `size:large`, `material:cotton`, `feature:waterproof`.
168
+
169
+ - **Customer Segments:** `archetype:whale`, `status:lapsed`, `ltv_tier:gold`, `interest:outdoors`.
170
+
171
+ - **Operational Statuses:** `order_status:shipped`, `stock_status:in_stock`, `payment_status:paid`.
172
+
173
+ - **Content Goals:** `goal:conversion`, `topic:how_to`, `audience:beginner`.
174
+
175
+
176
+ ---
177
+
178
+ ## 7. The Control Layer: Your Business Playbook (Plain English DSL)
179
+
180
+ This is the revolutionary part. The ontology provides the structure; this playbook gives you control. It's a simple, English-based language that allows you, the business owner, to write "Plays"—automated strategies that your store will run for you.
181
+
182
+ ### Your Command Reference
183
+
184
+ - `CREATE`: Add a new product, discount, or blog post.
185
+
186
+ - `GET`: Find customers, products, or orders based on rules.
187
+
188
+ - `CONNECT`: Link a review to a product or a product to a collection.
189
+
190
+ - `RECORD`: Log an important business event, like a customer support call.
191
+
192
+ - `CHECK`: Make decisions based on data (e.g., `CHECK IF a customer's total spending is OVER $1000`).
193
+
194
+ - `NOTIFY`: Send an email, SMS, or push notification.
195
+
196
+ - `WAIT`: Pause for a specific time to act at the perfect moment.
197
+
198
+
199
+ ### Your Automated Strategies, In Action
200
+
201
+ #### **Play 1: The "High-Value Cart Recovery" Play**
202
+
203
+ **Goal:** Prevent your most valuable customers from abandoning their carts.
204
+
205
+ **FEATURE:** High-Value Cart Recovery
206
+
207
+ **WHEN** a customer abandons a cart
208
+
209
+ **FLOW:**
210
+
211
+ GET the total value of the abandoned cart
212
+
213
+ SAVE AS cart value
214
+
215
+ CHECK IF cart value is OVER $200
216
+
217
+ THEN WAIT 30 minutes // Act quickly for high-value carts
218
+
219
+ CREATE a unique discount code FOR free shipping
220
+
221
+ NOTIFY the customer VIA email WITH a personal message and the free shipping code.
222
+
223
+ ELSE WAIT 2 hours
224
+
225
+ NOTIFY the customer VIA email WITH a standard cart reminder.
226
+
227
+ #### **Play 2: The "Customer Win-Back" Play**
228
+
229
+ **Goal:** Automatically re-engage customers who haven't purchased in a while.
230
+
231
+ **FEATURE:** Customer Win-Back Campaign
232
+
233
+ **WHEN** the system runs its daily check
234
+
235
+ **FLOW:**
236
+
237
+ GET all customers WHOSE last order was between 90 and 100 days ago
238
+
239
+ SAVE AS lapsed customers
240
+
241
+ FOR EACH customer IN lapsed customers
242
+
243
+ DO CREATE a unique discount code FOR 20% off
244
+
245
+ NOTIFY the customer VIA email
246
+
247
+ WITH the subject "We've Missed You!"
248
+
249
+ WITH a personal message and their unique 20% off code.
250
+
251
+ RECORD a "win_back_offer_sent" event FOR that customer.