P2p commission part group

[!info] Overview The P2P Commission Part Group REST API manages commission part groupings in the BMMS billing system. Groups enable organizing related commission parts for streamlined configuration and assignment in P2P commission structures.

📋 Table of Contents


Quick Reference

[!abstract] API Configuration

  • Base URL: /api

  • Entity Name: P2PCommissionPartGroup

  • Controller: P2pCommissionPartGroupResource

  • Framework: Spring Boot + JHipster

  • Auth: Required (Spring Security)

  • Content-Type: application/json

Endpoints Summary

Method
Endpoint
Description
Status

POST

/api/p-2-p-commission-part-groups

Create new commission part group

201

PUT

/api/p-2-p-commission-part-groups/{id}

Full update

200

PATCH

/api/p-2-p-commission-part-groups/{id}

Partial update

200

GET

/api/p-2-p-commission-part-groups

Get all with criteria

200

GET

/api/p-2-p-commission-part-groups/{id}

Get by ID

200

GET

/api/p-2-p-commission-part-groups/count

Count by criteria

200

DELETE

/api/p-2-p-commission-part-groups/{id}

Delete commission part group

204


Field Specifications

Field
Type
Required
Constraints
Description

id

Long

❌ Auto

-

Primary key

name

String

Unique

Group name (unique identifier)

description

String

-

Optional description

commissionParts

List

NotNull

List of commission parts in group


API Endpoints

Create Commission Part Group

POST /api/p-2-p-commission-part-groups

Creates a new commission part group entity.

Request

Headers:

Body:

[!warning] Validation Rules

  • id must be null (auto-generated)

  • name must be non-empty and unique

  • commissionParts must be non-null and contain valid commission part references

  • Commission parts must exist in the system

Response

✅ Success (201 Created):

❌ Error (400 - Name exists):


Update Commission Part Group

[!example] PUT /api/p-2-p-commission-part-groups/{id} Completely updates an existing commission part group.

Path Parameters

  • id (Long) - Commission part group identifier

Request

Headers:

Body:

[!warning] Validation

  • Body id must not be null

  • Path id must match body id

  • Commission part group must exist in database

  • New name must be unique (if changed)

Response

✅ Success (200 OK):

❌ Errors:

Status
Detail
Message

400

Invalid id

error.not.null

400

Invalid ID

error.not.equal.id

400

Entity not found

error.entity.not.found

400

Name already exists

error.existed.name


Partial Update Commission Part Group

[!example] PATCH /api/p-2-p-commission-part-groups/{id} Updates only specified fields. Null fields are ignored.

Path Parameters

  • id (Long) - Commission part group identifier

Request

Headers:

Body (Example - update only description):

Body (Example - update name and commission parts):

[!tip] Partial Update Behavior

  • Only non-null fields are updated

  • Other fields remain unchanged

  • Perfect for updating single fields without affecting others

  • Commission parts list is completely replaced if provided (not merged)

Response

✅ Success (200 OK):


Get All Commission Part Groups

[!example] GET /api/p-2-p-commission-part-groups Retrieves paginated list with filtering criteria.

Query Parameters

Pagination:

  • page - Page number (0-indexed, default: 0)

  • size - Items per page (default: 20)

  • sort - Sort criteria (e.g., name,asc)

  • unPaged - Boolean for unpaged results

Filters (P2pCommissionPartGroupCriteria):

  • id.equals, id.in

  • name.contains, name.equals

  • description.contains

Example Requests

Response

✅ Success (200 OK):


Get Single Commission Part Group

[!example] GET /api/p-2-p-commission-part-groups/{id} Retrieves a single commission part group by ID with all relationships.

Path Parameters

  • id (Long) - Commission part group identifier

Request

Response

✅ Success (200 OK):

❌ Error (404 Not Found):


Count Commission Part Groups

[!example] GET /api/p-2-p-commission-part-groups/count Returns count of commission part groups matching criteria.

Query Parameters

Same filtering parameters as [[#Get All Commission Part Groups]]

Example Requests

Response

✅ Success (200 OK):


Delete Commission Part Group

[!example] DELETE /api/p-2-p-commission-part-groups/{id} Deletes a commission part group from the system.

Path Parameters

  • id (Long) - Commission part group identifier

Request

Response

✅ Success (204 No Content):

❌ Error (400 - Group is in use):

[!danger] Deletion Constraint Warning A commission part group cannot be deleted if:

  • It is referenced by any existing P2P commission configurations

The system performs this check before deletion:

Workaround: Remove the group reference from all P2P commission configurations before attempting deletion.


Examples

Example 1: Create Basic Commission Part Group

[!example]- Setup Basic Fee Structure Request:

Example 2: Create Multi-Part Commission Group

[!example]- Complex Fee Structure Request:

Example 3: Update Commission Parts in Group

[!example]- Replace Commission Parts Request:

Response:

Example 4: Update Only Description

[!example]- Metadata Update Request:


Error Handling

Error Response Format

[!failure] RFC 7807 Problem Details All errors follow standardized format.

HTTP Status Codes

Code
Type
Description
Common Causes

400

Bad Request

Invalid request

Validation failure, ID mismatch, duplicate name, group in use

401

Unauthorized

Auth required

Missing/invalid token

403

Forbidden

Access denied

Insufficient permissions

404

Not Found

Resource missing

Invalid ID, deleted entity

409

Conflict

Resource conflict

Duplicate name

500

Server Error

Internal error

Database error, exception

Validation Error Example

[!bug] Field Validation Errors


Validation Rules

Required Fields

[!check] Mandatory Fields

  • name - Group name (unique)

  • commissionParts - List of commission parts

Field Constraints

Field
Rules
Error Messages

id

Null for POST

"A new commission part group cannot already have an ID"

id

Not null for PUT/PATCH

"Invalid id"

name

@NotEmpty, Unique

"must not be empty", "name already exists"

description

Optional

-

commissionParts

@NotNull, Valid references

"must not be null", "invalid commission part references"

Business Rules

[!info] Business Validation

  • name must be globally unique across all commission part groups

  • commissionParts must contain valid references to existing commission parts

  • Commission part group cannot be deleted if referenced by P2P commissions

  • Groups can contain multiple commission parts

  • Same commission part can appear in multiple groups

  • Empty commission parts list is not allowed


🔧 cURL Command Reference

Create

Update

Partial Update

Get All

Get Single

Count

Delete



Last updated