# Generated by web/scripts/semantics.mjs from semantics/catalog.yaml. Do not edit.
apiVersion: v3.0.2
kind: DataContract
id: wardrobe-diary-days
name: Wear log
version: 0.2.1
status: active
domain: wardrobe-diary
dataProduct: The Wardrobe Diary Project
description:
  purpose: One record per day with wears - the garments worn that day. Days with nothing worn have no record.
  usage: Not public (owner-only); described for transparency.
team:
  - username: hoverfalt
    name: Olof Hoverfält
    role: owner
servers:
  - server: days
    type: custom
    description: Firestore users/{uid}/days/{YYYY-MM-DD}
schema:
  - name: days
    physicalName: Firestore users/{uid}/days/{YYYY-MM-DD}
    logicalType: object
    description: One record per day with wears - the garments worn that day. Days with nothing worn have no record.
    properties:
      - name: date
        logicalType: date
        physicalType: date
        required: true
        primaryKey: true
        unique: true
        description: The day (document id).
        quality:
          - type: text
            description: ≥ 2018-01-01; not in the future
      - name: worn
        logicalType: array
        physicalType: list of garment ids
        required: true
        description: The garments worn that day.
        quality:
          - type: text
            description: each an existing garment id; no duplicates
    quality:
      - name: worn-exists
        type: text
        description: Every worn id is an existing garment.
        severity: error
        authoritativeDefinitions:
          - type: implementation
            url: https://github.com/hoverfalt/wardrobe-diary/blob/main/web/src/lib/quality.ts
      - name: wears-in-ownership
        type: text
        description: Wears fall within the garment's ownership period.
        severity: warning
        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#days
