Commit 36d44755 by jay

roles

1 parent 23eb4915
Showing 53 changed files with 620 additions and 91 deletions
...@@ -16,8 +16,8 @@ module.exports = ({ env }) => ({ ...@@ -16,8 +16,8 @@ module.exports = ({ env }) => ({
connection: { connection: {
host: env("DATABASE_HOST", "localhost"), host: env("DATABASE_HOST", "localhost"),
port: env.int("DATABASE_PORT", 3306), port: env.int("DATABASE_PORT", 3306),
database: env("DATABASE_NAME", "games"), database: env("DATABASE_NAME", "zango"),
user: env("DATABASE_USERNAME", "games"), user: env("DATABASE_USERNAME", "zango"),
password: env("DATABASE_PASSWORD", "12345"), password: env("DATABASE_PASSWORD", "12345"),
// schema: env("DATABASE_SCHEMA", "public"), // Not required // schema: env("DATABASE_SCHEMA", "public"), // Not required
// ssl: { // ssl: {
......
This diff could not be displayed because it is too large.
{ {
"name": "offers-backend", "name": "zango-backend",
"version": "0.1.0", "version": "0.1.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "offers-backend", "name": "zango-backend",
"version": "0.1.0", "version": "0.1.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
{ {
"name": "offers-backend", "name": "zango-backend",
"private": true, "private": true,
"version": "0.1.0", "version": "0.1.0",
"description": "A Strapi application", "description": "A Strapi application",
......
...@@ -18,10 +18,10 @@ const config = { ...@@ -18,10 +18,10 @@ const config = {
notifications: { releases: false }, notifications: { releases: false },
translations: { translations: {
en: { en: {
"app.components.LeftMenu.navbrand.title": "Offers", "app.components.LeftMenu.navbrand.title": "Zango",
"app.components.LeftMenu.navbrand.title": "Offers", "app.components.LeftMenu.navbrand.title": "Zango",
"app.components.LeftMenu.navbrand.subtitle": "", "app.components.LeftMenu.navbrand.subtitle": "",
"Auth.form.welcome.title": "Welcome to Offers", "Auth.form.welcome.title": "Welcome to Zango",
"Auth.form.welcome.subtitle": "Log in to your App" "Auth.form.welcome.subtitle": "Log in to your App"
} }
}, },
......
{
"kind": "collectionType",
"collectionName": "categories",
"info": {
"singularName": "categorie",
"pluralName": "categories",
"displayName": "Categories",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"subCategories": {
"type": "relation",
"relation": "oneToMany",
"target": "api::sub-categorie.sub-categorie",
"mappedBy": "category"
}
}
}
'use strict';
/**
* categorie controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::categorie.categorie');
'use strict'; 'use strict';
/** /**
* game router * categorie router
*/ */
const { createCoreRouter } = require('@strapi/strapi').factories; const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::game.game'); module.exports = createCoreRouter('api::categorie.categorie');
'use strict';
/**
* categorie service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::categorie.categorie');
{
"kind": "collectionType",
"collectionName": "course_details",
"info": {
"singularName": "course-detail",
"pluralName": "course-details",
"displayName": "Course-details"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"endUser": {
"type": "relation",
"relation": "oneToOne",
"target": "api::end-user.end-user",
"inversedBy": "courseDetail"
},
"experience": {
"type": "relation",
"relation": "oneToOne",
"target": "api::experience.experience",
"mappedBy": "courseDetail"
}
}
}
'use strict';
/**
* course-detail controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::course-detail.course-detail');
'use strict';
/**
* course-detail router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::course-detail.course-detail');
'use strict';
/**
* course-detail service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::course-detail.course-detail');
{ {
"kind": "collectionType", "kind": "collectionType",
"collectionName": "games", "collectionName": "end_users",
"info": { "info": {
"singularName": "game", "singularName": "end-user",
"pluralName": "games", "pluralName": "end-users",
"displayName": "Games" "displayName": "End-user",
"description": ""
}, },
"options": { "options": {
"draftAndPublish": true "draftAndPublish": true
}, },
"pluginOptions": {}, "pluginOptions": {},
"attributes": { "attributes": {
"firstReleaseDate": { "name": {
"type": "string" "type": "string"
}, },
"name": { "number": {
"type": "string" "type": "string"
}, },
"rating": { "age": {
"type": "string" "type": "string"
}, },
"summary": { "courseDetail": {
"type": "text" "type": "relation",
"relation": "oneToOne",
"target": "api::course-detail.course-detail",
"inversedBy": "endUser"
} }
} }
} }
'use strict';
/**
* end-user controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::end-user.end-user');
'use strict';
/**
* end-user router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::end-user.end-user');
'use strict';
/**
* end-user service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::end-user.end-user');
{
"kind": "collectionType",
"collectionName": "experiences",
"info": {
"singularName": "experience",
"pluralName": "experiences",
"displayName": "Experiences",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"description": {
"type": "text"
},
"pricePerPerson": {
"type": "string"
},
"address": {
"type": "text"
},
"masterCity": {
"type": "relation",
"relation": "oneToOne",
"target": "api::master-city.master-city"
},
"masterMonths": {
"type": "relation",
"relation": "oneToMany",
"target": "api::master-month.master-month"
},
"duration": {
"type": "string"
},
"minimumDuration": {
"type": "string"
},
"maximumDuration": {
"type": "string"
},
"ageLowerLimit": {
"type": "string"
},
"ageNotes": {
"type": "string"
},
"phoneNumber": {
"type": "string"
},
"minGroupSize": {
"type": "string"
},
"maxGroupSize": {
"type": "string"
},
"indoor": {
"type": "boolean"
},
"subCategory": {
"type": "relation",
"relation": "oneToOne",
"target": "api::sub-categorie.sub-categorie",
"inversedBy": "experience"
},
"link": {
"type": "string"
},
"cancellationPolicy": {
"type": "text"
},
"vendor": {
"type": "relation",
"relation": "manyToOne",
"target": "api::vendor.vendor",
"inversedBy": "experiences"
},
"courseDetail": {
"type": "relation",
"relation": "oneToOne",
"target": "api::course-detail.course-detail",
"inversedBy": "experience"
},
"timeSlots": {
"type": "relation",
"relation": "oneToMany",
"target": "api::time-slot.time-slot",
"mappedBy": "experience"
}
}
}
'use strict';
/**
* experience controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::experience.experience');
'use strict';
/**
* experience router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::experience.experience');
'use strict';
/**
* experience service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::experience.experience');
"use strict";
/**
* game controller
*/
const { createCoreController } = require("@strapi/strapi").factories;
module.exports = createCoreController("api::game.game", () => ({
async importSeedData(ctx) {
await strapi.service("api::game.game").importSeedDataFromApi();
ctx.send({ ok: true });
},
}));
const routes = {
routes: [
{
method: "POST",
path: "/games/import-seed-data",
handler: "api::game.game.importSeedData",
config: {
// some configuration...
}
},
]
};
module.exports = routes;
\ No newline at end of file \ No newline at end of file
"use strict";
const axios = require("axios");
const { factories } = require("@strapi/strapi");
/**
* game service
*/
const { createCoreService } = require("@strapi/strapi").factories;
module.exports = factories.createCoreService(
"api::game.game",
({ strapi: Strapi }) => ({
async importSeedDataFromApi() {
const seedData = await axios.get(
"https://public.connectnow.org.uk/applicant-test/"
);
// console.log("seedData", seedData.data[0]);
let seedDataFinal = seedData.data;
const date = new Date()
const deletedCnt = await strapi.db.query("api::game.game").deleteMany({ where: {} });
for (let i = 0; i < seedDataFinal.length; i++) {
const item = seedDataFinal[i];
// console.log("seedData", item);
// console.log(`Attempting to create country: `, country);
await strapi.entityService.create("api::game.game", {
data: {
firstReleaseDate: `${item.first_release_date}`,
name: item.name,
rating: `${item.rating}`,
summary: item.summary,
publishedAt: date
},
});
}
},
})
);
{
"kind": "collectionType",
"collectionName": "gift_cards",
"info": {
"singularName": "gift-card",
"pluralName": "gift-cards",
"displayName": "Gift-cards"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
}
}
}
'use strict';
/**
* gift-card controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::gift-card.gift-card');
'use strict';
/**
* gift-card router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::gift-card.gift-card');
'use strict';
/**
* gift-card service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::gift-card.gift-card');
{
"kind": "collectionType",
"collectionName": "master_cities",
"info": {
"singularName": "master-city",
"pluralName": "master-cities",
"displayName": "Master-city"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
}
}
}
'use strict';
/**
* master-city controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::master-city.master-city');
'use strict';
/**
* master-city router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::master-city.master-city');
'use strict';
/**
* master-city service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::master-city.master-city');
{
"kind": "collectionType",
"collectionName": "master_days",
"info": {
"singularName": "master-day",
"pluralName": "master-days",
"displayName": "Master-days"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
}
}
}
'use strict';
/**
* master-day controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::master-day.master-day');
'use strict';
/**
* master-day router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::master-day.master-day');
'use strict';
/**
* master-day service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::master-day.master-day');
{
"kind": "collectionType",
"collectionName": "master_months",
"info": {
"singularName": "master-month",
"pluralName": "master-months",
"displayName": "Master-months"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
}
}
}
'use strict';
/**
* master-month controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::master-month.master-month');
'use strict';
/**
* master-month router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::master-month.master-month');
'use strict';
/**
* master-month service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::master-month.master-month');
{
"kind": "collectionType",
"collectionName": "sub_categories",
"info": {
"singularName": "sub-categorie",
"pluralName": "sub-categories",
"displayName": "Sub-categories",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"category": {
"type": "relation",
"relation": "manyToOne",
"target": "api::categorie.categorie",
"inversedBy": "subCategories"
},
"experience": {
"type": "relation",
"relation": "oneToOne",
"target": "api::experience.experience",
"inversedBy": "subCategory"
}
}
}
'use strict';
/**
* sub-categorie controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::sub-categorie.sub-categorie');
'use strict';
/**
* sub-categorie router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::sub-categorie.sub-categorie');
'use strict';
/**
* sub-categorie service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::sub-categorie.sub-categorie');
{
"kind": "collectionType",
"collectionName": "time_slots",
"info": {
"singularName": "time-slot",
"pluralName": "time-slots",
"displayName": "Time-slots",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"start": {
"type": "time"
},
"end": {
"type": "time"
},
"masterDay": {
"type": "relation",
"relation": "oneToOne",
"target": "api::master-day.master-day"
},
"experience": {
"type": "relation",
"relation": "manyToOne",
"target": "api::experience.experience",
"inversedBy": "timeSlots"
}
}
}
'use strict';
/**
* time-slot controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::time-slot.time-slot');
'use strict';
/**
* time-slot router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::time-slot.time-slot');
'use strict';
/**
* time-slot service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::time-slot.time-slot');
{
"kind": "collectionType",
"collectionName": "vendors",
"info": {
"singularName": "vendor",
"pluralName": "vendors",
"displayName": "Vendor",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"experiences": {
"type": "relation",
"relation": "oneToMany",
"target": "api::experience.experience",
"mappedBy": "vendor"
}
}
}
'use strict';
/**
* vendor controller
*/
const { createCoreController } = require('@strapi/strapi').factories;
module.exports = createCoreController('api::vendor.vendor');
'use strict';
/**
* vendor router
*/
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::vendor.vendor');
'use strict';
/**
* vendor service
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::vendor.vendor');
...@@ -319,7 +319,7 @@ const userPermissionExtension = (plugin) => { ...@@ -319,7 +319,7 @@ const userPermissionExtension = (plugin) => {
ctx.request.body.httpsThirdPartyOTPApiRequestBody = ctx.request.body.httpsThirdPartyOTPApiRequestBody =
spertoCPOtpData.config.data; spertoCPOtpData.config.data;
ctx.request.body.httpThirdPartyOTPApiResposneBody = JSON.stringify( ctx.request.body.httpThirdPartyOTPApiResposneBody = JSON.stringify(
spertoCPOtpData.data spertoCPOtpData.datauser
); );
ctx.request.body.httpThirdPartyOTPApiError = false; ctx.request.body.httpThirdPartyOTPApiError = false;
// console.log(">>>>>",ctx.request.body.httpThirdPartyOTPApiError); // console.log(">>>>>",ctx.request.body.httpThirdPartyOTPApiError);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!