Skip to content

Commit

Permalink
Merge pull request #26 from NewcastleRSE/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
markdturner authored Aug 21, 2023
2 parents 933be41 + 737f22b commit 434f013
Show file tree
Hide file tree
Showing 23 changed files with 29,846 additions and 31,291 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Run with hot reload for development
yarn develop
```

Once running, you may need to change the redirect URL that is used after you have authenticated. Strapi gets this value from the database and so, if using a database dump from production, it may redirect you to the production url. To change this, log into the Strapi admin UI, go to Settings > Providers, and edit the Microsoft provider. Change the redirect URL to `http://localhost:3000/auth/login`.

## Deployment

### Local
Expand Down
17,550 changes: 17,550 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@
"build": "strapi build",
"strapi": "strapi"
},
"devDependencies": {},
"dependencies": {
"@hubspot/api-client": "^8.3.2",
"@strapi/plugin-documentation": "4.5.5",
"@strapi/plugin-i18n": "4.5.5",
"@strapi/plugin-sentry": "^4.5.5",
"@strapi/plugin-users-permissions": "4.5.5",
"@strapi/strapi": "4.5.5",
"axios": "^1.2.2",
"camelcase": "^6.3.0",
"camelcase-keys": "^7.0.2",
"@hubspot/api-client": "^9.0.0",
"@pdf-lib/fontkit": "^1.1.1",
"@strapi/plugin-documentation": "^4.12.0",
"@strapi/plugin-i18n": "^4.12.0",
"@strapi/plugin-sentry": "^4.12.0",
"@strapi/plugin-users-permissions": "^4.12.0",
"@strapi/strapi": "^4.12.0",
"axios": "1.4.0",
"camelcase": "5.2.0",
"camelcase-keys": "5.2.0",
"deepdash": "^5.3.9",
"exceljs": "^4.3.0",
"luxon": "^3.2.0",
"mysql": "2.18.1",
"strapi-plugin-import-export-entries": "^1.18.0",
"strapi-plugin-transformer": "^2.1.1"
"luxon": "^3.3.0",
"mysql": "^2.18.1",
"pdf-lib": "^1.17.1",
"strapi-plugin-import-export-entries": "^1.21.0",
"strapi-plugin-transformer": "^3.1.0"
},
"author": {
"name": "Mark Turner"
Expand Down
19 changes: 7 additions & 12 deletions src/api/facility/content-types/facility/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"info": {
"singularName": "facility",
"pluralName": "facilities",
"displayName": "Facility"
"displayName": "Facility",
"description": ""
},
"options": {
"draftAndPublish": false
Expand All @@ -16,10 +17,6 @@
"required": true,
"unique": true
},
"salaryCosts": {
"type": "integer",
"required": true
},
"nonSalaryCosts": {
"type": "integer",
"required": true
Expand All @@ -28,16 +25,14 @@
"type": "integer",
"required": true
},
"annualCapacity": {
"type": "integer",
"required": true
},
"annualUseage": {
"type": "integer",
"dayRate": {
"type": "decimal",
"required": true
},
"dayRate": {
"utilisationRate": {
"type": "decimal",
"min": 0,
"max": 1,
"required": true
}
}
Expand Down
75 changes: 75 additions & 0 deletions src/api/invoice/content-types/invoice/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"kind": "collectionType",
"collectionName": "invoices",
"info": {
"singularName": "invoice",
"pluralName": "invoices",
"displayName": "Invoice",
"description": ""
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"project": {
"type": "relation",
"relation": "manyToOne",
"target": "api::project.project",
"inversedBy": "invoices"
},
"generated": {
"type": "date",
"required": true
},
"sent": {
"type": "date"
},
"paid": {
"type": "date"
},
"transaction": {
"type": "relation",
"relation": "oneToOne",
"target": "api::transaction.transaction"
},
"year": {
"type": "integer",
"required": true
},
"month": {
"type": "enumeration",
"enum": [
"january",
"february",
"march",
"april",
"may",
"june",
"july",
"august",
"september",
"october",
"november",
"december"
],
"required": true
},
"processed": {
"type": "date"
},
"documentNumber": {
"type": "string",
"required": true,
"unique": true
},
"price": {
"type": "decimal",
"required": true
},
"units": {
"type": "integer",
"required": true
}
}
}
19 changes: 19 additions & 0 deletions src/api/invoice/controllers/invoice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

/**
* invoice controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::invoice.invoice', ({ strapi }) => ({
async create(ctx) {
try {
ctx.body = await strapi.service("api::invoice.invoice").create(ctx.request.body)
} catch (err) {
console.error(err)
ctx.body = err;
}
}
})
);
Loading

0 comments on commit 434f013

Please sign in to comment.