Field value

[!info] Overview The FieldValue REST API manages predefined values and options for dynamic form fields in the pkbillms billing system. FieldValues define selectable options, pricing information, and filtering logic for field configurations with multilingual support.

📋 Table of Contents


Quick Reference

[!abstract] API Configuration

  • Base URL: /api

  • Entity Name: FieldValue

  • Controller: FieldValueResource

  • Framework: Spring Boot + JHipster

  • Auth: Required (Spring Security)

  • Content-Type: application/json

Endpoints Summary

Method
Endpoint
Description
Status

POST

/api/field-values

Create new field value

201

PUT

/api/field-values/{id}

Full update

200

PATCH

/api/field-values/{id}

Partial update

200

GET

/api/field-values

Get all with pagination

200

GET

/api/field-values/get

Get all (alternative)

200

GET

/api/field-values/criteria

Get by criteria + field

200

GET

/api/v2/field-values

Get V2 projection

200

GET

/api/field-values/{id}

Get by ID

200

GET

/api/field-values/count

Count by criteria

200

DELETE

/api/field-values/{id}

Delete field value

204

DELETE

/api/field-values/cascaded/{id}

Cascaded delete

200


Data Models

FieldValue Specifications

Field
Type
Required
Max/Range
Description

id

Long

❌ Auto

-

Primary key

value

String

64

Param value to send to server

amount

Long

-

Price of selected value

filterBy

String

16

Filter by parent field

ord

Integer

-

Display order

checkId

String

-

Check identifier

field

FieldDTO

-

Parent field reference

titles

Set

-

Multilingual titles

descriptions

Set

-

Multilingual descriptions


API Endpoints

Create FieldValue

POST /api/field-values

Creates a new field value option.

Request

Headers:

Body:

[!warning] Validation Rules

  • id must be null (auto-generated)

  • value and field are required

  • value max length is 64 characters

  • filterBy max length is 16 characters

Response

✅ Success (201 Created):

❌ Error (400 - ID exists):


Update FieldValue

PUT /api/field-values/{id}

Updates an existing field value (full update).

Request

Headers:

Body:

[!warning] Validation Rules

  • id must match path parameter

  • id must not be null

  • FieldValue must exist in database

Response

✅ Success (200 OK):

❌ Error (400 - Invalid ID):

❌ Error (400 - Not found):


Partial Update

PATCH /api/field-values/{id}

Partially updates field value properties.

Request

Headers:

Body:

Response

✅ Success (200 OK):

❌ Error (404 - Not Found):


Get All FieldValues

GET /api/field-values

Retrieves all field values with pagination and filtering.

Request

Headers:

Query Parameters:

Parameter
Type
Required
Description

page

Integer

Page number (default: 0)

size

Integer

Page size (default: 20)

sort

String

Sort field and direction

unPaged

Boolean

Disable pagination

Example:

Response

✅ Success (200 OK):


Get All FieldValues (Alternative)

GET /api/field-values/get

Alternative endpoint for retrieving field values.

Request

Headers:

Query Parameters: Same as main GET endpoint plus FieldValueCriteria filters.

Example:

Response

✅ Success (200 OK): Same format as main GET endpoint.


FieldValueCriteria - Advanced Filtering

[!abstract] JHipster Criteria Filtering FieldValueCriteria provides powerful filtering capabilities for querying field values. All filter parameters support multiple operators for precise data retrieval.

Available Filter Types

String Filters:

Operator
Description
Example

equals

Exact match

value.equals=50000

notEquals

Not equal

value.notEquals=100000

in

Match any value

value.in=50000,100000,150000

notIn

Not in list

value.notIn=0,5000

contains

Partial match

value.contains=000

doesNotContain

Doesn't contain

filterBy.doesNotContain=test

specified

Field exists/null

filterBy.specified=true

Numeric Filters (Long, Integer):

Operator
Description
Example

equals

Exact match

amount.equals=50000

notEquals

Not equal

amount.notEquals=0

in

Match any value

amount.in=50000,100000

notIn

Not in list

amount.notIn=0

greaterThan

Greater than

amount.greaterThan=50000

lessThan

Less than

amount.lessThan=100000

greaterOrEqualThan

Greater or equal

amount.greaterOrEqualThan=50000

lessOrEqualThan

Less or equal

amount.lessOrEqualThan=100000

specified

Field exists/null

amount.specified=true

Get FieldValues by Criteria

GET /api/field-values/criteria

Retrieves field values filtered by field name and criteria.

Request

Headers:

Example:

Response

✅ Success (200 OK):

FieldValueCriteria Parameters

Common Query Examples

Filter by Field:

Filter by Amount Range:

Filter with filterBy:

Search by Value:

Values with Amount:

Sorted by Display Order:

Complex Filter (AND operation):

Combining Filters

[!tip] Multiple Criteria All criteria are combined with AND logic. Use .in operator for OR logic on same field.

Example:


Get FieldValues V2

GET /api/v2/field-values

Retrieves field values using V2 projection (optimized response).

Request

Headers:

Query Parameters: Same as standard criteria endpoint.

Example:

Response

✅ Success (200 OK):

[!info] V2 Projection V2 endpoint returns a lighter projection without nested objects for better performance.


Get Single FieldValue

GET /api/field-values/{id}

Retrieves a single field value by ID.

Request

Headers:

Example:

Response

✅ Success (200 OK):

❌ Error (404 - Not found):


Count FieldValues

GET /api/field-values/count

Counts field values matching criteria.

Request

Headers:

Query Parameters: Any FieldValueCriteria filters.

Example:

Response

✅ Success (200 OK):


Delete FieldValue

DELETE /api/field-values/{id}

Deletes a field value.

Request

Headers:

Example:

Response

✅ Success (204 No Content):


Cascaded Delete FieldValue

[!example] DELETE /api/field-values/cascaded/{id} Deletes a field value with all related entities (I18n translations).

Request

Headers:

Example:

Response

✅ Success (200 OK):


Error Handling

Error Response Format

HTTP Status Codes

Code
Description
When

200

OK

Successful GET/PUT/PATCH

201

Created

Successful POST

204

No Content

Successful DELETE

400

Bad Request

Validation error

401

Unauthorized

Missing/invalid authentication

403

Forbidden

Insufficient permissions

404

Not Found

Resource doesn't exist

500

Internal Server Error

Server error


Validation Rules

Required Fields

[!check] Mandatory Fields

  • value - Value to send to server

  • field - Parent field reference

  • titles - At least one title (I18n)

Field Constraints

Field
Rules
Error Messages

id

Null for POST

"A new fieldValue cannot already have an ID"

id

Not null for PUT/PATCH

"Invalid id"

value

@NotNull, @Size(max=64)

"must not be null", "size must be between 0 and 64"

filterBy

@Size(max=16)

"size must be between 0 and 16"

field

@NotNull

"must not be null"

titles

@NotNull

"must not be null"

Business Rules

[!info] Business Validation

  • value is used as the parameter sent to backend services

  • amount represents pricing information for the selected value

  • filterBy enables dependent dropdown filtering (parent-child relationships)

  • ord determines display order in UI select elements

  • checkId is used for validation and reconciliation processes

  • titles must include at least one language translation

  • descriptions are optional additional information


🔧 cURL Command Reference

Create

Update

Partial Update

Get All

Get by Criteria (with Field Name)

Get by Criteria (Standard)

Get V2

Get Single

Count

Delete

Cascaded Delete


📝 Notes

[!tip] Best Practices

  • Always provide meaningful ord values for proper sorting

  • Use filterBy for cascading dropdown dependencies

  • Include translations for all supported languages

  • Set appropriate amount values for pricing information

  • Use checkId for validation and reconciliation tracking

[!warning] Important

  • Deleting field values may affect active payment forms

  • Use cascaded delete carefully as it removes all I18n data

  • value field is sent to backend services - ensure proper validation

  • V2 endpoint provides better performance for large datasets



Last updated