details:
    type: libraryRecordOptical
    name: Records - Optical Media
    table: gibbonLibraryItem
    modes: { update: true, insert: true, export: true }
access:
    module: Library
    action: Manage Catalog
primaryKey:
    gibbonLibraryItemID
uniqueKeys:
    - id
table:
    gibbonLibraryTypeID: 
        name: "Type"
        desc: ""
        value: "Optical Media"
        args: { filter: string, required: true, custom: true, hidden: true }
        relationship: { table: gibbonLibraryType, key: gibbonLibraryTypeID, field: name  }
    name: 
        name: "Name"
        desc: "Volume or product name."
        args: { filter: string, required: true }
    id: 
        name: "ID"
        desc: "Must be unique, or will lead to update not insert."
        args: { filter: string, required: true }
    producer: 
        name: "Author/Brand"
        desc: "Who created the item?"
        args: { filter: string, required: true, custom: true }
    vendor: 
        name: "Vendor"
        desc: "Who supplied the item?"
        args: { filter: string, custom: true }
    purchaseDate: 
        name: "Purchase Date"
        desc: ""
        args: { filter: date, custom: true }
    invoiceNumber: 
        name: "Invoice Number"
        desc: ""
        args: { filter: string, custom: true }
    cost: 
        name: "Cost"
        desc: ""
        args: { filter: numeric, custom: true }
    gibbonSpaceID: 
        name: "Location"
        desc: "Name"
        args: { filter: string, custom: true }
        relationship: { table: gibbonSpace, key: gibbonSpaceID, field: name }
    locationDetail: 
        name: "Location Detail"
        desc: "Shelf, cabinet, sector, etc"
        args: { filter: string, custom: true }
    ownershipType: 
        name: "Ownership Type"
        desc: ""
        args: { filter: string, custom: true }
    gibbonPersonIDOwnership: 
        name: "Main User"
        desc: "Username or email of person the device is assigned to."
        args: { filter: string, custom: true }
        relationship: { table: gibbonPerson, key: gibbonPersonID, field: username|email  }
    gibbonDepartmentID:
        name: "Department"
        desc: "Short Name"
        args: { filter: string, custom: true }
        relationship: { table: gibbonDepartment, key: gibbonDepartmentID, field: nameShort  }
    borrowable: 
        name: "Borrowable?"
        desc: "Is item available for loan?"
        args: { filter: yesno, custom: true }
    status: 
        name: "Status?"
        desc: ""
        args: { filter: string, custom: true }
    replacement: 
        name: "Replacement?"
        desc: ""
        args: { filter: yesno, custom: true }
    replacementCost: 
        name: "Replacement Cost"
        desc: ""
        args: { filter: numeric, custom: true }
    gibbonSchoolYearIDReplacement : 
        name: "Replacement Year"
        desc: "School year name, as set in School Admin. Must already exist."
        args: { filter: schoolyear, custom: true }
        relationship: { table: gibbonSchoolYear, key: gibbonSchoolYearID, field: name  }
    comment: 
        name: "Comments/Notes"
        desc: ""
        args: { filter: string, custom: true  }

    # Type-Specific Serializable Fields

    fieldType: 
        name: "Type"
        desc: "What type of optical media is this?"
        args: { filter: string, required: true, custom: true, readonly: true, serialize: fields  }
    fieldFormat: 
        name: "Format"
        desc: "Technical details of media formatting."
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fieldLanguage: 
        name: "Language"
        desc: ""
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fieldSubtitles: 
        name: "Subtitles"
        desc: ""
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fieldAspectRatio: 
        name: "Aspect Ratio"
        desc: ""
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fieldNumberofDiscs: 
        name: "Number of Discs"
        desc: ""
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fieldContentRating: 
        name: "Content Rating"
        desc: "Details of age guidance or retrictions."
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fieldStudio: 
        name: "Studio"
        desc: " Name of originating studio."
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fieldReleaseDate: 
        name: "Release Date"
        desc: ""
        args: { filter: date, custom: true, readonly: true, serialize: fields  }
    fieldRunTime: 
        name: "Run Time"
        desc: "In minutes."
        args: { filter: string, custom: true, readonly: true, serialize: fields  }
    fields:
        name: "Type-Specific Details"
        desc: ""
        args: { filter: string, serialize: fields, hidden: true, custom: true }
