{"lexicon":1,"id":"money.atmosphere.catalog.listDiscountCodes","defs":{"catalogDiscountCode":{"type":"object","required":["uri","cid","creatorDid","code","disabled"],"properties":{"uri":{"type":"string","format":"at-uri"},"cid":{"type":"string","format":"cid"},"creatorDid":{"type":"string","format":"did","description":"The repo DID that authored this discount-code record (the creator)."},"code":{"type":"string","maxLength":64},"name":{"type":"string","maxGraphemes":100,"maxLength":1000},"discountUri":{"type":"string","format":"at-uri"},"discountCid":{"type":"string","format":"cid"},"percentOffBps":{"type":"integer","minimum":1,"maximum":10000},"amountOff":{"type":"ref","ref":"#catalogDiscountAmountOff"},"duration":{"type":"string","knownValues":["once","forever","repeating"],"maxLength":16},"durationInMonths":{"type":"integer","minimum":1,"maximum":36},"maxRedemptions":{"type":"integer","minimum":1,"description":"Public configured redemption cap from the record. NOT a count of redemptions used."},"redeemBy":{"type":"string","format":"datetime"},"disabled":{"type":"boolean","description":"Whether the offer is disabled (inverse of the indexed active state)."},"createdAt":{"type":"string","format":"datetime"},"indexedAt":{"type":"string","format":"datetime","description":"When the AppView indexed this discount code."}}},"catalogDiscountAmountOff":{"type":"object","required":["currency","unitAmount"],"properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"unitAmount":{"type":"integer","minimum":1}}},"main":{"type":"query","description":"List indexed public money.atmosphere.discountCode offers authored by a set of creators (read-only catalog projection). Public read; no authentication required.","parameters":{"type":"params","required":["creators"],"properties":{"creators":{"type":"array","minLength":1,"maxLength":50,"items":{"type":"string","format":"did"}},"includeDisabled":{"type":"boolean","default":false},"limit":{"type":"integer","minimum":1,"maximum":100,"default":50},"cursor":{"type":"string","maxLength":1024}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["codes"],"properties":{"codes":{"type":"array","items":{"type":"ref","ref":"#catalogDiscountCode"}},"cursor":{"type":"string","maxLength":1024}}}}}}}