ISPANA Backend API Changelog — v1.0.0 Catatan Rilis API Backend ISPANA — v1.0.0
Focus: WhatsApp Message History Backend & Phone Auto-Sanitization
- a. [whatsapp_history_datasource.dart] (DataSource): Added collection
data_whatsapp_historyaccess with methods to insert sent logs, query vendor history sorted by date descending, and search recipient candidates (customers and employees) for autocomplete. - b. [whatsapp_history_repository.dart] (Repository): Created repository orchestration to dispatch WhatsApp notifications via
WhatsappService, sanitize target phone numbers (converting leading0to country code62), and insert history records with vendor tenant isolation. - c. [settings_controller.dart] & [server.dart] (Controller & Server): Mounted endpoints
POST /<vendorId>/settings/whatsapp-gateway/send,GET /<vendorId>/settings/whatsapp-gateway/history, andGET /<vendorId>/settings/whatsapp-gateway/recipientswith JWT vendor authorization checks. - d. [whatsapp_service.dart] (Service): Added backend normalization in
sendNotificationconverting leading0numbers to country code62before generating WAHA chat IDs (628...@c.us). - e. [pubspec.yaml]: Bumped API version to
1.0.0+22.
Git Commit Tag:
ispana-api-v1.0.0a22 Focus: Database-Wide 30-Day Soft-Delete Automated Cron Removal
- a. [clean_mongo.sh]: Configured Linux bash cron script to execute database-wide physical removal for all soft-deleted records (
isDeleted: true) across all collections inispana_dbolder than 30 days ofupdatedAt/deletedAt. - b. [Security & Data Integrity]: Excluded critical audit and financial collections (
data_invoices,data_finance,data_audit_logs,system.views) from physical purge per Rule 10 retention standard. - c. [pubspec.yaml]: Bumped API version to
1.0.0+21.
Git Commit Tag:
ispana-api-v1.0.0a21 Focus: Multi-provider SMTP configuration (Custom SMTP or Gmail fallback)
- [.env & .env.example]: Added
SMTP_HOST,SMTP_PORT,SMTP_SSL, andSMTP_IGNORE_BAD_CERTvariables. - [env_config.dart]: Exposed getters for new SMTP config parameters.
- [email_service.dart]: Refactored constructor to initialize either a custom SMTP server (
SmtpServer) or fallback togmail()ifSMTP_HOSTis empty. Updated error handling to extract detailed SMTP problems fromMailerException. - [scratch/test_smtp.dart]: Created SMTP test scratch script.
- [pubspec.yaml]: Bumped version to
1.0.0+20.
Git Commit Tag:
ispana-api-v1.0.0a20 Focus: L2TP VPN Tunneling feature restoration & RADIUS authorization integration
- [vpn_tunnel_model.dart]: Created L2TP VPN user data model representation.
- [auth_remote_data_source.dart]: Added MongoDB unique indexing for VPN users collection.
- [network_data_source.dart]: Added MongoDB query support for VPN users CRUD operations.
- [network_repository.dart]: Implemented validation, logical tenant isolation, soft-deletion, and credentials lookup fallback.
- [network_controller.dart]: Added CRUD HTTP endpoints and updated RADIUS authorization checks to allow VPN users.
- [vendor_controller.dart]: Mounted dynamic wildcard mappings for VPN endpoints.
Git Commit Tag:
ispana-api-v1.0.0a19 Focus: Customer Isolation Backend & System Profiles
- [pppoe_profile_model & customer_model]: Added
isSystemProfile,subscriptionEndDate, andisolationType. - [network_data_source & repository]: Handled isolation profile verification and protected system profiles.
- [customer_repository & controller]: Added
isolateCustomerandactivateCustomerAPIs with audit logs. - [network_controller.dart]: Dynamically routed isolated clients to
ISPANA_ISOLATION_POOLand set rate limit to 256k/256k in RADIUS handler.
Git Commit Tag:
ispana-api-v1.0.0a18 Focus: Dynamic RADIUS IP Pool Assignment
- [network_controller.dart]: Injected the resolved PPPoE Profile
ipPoolfield asreply:Framed-Poolin RADIUS access response payload.
Git Commit Tag:
ispana-api-v1.0.0a17 Focus: Decoupled Vertical Slice Domain Migration & Purged Monolithic Backend
- [vendor]: Split monolithic classes into isolated domains (
staff,landmark,customer,network). - [server.dart]: Re-wired dependencies to instantiate domain-specific datasources, repositories, and controllers.
- [Deprecation & Purge]: Purged deprecated monolithic files.
Git Commit Tag:
ispana-api-v1.0.0a16 Focus: POP Landmark Mapping & Double-Collection Router Updates
- [vendor_network_logic.dart]: Updated
createRouterto insert router identity todata_routersand sync device structure todata_landmarks.
Git Commit Tag:
ispana-api-v1.0.0a15 Focus: Decoupled Customer Personal Identity & Subscriptions DB
- [auth_remote_data_source.dart]: Added indexes for
data_vendor_customersand DB migration block. - [vendor_remote_data_source.dart]: Refactored Customer CRUD methods to split-write personal profile data to
data_customersand subscription data todata_vendor_customers.
Git Commit Tag:
ispana-api-v1.0.0a14 Focus: RADIUS Dynamic NAS IP Lookup & Active Sessions Tracking
- [auth_remote_data_source.dart]: Added index definitions for routers, customers, and active sessions.
- [vendor_controller.dart]: Outlined dynamic NAS IP router lookup endpoint (
/radius/nas) and mounted authorize and accounting endpoints. - [vendor_remote_data_source & repository]: Added active sessions CRUD methods.
Git Commit Tag:
ispana-api-v1.0.0a13 Focus: Customer Management CRUD API & Registry Integration
- [customer_model.dart]: Extended data schema mapping.
- [vendor_remote_data_source.dart]: Added MongoDB collection operations and registry query helpers.
- [vendor_repository_impl.dart]: Designed logical actions mapping tenant isolation, find-or-create registry accounts, and bulk import tasks.
- [vendor_controller.dart]: Attached endpoint controllers.
Git Commit Tag:
ispana-api-v1.0.0a12 Focus: Media Upload Support (Photos)
- [media_controller.dart]: Created new controller to handle multipart/form-data photo uploads.
- [bin/server.dart]: Mounted media route and configured
shelf_staticto serve uploaded images.
Git Commit Tag:
ispana-api-v1.0.0a11 Focus: Landmark Model Re-Architecture & Draft System Support
- [landmark_model.dart]: Removed directional properties, introduced
connectedPortIdsarray. - [vendor_remote_data_source.dart]: Implemented
data_landmark_draftscollection management. - [vendor_gis_logic.dart]: Implemented draft resolution logic to merge approved network changes.
Git Commit Tag:
ispana-api-v1.0.0a10 Focus: Router Operations Reliability - FreeRADIUS Sync Failure Handling
- [VendorNetworkLogic]: Wrapped
RadiusService.syncRouters()calls in try-catch blocks. - Bug Fix: Router CRUD operations now succeed even when FreeRADIUS service is inactive.
- Impact: Eliminates snackbar errors while preserving database consistency.
Git Commit Tag:
ispana-api-v1.0.0a9 Focus: Feature Rollback & Abortion (Check Pipeline)
- [VendorController]: Removed specialized diagnostic routes and
_getRouterStatushandler. - [VendorRemoteDataSource]: Removed
addRadiusLogandupdateRouterLastSeenmethods. - [VendorNetworkLogic]: Removed diagnostic logging integration.
Git Commit Tag:
ispana-api-v1.0.0a8 Focus: MikroTik-Friendly Pulse & Heartbeat
- [VendorController]: Added RESTful route support for
/vendor/radius/nas/ip/<ip>. - [_getNASInfo]: Refactored to support both query parameters and path parameters.
Git Commit Tag:
ispana-api-v1.0.0a7 Focus: RADIUS Diagnostics & Structured Logging
- [VendorRemoteDataSource]: Implemented
addRadiusLogto record historical NAS check-in events. - [VendorNetworkLogic]: Integrated logic to automatically log hits when a router is seen by RADIUS bridge.
Git Commit Tag:
ispana-api-v1.0.0a6 Focus: Vendor Repository Architectural Refactoring
- [VendorRepositoryImpl]: Refactored to delegate Network and GIS logic to internal helpers.
- [VendorNetworkLogic]: Encapsulates Router, VPN, and PPPoE Profile management logic.
- [VendorGisLogic]: Encapsulates Landmark and Map-related data management.
- [AuthHelper]: Integrated for centralized password hashing and TokenID generation.
Git Commit Tag:
ispana-api-v1.0.0a5 Focus: Repository Refactoring & Utility Extraction
- [AuthHelper]: Created a central utility for hashing, password generation, and Token ID orchestration.
- [AuthRepositoryImpl]: Refactored internally to use
AuthHelper.
Git Commit Tag:
ispana-api-v1.0.0a4 Focus: API Documentation & Flexible Auth Identifiers
- [README.md]: Developed a complete API reference, endpoint registry, and local setup guide.
- [auth]: Updated
AuthRepositoryImplandAuthControllerto allow login via both Email and Token ID.
Git Commit Tag:
ispana-api-v1.0.0a3 Focus: System Configuration & Feature Isolation
- [system]: Created
system_configscollection, implementedGET /v1/system/versionandPOST /v1/system/version. - [server.dart]: Registered SystemController routes.
Git Commit Tag:
ispana-api-v1.0.0a2 Focus: Project Initialization & Core Architecture
- Initial project baseline.
- Set up clean architecture folders.
- Implemented core auth features (OTP, JWT, Registry).
Git Commit Tag:
ispana-api-v1.0.0a1