Skip to content

Commit 9e8ea90

Browse files
committed
fix: Update campaign status values and requirement schema
1 parent 85db585 commit 9e8ea90

File tree

8 files changed

+311
-791
lines changed

8 files changed

+311
-791
lines changed
File renamed without changes.

swt_api_spec/cocoaflow-api.yaml

Lines changed: 36 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -137,160 +137,42 @@ externalDocs:
137137
url: "https://github.com/frckbrice/project-api_spec"
138138

139139
tags:
140-
- name: 🔐 Authentication
141-
description: |
142-
**User authentication and authorization endpoints**
143-
144-
Secure JWT Bearer token authentication with OAuth 2.0 support for third-party integrations.
145-
146-
**Features:**
147-
- JWT Token Management
148-
- OAuth 2.0 Authorization
149-
- Role-based Access Control
150-
- Session Management
151-
- name: 🏢 Companies
152-
description: |
153-
**Company management operations for cocoa industry organizations**
154-
155-
Complete company profile management with multi-tenant support and organizational hierarchy.
156-
157-
**Features:**
158-
- Company Registration & Onboarding
159-
- Multi-tenant Architecture
160-
- Organizational Hierarchy
161-
- Compliance Management
162-
- name: 👥 Users
163-
description: |
164-
**User management for system administrators and company employees**
165-
166-
Comprehensive user management with role-based permissions and activity tracking.
167-
168-
**Features:**
169-
- User Registration & Profiles
170-
- Role-based Permissions
171-
- Activity Tracking
172-
- Password Management
173-
- name: 👨‍🌾 Farmers
174-
description: |
175-
**Farmer profile and relationship management**
176-
177-
Digital farmer onboarding with comprehensive profile management and relationship tracking.
178-
179-
**Features:**
180-
- Digital Onboarding
181-
- Profile Management
182-
- Contract Management
183-
- Performance Tracking
184-
- name: 🏡 Farms
185-
description: |
186-
**Farm registration, GPS tracking, and compliance monitoring**
187-
188-
GPS-enabled farm management with real-time tracking and compliance monitoring.
189-
190-
**Features:**
191-
- GPS Coordinates
192-
- Real-time Tracking
193-
- Compliance Monitoring
194-
- Inspection Data
195-
- name: 🌿 Projects
196-
description: |
197-
**Rainforest Alliance certification projects and compliance tracking**
198-
199-
Automated compliance tracking with audit trails and certification management.
200-
201-
**Features:**
202-
- Certification Tracking
203-
- Audit Trails
204-
- Compliance Automation
205-
- Reporting Tools
206-
- name: 📈 Campaigns
207-
description: |
208-
**Seasonal campaign management and data collection periods**
209-
210-
Seasonal campaign management with performance analytics and data collection.
211-
212-
**Features:**
213-
- Campaign Planning
214-
- Data Collection
215-
- Performance Analytics
216-
- Seasonal Management
217-
- name: 🏪 Markets
218-
description: |
219-
**Market sessions for cocoa trading between companies and farmers**
220-
221-
Digital marketplace for cocoa trading with transaction management and pricing.
222-
223-
**Features:**
224-
- Digital Marketplace
225-
- Transaction Management
226-
- Pricing Models
227-
- Market Analytics
228-
- name: 💰 Transactions
229-
description: |
230-
**Financial transactions and payment processing**
231-
232-
Secure payment processing with transaction history and financial reporting.
233-
234-
**Features:**
235-
- Payment Processing
236-
- Transaction History
237-
- Financial Reporting
238-
- Audit Trails
239-
- name: 🎓 Training
240-
description: |
241-
**Farmer training sessions and educational content management**
242-
243-
Comprehensive training management with learning analytics and certification tracking.
244-
245-
**Features:**
246-
- Session Management
247-
- Learning Analytics
248-
- Certification Tracking
249-
- Content Management
250-
- name: 🔍 Inspection
251-
description: |
252-
**Farm inspection data collection and compliance verification**
253-
254-
Digital inspection tools with automated compliance verification and reporting.
255-
256-
**Features:**
257-
- Digital Inspections
258-
- Compliance Verification
259-
- Automated Reporting
260-
- Data Collection
261-
- name: 📊 Analytics
262-
description: |
263-
**Data analytics and reporting endpoints**
264-
265-
Comprehensive business intelligence with real-time analytics and custom reporting.
266-
267-
**Features:**
268-
- Business Intelligence
269-
- Real-time Analytics
270-
- Custom Reporting
271-
- Data Visualization
272-
- name: ⚙️ Administration
273-
description: |
274-
**System administration and configuration**
275-
276-
System-wide administration tools with configuration management and monitoring.
277-
278-
**Features:**
279-
- System Configuration
280-
- User Management
281-
- Monitoring & Alerts
282-
- Backup & Recovery
283-
- name: 🌿 Audits
284-
description: |
285-
**Audit and compliance verification endpoints**
286-
287-
Comprehensive audit management with compliance verification and reporting.
288-
289-
**Features:**
290-
- Project Audits
291-
- Market Audits
292-
- Compliance Verification
293-
- Audit Reporting
140+
- name: "🔐 Authentication"
141+
description: "Authentication and authorization endpoints"
142+
- name: "🏡 Farms"
143+
description: "Farm management operations"
144+
- name: "📈 Campaigns"
145+
description: "Campaign and stock management"
146+
- name: "🏢 Companies"
147+
description: "Company management and subscriptions"
148+
- name: "💰 Transactions"
149+
description: "Transaction processing and management"
150+
- name: "💰 Receipts"
151+
description: "Receipt generation and management"
152+
- name: "🔍 Inspection"
153+
description: "Inspection data management"
154+
- name: "🎓 Training"
155+
description: "Training sessions and management"
156+
- name: "User"
157+
description: "User account management"
158+
- name: "Price"
159+
description: "Pricing and subscription plans"
160+
- name: "Farm_coodinates"
161+
description: "Farm location and mapping data"
162+
- name: "Subscription"
163+
description: "Subscription management"
164+
- name: "Company"
165+
description: "Company profile management"
166+
- name: "Receipt"
167+
description: "Receipt operations"
168+
- name: "Inspection_data"
169+
description: "Detailed inspection records"
170+
- name: "🌿 Projects"
171+
description: "Project management and certification tracking"
172+
- name: "🏪 Markets"
173+
description: "Market session management and trading"
174+
- name: "🌿 Audits"
175+
description: "Project and market audit management"
294176

295177
x-tagGroups:
296178
- name: 🏢 Core Operations
Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,48 @@
11
type: object
2+
required:
3+
- name
4+
- start_date
5+
- end_date
6+
- status
27
properties:
38
id:
49
type: string
510
format: cuid
611
readOnly: true
7-
description: "The unique Id of the campaign."
12+
description: "The unique ID of the campaign"
13+
example: "clh1234567890abcdef"
814
name:
915
type: string
10-
description: "title of the campaign"
11-
readOnly: true
16+
description: "The name of the campaign"
17+
example: "Spring 2024 Harvest"
1218
description:
1319
type: string
14-
description: "description of the campaign"
20+
description: "Detailed description of the campaign"
21+
example: "Main cocoa harvest campaign for Spring 2024"
1522
start_date:
1623
type: string
1724
format: date
18-
description: "start date of the campaign"
25+
description: "When the campaign starts"
26+
example: "2024-09-01"
1927
end_date:
2028
type: string
2129
format: date
22-
description: "end date of the campaign"
30+
description: "When the campaign ends"
31+
example: "2025-03-31"
2332
status:
2433
type: string
2534
enum: ["OPEN", "CLOSED"]
26-
description: "status of the campaign"
35+
description: "Current status of the campaign"
36+
example: "OPEN"
2737
created_at:
2838
type: string
2939
format: date-time
30-
example: "2020-01-01T00:00:00Z"
31-
description: "the date and time when the campaign was created"
40+
readOnly: true
41+
description: "When the campaign was created"
42+
example: "2024-01-15T10:30:00Z"
3243
updated_at:
3344
type: string
3445
format: date-time
35-
example: "2020-01-01T00:00:00Z"
36-
description: "the date and time when the campaign was updated"
46+
readOnly: true
47+
description: "When the campaign was last updated"
48+
example: "2024-01-15T10:30:00Z"
Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,72 @@
1-
#the campaign stock object to be stored
21
type: object
2+
required:
3+
- campaign_id
4+
- product_name
5+
- quantity
6+
- unit
7+
- stock_date
8+
- unit_price
39
properties:
410
id:
511
type: string
6-
description: the unique identifier of a specific campaign stock
712
format: cuid
813
readOnly: true
14+
description: "The unique ID of the stock entry"
15+
example: "clh1234567890abcdef"
16+
campaign_id:
17+
type: string
18+
format: cuid
19+
description: "The ID of the campaign this stock belongs to"
20+
example: "clh1234567890abcdef"
21+
product_name:
22+
type: string
23+
description: "Name of the product"
24+
example: "Premium Cocoa Beans"
925
quantity:
1026
type: number
11-
description: the quantity stored as not sold for a specific campaign.
12-
format: int32
13-
weight:
27+
minimum: 0
28+
description: "Quantity of product in stock"
29+
example: 1000
30+
unit:
1431
type: string
15-
description: the weight use to mesure the stock
16-
format: int32
17-
example: 5kg
18-
campaign_id:
32+
description: "Unit of measurement"
33+
example: "kg"
34+
stock_date:
1935
type: string
20-
format: cuid
21-
description: the identifier of the campaign
22-
company_id:
23-
description: the companies ID to which the stock belongs to.
36+
format: date
37+
description: "Date when the stock was recorded"
38+
example: "2024-01-15"
39+
unit_price:
40+
type: number
41+
minimum: 0
42+
description: "Price per unit"
43+
example: 2.50
44+
total_value:
45+
type: number
46+
minimum: 0
47+
description: "Total value of the stock"
48+
example: 2500.00
49+
location:
2450
type: string
25-
format: cuid
26-
example: "AQA9CNo0cXNLt6sZp5Uc5P0"
27-
unit_of_mesure:
28-
description: The unit used to mesure the stock
29-
type: integer
30-
format: int32
31-
example: 5 Ton, 5kg
51+
description: "Storage location"
52+
example: "Warehouse A"
53+
condition:
54+
type: string
55+
description: "Condition of the stock"
56+
example: "excellent"
57+
notes:
58+
type: string
59+
description: "Additional notes about the stock"
60+
example: "High-quality beans from organic farms"
3261
created_at:
3362
type: string
3463
format: date-time
35-
description: the date and time when the stock was created
64+
readOnly: true
65+
description: "When the stock entry was created"
66+
example: "2024-01-15T10:30:00Z"
3667
updated_at:
3768
type: string
3869
format: date-time
39-
description: the date and time when the stock was updated
70+
readOnly: true
71+
description: "When the stock entry was last updated"
72+
example: "2024-01-15T10:30:00Z"

0 commit comments

Comments
 (0)