@@ -367,68 +367,101 @@ <h1 class="title">OpenSPP Base API</h1>
367
367
!! This file is generated by oca-gen-addon-readme !!
368
368
!! changes will be overwritten. !!
369
369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:3913d9428bf2e05d7518f15cb6aa063947e98e620a65a21f053c64444a6519a2
370
+ !! source digest: sha256:c6754fb283eb014c02a2d475d261ed7eca3db51a50ef4b0be83bab8421b17713
371
371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
372
< p > < a class ="reference external image-reference " href ="https://odoo-community.org/page/development-status "> < img alt ="Production/Stable " src ="https://img.shields.io/badge/maturity-Production%2FStable-green.png " /> </ a > < a class ="reference external image-reference " href ="http://www.gnu.org/licenses/lgpl-3.0-standalone.html "> < img alt ="License: LGPL-3 " src ="https://img.shields.io/badge/licence-LGPL--3-blue.png " /> </ a > < a class ="reference external image-reference " href ="https://github.com/OpenSPP/openspp-modules/tree/17.0/spp_base_api "> < img alt ="OpenSPP/openspp-modules " src ="https://img.shields.io/badge/github-OpenSPP%2Fopenspp--modules-lightgray.png?logo=github " /> </ a > </ p >
373
373
< div class ="section " id ="openspp-base-api-1 ">
374
374
< h1 > OpenSPP Base API</ h1 >
375
- < div class ="section " id ="overview ">
376
- < h2 > Overview</ h2 >
377
- < p > The < a class ="reference external " href ="spp_base_api "> spp_base_api</ a > module provides foundational API
378
- functions and methods for interacting with the OpenSPP system. It acts
379
- as a bridge between the core OpenSPP functionalities and external
380
- systems, enabling data exchange via APIs or XML-RPC. This module does
381
- not introduce any user-facing features but serves as a building block
382
- for other modules that require API access to OpenSPP data.</ p >
383
- </ div >
375
+ < p > The < tt class ="docutils literal "> spp_base_api</ tt > module provides foundational API functions and
376
+ methods for seamless interaction with the OpenSPP system. It enables
377
+ robust data exchange with external systems and internal modules,
378
+ primarily through APIs and XML-RPC, ensuring efficient and reliable data
379
+ management.</ p >
384
380
< div class ="section " id ="purpose ">
385
381
< h2 > Purpose</ h2 >
386
- < p > The main purpose of this module is to:</ p >
382
+ < p > This module establishes core capabilities for programmatic data
383
+ interaction within OpenSPP, serving as a critical layer for integration
384
+ and automated processes. It accomplishes the following:</ p >
387
385
< ul class ="simple ">
388
- < li > Establish a standardized way to access and manipulate OpenSPP data
389
- externally.</ li >
390
- < li > Provide a consistent and reusable API framework for other OpenSPP
391
- modules.</ li >
392
- < li > Enable seamless integration with external applications and systems.</ li >
386
+ < li > < strong > Streamlined Data Exchange</ strong > : Facilitates the transfer of
387
+ information between OpenSPP and other systems, crucial for
388
+ integrating with national registries, payment systems, or other
389
+ program management tools.</ li >
390
+ < li > < strong > Efficient Record Management</ strong > : Offers methods to create, retrieve,
391
+ and update records, preventing duplicates and maintaining data
392
+ consistency across the platform.</ li >
393
+ < li > < strong > External System Integration</ strong > : Simplifies the process of
394
+ synchronizing data with external databases by supporting the use of
395
+ external identifiers for record creation and updates.</ li >
396
+ < li > < strong > Complex Data Retrieval</ strong > : Enables the fetching of detailed, nested
397
+ data structures, allowing external systems or other OpenSPP modules
398
+ to query information comprehensively.</ li >
399
+ < li > < strong > Foundational API Layer</ strong > : Provides a stable and consistent set of
400
+ API tools that other OpenSPP modules can leverage, reducing
401
+ development effort and ensuring system-wide data integrity.</ li >
393
402
</ ul >
403
+ < p > This module is essential for any OpenSPP deployment that requires
404
+ automated data imports, exports, or real-time synchronization with
405
+ external partners or services, ensuring that data is always current and
406
+ consistent.</ p >
407
+ </ div >
408
+ < div class ="section " id ="dependencies-and-integration ">
409
+ < h2 > Dependencies and Integration</ h2 >
410
+ < p > The < tt class ="docutils literal "> spp_base_api</ tt > module is a foundational component within OpenSPP
411
+ and does not have direct dependencies on other specific OpenSPP modules.
412
+ Instead, it extends the core < tt class ="docutils literal "> base</ tt > model of the system, making its
413
+ powerful API methods universally available to all other OpenSPP modules
414
+ and any model defined within them.</ p >
415
+ < p > This module serves as a crucial integration point, providing a common
416
+ set of tools for data manipulation. Any OpenSPP module requiring
417
+ advanced search, creation, or update functionalities, especially when
418
+ interacting with external systems via API or XML-RPC, will implicitly
419
+ rely on the methods provided here. For instance, modules like < a class ="reference external " href ="openspp_beneficiaries "> OpenSPP
420
+ Beneficiaries</ a > or < a class ="reference external " href ="openspp_programs "> OpenSPP
421
+ Programs</ a > can utilize these base API methods to
422
+ manage their specific data records.</ p >
423
+ </ div >
424
+ < div class ="section " id ="additional-functionality ">
425
+ < h2 > Additional Functionality</ h2 >
426
+ < p > The < tt class ="docutils literal "> spp_base_api</ tt > module offers several key features to manage
427
+ OpenSPP data programmatically:</ p >
428
+ < div class ="section " id ="smart-record-creation-and-retrieval ">
429
+ < h3 > Smart Record Creation and Retrieval</ h3 >
430
+ < p > This feature allows users and integrated systems to efficiently manage
431
+ records by either locating an existing one or creating a new one if it
432
+ doesn’t already exist. It prevents the creation of duplicate records
433
+ during data imports or synchronization processes, ensuring data
434
+ integrity. The system uses provided field values to search for a match
435
+ before deciding whether to create a new entry.</ p >
436
+ </ div >
437
+ < div class ="section " id ="advanced-nested-data-retrieval ">
438
+ < h3 > Advanced Nested Data Retrieval</ h3 >
439
+ < p > Users can retrieve data in a highly structured, nested format,
440
+ simplifying the process of fetching complex related information. This is
441
+ particularly useful when you need to query a record and simultaneously
442
+ retrieve details from its related records, such as fetching a
443
+ beneficiary’s details along with their household members or their
444
+ geographic location (e.g., district within a province). This capability
445
+ reduces the number of API calls needed and simplifies data processing.</ p >
446
+ </ div >
447
+ < div class ="section " id ="synchronization-with-external-identifiers ">
448
+ < h3 > Synchronization with External Identifiers</ h3 >
449
+ < p > This module provides robust support for managing records using external
450
+ IDs, which is vital for integrating OpenSPP with other systems. It
451
+ allows for the creation or updating of records based on an identifier
452
+ provided by an external system, ensuring that records remain
453
+ synchronized across different platforms. The module intelligently
454
+ handles various field types, including many-to-one and many-to-many
455
+ relationships, by converting external IDs to internal OpenSPP IDs where
456
+ necessary.</ p >
394
457
</ div >
395
- < div class ="section " id ="functionality ">
396
- < h2 > Functionality</ h2 >
397
- < p > The < a class ="reference external " href ="spp_base_api "> spp_base_api</ a > module introduces several key
398
- functions and methods to the Odoo models, extending their capabilities
399
- for API interaction:</ p >
400
- < ul class ="simple ">
401
- < li > < strong > search_or_create</ strong > : Searches for a record based on given values. If
402
- no match is found, it creates a new record with the provided values.</ li >
403
- < li > < strong > search_read_nested</ strong > : Performs a nested search across related
404
- models and returns a list of dictionaries representing the results.
405
- This allows retrieving data from multiple linked models in a single
406
- API call.</ li >
407
- < li > < strong > create_or_update_by_external_id</ strong > : Creates or updates records based
408
- on an external ID. This is crucial for synchronizing data with
409
- external systems that rely on unique identifiers.</ li >
410
- </ ul >
411
458
</ div >
412
- < div class ="section " id ="integration-with-other-modules ">
413
- < h2 > Integration with other modules</ h2 >
414
- < p > The < a class ="reference external " href ="spp_base_api "> spp_base_api</ a > module is designed to be a
415
- dependency for other modules that need API access. For instance, a
416
- hypothetical module
417
- < a class ="reference external " href ="spp_external_integration "> spp_external_integration</ a > could depend on
418
- < a class ="reference external " href ="spp_base_api "> spp_base_api</ a > module is designed to be a dependency
419
- for other modules that need API access. For instance, a hypothetical
420
- module < tt class ="docutils literal "> spp_external_integration</ tt > could depend on < tt class ="docutils literal "> spp_base_api</ tt > and
421
- utilize its functions to:</ p >
422
- < ol class ="arabic simple ">
423
- < li > Fetch data from OpenSPP through defined API endpoints.</ li >
424
- < li > Create or update records in OpenSPP based on data received from
425
- external systems.</ li >
426
- < li > Ensure data consistency between OpenSPP and other integrated
427
- applications.</ li >
428
- </ ol >
429
- < p > By providing these base functionalities, the
430
- < a class ="reference external " href ="spp_base_api "> spp_base_api</ a > module streamlines the development of
431
- other OpenSPP modules that interact with external systems and APIs.</ p >
459
+ < div class ="section " id ="conclusion ">
460
+ < h2 > Conclusion</ h2 >
461
+ < p > The < tt class ="docutils literal "> spp_base_api</ tt > module is a core enabler for data interaction,
462
+ providing essential API functions that underpin OpenSPP’s ability to
463
+ seamlessly manage and exchange information with internal components and
464
+ external systems.</ p >
432
465
< p > < strong > Table of contents</ strong > </ p >
433
466
</ div >
434
467
</ div >
0 commit comments