Catalog Service
The catalog service consists of the bounded contexts Catalog, Category, and CategoryValue.
It is responsible for managing products, their variants and versions, categories, and their respective characteristics and values.
Domain Model
Imported entities from other bounded contexts are marked with a dashed border.
API
The service provides a GraphQL API, which is documented in the GraphQL API documentation.
Technology Stack
- Language: Kotlin
- Framework: Spring Boot
- GraphQL Library: GraphQL Kotlin
- Database: PostgreSQL
- Schema Management: Flyway
Repository Structure
The repository is structured as follows:
/src/main/: Source code of the servicekotlin/org/misarch/catalog/: Kotlin source codeevent/: Dapr event handlingmodel/: Event DTOs
graphql/: GraphQL APIdataloader/: Data loaders for efficient data fetchingfederation/: Apollo Federation entity resolversinput/: Input types for mutationsmodel/: GraphQL typesconnection/: Connection types and logic for paginated queries
persistance/: Database entities and repositoriesmodel/: R2DBC entitiesrepository/: Spring Data R2DBC repositories
service/: Service logic
resources/: Spring Boot application configuration and SQL schema migration filesdb/migration/: Flyway SQL schema migration files
Defined Events
This section lists events that are defined by the catalog service and can be used by other services.
Published Defined Events
catalog/product/created
This event is published when a new product is created.
{
id: string,
internalName: string,
isPubliclyVisible: boolean,
defaultVariantId: string,
categoryIds: string[]
}
catalog/product-variant/created
This event is published when a new product variant is created. This includes the default variant created when a product is created.
{
id: string,
productId: string,
currentVersionId: string,
isPubliclyVisible: boolean
}
catalog/product-variant-version/created
This event is published when a new product variant version is created. This includes the initial version created when a product variant is created.
{
id: string,
name: string,
description: string,
version: number,
retailPrice: number,
createdAt: string,
canBeReturnedForDays?: number,
productVariantId: string,
taxRateId: string,
weight: number,
mediaIds: string[]
}
catalog/category/created
This event is published when a new category is created.
{
id: string,
name: string,
description: string
}
catalog/product/updated
This event is published when a product is updated.
{
id: string,
internalName: string,
isPubliclyVisible: boolean,
defaultVariantId: string,
categoryIds: string[]
}
catalog/product-variant/updated
This event is published when a product variant is updated.
{
id: string,
isPubliclyVisible: boolean
}
Subscribed Defined Events
n/a
Imported Events
This section lists events defined by other services that are used by the catalog service.
Published Imported Events
n/a
Subscribed Imported Events
- tax/tax-rate/created: Used to import
TaxRatefrom theTaxbounded context. - media/media/created: Used to import
Mediafrom theMediabounded context.