feat: consumer entity to register technical accounts #1341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add new
Consumerentity to the data access layer for registering and managing technical accounts. This entity provides a structured way to track consumers with their associated client credentials, capabilities, and issuer information.Changes
Consumer Entity Schema
ACTIVE,SUSPEND)Validation & Constraints
ACTIVEorSUSPENDvalues[a-z0-9]{24}@AdobeOrgDatabase Indexes
consumerIdissuerId- for querying consumers by issuerclientId- for querying consumers by clientCollection Methods
Auto-generated query methods via BaseCollection:
findById(consumerId)- Find consumer by IDallByIssuerId(issuerId)- Get all consumers for an issuerallByClientId(clientId)- Get all consumers for a clientfindByIssuerId(issuerId)- Find first consumer by issuerfindByClientId(clientId)- Find first consumer by clientTest Coverage
✅ Unit Tests: 15 tests covering model static constants, getters, setters, and collection
✅ Integration Tests: 9 tests covering CRUD operations, index queries, and validation
✅ Fixtures: Sample test data for multiple consumer scenarios
Files Added
src/models/consumer/consumer.model.jssrc/models/consumer/consumer.collection.jssrc/models/consumer/consumer.schema.jssrc/models/consumer/index.jssrc/models/consumer/index.d.tstest/fixtures/consumers.fixture.jstest/it/consumer/consumer.test.jstest/unit/models/consumer/consumer.model.test.jstest/unit/models/consumer/consumer.collection.test.jsFiles Modified
src/models/base/entity.registry.js- Registered Consumer entitysrc/models/index.js- Added Consumer exportssrc/models/index.d.ts- Added Consumer type exportstest/fixtures/index.fixtures.js- Added consumer fixtures