diff --git a/carbon-projects/schemas/index.ts b/carbon-projects/schemas/index.ts index 2d9e074d8c..d5bd05d104 100644 --- a/carbon-projects/schemas/index.ts +++ b/carbon-projects/schemas/index.ts @@ -3,6 +3,7 @@ import indexContent from "./indexContent"; import methodology from "./methodology"; import captionImage from "./objects/captionImage"; import externalFile from "./objects/externalFile"; +import hostedFile from "./objects/hostedFile"; import project from "./project"; import projectContent from "./projectContent"; export const schemaTypes = [ @@ -10,6 +11,7 @@ export const schemaTypes = [ methodology, projectContent, externalFile, + hostedFile, captionImage, country, indexContent, diff --git a/carbon-projects/schemas/objects/hostedFile.ts b/carbon-projects/schemas/objects/hostedFile.ts new file mode 100644 index 0000000000..797e1844bb --- /dev/null +++ b/carbon-projects/schemas/objects/hostedFile.ts @@ -0,0 +1,35 @@ +import { defineType } from "sanity"; + +export default defineType({ + name: "hostedFile", + type: "file", + title: "Hosted file", + description: "A file whose content is hosted directly in the Sanity CMS, with associated metadata", + fields: [ + { + type: "string", + title: "File name", + name: "filename", + }, + { + type: "string", + title: "Description or Caption", + name: "description", + }, + { + type: "string", + title: "MIME Type", + name: "mimetype", + }, + { + type: "string", + title: "File category", + name: "category" + }, + { + type: "number", + title: "File size", + name: "size" + } + ], +}); diff --git a/carbon-projects/schemas/project.ts b/carbon-projects/schemas/project.ts index 7a142ca1e1..6591d1d527 100644 --- a/carbon-projects/schemas/project.ts +++ b/carbon-projects/schemas/project.ts @@ -11,6 +11,25 @@ const ccbs = [ { title: "CCB Community Gold", value: "CCB-Community Gold" }, ]; +const registries = [ + { title: "Verra", value: "VCS" }, + { title: "Gold Standard", value: "GS" }, + { title: "EcoRegistry", value: "ECO" }, + { title: "International Carbon Registry", value: "ICR" }, + { title: "Puro", value: "PUR" }, + { title: "J-Credit", value: "JCS" }, + { title: "Carbonmark Direct Issuance", value: "CMARK" } +] + +const standards = [ + { title: "Verra", value: "VCS" }, + { title: "Gold Standard", value: "GS" }, + { title: "Cercarbono", value: "CER" }, + { title: "Puro", value: "PUR" }, + { title: "J-Credit", value: "JCS" }, + { title: "ISO 14064-2", value: "ISO-14064-2" } +] + const subcategories = [ { title: "Solar Energy", value: "solar" }, { title: "Wind Energy", value: "wind" }, @@ -21,6 +40,19 @@ const subcategories = [ { title: "Mangrove Restoration", value: "mangroves" }, ]; +const statuses = [ + { title: "Registered", value: "registered" }, + { title: "Validated", value: "validated" }, + { title: "Verified", value: "verified" }, +] + +const types = [ + { title: "Avoidance", value: "avoidance" }, + { title: "Removal", value: "removal" }, + { title: "Hybrid", value: "hybrid" }, +] + + export default defineType({ name: "project", title: "Project", @@ -71,14 +103,7 @@ export default defineType({ placeholder: "VCS", type: "string", options: { - list: [ - { title: "Verra", value: "VCS" }, - { title: "Gold Standard", value: "GS" }, - { title: "EcoRegistry", value: "ECO" }, - { title: "International Carbon Registry", value: "ICR" }, - { title: "Puro", value: "PUR" }, - { title: "J-Credit", value: "JCS" }, - ], + list: registries }, validation: (r) => r.required(), }, @@ -117,6 +142,38 @@ export default defineType({ return true; }), }), + defineField({ + type: "array", + name: "standards", + of: [ + { + type: "string", + options: standards + }, + ], + description: "Standards with which the project conforms", + group: "info", + }), + { + name: "status", + description: + "Project status. Indicates where a project is in its lifecycle from registration to verification and issuance", + group: "info", + type: "string", + options: { + list: statuses, + }, + }, + { + name: "type", + description: + "Project type. Indicates whether a project avoids or removes emissions, or both.", + group: "info", + type: "string", + options: { + list: types, + }, + }, defineField({ type: "array", name: "methodologies", @@ -250,5 +307,12 @@ export default defineType({ type: "array", of: [{ type: "externalFile" }], }), + defineField({ + name: "hostedDocuments", + description: "PDF documents hosted in this CMS associated with this project", + group: "media", + type: "array", + of: [{ type: "hostedFile" }], + }), ], });