Skip to content

Commit

Permalink
feat: add compliance credits to project object (#68)
Browse files Browse the repository at this point in the history
* feat: add compliance credits to project object

* feat: add complianceCredits and terrasos project types

* fix: structure
  • Loading branch information
flagrede authored Oct 31, 2024
1 parent 50c5981 commit 4e933e2
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
4 changes: 4 additions & 0 deletions deskStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ export default S =>
.title('Tebu Banner')
.schemaType('tebuBanner')
.child(S.document().schemaType('tebuBanner')),
S.listItem()
.title('Terrasos Project')
.schemaType('terrasosProject')
.child(S.documentTypeList('terrasosProject').title('Terrasos Project')),
]),
),
]);
3 changes: 2 additions & 1 deletion schemas/documents/shared/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default {
title: 'Project slug, on-chain id or off-chain uuid',
name: 'projectId',
type: 'string',
description: 'Slug should be the prefered option if the project has a slug, otherwise it might result in the data below not being displayed on the project page.',
description:
'Slug should be the prefered option if the project has a slug, otherwise it might result in the data below not being displayed on the project page.',
validation: Rule => Rule.required(),
},
{
Expand Down
15 changes: 15 additions & 0 deletions schemas/documents/terrasos/terrasosProject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sharedProject from '../shared/project';

export default {
name: 'terrasosProject',
title: 'Terrasos Project',
type: 'document',
fields: [
...sharedProject.fields,
{
title: 'Compliance credits',
name: 'complianceCredits',
type: 'complianceCredits',
},
],
};
25 changes: 25 additions & 0 deletions schemas/objects/complianceCredits.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export default {
type: 'object',
name: 'complianceCredits',
title: 'Compliance Credits',
fields: [
{
title: 'Credits Registered',
name: 'creditsRegistered',
type: 'number',
validation: Rule => Rule.required(),
},
{
title: 'Credits Available',
name: 'creditsAvailable',
type: 'number',
validation: Rule => Rule.required(),
},
{
title: 'Credits Retired',
name: 'creditsRetired',
type: 'number',
validation: Rule => Rule.required(),
},
],
};
4 changes: 4 additions & 0 deletions schemas/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import walletAddressRegistrationPage from './documents/www/walletAddressRegistra
import nctPage from './documents/www/nctPage';
import creditCategory from './documents/shared/creditCategory';
import tebuBanner from './documents/terrasos/tebuBanner';
import terrasosProject from './documents/terrasos/terrasosProject';

export const documentsSchemas = [
homePage,
Expand Down Expand Up @@ -131,6 +132,7 @@ export const documentsSchemas = [
nctPage,
creditCategory,
tebuBanner,
terrasosProject,
];

// Object types
Expand Down Expand Up @@ -271,6 +273,7 @@ import prefinanceProjects from './objects/prefinanceProjects';
import createProjectPagePopup from './objects/createProjectPagePopup';
import sellOrderPrice from './objects/sellOrderPrice';
import linkItem from './objects/linkItem';
import complianceCredits from './objects/complianceCredits';

export const objectSchemas = [
heroSection,
Expand Down Expand Up @@ -410,6 +413,7 @@ export const objectSchemas = [
createProjectPagePopup,
sellOrderPrice,
linkItem,
complianceCredits,
];

export default [
Expand Down

0 comments on commit 4e933e2

Please sign in to comment.