Textile Products Module

Yarn, Fiber, and Fabric product entities — specialized textile types extending the base product model with industry-specific attributes.

Overview

The textile module provides three specialized product types for the textile industry: Yarn, Fiber, and Fabric. Each extends the shared BaseProduct model (via BaseTextileProduct) with domain-specific attributes while inheriting all common product fields like composition, certifications, origin countries, and logistics.

Entity Hierarchy

Shell
BaseProduct (abstract, @MappedSuperclass)
└── BaseTextileProduct (abstract, @MappedSuperclass)
├── YarnProduct (@Entity, table: yarn_product)
├── FiberProduct (@Entity, table: fiber_product)
└── FabricProduct (@Entity, table: fabric_product)

BaseTextileProduct Fields

All textile products share these fields in addition to BaseProduct:

FieldTypeDescription
supplierIdLongFK to Supplier.id
companyIdLongFK to company
userIdLongCreator user ID
textileCategoryTextileCategoryAuto-set based on product type

TextileCategory Enum

ValueDescriptionDefault for
YARNYarn productsYarnProduct
FIBERFiber productsFiberProduct
FABRICFabric productsFabricProduct

The textileCategory is automatically set via @PrePersist based on the concrete entity type. You can override it in the request, but the default is determined by getDefaultCategory().


Entity: YarnProduct

Yarns are continuous strands of fibers used in textile production, classified by count, twist, and ply.

FieldTypeDB ColumnDescription
yarnCountDoubleyarn_countYarn count (must be positive)
yarnCountUnitYarnCountUnityarn_count_unitUnit of measurement for yarn count
twistStringtwistTwist direction, e.g. S, Z (max 10)
plyIntegerplyNumber of plies (≥ 0)
yarnTypeStringyarn_typeType of yarn (max 100)

YarnCountUnit Enum

ValueDescription
NEEnglish cotton count
NMMetric count
TEXTex (g per 1000m)
DTEXDecitex (g per 10000m)
DENIERDenier (g per 9000m)

Entity: FiberProduct

Fibers are the raw material input for textile production, characterized by type, length, and fineness.

FieldTypeDB ColumnDescription
fiberTypeStringfiber_typeType of fiber, e.g. Cotton, Wool, Polyester (max 100)
stapleLengthMmDoublestaple_length_mmStaple length in mm (must be positive)
finenessMicronDoublefineness_micronFineness in microns (must be positive)
fiberOriginStringfiber_originGeographic origin of the fiber (max 100)

Entity: FabricProduct

Fabrics are woven or knitted textile products, described by width, weight, weave, and finish.

FieldTypeDB ColumnDescription
widthCmDoublewidth_cmFabric width in cm (must be positive)
arealMassGsmDoubleareal_mass_gsmAreal mass in g/m² (must be positive)
weaveTypeStringweave_typee.g. Plain, Twill, Satin, Jersey (max 100)
finishStringfinishe.g. Mercerized, Calendered, Brushed (max 100)

Inherited BaseProduct Fields

All textile products inherit these fields from the base product model:

FieldTypeDescription
nameStringProduct name (required)
codeStringProduct code
category / subcategoryStringClassification
descriptionStringProduct description
technicalSpecsStringTechnical specifications
compositionStringMaterial composition
productOriginCountryStringISO 3166-1 alpha-2 (validated)
rawMaterialOriginCountryStringISO 3166-1 alpha-2 (validated)
unitOfMeasureUnitOfMeasureKG, METERS, PIECES, ROLLS
quantityAvailableDoubleCurrent stock (≥ 0)
leadTimeDaysIntegerLead time in days (≥ 0)
pricePerUnitBigDecimalPrice per unit
currencyStringISO 4217 currency code
minimumOrderDoubleMinimum order quantity
productWeightKgDoubleWeight in kg
Certification booleansBooleangotsCertified, grsCertified, oekoTexCertified, cradleToCradleCertified, betterCottonCertified
recycledContentPercentDouble% recycled content
organicContentPercentDouble% organic content
sustainabilityNotesStringSustainability notes
availableBooleanAvailability flag (default: true)
metadataMap<String, Object>Custom JSON metadata
createdAt / updatedAtLocalDateTimeAuto-set timestamps

API Reference

See Textile Products API → for endpoint details and examples.