-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUSINESS_LOGIC_BY_ROLE.txt
More file actions
702 lines (588 loc) · 21.7 KB
/
BUSINESS_LOGIC_BY_ROLE.txt
File metadata and controls
702 lines (588 loc) · 21.7 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
================================================================================
CYCLESYNC PLATFORM - BUSINESS LOGIC BY ROLE
================================================================================
Platform Overview:
------------------
CircularSync is an industrial waste management and circular economy platform
that transforms waste into valuable resources. It connects waste suppliers
with buyers through an intelligent marketplace featuring real-time auctions,
AI-powered quality assessment, field agent verification, and secure payment
processing.
================================================================================
ROLE 1: SUPPLIER
================================================================================
WHO THEY ARE:
-------------
Industrial waste material providers (individuals or organizations) who want to
sell their waste materials instead of sending them to landfills.
WHAT THEY CAN DO:
-----------------
1. REGISTRATION & PROFILE MANAGEMENT
• Self-register on the platform (no approval needed)
• Complete their profile with business/individual information
• Manage account settings and preferences
• Access personal wallet for payments
2. MATERIAL SUBMISSION (Multi-Step Process)
• Submit waste materials with detailed information:
- Material type, category, and subcategory
- Quantity and unit of measurement
- Upload photos of the material
- Provide location details
- Add description and condition notes
• Material goes through automated AI analysis:
- Google Vision API analyzes photos
- System generates quality score (0-100)
- AI provides recommendations or identifies issues
- Automatically approved or flagged for review
3. FIELD AGENT VERIFICATION (If Required)
• System assigns a field agent based on:
- Geographic location (nearest agent)
- Agent specialization in material type
- Agent availability and rating
• Agent conducts on-site verification:
- Verifies actual quantity vs. claimed quantity
- Assesses material condition in person
- Takes additional verification photos
- Provides professional quality rating
• Supplier receives visit cost invoice based on:
- Distance from agent location
- Material type complexity
- Time required for inspection
4. AUCTION PARTICIPATION
• Once material is approved (AI + Agent), it's listed for auction
• Supplier can:
- Set starting price and reserve price
- Choose auction type (Standard, Buy It Now, Reserve, Dutch, Bulk)
- Set auction duration (typically 7 days)
- Monitor bids in real-time
- Chat with potential buyers
- Accept or reject offers
5. PAYMENT & WALLET MANAGEMENT
• Wallet system with two components:
- Available balance (for withdrawals)
- Frozen balance (during transactions)
• When auction ends and buyer pays:
- Payment goes into supplier's wallet
- Platform fee is deducted
- Remaining amount available for withdrawal
• Withdrawal options:
- Subject to daily limits
- Transferred to bank account
- Transaction history tracking
6. NOTIFICATIONS & COMMUNICATION
• Receive real-time notifications for:
- Material submission status
- AI analysis results
- Agent assignment and arrival
- New bids on auctions
- Auction end results
- Payment received
• In-app chat with:
- Potential buyers (during auction)
- Field agents (during verification)
- Support team (for issues)
BUSINESS FLOW FOR SUPPLIER:
---------------------------
1. Register → 2. Submit Material → 3. AI Analysis → 4. Agent Verification
→ 5. Material Listed in Auction → 6. Buyers Bid → 7. Auction Ends
→ 8. Payment Received → 9. Deliver Material → 10. Withdraw Funds
================================================================================
ROLE 2: BUYER
================================================================================
WHO THEY ARE:
-------------
Companies or individuals looking to purchase recycled/waste materials for
reuse in manufacturing, construction, or other industrial processes.
WHAT THEY CAN DO:
-----------------
1. REGISTRATION & PROFILE MANAGEMENT
• Self-register on the platform (no approval needed)
• Complete business profile and requirements
• Set material preferences and interests
• Manage delivery addresses
• Access personal wallet for bidding
2. MATERIAL DISCOVERY
• Browse marketplace with advanced filters:
- Material category and subcategory
- Location and distance radius
- Quantity range
- Quality score range
- Price range
- Auction type
• Search functionality:
- Keyword search
- Category browsing
- Save favorite searches
- Receive alerts for matching materials
3. AUCTION PARTICIPATION
• View detailed material information:
- Photos (supplier + agent verification photos)
- AI quality assessment report
- Agent verification report
- Quantity details
- Location information
- Supplier ratings/history
• Bidding process:
- Place bids on active auctions
- Auto-bid functionality (optional)
- Real-time bid notifications
- Buy It Now option (if available)
- Bid amount gets frozen in wallet
• Auction types available:
- Standard: Traditional highest bidder wins
- Reserve: Must meet minimum reserve price
- Buy It Now: Instant purchase option
- Dutch: Price decreases over time
- Bulk: Multiple items bundled together
4. WALLET & PAYMENT MANAGEMENT
• Multi-wallet system:
- Recharge wallet to participate in auctions
- Available balance for new bids
- Frozen balance (active bids)
- Escrow protection during transactions
• When winning an auction:
- Bid amount transferred to escrow
- Released to supplier after delivery confirmation
- Refunded if supplier fails to deliver
• Payment methods:
- Credit/Debit card recharge
- Bank transfer
- Previous winnings reinvestment
5. ORDER MANAGEMENT
• After winning auction:
- Coordinate delivery with supplier
- Track order status
- Confirm receipt of materials
- Rate supplier and material quality
- Dispute resolution (if needed)
6. COMMUNICATION & SUPPORT
• Real-time chat with:
- Suppliers (during auction/after winning)
- Support team
• Notifications for:
- New materials matching preferences
- Outbid notifications
- Auction ending soon
- Auction won/lost
- Delivery updates
BUSINESS FLOW FOR BUYER:
-------------------------
1. Register → 2. Recharge Wallet → 3. Browse Materials → 4. Review Quality Reports
→ 5. Place Bids → 6. Win Auction → 7. Payment Processed → 8. Coordinate Delivery
→ 9. Receive Materials → 10. Confirm & Rate
================================================================================
ROLE 3: FIELD AGENT
================================================================================
WHO THEY ARE:
-------------
Mobile field professionals who conduct on-site verification of waste materials.
They provide critical quality assurance by physically inspecting materials
before they're listed for auction.
WHAT THEY CAN DO:
-----------------
1. REGISTRATION & PROFILE
• Registered by admin (not self-registration)
• Profile includes:
- Specialization areas (material types)
- Service location/coverage area
- Qualifications and certifications
- Rating history
• Access to mobile-optimized interface
• Offline capability for field work
2. ASSIGNMENT MANAGEMENT
• Receive automated assignments based on:
- Geographic proximity to material
- Specialization in material type
- Current availability
- Performance rating
• Assignment notifications include:
- Material details and photos
- Supplier location on map
- Estimated travel distance
- Estimated visit cost
- Expected time required
3. FIELD VERIFICATION PROCESS
• Check-in upon arrival:
- GPS-verified location
- Record arrival time
- Start verification session
• On-site inspection:
- Verify actual quantity vs. claimed
- Assess material condition (visual inspection)
- Check for contamination or quality issues
- Verify material category accuracy
- Take verification photos
- Document any discrepancies
• Verification checklist includes:
- Material condition rating (1-10)
- Quantity verification (accurate/discrepant)
- Quality assessment (Grade A/B/C/D)
- Contamination check (yes/no)
- Safety concerns (if any)
- Storage conditions
4. REPORTING & RECOMMENDATIONS
• Submit detailed verification report:
- Overall rating (1-10 scale)
- Condition rating
- Quantity rating
- Quality notes and observations
- Photos with timestamps
- GPS-stamped location
• Make recommendation:
- APPROVE: Material meets standards → List for auction
- REJECT: Material doesn't meet standards → Not listed
- REQUIRES SECOND REVIEW: Borderline case → Senior agent review
• Rejection reasons (if applicable):
- Contamination detected
- Quantity discrepancy
- Poor condition
- Safety hazards
- Misclassified material
5. PAYMENT & EARNINGS
• Agent wallet system:
- Earn verification fees per assignment
- Fees based on:
* Distance traveled
* Material complexity
* Time spent on verification
- Daily/weekly payout options
- Transaction history
• Performance bonuses:
- High accuracy ratings
- Fast turnaround times
- Positive supplier feedback
6. ASSIGNMENT TRACKING
• View assignment history
• Track verification statistics
• Monitor performance ratings
• Access training materials
• Receive feedback from supervisors
BUSINESS FLOW FOR AGENT:
-------------------------
1. Receive Assignment → 2. Travel to Location → 3. Check In (GPS verified)
→ 4. Conduct On-Site Inspection → 5. Document Findings → 6. Upload Photos
→ 7. Submit Recommendation → 8. Check Out → 9. Receive Payment
================================================================================
ROLE 4: ADMIN
================================================================================
WHO THEY ARE:
-------------
Platform administrators who manage daily operations, oversee transactions,
handle disputes, manage field agents, and ensure smooth platform functioning.
WHAT THEY CAN DO:
-----------------
1. USER MANAGEMENT
• View all platform users (buyers, suppliers, agents)
• Filter and search users:
- By role
- By status (active, inactive, suspended)
- By registration date
- By activity level
• Manage user accounts:
- View detailed user profiles
- Update user information
- Activate/deactivate accounts
- Suspend problematic users
- Reset passwords
- Handle account issues
• CANNOT create/manage Super Admins
2. FIELD AGENT MANAGEMENT
• Agent recruitment and onboarding:
- Create agent accounts
- Assign service areas
- Define specializations
- Set availability schedules
• Monitor agent performance:
- View verification accuracy
- Track response times
- Monitor customer ratings
- Analyze productivity metrics
• Assignment oversight:
- View all active assignments
- Reassign tasks if needed
- Handle agent disputes
- Approve second reviews
3. MATERIAL & AUCTION OVERSIGHT
• Review all material submissions
• Monitor AI analysis results
• Override AI decisions when necessary
• View all active auctions
• Monitor bidding activity
• Handle material disputes:
- Quantity disputes
- Quality disputes
- Misrepresentation claims
4. TRANSACTION MONITORING
• View all platform transactions:
- Auction payments
- Wallet recharges
- Withdrawals
- Agent fees
• Financial oversight:
- Monitor platform revenue
- Track commission collection
- Manage refunds
- Process chargebacks
• Payment issues:
- Resolve payment failures
- Handle escrow releases
- Process manual refunds
5. DISPUTE RESOLUTION
• Handle various dispute types:
- Buyer-Supplier disputes
- Material quality issues
- Delivery problems
- Payment conflicts
- Agent verification disputes
• Dispute resolution process:
- Review evidence from both parties
- Examine transaction history
- Review agent reports
- Make fair judgments
- Process refunds/compensations
- Document resolutions
6. SYSTEM MONITORING
• Dashboard with key metrics:
- Daily active users
- New registrations
- Active auctions
- Transaction volume
- Revenue analytics
- System health
• Operational reports:
- Material submission trends
- Auction success rates
- Agent performance
- User satisfaction scores
7. CUSTOMER SUPPORT
• Support ticket management
• In-app chat support
• Email support
• FAQ management
• Help documentation updates
8. NOTIFICATIONS & COMMUNICATION
• Send platform-wide announcements
• Alert users to policy changes
• Notify about maintenance windows
• Send targeted communications
BUSINESS FLOW FOR ADMIN:
-------------------------
Daily Operations: Monitor Dashboard → Review Flagged Items → Manage Agent
Assignments → Process Disputes → Generate Reports → Support Users
================================================================================
ROLE 5: SUPER ADMIN
================================================================================
WHO THEY ARE:
-------------
Highest level platform administrators with complete system access. They manage
the entire platform infrastructure, other admins, and make strategic decisions.
WHAT THEY CAN DO:
-----------------
1. COMPLETE ADMIN CAPABILITIES
• Everything that regular Admin can do
• Plus additional super-user privileges
2. ADMIN MANAGEMENT
• Create and manage admin accounts:
- Add new administrators
- Assign admin permissions
- Update admin profiles
- Deactivate admin accounts
- Monitor admin activities
• Admin oversight:
- View admin action logs
- Track admin performance
- Review admin decisions
- Override admin actions
3. PLATFORM CONFIGURATION
• System settings management:
- Payment gateway configuration
- Commission rates and fees
- Auction rules and parameters
- Quality threshold settings
- AI analysis parameters
• Feature toggles:
- Enable/disable platform features
- Roll out new functionality
- Beta testing controls
- Emergency shutdowns
4. FINANCIAL MANAGEMENT
• Shared admin wallet:
- All platform commissions collected here
- Platform operational expenses
- Agent payment pool
- Revenue distribution
• Financial analytics:
- Total platform revenue
- Revenue by category
- Profit margins
- Cost analysis
- Growth metrics
• Commission structure:
- Set commission rates
- Adjust platform fees
- Configure agent fee calculations
- Manage pricing models
5. SECURITY & COMPLIANCE
• User data protection
• Audit trail management
• Security incident handling
• Compliance monitoring
• Privacy policy enforcement
• Terms of service updates
6. STRATEGIC OVERSIGHT
• Platform analytics and insights:
- User growth trends
- Market analysis
- Material category performance
- Regional performance
- Seasonal trends
• Business intelligence:
- Revenue forecasting
- User retention metrics
- Platform health indicators
- Competitive analysis
7. SYSTEM ADMINISTRATION
• Database management oversight
• API integration management
• Third-party service configuration:
- Asgardeo authentication
- Google Vision API
- Payment processors
- Cloud services (Choreo, Neon)
• Performance monitoring:
- Server health
- Response times
- Error rates
- Uptime statistics
8. CRISIS MANAGEMENT
• Handle platform emergencies
• Make critical business decisions
• Override all system controls
• Emergency user communications
• Platform-wide interventions
BUSINESS FLOW FOR SUPER ADMIN:
-------------------------------
Strategic: Set Platform Policies → Configure Systems → Monitor Overall Health
→ Analyze Business Metrics → Manage Admin Team → Make Strategic Decisions
Operational: Everything Admin does + Higher level controls
================================================================================
PLATFORM WORKFLOW SUMMARY
================================================================================
COMPLETE MATERIAL LIFECYCLE:
-----------------------------
1. SUBMISSION (Supplier)
└─> Supplier submits material with photos and details
2. AI ANALYSIS (Automated)
└─> Google Vision API analyzes quality
└─> System generates quality score
└─> Auto-approve or flag for agent review
3. AGENT ASSIGNMENT (System + Agent)
└─> System assigns nearest specialized agent
└─> Agent receives notification
└─> Cost calculation based on distance
4. FIELD VERIFICATION (Agent)
└─> Agent travels to location
└─> GPS check-in
└─> On-site inspection
└─> Photo documentation
└─> Submit verification report
└─> Recommend: Approve/Reject/Second Review
5. AUCTION LISTING (Automated if Approved)
└─> Material listed in marketplace
└─> Buyers can browse and view details
└─> Auction becomes active
6. BIDDING (Buyers)
└─> Buyers place bids
└─> Bid amounts frozen in wallet
└─> Real-time updates
└─> Outbid notifications
7. AUCTION CLOSE (System)
└─> Highest bidder wins
└─> Payment transferred to escrow
└─> Supplier and buyer notified
8. DELIVERY (Supplier + Buyer)
└─> Coordinate delivery
└─> Material shipped/picked up
└─> Buyer confirms receipt
9. PAYMENT RELEASE (System)
└─> Payment released to supplier wallet
└─> Platform commission deducted
└─> Agent fee processed
└─> Transaction complete
10. POST-TRANSACTION (Users)
└─> Rating and reviews
└─> Dispute window (if issues)
└─> Admin oversight
================================================================================
KEY PLATFORM FEATURES
================================================================================
WALLET SYSTEM:
--------------
• Buyers: Recharge wallet → Bid (frozen balance) → Win or refund
• Suppliers: Receive payments → Withdraw to bank
• Agents: Earn verification fees → Daily/weekly payouts
• Admins: Shared wallet for platform revenue and operational costs
QUALITY ASSURANCE (Two-Layer):
-------------------------------
1. AI Analysis (Google Vision API)
- Automated photo analysis
- Quality scoring (0-100)
- Contamination detection
- Category verification
2. Field Agent Verification
- Physical inspection
- Quantity verification
- Professional quality assessment
- Photo documentation
- GPS-stamped reporting
AUCTION TYPES:
--------------
• Standard: Traditional bidding, highest wins
• Reserve: Minimum price must be met
• Buy It Now: Instant purchase option
• Dutch: Price decreases over time
• Bulk: Multiple items packaged together
NOTIFICATION SYSTEM:
--------------------
• In-app notifications
• Real-time updates
• Email notifications (optional)
• SMS alerts (critical updates)
• Push notifications (mobile app)
SECURITY:
---------
• Asgardeo authentication (OAuth2/OIDC)
• Role-based access control
• Encrypted data transmission
• Secure payment processing
• Escrow protection
• GPS verification for agents
================================================================================
TECHNICAL STACK
================================================================================
Frontend: Next.js 14+ (TypeScript, React, Tailwind CSS, Redux)
Backend: Ballerina microservices
Database: PostgreSQL (Neon Cloud)
Authentication: Asgardeo Identity Server (WSO2)
AI: Google Vision API
Deployment: Choreo Platform (WSO2)
Real-time: WebSocket (Socket.io)
Maps: OpenStreetMap
================================================================================
SUPPORT & CONTACT
================================================================================
For platform support and inquiries:
- User Support Portal: Available in-app
- Admin Dashboard: Complete oversight and management tools
- Documentation: Technical and user guides available
- Emergency Contacts: Platform downtime or critical issues
================================================================================
END
================================================================================
This document provides a comprehensive overview of the CircularSync platform's
business logic for each user role. It explains what each role can do, how they
interact with the system, and how the platform creates a complete circular
economy ecosystem for industrial waste management.
Document Version: 1.0
Last Updated: October 5, 2025
Platform: CircularSync (Cyclesync)