
struct ItemId {

    let language: ContentLanguage

    let itemType: ItemType
}

extension ItemId: Equatable {

    static func == (lhs: ItemId, rhs: ItemId) -> Bool {
        lhs.language == rhs.language &&
        lhs.itemType == rhs.itemType
    }
}

extension ItemId: Hashable {

    func hash(into hasher: inout Hasher) {
        hasher.combine(language)
        hasher.combine(itemType.id)
    }
}

extension ItemId: Comparable {
    
    static func < (lhs: ItemId, rhs: ItemId) -> Bool {
        guard lhs.itemType == rhs.itemType else {
            return lhs.itemType < rhs.itemType
        }
        return lhs.language < rhs.language
    }
}
