Skip to content

Commit

Permalink
refactor: remove cols that aren't in the database
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynndp committed Apr 4, 2022
1 parent 73554e2 commit a767324
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 161 deletions.
8 changes: 3 additions & 5 deletions api-tests/stakeholder-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ describe.skip('Stakeholder API tests.', () => {
.expect(422)
.end(function (err, res) {
// console.log('res.body.message ----------> ', res.body);
expect(res.body.message).to.eql(
'"id" must be a valid GUID',
);
expect(res.body.message).to.eql('"id" must be a valid GUID');
if (err) return done(err);
return done();
});
Expand Down Expand Up @@ -171,15 +169,15 @@ describe.skip('Stakeholder API tests.', () => {
'wallet',
'password',
'salt',
'active_contract_id',
// 'active_contract_id',
'offering_pay_to_plant',
'tree_validation_contract_id',
'logo_url',
'map',
'organization_id',
'owner_id',
'children',
'parents'
'parents',
]);
}

Expand Down
31 changes: 14 additions & 17 deletions docs/api/spec/stakeholder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ paths:
description: get all Organization and Person entities that could possibly be linked to the stakeholder as children, parents
# growers and users to be added soon
parameters:
# NOT IMPLEMENTED YET
# NOT IMPLEMENTED YET
# - in: query
# name: search
# description: pass an optional search term for partial match on any part of a name field, phone number, email, etc.
Expand Down Expand Up @@ -421,7 +421,7 @@ components:
- wallet
- salt
- offering_pay_to_plant
- active_contract_id
# - active_contract_id
- tree_validation_contract_id
- website
- logo_url
Expand Down Expand Up @@ -481,10 +481,10 @@ components:
type: boolean
format: boolean
example: false
active_contract_id:
type: string
format: uuid
example: '792a4eee-8e18-4750-a56f-91bdec383aa6'
# active_contract_id:
# type: string
# format: uuid
# example: '792a4eee-8e18-4750-a56f-91bdec383aa6'
tree_validation_contract_id:
type: string
format: uuid
Expand Down Expand Up @@ -537,8 +537,7 @@ components:
format: json
items:
$ref: '#/components/schemas/Stakeholder'
example:
[
example: [
{
id: '1a05ec87-3c38-4395-b9f3-aa15becedc31',
type: 'Organization',
Expand All @@ -552,7 +551,7 @@ components:
wallet: null,
salt: null,
offering_pay_to_plant: null,
active_contract_id: null,
# active_contract_id: null,
tree_validation_contract_id: null,
website: 'childone.com',
logo_url: './logo_192x192.png',
Expand All @@ -573,7 +572,7 @@ components:
wallet: null,
salt: null,
offering_pay_to_plant: null,
active_contract_id: null,
# active_contract_id: null,
tree_validation_contract_id: null,
website: 'childtwo.com',
logo_url: './logo_192x192.png',
Expand All @@ -587,8 +586,7 @@ components:
format: json
items:
$ref: '#/components/schemas/Stakeholder'
example:
[
example: [
{
id: '792a4eee-8e18-4750-a56f-91bdec383aa6',
type: 'Organization',
Expand All @@ -602,7 +600,7 @@ components:
wallet: null,
salt: null,
offering_pay_to_plant: null,
active_contract_id: null,
# active_contract_id: null,
tree_validation_contract_id: null,
website: 'greenstand',
logo_url: './logo_192x192.png',
Expand All @@ -616,8 +614,7 @@ components:
format: json
items:
$ref: '#/components/schemas/Stakeholder'
example:
[
example: [
{
id: '35a23de8-f1ab-4409-be79-3c6a158d5bde',
type: 'Person',
Expand All @@ -631,7 +628,7 @@ components:
wallet: null,
salt: null,
offering_pay_to_plant: null,
active_contract_id: null,
# active_contract_id: null,
tree_validation_contract_id: null,
website: '',
logo_url: './person_192x192.png',
Expand All @@ -652,7 +649,7 @@ components:
wallet: null,
salt: null,
offering_pay_to_plant: null,
active_contract_id: null,
# active_contract_id: null,
tree_validation_contract_id: null,
website: '',
logo_url: './person_192x192.png',
Expand Down
8 changes: 4 additions & 4 deletions docs/api/spec/treetracker-stakeholders-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ paths:
wallet: 'wallet.com'
password: 'password'
salt: 'salt'
active_contract_id: 1
# active_contract_id: 1
offering_pay_to_plant: false
tree_validation_contract_id: 1
logo_url: 'logo_url'
Expand Down Expand Up @@ -101,9 +101,9 @@ paths:
type: string
salt:
type: string
active_contract_id:
type: number
format: integer
# active_contract_id:
# type: number
# format: integer
offering_pay_to_plant:
type: boolean
tree_validation_contract_id:
Expand Down
4 changes: 2 additions & 2 deletions server/handlers/stakeholderHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const StakeholderRepository = require('../repositories/StakeholderRepository');

const stakeholderGetQuerySchema = Joi.object({
id: Joi.string().uuid(),
organization_id: Joi.number().integer(),
owner_id: Joi.string().uuid(),
// organization_id: Joi.number().integer(),
// owner_id: Joi.string().uuid(),
limit: Joi.number().integer().greater(0).less(101),
offset: Joi.number().integer().greater(-1),
type: Joi.string(),
Expand Down
Loading

0 comments on commit a767324

Please sign in to comment.