ProductSessions table
The ProductSessions table in the FitStack - V2 schema has 22 columns, keyed by Id, with 1 foreign key to Products. 1 column in NutriScanJobs references it.
One user scanning one product. C# class is `ProductSession`, in the file ProductionSession.cs.
Columns (22)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| CorrelationId | uuid | not null | |
| ProductId | uuid | references Products.Id | |
| UserId | text | ||
| Barcode | character varying(32) | ||
| Status | character varying(50) | not null | `ProductSessionStatus` as TEXT. |
| HasNutrition | boolean | not null | |
| HasIngredients | boolean | not null | |
| HasBranding | boolean | not null | |
| HasBarcode | boolean | not null | |
| NutritionId | uuid | ||
| BrandingId | uuid | ||
| IngredientIds | jsonb | not null | |
| BarcodeIds | jsonb | not null | |
| BrandingProductId | uuid | ||
| NutritionProductId | uuid | ||
| CompletedAt | timestamp with time zone | ||
| FailureReason | character varying(500) | ||
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (5)
(CorrelationId)(IX_ProductCreationSession_CorrelationId)(Barcode)(IX_ProductCreationSession_Barcode)(Status)(IX_ProductCreationSession_Status)(Status, CreatedAt)(IX_ProductCreationSession_Status_CreatedAt)(ProductId)(IX_ProductSessions_ProductId)
Relationships
ProductSessions.ProductIdreferencesProducts.IdNutriScanJobs.ProductCreationSessionIdreferencesProductSessions