# Generated by web/scripts/semantics.mjs from semantics/catalog.yaml. Do not edit.
apiVersion: v3.0.2
kind: DataContract
id: wardrobe-diary-garments
name: Garments
version: 0.2.1
status: active
domain: wardrobe-diary
dataProduct: The Wardrobe Diary Project
description:
  purpose: Every garment owned at some point since tracking began, with its details. The source of truth for garment details (decision D-4).
  usage: Not public (owner-only); described for transparency.
team:
  - username: hoverfalt
    name: Olof Hoverfält
    role: owner
servers:
  - server: garments
    type: custom
    description: Firestore users/{uid}/garments/{garmentId}
schema:
  - name: garments
    physicalName: Firestore users/{uid}/garments/{garmentId}
    logicalType: object
    description: Every garment owned at some point since tracking began, with its details. The source of truth for garment details (decision D-4).
    properties:
      - name: id
        logicalType: string
        physicalType: text
        required: true
        primaryKey: true
        unique: true
        description: Garment id, from the original Sheet's Photo id (e.g. Jackets_and_hoodies-006); also the photo file name.
        quality:
          - type: text
            description: pattern <Category_words>-NNN; unique
      - name: category
        logicalType: string
        physicalType: text
        required: true
        description: The garment's category.
        quality:
          - type: text
            description: one of the 13 standard categories
        authoritativeDefinitions:
          - type: businessDefinition
            url: https://wardrobediary.io/glossary#category
      - name: item
        logicalType: string
        physicalType: text
        required: true
        description: Name (brand, model, colour; numbered when identical items exist).
      - name: details
        logicalType: string
        physicalType: text
        required: false
        description: Free-text details such as size or model code.
      - name: photo
        logicalType: string
        physicalType: text
        required: true
        description: Photo file name without .png in public storage.
      - name: photoVersion
        logicalType: string
        physicalType: text
        required: false
        description: Set when the photo is replaced; part of the photo URL so caches show the new one.
      - name: price
        logicalType: number
        physicalType: money-eur
        required: false
        description: What was paid, rounded to whole cents.
        quality:
          - type: text
            description: ≥ 0
        authoritativeDefinitions:
          - type: businessDefinition
            url: https://wardrobediary.io/glossary#price
      - name: purchased
        logicalType: date
        physicalType: date
        required: false
        description: Purchase date.
        quality:
          - type: text
            description: ≤ divested
      - name: divested
        logicalType: date
        physicalType: date
        required: false
        description: Last day owned; empty while active.
        authoritativeDefinitions:
          - type: businessDefinition
            url: https://wardrobediary.io/glossary#divested
      - name: timesUsedInit
        logicalType: integer
        physicalType: integer
        required: true
        description: Wears before tracking began (estimate).
        quality:
          - type: text
            description: ≥ 0
        authoritativeDefinitions:
          - type: businessDefinition
            url: https://wardrobediary.io/glossary#pre-tracking-wears
      - name: materials
        logicalType: string
        physicalType: text
        required: false
        description: The materials label as written.
        authoritativeDefinitions:
          - type: businessDefinition
            url: https://wardrobediary.io/glossary#materials
      - name: weightG
        logicalType: number
        physicalType: mass-g
        required: false
        description: Weight in grams.
        quality:
          - type: text
            description: "> 0"
      - name: tags
        logicalType: array
        physicalType: list of text
        required: false
        description: Descriptive tags.
        quality:
          - type: text
            description: "each one of: second-hand, hanko, bicycle, motorcycle, winter, summer"
        authoritativeDefinitions:
          - type: businessDefinition
            url: https://wardrobediary.io/glossary#tag
      - name: detailsUnavailable
        logicalType: boolean
        physicalType: boolean
        required: false
        description: "Divested only: missing materials or weight can no longer be filled in (left off the review list)."
    quality:
      - name: unique-ids
        type: text
        description: Every garment id is unique.
        severity: error
        authoritativeDefinitions:
          - type: implementation
            url: https://github.com/hoverfalt/wardrobe-diary/blob/main/web/src/lib/quality.ts
      - name: known-category
        type: text
        description: Every category is one of the 13 standard categories.
        severity: error
        authoritativeDefinitions:
          - type: implementation
            url: https://github.com/hoverfalt/wardrobe-diary/blob/main/web/src/lib/quality.ts
      - name: dates-ordered
        type: text
        description: purchased ≤ divested when both are set.
        severity: error
        authoritativeDefinitions:
          - type: implementation
            url: https://github.com/hoverfalt/wardrobe-diary/blob/main/web/src/lib/quality.ts
      - name: non-negative
        type: text
        description: price ≥ 0, timesUsedInit ≥ 0, weightG > 0 when set.
        severity: error
        authoritativeDefinitions:
          - type: implementation
            url: https://github.com/hoverfalt/wardrobe-diary/blob/main/web/src/lib/quality.ts
      - name: known-tags
        type: text
        description: Every tag is in the vocabulary.
        severity: error
        authoritativeDefinitions:
          - type: implementation
            url: https://github.com/hoverfalt/wardrobe-diary/blob/main/web/src/lib/quality.ts
      - name: materials-coverage
        type: text
        description: Share of active garments with a weight and readable materials (reported, no threshold).
        severity: info
        authoritativeDefinitions:
          - type: implementation
            url: https://github.com/hoverfalt/wardrobe-diary/blob/main/web/src/lib/quality.ts
slaProperties:
  - property: frequency
    value: daily (logged in the app)
authoritativeDefinitions:
  - type: catalog
    url: https://wardrobediary.io/data#garments
