diff --git a/services/subscription-service/migrations/pg/migrations/20240711124515-add-table-features.js b/services/subscription-service/migrations/pg/migrations/20240711124515-add-table-features.js new file mode 100644 index 0000000..242550c --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/20240711124515-add-table-features.js @@ -0,0 +1,59 @@ +'use strict'; + +var dbm; +var type; +var seed; +var fs = require('fs'); +var path = require('path'); +var Promise; + +/** + * We receive the dbmigrate dependency from dbmigrate initially. + * This enables us to not have to rely on NODE_PATH. + */ +exports.setup = function (options, seedLink) { + dbm = options.dbmigrate; + type = dbm.dataType; + seed = seedLink; + Promise = options.Promise; +}; + +exports.up = function (db) { + var filePath = path.join( + __dirname, + 'sqls', + '20240711124515-add-features-up.sql', + ); + return new Promise(function (resolve, reject) { + fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) { + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }).then(function (data) { + return db.runSql(data); + }); +}; + +exports.down = function (db) { + var filePath = path.join( + __dirname, + 'sqls', + '20240711124515-add-features-down.sql', + ); + return new Promise(function (resolve, reject) { + fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) { + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }).then(function (data) { + return db.runSql(data); + }); +}; + +exports._meta = { + version: 1, +}; diff --git a/services/subscription-service/migrations/pg/migrations/20240711130845-add-plan-details-column.js b/services/subscription-service/migrations/pg/migrations/20240711130845-add-plan-details-column.js new file mode 100644 index 0000000..adbb11b --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/20240711130845-add-plan-details-column.js @@ -0,0 +1,59 @@ +'use strict'; + +var dbm; +var type; +var seed; +var fs = require('fs'); +var path = require('path'); +var Promise; + +/** + * We receive the dbmigrate dependency from dbmigrate initially. + * This enables us to not have to rely on NODE_PATH. + */ +exports.setup = function (options, seedLink) { + dbm = options.dbmigrate; + type = dbm.dataType; + seed = seedLink; + Promise = options.Promise; +}; + +exports.up = function (db) { + var filePath = path.join( + __dirname, + 'sqls', + '20240711130845-add-plan-details-column.up.sql', + ); + return new Promise(function (resolve, reject) { + fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) { + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }).then(function (data) { + return db.runSql(data); + }); +}; + +exports.down = function (db) { + var filePath = path.join( + __dirname, + 'sqls', + '20240711130845-add-plan-details-column.down.sql', + ); + return new Promise(function (resolve, reject) { + fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) { + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }).then(function (data) { + return db.runSql(data); + }); +}; + +exports._meta = { + version: 1, +}; diff --git a/services/subscription-service/migrations/pg/migrations/20240715100807-seed-features-and-services.js b/services/subscription-service/migrations/pg/migrations/20240715100807-seed-features-and-services.js new file mode 100644 index 0000000..ea4163f --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/20240715100807-seed-features-and-services.js @@ -0,0 +1,59 @@ +'use strict'; + +var dbm; +var type; +var seed; +var fs = require('fs'); +var path = require('path'); +var Promise; + +/** + * We receive the dbmigrate dependency from dbmigrate initially. + * This enables us to not have to rely on NODE_PATH. + */ +exports.setup = function (options, seedLink) { + dbm = options.dbmigrate; + type = dbm.dataType; + seed = seedLink; + Promise = options.Promise; +}; + +exports.up = function (db) { + var filePath = path.join( + __dirname, + 'sqls', + '20240715100807-seed-features-and-services-up.sql', + ); + return new Promise(function (resolve, reject) { + fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) { + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }).then(function (data) { + return db.runSql(data); + }); +}; + +exports.down = function (db) { + var filePath = path.join( + __dirname, + 'sqls', + '20240715100807-seed-features-and-services-down.sql', + ); + return new Promise(function (resolve, reject) { + fs.readFile(filePath, {encoding: 'utf-8'}, function (err, data) { + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }).then(function (data) { + return db.runSql(data); + }); +}; + +exports._meta = { + version: 1, +}; diff --git a/services/subscription-service/migrations/pg/migrations/sqls/20240209122448-seed-data-up.sql b/services/subscription-service/migrations/pg/migrations/sqls/20240209122448-seed-data-up.sql index c58d713..b5da2d9 100644 --- a/services/subscription-service/migrations/pg/migrations/sqls/20240209122448-seed-data-up.sql +++ b/services/subscription-service/migrations/pg/migrations/sqls/20240209122448-seed-data-up.sql @@ -26,21 +26,50 @@ INSERT INTO main."plans"("name", created_on, created_by, description, price, cur WHERE cycle_name = 'MONTHLY'), 1); -INSERT INTO main.plan_items(created_on, created_by, "name", plan_item_type, plan_id, value) - VALUES (CURRENT_TIMESTAMP, '123e4567-e89b-12d3-a456-426614174002', 'Database', 'database',( - SELECT - id - FROM - main."plans" pl - WHERE - pl.name = 'Standard'), '{"name": "RDS_POSTGRES_STORAGE", "value": 50}'); +INSERT INTO main.plan_items (created_on, created_by, "name", plan_item_type, plan_id, value) +VALUES ( + CURRENT_TIMESTAMP, + '123e4567-e89b-12d3-a456-426614174002', + 'Database', + 'database', + ( + SELECT id + FROM main.plans pl + WHERE pl.name = 'Premium' + ), + '{ + "service": { + "features": [ + { "name": "video call", "enabled": true, "description": "High quality video calling", "maxParticipants": 100 } + ] + } + }' +); + +INSERT INTO main.plan_items (created_on, created_by, "name", plan_item_type, plan_id, value) +VALUES ( + CURRENT_TIMESTAMP, + '123e4567-e89b-12d3-a456-426614174002', + 'Database', + 'database', + ( + SELECT id + FROM main.plans pl + WHERE pl.name = 'Premium' + ), + '{ + "service": { + "features": [ + { "name": "video call", "enabled": true, "description": "High quality video calling", "maxParticipants": 100 }, + { "name": "chat", "enabled": true, "description": "Real-time text chat", "property4": "value" }, + { "name": "recording", "enabled": false, "description": "Record meetings", "priority": 3, "storageLimit": "5GB" } + ] + } + }' +); + + + + -INSERT INTO main.plan_items(created_on, created_by, "name", plan_item_type, plan_id, value) - VALUES (CURRENT_TIMESTAMP, '123e4567-e89b-12d3-a456-426614174002', 'Database', 'database',( - SELECT - id - FROM - main."plans" pl - WHERE - pl.name = 'Premium'), '{"name": "RDS_POSTGRES_STORAGE", "value": 100}'); diff --git a/services/subscription-service/migrations/pg/migrations/sqls/20240711124515-add-features-down.sql b/services/subscription-service/migrations/pg/migrations/sqls/20240711124515-add-features-down.sql new file mode 100644 index 0000000..d873331 --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/sqls/20240711124515-add-features-down.sql @@ -0,0 +1 @@ +drop table main.features; \ No newline at end of file diff --git a/services/subscription-service/migrations/pg/migrations/sqls/20240711124515-add-features-up.sql b/services/subscription-service/migrations/pg/migrations/sqls/20240711124515-add-features-up.sql new file mode 100644 index 0000000..4b53742 --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/sqls/20240711124515-add-features-up.sql @@ -0,0 +1,15 @@ +CREATE TABLE main.features ( + id uuid DEFAULT (md5(((random())::text || (clock_timestamp())::text)))::uuid NOT NULL, + created_on timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL, + modified_on timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL, + deleted boolean DEFAULT false NOT NULL, + deleted_on timestamptz, + deleted_by uuid, + created_by uuid NOT NULL, + modified_by uuid, + name varchar(100) NOT NULL, + properties jsonb NOT NULL, + service_id uuid NOT NULL, + CONSTRAINT pk_features_id PRIMARY KEY (id), + CONSTRAINT fk_features_services FOREIGN KEY (service_id) REFERENCES services (id) +); \ No newline at end of file diff --git a/services/subscription-service/migrations/pg/migrations/sqls/20240711130845-add-plan-details-column.down.sql b/services/subscription-service/migrations/pg/migrations/sqls/20240711130845-add-plan-details-column.down.sql new file mode 100644 index 0000000..0641721 --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/sqls/20240711130845-add-plan-details-column.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE main.subscriptions +DROP COLUMN IF EXISTS plan_details; diff --git a/services/subscription-service/migrations/pg/migrations/sqls/20240711130845-add-plan-details-column.up.sql b/services/subscription-service/migrations/pg/migrations/sqls/20240711130845-add-plan-details-column.up.sql new file mode 100644 index 0000000..e86e6d2 --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/sqls/20240711130845-add-plan-details-column.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE main.subscriptions +ADD COLUMN plan_details jsonb NOT NULL; \ No newline at end of file diff --git a/services/subscription-service/migrations/pg/migrations/sqls/20240715100807-seed-features-and-services-down.sql b/services/subscription-service/migrations/pg/migrations/sqls/20240715100807-seed-features-and-services-down.sql new file mode 100644 index 0000000..c4c068a --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/sqls/20240715100807-seed-features-and-services-down.sql @@ -0,0 +1,2 @@ +Delete from main.services; +Delete from main.features; diff --git a/services/subscription-service/migrations/pg/migrations/sqls/20240715100807-seed-features-and-services-up.sql b/services/subscription-service/migrations/pg/migrations/sqls/20240715100807-seed-features-and-services-up.sql new file mode 100644 index 0000000..3350374 --- /dev/null +++ b/services/subscription-service/migrations/pg/migrations/sqls/20240715100807-seed-features-and-services-up.sql @@ -0,0 +1,46 @@ +INSERT INTO main.services (id, created_on, modified_on, deleted, deleted_on, deleted_by, created_by, modified_by, name) +VALUES ( + '91f3c086-8794-4a62-98a0-7f02d4e8c103', + CURRENT_TIMESTAMP, + CURRENT_TIMESTAMP, + false, + NULL, + NULL, + '123e4567-e89b-12d3-a456-426614174002', + NULL, + 'video conferencing service' +); + +INSERT INTO main.features (created_by, name, properties, service_id) +VALUES +( + '123e4567-e89b-12d3-a456-426614174002', + 'video call', + '{ + "enabled": true, + "description": "High quality video calling", + "maxParticipants": 100 + }', + '91f3c086-8794-4a62-98a0-7f02d4e8c103' +), +( + '123e4567-e89b-12d3-a456-426614174002', + 'chat', + '{ + "enabled": true, + "description": "Real-time text chat", + "property4": "value" + }', + '91f3c086-8794-4a62-98a0-7f02d4e8c103' +), +( + '123e4567-e89b-12d3-a456-426614174002', + 'recording', + '{ + "enabled": false, + "description": "Record meetings", + "priority": 3, + "storageLimit": "5GB" + }', + '91f3c086-8794-4a62-98a0-7f02d4e8c103' +); \ No newline at end of file diff --git a/services/subscription-service/src/__tests__/acceptance/mock-data.ts b/services/subscription-service/src/__tests__/acceptance/mock-data.ts index 73259ad..3dc0e95 100644 --- a/services/subscription-service/src/__tests__/acceptance/mock-data.ts +++ b/services/subscription-service/src/__tests__/acceptance/mock-data.ts @@ -48,4 +48,5 @@ export const mockSubscription: DataObject = { endDate: 'sdsd', status: SubscriptionStatus.ACTIVE, planId: 'test-plan-id', + planDetails: {}, }; diff --git a/services/subscription-service/src/component.ts b/services/subscription-service/src/component.ts index 47ba205..71233d3 100644 --- a/services/subscription-service/src/component.ts +++ b/services/subscription-service/src/component.ts @@ -32,6 +32,7 @@ import {ISubscriptionServiceConfig} from './types'; import { BillingCycleRepository, CurrencyRepository, + FeatureRepository, PlanItemRepository, PlanRepository, ResourceRepository, @@ -41,6 +42,7 @@ import { import { BillinCycleController, CurrencyController, + FeatureController, HomePageController, PingController, PlanController, @@ -58,7 +60,9 @@ import { Resource, Service, Subscription, + Feature, } from './models'; +import { features } from 'process'; export class SubscriptionServiceComponent implements Component { constructor( @@ -98,6 +102,7 @@ export class SubscriptionServiceComponent implements Component { ResourceRepository, ServiceRepository, SubscriptionRepository, + FeatureRepository ]; this.models = [ @@ -108,6 +113,7 @@ export class SubscriptionServiceComponent implements Component { Resource, Service, Subscription, + Feature ]; this.controllers = [ @@ -121,6 +127,7 @@ export class SubscriptionServiceComponent implements Component { ServiceController, SubscriptionController, PlanSubscriptionController, + FeatureController ]; } diff --git a/services/subscription-service/src/controllers/feature.controller.ts b/services/subscription-service/src/controllers/feature.controller.ts new file mode 100644 index 0000000..eff0049 --- /dev/null +++ b/services/subscription-service/src/controllers/feature.controller.ts @@ -0,0 +1,149 @@ +import { + Count, + CountSchema, + Filter, + FilterExcludingWhere, + repository, + Where, +} from '@loopback/repository'; +import { + post, + param, + get, + getModelSchemaRef, + patch, + put, + del, + requestBody, + response, +} from '@loopback/rest'; +import {FeatureRepository} from '../repositories/feature.repository'; +import {Feature} from '../models/feature.model'; + +export class FeatureController { + constructor( + @repository(FeatureRepository) + public featureRepository: FeatureRepository, + ) {} + + @post('/features') + @response(200, { + description: 'Feature model instance', + content: {'application/json': {schema: getModelSchemaRef(Feature)}}, + }) + async create( + @requestBody({ + content: { + 'application/json': { + schema: getModelSchemaRef(Feature, { + title: 'NewFeature', + exclude: ['id'], + }), + }, + }, + }) + feature: Omit, + ): Promise { + return this.featureRepository.create(feature); + } + + @get('/features/count') + @response(200, { + description: 'Feature model count', + content: {'application/json': {schema: CountSchema}}, + }) + async count(@param.where(Feature) where?: Where): Promise { + return this.featureRepository.count(where); + } + + @get('/features') + @response(200, { + description: 'Array of Feature model instances', + content: { + 'application/json': { + schema: { + type: 'array', + items: getModelSchemaRef(Feature, {includeRelations: true}), + }, + }, + }, + }) + async find( + @param.filter(Feature) filter?: Filter, + ): Promise { + return this.featureRepository.find(filter); + } + + @patch('/features') + @response(200, { + description: 'Feature PATCH success count', + content: {'application/json': {schema: CountSchema}}, + }) + async updateAll( + @requestBody({ + content: { + 'application/json': { + schema: getModelSchemaRef(Feature, {partial: true}), + }, + }, + }) + feature: Feature, + @param.where(Feature) where?: Where, + ): Promise { + return this.featureRepository.updateAll(feature, where); + } + + @get('/features/{id}') + @response(200, { + description: 'Feature model instance', + content: { + 'application/json': { + schema: getModelSchemaRef(Feature, {includeRelations: true}), + }, + }, + }) + async findById( + @param.path.string('id') id: string, + @param.filter(Feature, {exclude: 'where'}) + filter?: FilterExcludingWhere, + ): Promise { + return this.featureRepository.findById(id, filter); + } + + @patch('/features/{id}') + @response(204, { + description: 'Feature PATCH success', + }) + async updateById( + @param.path.string('id') id: string, + @requestBody({ + content: { + 'application/json': { + schema: getModelSchemaRef(Feature, {partial: true}), + }, + }, + }) + feature: Feature, + ): Promise { + await this.featureRepository.updateById(id, feature); + } + + @put('/features/{id}') + @response(204, { + description: 'Feature PUT success', + }) + async replaceById( + @param.path.string('id') id: string, + @requestBody() feature: Feature, + ): Promise { + await this.featureRepository.replaceById(id, feature); + } + + @del('/features/{id}') + @response(204, { + description: 'Feature DELETE success', + }) + async deleteById(@param.path.string('id') id: string): Promise { + await this.featureRepository.deleteById(id); + } +} diff --git a/services/subscription-service/src/controllers/index.ts b/services/subscription-service/src/controllers/index.ts index 2a24d93..c472458 100644 --- a/services/subscription-service/src/controllers/index.ts +++ b/services/subscription-service/src/controllers/index.ts @@ -8,3 +8,4 @@ export * from './resource.controller'; export * from './billing-cycle.controller'; export * from './currency.controller'; export * from './plan-subscription.controller'; +export * from './feature.controller'; diff --git a/services/subscription-service/src/models/feature.model.ts b/services/subscription-service/src/models/feature.model.ts new file mode 100644 index 0000000..91b4421 --- /dev/null +++ b/services/subscription-service/src/models/feature.model.ts @@ -0,0 +1,40 @@ +import {model, property, belongsTo} from '@loopback/repository'; +import {UserModifiableEntity} from '@sourceloop/core'; +import {Service} from './service.model'; + +@model({ + name: 'features', +}) +export class Feature extends UserModifiableEntity { + @property({ + type: 'string', + id: true, + generated: true, + }) + id: string; + + @property({ + type: 'string', + required: true, + description: 'name of the feature', + }) + name: string; + @property({ + type: 'object', + description: ' properties of the feature', + }) + properties: object; + + @belongsTo(() => Service) + serviceId: string; + + constructor(data?: Partial) { + super(data); + } +} + +export interface FeatureRelations { + // describe navigational properties here +} + +export type FeatureWithRelations = Feature & FeatureRelations; diff --git a/services/subscription-service/src/models/index.ts b/services/subscription-service/src/models/index.ts index 1685546..8cdcd54 100644 --- a/services/subscription-service/src/models/index.ts +++ b/services/subscription-service/src/models/index.ts @@ -5,3 +5,4 @@ export * from './service.model'; export * from './resource.model'; export * from './billing-cycle.model'; export * from './currency.model'; +export * from './feature.model'; diff --git a/services/subscription-service/src/models/plan-item.model.ts b/services/subscription-service/src/models/plan-item.model.ts index 7fdec65..d99e483 100644 --- a/services/subscription-service/src/models/plan-item.model.ts +++ b/services/subscription-service/src/models/plan-item.model.ts @@ -1,6 +1,7 @@ import {belongsTo, model, property} from '@loopback/repository'; import {UserModifiableEntity} from '@sourceloop/core'; import {Plan} from './plan.model'; +import {IService} from '../types'; @model({ name: 'plan_items', @@ -33,7 +34,7 @@ export class PlanItem extends UserModifiableEntity { required: true, description: 'value of the plan item', }) - value: object; + value: IService; @belongsTo(() => Plan, undefined, { description: 'plan id of the plan item', diff --git a/services/subscription-service/src/models/plan.model.ts b/services/subscription-service/src/models/plan.model.ts index 557516e..d3a6de5 100644 --- a/services/subscription-service/src/models/plan.model.ts +++ b/services/subscription-service/src/models/plan.model.ts @@ -79,6 +79,8 @@ export class Plan extends UserModifiableEntity { export interface PlanRelations { planItems: PlanItem[]; + billingCycle: BillingCycle; + currency: Currency; } export type PlanWithRelations = Plan & PlanRelations; diff --git a/services/subscription-service/src/models/subscription.model.ts b/services/subscription-service/src/models/subscription.model.ts index 3b2f834..521614e 100644 --- a/services/subscription-service/src/models/subscription.model.ts +++ b/services/subscription-service/src/models/subscription.model.ts @@ -2,7 +2,7 @@ import {model, property, belongsTo} from '@loopback/repository'; import {SubscriptionStatus} from '../enums/subscription-status.enum'; import {numericEnumValues} from '../utils'; import {UserModifiableEntity} from '@sourceloop/core'; -import {Plan} from './plan.model'; +import {Plan, PlanWithRelations} from './plan.model'; @model({ name: 'subscriptions', @@ -53,6 +53,14 @@ export class Subscription extends UserModifiableEntity { }) planId: string; + @property({ + type: 'object', + required: true, + name: 'plan_details', + description: 'Details of the plan with relations', + }) + planDetails: PlanWithRelations; + constructor(data?: Partial) { super(data); } diff --git a/services/subscription-service/src/openapi.json b/services/subscription-service/src/openapi.json index e7a74f8..753ebc8 100644 --- a/services/subscription-service/src/openapi.json +++ b/services/subscription-service/src/openapi.json @@ -1,9 +1,9 @@ { "openapi": "3.0.0", "info": { - "title": "subscription-service", + "title": "Audit Service", "version": "1.0.0", - "description": "subscription-service", + "description": "Subscription management microservice for SaaS control plane", "contact": { "name": "Sourcefuse" } @@ -13,7 +13,9 @@ "get": { "x-controller-name": "BillinCycleController", "x-operation-name": "count", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -55,7 +57,9 @@ "put": { "x-controller-name": "BillinCycleController", "x-operation-name": "replaceById", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -92,7 +96,9 @@ "patch": { "x-controller-name": "BillinCycleController", "x-operation-name": "updateById", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -129,7 +135,9 @@ "get": { "x-controller-name": "BillinCycleController", "x-operation-name": "findById", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -174,7 +182,9 @@ "delete": { "x-controller-name": "BillinCycleController", "x-operation-name": "deleteById", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -203,7 +213,9 @@ "post": { "x-controller-name": "BillinCycleController", "x-operation-name": "create", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -236,7 +248,9 @@ "patch": { "x-controller-name": "BillinCycleController", "x-operation-name": "updateAll", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -285,7 +299,9 @@ "get": { "x-controller-name": "BillinCycleController", "x-operation-name": "find", - "tags": ["BillinCycleController"], + "tags": [ + "BillinCycleController" + ], "security": [ { "HTTPBearer": [] @@ -327,7 +343,9 @@ "get": { "x-controller-name": "CurrencyController", "x-operation-name": "count", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -369,7 +387,9 @@ "put": { "x-controller-name": "CurrencyController", "x-operation-name": "replaceById", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -406,7 +426,9 @@ "patch": { "x-controller-name": "CurrencyController", "x-operation-name": "updateById", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -443,7 +465,9 @@ "get": { "x-controller-name": "CurrencyController", "x-operation-name": "findById", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -488,7 +512,9 @@ "delete": { "x-controller-name": "CurrencyController", "x-operation-name": "deleteById", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -517,7 +543,9 @@ "post": { "x-controller-name": "CurrencyController", "x-operation-name": "create", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -550,7 +578,9 @@ "patch": { "x-controller-name": "CurrencyController", "x-operation-name": "updateAll", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -599,7 +629,9 @@ "get": { "x-controller-name": "CurrencyController", "x-operation-name": "find", - "tags": ["CurrencyController"], + "tags": [ + "CurrencyController" + ], "security": [ { "HTTPBearer": [] @@ -637,40 +669,16 @@ "operationId": "CurrencyController.find" } }, - "/ping": { - "get": { - "x-controller-name": "PingController", - "x-operation-name": "ping", - "tags": ["PingController"], - "responses": { - "200": { - "description": "Ping Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PingResponse" - } - } - } - } - }, - "description": "", - "operationId": "PingController.ping" - } - }, - "/plan-items/count": { + "/features/count": { "get": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "count", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "200": { - "description": "PlanItem model count", + "description": "Feature model count", "content": { "application/json": { "schema": { @@ -680,7 +688,6 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7012 |\n", "parameters": [ { "name": "where", @@ -689,33 +696,36 @@ "application/json": { "schema": { "type": "object", - "title": "plan_items.WhereFilter", + "title": "features.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } } ], - "operationId": "PlanItemController.count" + "operationId": "FeatureController.count" } }, - "/plan-items/{id}": { + "/features/{id}": { "put": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "replaceById", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "204": { - "description": "PlanItem PUT success" + "description": "No Content", + "content": { + "application/json": { + "schema": { + "description": "Feature PUT success" + } + } + } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7010 |\n", "parameters": [ { "name": "id", @@ -730,29 +740,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanItem" + "$ref": "#/components/schemas/Feature" } } }, "x-parameter-index": 1 }, - "operationId": "PlanItemController.replaceById" + "operationId": "FeatureController.replaceById" }, "patch": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "updateById", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "204": { - "description": "PlanItem PATCH success" + "description": "No Content", + "content": { + "application/json": { + "schema": { + "description": "Feature PATCH success" + } + } + } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7010 |\n", "parameters": [ { "name": "id", @@ -767,36 +780,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanItemPartial" + "$ref": "#/components/schemas/FeaturePartial" } } }, "x-parameter-index": 1 }, - "operationId": "PlanItemController.updateById" + "operationId": "FeatureController.updateById" }, "get": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "findById", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "200": { - "description": "PlanItem model instance", + "description": "Feature model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanItemWithRelations" + "$ref": "#/components/schemas/FeatureWithRelations" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7012 |\n", "parameters": [ { "name": "id", @@ -812,29 +821,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/plan_items.Filter" + "$ref": "#/components/schemas/features.Filter" } } } } ], - "operationId": "PlanItemController.findById" + "operationId": "FeatureController.findById" }, "delete": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "deleteById", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "204": { - "description": "PlanItem DELETE success" + "description": "No Content", + "content": { + "application/json": { + "schema": { + "description": "Feature DELETE success" + } + } + } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7011 |\n", "parameters": [ { "name": "id", @@ -845,55 +857,48 @@ "required": true } ], - "operationId": "PlanItemController.deleteById" + "operationId": "FeatureController.deleteById" } }, - "/plan-items": { + "/features": { "post": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "create", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "200": { - "description": "PlanItem model instance", + "description": "Feature model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanItem" + "$ref": "#/components/schemas/Feature" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7009 |\n", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewPlanItem" + "$ref": "#/components/schemas/NewFeature" } } } }, - "operationId": "PlanItemController.create" + "operationId": "FeatureController.create" }, "patch": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "updateAll", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "200": { - "description": "PlanItem PATCH success count", + "description": "Feature PATCH success count", "content": { "application/json": { "schema": { @@ -903,7 +908,6 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7010 |\n", "parameters": [ { "name": "where", @@ -912,9 +916,9 @@ "application/json": { "schema": { "type": "object", - "title": "plan_items.WhereFilter", + "title": "features.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } @@ -924,38 +928,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanItemPartial" + "$ref": "#/components/schemas/FeaturePartial" } } } }, - "operationId": "PlanItemController.updateAll" + "operationId": "FeatureController.updateAll" }, "get": { - "x-controller-name": "PlanItemController", + "x-controller-name": "FeatureController", "x-operation-name": "find", - "tags": ["PlanItemController"], - "security": [ - { - "HTTPBearer": [] - } + "tags": [ + "FeatureController" ], "responses": { "200": { - "description": "Array of PlanItem model instances", + "description": "Array of Feature model instances", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/PlanItemWithRelations" + "$ref": "#/components/schemas/FeatureWithRelations" } } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7012 |\n", "parameters": [ { "name": "filter", @@ -963,20 +963,45 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/plan_items.Filter1" + "$ref": "#/components/schemas/features.Filter1" } } } } ], - "operationId": "PlanItemController.find" + "operationId": "FeatureController.find" } }, - "/plans/count": { + "/ping": { "get": { - "x-controller-name": "PlanController", + "x-controller-name": "PingController", + "x-operation-name": "ping", + "tags": [ + "PingController" + ], + "responses": { + "200": { + "description": "Ping Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PingResponse" + } + } + } + } + }, + "description": "", + "operationId": "PingController.ping" + } + }, + "/plan-items/count": { + "get": { + "x-controller-name": "PlanItemController", "x-operation-name": "count", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -984,7 +1009,7 @@ ], "responses": { "200": { - "description": "Plan model count", + "description": "PlanItem model count", "content": { "application/json": { "schema": { @@ -994,7 +1019,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7008 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7012 |\n", "parameters": [ { "name": "where", @@ -1003,22 +1028,24 @@ "application/json": { "schema": { "type": "object", - "title": "plans.WhereFilter", + "title": "plan_items.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } } ], - "operationId": "PlanController.count" + "operationId": "PlanItemController.count" } }, - "/plans/{id}": { + "/plan-items/{id}": { "put": { - "x-controller-name": "PlanController", + "x-controller-name": "PlanItemController", "x-operation-name": "replaceById", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -1026,10 +1053,10 @@ ], "responses": { "204": { - "description": "Plan PUT success" + "description": "PlanItem PUT success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7006 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7010 |\n", "parameters": [ { "name": "id", @@ -1044,18 +1071,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Plan" + "$ref": "#/components/schemas/PlanItem" } } }, "x-parameter-index": 1 }, - "operationId": "PlanController.replaceById" + "operationId": "PlanItemController.replaceById" }, "patch": { - "x-controller-name": "PlanController", + "x-controller-name": "PlanItemController", "x-operation-name": "updateById", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -1063,10 +1092,10 @@ ], "responses": { "204": { - "description": "Plan PATCH success" + "description": "PlanItem PATCH success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7006 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7010 |\n", "parameters": [ { "name": "id", @@ -1081,18 +1110,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanPartial" + "$ref": "#/components/schemas/PlanItemPartial" } } }, "x-parameter-index": 1 }, - "operationId": "PlanController.updateById" + "operationId": "PlanItemController.updateById" }, "get": { - "x-controller-name": "PlanController", + "x-controller-name": "PlanItemController", "x-operation-name": "findById", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -1100,17 +1131,17 @@ ], "responses": { "200": { - "description": "Plan model instance", + "description": "PlanItem model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanWithRelations" + "$ref": "#/components/schemas/PlanItemWithRelations" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7008 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7012 |\n", "parameters": [ { "name": "id", @@ -1126,18 +1157,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/plans.Filter" + "$ref": "#/components/schemas/plan_items.Filter" } } } } ], - "operationId": "PlanController.findById" + "operationId": "PlanItemController.findById" }, "delete": { - "x-controller-name": "PlanController", + "x-controller-name": "PlanItemController", "x-operation-name": "deleteById", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -1145,10 +1178,10 @@ ], "responses": { "204": { - "description": "Plan DELETE success" + "description": "PlanItem DELETE success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7007 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7011 |\n", "parameters": [ { "name": "id", @@ -1159,14 +1192,16 @@ "required": true } ], - "operationId": "PlanController.deleteById" + "operationId": "PlanItemController.deleteById" } }, - "/plans": { + "/plan-items": { "post": { - "x-controller-name": "PlanController", + "x-controller-name": "PlanItemController", "x-operation-name": "create", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -1174,32 +1209,34 @@ ], "responses": { "200": { - "description": "Plan model instance", + "description": "PlanItem model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Plan" + "$ref": "#/components/schemas/PlanItem" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7005 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7009 |\n", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewPlan" + "$ref": "#/components/schemas/NewPlanItem" } } } }, - "operationId": "PlanController.create" + "operationId": "PlanItemController.create" }, "patch": { - "x-controller-name": "PlanController", + "x-controller-name": "PlanItemController", "x-operation-name": "updateAll", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -1207,7 +1244,7 @@ ], "responses": { "200": { - "description": "Plan PATCH success count", + "description": "PlanItem PATCH success count", "content": { "application/json": { "schema": { @@ -1217,7 +1254,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7006 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7010 |\n", "parameters": [ { "name": "where", @@ -1226,9 +1263,9 @@ "application/json": { "schema": { "type": "object", - "title": "plans.WhereFilter", + "title": "plan_items.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } @@ -1238,17 +1275,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PlanPartial" + "$ref": "#/components/schemas/PlanItemPartial" } } } }, - "operationId": "PlanController.updateAll" + "operationId": "PlanItemController.updateAll" }, "get": { - "x-controller-name": "PlanController", + "x-controller-name": "PlanItemController", "x-operation-name": "find", - "tags": ["PlanController"], + "tags": [ + "PlanItemController" + ], "security": [ { "HTTPBearer": [] @@ -1256,20 +1295,20 @@ ], "responses": { "200": { - "description": "Array of Plan model instances", + "description": "Array of PlanItem model instances", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/PlanWithRelations" + "$ref": "#/components/schemas/PlanItemWithRelations" } } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7008 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7012 |\n", "parameters": [ { "name": "filter", @@ -1277,20 +1316,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/plans.Filter1" + "$ref": "#/components/schemas/plan_items.Filter1" } } } } ], - "operationId": "PlanController.find" + "operationId": "PlanItemController.find" } }, - "/resources/count": { + "/plans/count": { "get": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "count", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1298,7 +1339,7 @@ ], "responses": { "200": { - "description": "Resource model count", + "description": "Plan model count", "content": { "application/json": { "schema": { @@ -1308,7 +1349,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7016 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7008 |\n", "parameters": [ { "name": "where", @@ -1317,22 +1358,62 @@ "application/json": { "schema": { "type": "object", - "title": "resources.WhereFilter", + "title": "plans.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } } ], - "operationId": "ResourceController.count" + "operationId": "PlanController.count" } }, - "/resources/{id}": { + "/plans/{id}/subscriptions": { + "get": { + "x-controller-name": "PlanSubscriptionController", + "x-operation-name": "find", + "tags": [ + "PlanSubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "200": { + "description": "Plan model instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriptionWithRelations" + } + } + } + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7008 |\n| 7004 |\n", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "operationId": "PlanSubscriptionController.find" + } + }, + "/plans/{id}": { "put": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "replaceById", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1340,10 +1421,10 @@ ], "responses": { "204": { - "description": "Resource PUT success" + "description": "Plan PUT success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7014 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7006 |\n", "parameters": [ { "name": "id", @@ -1358,18 +1439,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Resource" + "$ref": "#/components/schemas/Plan" } } }, "x-parameter-index": 1 }, - "operationId": "ResourceController.replaceById" + "operationId": "PlanController.replaceById" }, "patch": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "updateById", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1377,10 +1460,10 @@ ], "responses": { "204": { - "description": "Resource PATCH success" + "description": "Plan PATCH success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7014 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7006 |\n", "parameters": [ { "name": "id", @@ -1395,18 +1478,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResourcePartial" + "$ref": "#/components/schemas/PlanPartial" } } }, "x-parameter-index": 1 }, - "operationId": "ResourceController.updateById" + "operationId": "PlanController.updateById" }, "get": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "findById", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1414,17 +1499,17 @@ ], "responses": { "200": { - "description": "Resource model instance", + "description": "Plan model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResourceWithRelations" + "$ref": "#/components/schemas/PlanWithRelations" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7016 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7008 |\n", "parameters": [ { "name": "id", @@ -1440,18 +1525,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/resources.Filter" + "$ref": "#/components/schemas/plans.Filter" } } } } ], - "operationId": "ResourceController.findById" + "operationId": "PlanController.findById" }, "delete": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "deleteById", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1459,10 +1546,10 @@ ], "responses": { "204": { - "description": "Resource DELETE success" + "description": "Plan DELETE success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7015 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7007 |\n", "parameters": [ { "name": "id", @@ -1473,14 +1560,16 @@ "required": true } ], - "operationId": "ResourceController.deleteById" + "operationId": "PlanController.deleteById" } }, - "/resources": { + "/plans": { "post": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "create", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1488,32 +1577,34 @@ ], "responses": { "200": { - "description": "Resource model instance", + "description": "Plan model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Resource" + "$ref": "#/components/schemas/Plan" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7013 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7005 |\n", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewResource" + "$ref": "#/components/schemas/NewPlan" } } } }, - "operationId": "ResourceController.create" + "operationId": "PlanController.create" }, "patch": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "updateAll", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1521,7 +1612,7 @@ ], "responses": { "200": { - "description": "Resource PATCH success count", + "description": "Plan PATCH success count", "content": { "application/json": { "schema": { @@ -1531,7 +1622,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7014 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7006 |\n", "parameters": [ { "name": "where", @@ -1540,9 +1631,9 @@ "application/json": { "schema": { "type": "object", - "title": "resources.WhereFilter", + "title": "plans.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } @@ -1552,17 +1643,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResourcePartial" + "$ref": "#/components/schemas/PlanPartial" } } } }, - "operationId": "ResourceController.updateAll" + "operationId": "PlanController.updateAll" }, "get": { - "x-controller-name": "ResourceController", + "x-controller-name": "PlanController", "x-operation-name": "find", - "tags": ["ResourceController"], + "tags": [ + "PlanController" + ], "security": [ { "HTTPBearer": [] @@ -1570,20 +1663,20 @@ ], "responses": { "200": { - "description": "Array of Resource model instances", + "description": "Array of Plan model instances", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/ResourceWithRelations" + "$ref": "#/components/schemas/PlanWithRelations" } } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7016 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7008 |\n", "parameters": [ { "name": "filter", @@ -1591,20 +1684,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/resources.Filter1" + "$ref": "#/components/schemas/plans.Filter1" } } } } ], - "operationId": "ResourceController.find" + "operationId": "PlanController.find" } }, - "/services/count": { + "/resources/count": { "get": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "count", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1612,7 +1707,7 @@ ], "responses": { "200": { - "description": "Service model count", + "description": "Resource model count", "content": { "application/json": { "schema": { @@ -1622,7 +1717,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7020 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7016 |\n", "parameters": [ { "name": "where", @@ -1631,22 +1726,24 @@ "application/json": { "schema": { "type": "object", - "title": "services.WhereFilter", + "title": "resources.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } } ], - "operationId": "ServiceController.count" + "operationId": "ResourceController.count" } }, - "/services/{id}": { + "/resources/{id}": { "put": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "replaceById", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1654,10 +1751,10 @@ ], "responses": { "204": { - "description": "Service PUT success" + "description": "Resource PUT success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7018 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7014 |\n", "parameters": [ { "name": "id", @@ -1672,18 +1769,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Service" + "$ref": "#/components/schemas/Resource" } } }, "x-parameter-index": 1 }, - "operationId": "ServiceController.replaceById" + "operationId": "ResourceController.replaceById" }, "patch": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "updateById", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1691,10 +1790,10 @@ ], "responses": { "204": { - "description": "Service PATCH success" + "description": "Resource PATCH success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7018 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7014 |\n", "parameters": [ { "name": "id", @@ -1709,18 +1808,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServicePartial" + "$ref": "#/components/schemas/ResourcePartial" } } }, "x-parameter-index": 1 }, - "operationId": "ServiceController.updateById" + "operationId": "ResourceController.updateById" }, "get": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "findById", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1728,17 +1829,17 @@ ], "responses": { "200": { - "description": "Service model instance", + "description": "Resource model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServiceWithRelations" + "$ref": "#/components/schemas/ResourceWithRelations" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7020 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7016 |\n", "parameters": [ { "name": "id", @@ -1754,18 +1855,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/services.Filter" + "$ref": "#/components/schemas/resources.Filter" } } } } ], - "operationId": "ServiceController.findById" + "operationId": "ResourceController.findById" }, "delete": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "deleteById", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1773,10 +1876,10 @@ ], "responses": { "204": { - "description": "Service DELETE success" + "description": "Resource DELETE success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7019 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7015 |\n", "parameters": [ { "name": "id", @@ -1787,14 +1890,16 @@ "required": true } ], - "operationId": "ServiceController.deleteById" + "operationId": "ResourceController.deleteById" } }, - "/services": { + "/resources": { "post": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "create", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1802,32 +1907,34 @@ ], "responses": { "200": { - "description": "Service model instance", + "description": "Resource model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Service" + "$ref": "#/components/schemas/Resource" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7017 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7013 |\n", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewService" + "$ref": "#/components/schemas/NewResource" } } } }, - "operationId": "ServiceController.create" + "operationId": "ResourceController.create" }, "patch": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "updateAll", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1835,7 +1942,7 @@ ], "responses": { "200": { - "description": "Service PATCH success count", + "description": "Resource PATCH success count", "content": { "application/json": { "schema": { @@ -1845,7 +1952,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7018 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7014 |\n", "parameters": [ { "name": "where", @@ -1854,9 +1961,9 @@ "application/json": { "schema": { "type": "object", - "title": "services.WhereFilter", + "title": "resources.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } @@ -1866,17 +1973,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServicePartial" + "$ref": "#/components/schemas/ResourcePartial" } } } }, - "operationId": "ServiceController.updateAll" + "operationId": "ResourceController.updateAll" }, "get": { - "x-controller-name": "ServiceController", + "x-controller-name": "ResourceController", "x-operation-name": "find", - "tags": ["ServiceController"], + "tags": [ + "ResourceController" + ], "security": [ { "HTTPBearer": [] @@ -1884,20 +1993,20 @@ ], "responses": { "200": { - "description": "Array of Service model instances", + "description": "Array of Resource model instances", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/ServiceWithRelations" + "$ref": "#/components/schemas/ResourceWithRelations" } } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7020 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7016 |\n", "parameters": [ { "name": "filter", @@ -1905,20 +2014,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/services.Filter1" + "$ref": "#/components/schemas/resources.Filter1" } } } } ], - "operationId": "ServiceController.find" + "operationId": "ResourceController.find" } }, - "/subscriptions/count": { + "/services/count": { "get": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "count", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], "security": [ { "HTTPBearer": [] @@ -1926,7 +2037,7 @@ ], "responses": { "200": { - "description": "Subscription model count", + "description": "Service model count", "content": { "application/json": { "schema": { @@ -1936,7 +2047,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7004 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7020 |\n", "parameters": [ { "name": "where", @@ -1945,22 +2056,24 @@ "application/json": { "schema": { "type": "object", - "title": "subscriptions.WhereFilter", + "title": "services.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } } ], - "operationId": "SubscriptionController.count" + "operationId": "ServiceController.count" } }, - "/subscriptions/{id}": { + "/services/{id}": { "put": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "replaceById", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], "security": [ { "HTTPBearer": [] @@ -1968,10 +2081,10 @@ ], "responses": { "204": { - "description": "Subscription PUT success" + "description": "Service PUT success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7002 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7018 |\n", "parameters": [ { "name": "id", @@ -1986,18 +2099,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Subscription" + "$ref": "#/components/schemas/Service" } } }, "x-parameter-index": 1 }, - "operationId": "SubscriptionController.replaceById" + "operationId": "ServiceController.replaceById" }, "patch": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "updateById", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], "security": [ { "HTTPBearer": [] @@ -2005,10 +2120,10 @@ ], "responses": { "204": { - "description": "Subscription PATCH success" + "description": "Service PATCH success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7002 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7018 |\n", "parameters": [ { "name": "id", @@ -2023,18 +2138,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SubscriptionPartial" + "$ref": "#/components/schemas/ServicePartial" } } }, "x-parameter-index": 1 }, - "operationId": "SubscriptionController.updateById" + "operationId": "ServiceController.updateById" }, "get": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "findById", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], "security": [ { "HTTPBearer": [] @@ -2042,17 +2159,17 @@ ], "responses": { "200": { - "description": "Subscription model instance", + "description": "Service model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SubscriptionWithRelations" + "$ref": "#/components/schemas/ServiceWithRelations" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7004 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7020 |\n", "parameters": [ { "name": "id", @@ -2068,18 +2185,20 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/subscriptions.Filter" + "$ref": "#/components/schemas/services.Filter" } } } } ], - "operationId": "SubscriptionController.findById" + "operationId": "ServiceController.findById" }, "delete": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "deleteById", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], "security": [ { "HTTPBearer": [] @@ -2087,10 +2206,10 @@ ], "responses": { "204": { - "description": "Subscription DELETE success" + "description": "Service DELETE success" } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7003 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7019 |\n", "parameters": [ { "name": "id", @@ -2101,14 +2220,16 @@ "required": true } ], - "operationId": "SubscriptionController.deleteById" + "operationId": "ServiceController.deleteById" } }, - "/subscriptions": { + "/services": { "post": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "create", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], "security": [ { "HTTPBearer": [] @@ -2116,32 +2237,34 @@ ], "responses": { "200": { - "description": "Subscription model instance", + "description": "Service model instance", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Subscription" + "$ref": "#/components/schemas/Service" } } } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7001 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7017 |\n", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewSubscription" + "$ref": "#/components/schemas/NewService" } } } }, - "operationId": "SubscriptionController.create" + "operationId": "ServiceController.create" }, "patch": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "updateAll", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], "security": [ { "HTTPBearer": [] @@ -2149,7 +2272,7 @@ ], "responses": { "200": { - "description": "Subscription PATCH success count", + "description": "Service PATCH success count", "content": { "application/json": { "schema": { @@ -2159,7 +2282,7 @@ } } }, - "description": "\n\n| Permissions |\n| ------- |\n| 7002 |\n", + "description": "\n\n| Permissions |\n| ------- |\n| 7018 |\n", "parameters": [ { "name": "where", @@ -2168,9 +2291,9 @@ "application/json": { "schema": { "type": "object", - "title": "subscriptions.WhereFilter", + "title": "services.WhereFilter", "additionalProperties": true, - "x-typescript-type": "@loopback/repository#Where" + "x-typescript-type": "@loopback/repository#Where" } } } @@ -2180,17 +2303,107 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SubscriptionPartial" + "$ref": "#/components/schemas/ServicePartial" } } } }, - "operationId": "SubscriptionController.updateAll" + "operationId": "ServiceController.updateAll" }, "get": { - "x-controller-name": "SubscriptionController", + "x-controller-name": "ServiceController", "x-operation-name": "find", - "tags": ["SubscriptionController"], + "tags": [ + "ServiceController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "200": { + "description": "Array of Service model instances", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceWithRelations" + } + } + } + } + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7020 |\n", + "parameters": [ + { + "name": "filter", + "in": "query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/services.Filter1" + } + } + } + } + ], + "operationId": "ServiceController.find" + } + }, + "/subscriptions/count": { + "get": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "count", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "200": { + "description": "Subscription model count", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/loopback.Count" + } + } + } + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7004 |\n", + "parameters": [ + { + "name": "where", + "in": "query", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "subscriptions.WhereFilter", + "additionalProperties": true, + "x-typescript-type": "@loopback/repository#Where" + } + } + } + } + ], + "operationId": "SubscriptionController.count" + } + }, + "/subscriptions/expire-soon": { + "get": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "expireSoonSubscription", + "tags": [ + "SubscriptionController" + ], "security": [ { "HTTPBearer": [] @@ -2219,56 +2432,395 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/subscriptions.Filter1" + "$ref": "#/components/schemas/subscriptions.Filter" } } } } ], - "operationId": "SubscriptionController.find" + "operationId": "SubscriptionController.expireSoonSubscription" } }, - "/": { + "/subscriptions/expired": { "get": { - "x-controller-name": "HomePageController", - "x-operation-name": "homePage", - "tags": ["HomePageController"], + "x-controller-name": "SubscriptionController", + "x-operation-name": "expiredSubscription", + "tags": [ + "SubscriptionController" + ], + "description": "api that will return newly expired subscription\n\n| Permissions |\n| ------- |\n| 7004 |\n", + "security": [ + { + "HTTPBearer": [] + } + ], "responses": { "200": { - "description": "Home Page", + "description": "Array of Subscription model instances", "content": { - "text/html": { + "application/json": { "schema": { - "type": "string" + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionWithRelations" + } } } } } }, - "description": "", - "operationId": "HomePageController.homePage" - } - } - }, - "components": { - "securitySchemes": { - "HTTPBearer": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" + "parameters": [ + { + "name": "days", + "in": "header", + "schema": { + "type": "number" + } + }, + { + "name": "filter", + "in": "query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/subscriptions.Filter" + } + } + } + } + ], + "operationId": "SubscriptionController.expiredSubscription" } }, - "schemas": { - "Subscription": { - "title": "Subscription", - "type": "object", - "properties": { - "deleted": { - "type": "boolean" + "/subscriptions/{id}": { + "put": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "replaceById", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "204": { + "description": "Subscription PUT success" + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7002 |\n", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Subscription" + } + } }, - "deletedOn": { - "type": "string", - "format": "date-time", + "x-parameter-index": 1 + }, + "operationId": "SubscriptionController.replaceById" + }, + "patch": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "updateById", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "204": { + "description": "Subscription PATCH success" + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7002 |\n", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriptionPartial" + } + } + }, + "x-parameter-index": 1 + }, + "operationId": "SubscriptionController.updateById" + }, + "get": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "findById", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "200": { + "description": "Subscription model instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriptionWithRelations" + } + } + } + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7004 |\n", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + }, + { + "name": "filter", + "in": "query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/subscriptions.Filter1" + } + } + } + } + ], + "operationId": "SubscriptionController.findById" + }, + "delete": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "deleteById", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "204": { + "description": "Subscription DELETE success" + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7003 |\n", + "parameters": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + }, + "required": true + } + ], + "operationId": "SubscriptionController.deleteById" + } + }, + "/subscriptions": { + "post": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "create", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "200": { + "description": "Subscription model instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Subscription" + } + } + } + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7001 |\n", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewSubscription" + } + } + } + }, + "operationId": "SubscriptionController.create" + }, + "patch": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "updateAll", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "200": { + "description": "Subscription PATCH success count", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/loopback.Count" + } + } + } + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7002 |\n", + "parameters": [ + { + "name": "where", + "in": "query", + "content": { + "application/json": { + "schema": { + "type": "object", + "title": "subscriptions.WhereFilter", + "additionalProperties": true, + "x-typescript-type": "@loopback/repository#Where" + } + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriptionPartial" + } + } + } + }, + "operationId": "SubscriptionController.updateAll" + }, + "get": { + "x-controller-name": "SubscriptionController", + "x-operation-name": "find", + "tags": [ + "SubscriptionController" + ], + "security": [ + { + "HTTPBearer": [] + } + ], + "responses": { + "200": { + "description": "Array of Subscription model instances", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionWithRelations" + } + } + } + } + } + }, + "description": "\n\n| Permissions |\n| ------- |\n| 7004 |\n", + "parameters": [ + { + "name": "filter", + "in": "query", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/subscriptions.Filter" + } + } + } + } + ], + "operationId": "SubscriptionController.find" + } + }, + "/": { + "get": { + "x-controller-name": "HomePageController", + "x-operation-name": "homePage", + "tags": [ + "HomePageController" + ], + "responses": { + "200": { + "description": "Home Page", + "content": { + "text/html": { + "schema": { + "type": "string" + } + } + } + } + }, + "description": "", + "operationId": "HomePageController.homePage" + } + } + }, + "components": { + "securitySchemes": { + "HTTPBearer": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "BillingCycle": { + "title": "BillingCycle", + "type": "object", + "properties": { + "deleted": { + "type": "boolean" + }, + "deletedOn": { + "type": "string", + "format": "date-time", "nullable": true }, "deletedBy": { @@ -2292,32 +2844,30 @@ "id": { "type": "string" }, - "subscriberId": { + "cycleName": { "type": "string" }, - "startDate": { - "type": "string" + "duration": { + "type": "number" }, - "endDate": { + "durationUnit": { "type": "string" }, - "status": { - "type": "number", - "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", - "enum": [0, 1, 2, 3, 4] - }, - "planId": { - "type": "string", - "description": "plan id of the subscription" + "description": { + "type": "string" } }, - "required": ["subscriberId", "startDate", "endDate", "status"], + "required": [ + "cycleName", + "duration", + "durationUnit" + ], "additionalProperties": false }, - "NewSubscription": { - "title": "NewSubscription", + "NewBillingCycle": { + "title": "NewBillingCycle", "type": "object", - "description": "(tsType: Omit, schemaOptions: { title: 'NewSubscription', exclude: [ 'id' ] })", + "description": "(tsType: Omit, schemaOptions: { title: 'NewBillingCycle', exclude: [ 'id' ] })", "properties": { "deleted": { "type": "boolean" @@ -2345,33 +2895,31 @@ "modifiedBy": { "type": "string" }, - "subscriberId": { + "cycleName": { "type": "string" }, - "startDate": { - "type": "string" + "duration": { + "type": "number" }, - "endDate": { + "durationUnit": { "type": "string" }, - "status": { - "type": "number", - "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", - "enum": [0, 1, 2, 3, 4] - }, - "planId": { - "type": "string", - "description": "plan id of the subscription" + "description": { + "type": "string" } }, - "required": ["subscriberId", "startDate", "endDate", "status"], + "required": [ + "cycleName", + "duration", + "durationUnit" + ], "additionalProperties": false, - "x-typescript-type": "Omit" + "x-typescript-type": "Omit" }, - "PlanItemWithRelations": { - "title": "PlanItemWithRelations", + "BillingCycleWithRelations": { + "title": "BillingCycleWithRelations", "type": "object", - "description": "(tsType: PlanItemWithRelations, schemaOptions: { includeRelations: true })", + "description": "(tsType: BillingCycleWithRelations, schemaOptions: { includeRelations: true })", "properties": { "deleted": { "type": "boolean" @@ -2402,35 +2950,31 @@ "id": { "type": "string" }, - "name": { - "type": "string", - "description": "name of the plan item" - }, - "planItemType": { - "type": "string", - "description": "type of the plan item" - }, - "value": { - "type": "object", - "description": "value of the plan item" + "cycleName": { + "type": "string" }, - "planId": { - "type": "string", - "description": "plan id of the plan item" + "duration": { + "type": "number" }, - "plan": { - "$ref": "#/components/schemas/PlanWithRelations" + "durationUnit": { + "type": "string" }, - "foreignKey": {} + "description": { + "type": "string" + } }, - "required": ["name", "planItemType", "value"], + "required": [ + "cycleName", + "duration", + "durationUnit" + ], "additionalProperties": false, - "x-typescript-type": "PlanItemWithRelations" + "x-typescript-type": "BillingCycleWithRelations" }, - "BillingCycleWithRelations": { - "title": "BillingCycleWithRelations", + "BillingCyclePartial": { + "title": "BillingCyclePartial", "type": "object", - "description": "(tsType: BillingCycleWithRelations, schemaOptions: { includeRelations: true })", + "description": "(tsType: Partial, schemaOptions: { partial: true })", "properties": { "deleted": { "type": "boolean" @@ -2474,9 +3018,59 @@ "type": "string" } }, - "required": ["cycleName", "duration", "durationUnit"], "additionalProperties": false, - "x-typescript-type": "BillingCycleWithRelations" + "x-typescript-type": "Partial" + }, + "Currency": { + "title": "Currency", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "currencyCode": { + "type": "string" + }, + "currencyName": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "country": { + "type": "string" + } + }, + "required": [ + "currencyCode", + "currencyName" + ], + "additionalProperties": false + }, + "NewCurrency": { + "title": "NewCurrency", + "type": "object", + "description": "(tsType: Omit, schemaOptions: { title: 'NewCurrency', exclude: [ 'id' ] })", + "properties": { + "currencyCode": { + "type": "string" + }, + "currencyName": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "country": { + "type": "string" + } + }, + "required": [ + "currencyCode", + "currencyName" + ], + "additionalProperties": false, + "x-typescript-type": "Omit" }, "CurrencyWithRelations": { "title": "CurrencyWithRelations", @@ -2499,14 +3093,40 @@ "type": "string" } }, - "required": ["currencyCode", "currencyName"], + "required": [ + "currencyCode", + "currencyName" + ], "additionalProperties": false, "x-typescript-type": "CurrencyWithRelations" }, - "PlanWithRelations": { - "title": "PlanWithRelations", + "CurrencyPartial": { + "title": "CurrencyPartial", + "type": "object", + "description": "(tsType: Partial, schemaOptions: { partial: true })", + "properties": { + "id": { + "type": "string" + }, + "currencyCode": { + "type": "string" + }, + "currencyName": { + "type": "string" + }, + "symbol": { + "type": "string" + }, + "country": { + "type": "string" + } + }, + "additionalProperties": false, + "x-typescript-type": "Partial" + }, + "PlanItem": { + "title": "PlanItem", "type": "object", - "description": "(tsType: PlanWithRelations, schemaOptions: { includeRelations: true })", "properties": { "deleted": { "type": "boolean" @@ -2539,52 +3159,88 @@ }, "name": { "type": "string", - "description": "name of the plan" + "description": "name of the plan item" }, - "description": { + "planItemType": { "type": "string", - "description": "description of the plan" + "description": "type of the plan item" }, - "tier": { - "type": "number", - "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", - "enum": [0, 1] + "value": { + "type": "object", + "description": "value of the plan item" }, - "price": { - "type": "number" + "planId": { + "type": "string", + "description": "plan id of the plan item" + } + }, + "required": [ + "name", + "planItemType", + "value" + ], + "additionalProperties": false + }, + "NewPlanItem": { + "title": "NewPlanItem", + "type": "object", + "description": "(tsType: Omit, schemaOptions: { title: 'NewPlanItem', exclude: [ 'id' ] })", + "properties": { + "deleted": { + "type": "boolean" }, - "metaData": { - "type": "object", - "description": "Meta data of the plan" + "deletedOn": { + "type": "string", + "format": "date-time", + "nullable": true }, - "billingCycleId": { + "deletedBy": { + "type": "string", + "nullable": true + }, + "createdOn": { + "type": "string", + "format": "date-time" + }, + "modifiedOn": { + "type": "string", + "format": "date-time" + }, + "createdBy": { "type": "string" }, - "currencyId": { + "modifiedBy": { "type": "string" }, - "planItems": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PlanItemWithRelations" - } + "name": { + "type": "string", + "description": "name of the plan item" }, - "billingCycle": { - "$ref": "#/components/schemas/BillingCycleWithRelations" + "planItemType": { + "type": "string", + "description": "type of the plan item" }, - "foreignKey": {}, - "currency": { - "$ref": "#/components/schemas/CurrencyWithRelations" + "value": { + "type": "object", + "description": "value of the plan item" + }, + "planId": { + "type": "string", + "description": "plan id of the plan item" } }, - "required": ["name", "description", "tier", "price"], + "required": [ + "name", + "planItemType", + "value" + ], "additionalProperties": false, - "x-typescript-type": "PlanWithRelations" + "x-typescript-type": "Omit" }, - "SubscriptionWithRelations": { - "title": "SubscriptionWithRelations", + "PlanItemWithRelations": { + "title": "PlanItemWithRelations", "type": "object", - "description": "(tsType: SubscriptionWithRelations, schemaOptions: { includeRelations: true })", + "description": "(tsType: PlanItemWithRelations, schemaOptions: { includeRelations: true })", "properties": { "deleted": { "type": "boolean" @@ -2615,37 +3271,39 @@ "id": { "type": "string" }, - "subscriberId": { - "type": "string" - }, - "startDate": { - "type": "string" + "name": { + "type": "string", + "description": "name of the plan item" }, - "endDate": { - "type": "string" + "planItemType": { + "type": "string", + "description": "type of the plan item" }, - "status": { - "type": "number", - "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", - "enum": [0, 1, 2, 3, 4] + "value": { + "type": "object", + "description": "value of the plan item" }, "planId": { "type": "string", - "description": "plan id of the subscription" + "description": "plan id of the plan item" }, "plan": { "$ref": "#/components/schemas/PlanWithRelations" }, "foreignKey": {} }, - "required": ["subscriberId", "startDate", "endDate", "status"], + "required": [ + "name", + "planItemType", + "value" + ], "additionalProperties": false, - "x-typescript-type": "SubscriptionWithRelations" + "x-typescript-type": "PlanItemWithRelations" }, - "SubscriptionPartial": { - "title": "SubscriptionPartial", + "PlanItemPartial": { + "title": "PlanItemPartial", "type": "object", - "description": "(tsType: Partial, schemaOptions: { partial: true })", + "description": "(tsType: Partial, schemaOptions: { partial: true })", "properties": { "deleted": { "type": "boolean" @@ -2676,30 +3334,28 @@ "id": { "type": "string" }, - "subscriberId": { - "type": "string" - }, - "startDate": { - "type": "string" + "name": { + "type": "string", + "description": "name of the plan item" }, - "endDate": { - "type": "string" + "planItemType": { + "type": "string", + "description": "type of the plan item" }, - "status": { - "type": "number", - "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", - "enum": [0, 1, 2, 3, 4] + "value": { + "type": "object", + "description": "value of the plan item" }, "planId": { "type": "string", - "description": "plan id of the subscription" + "description": "plan id of the plan item" } }, "additionalProperties": false, - "x-typescript-type": "Partial" + "x-typescript-type": "Partial" }, - "Service": { - "title": "Service", + "Plan": { + "title": "Plan", "type": "object", "properties": { "deleted": { @@ -2733,16 +3389,46 @@ }, "name": { "type": "string", - "description": "name of the service" + "description": "name of the plan" + }, + "description": { + "type": "string", + "description": "description of the plan" + }, + "tier": { + "type": "number", + "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", + "enum": [ + 0, + 1 + ] + }, + "price": { + "type": "number" + }, + "metaData": { + "type": "object", + "description": "Meta data of the plan" + }, + "billingCycleId": { + "type": "string" + }, + "currencyId": { + "type": "string" } }, - "required": ["name"], + "required": [ + "name", + "description", + "tier", + "price" + ], "additionalProperties": false }, - "NewService": { - "title": "NewService", + "NewPlan": { + "title": "NewPlan", "type": "object", - "description": "(tsType: Omit, schemaOptions: { title: 'NewService', exclude: [ 'id' ] })", + "description": "(tsType: Omit, schemaOptions: { title: 'NewPlan', exclude: [ 'id' ] })", "properties": { "deleted": { "type": "boolean" @@ -2772,17 +3458,47 @@ }, "name": { "type": "string", - "description": "name of the service" + "description": "name of the plan" + }, + "description": { + "type": "string", + "description": "description of the plan" + }, + "tier": { + "type": "number", + "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", + "enum": [ + 0, + 1 + ] + }, + "price": { + "type": "number" + }, + "metaData": { + "type": "object", + "description": "Meta data of the plan" + }, + "billingCycleId": { + "type": "string" + }, + "currencyId": { + "type": "string" } }, - "required": ["name"], + "required": [ + "name", + "description", + "tier", + "price" + ], "additionalProperties": false, - "x-typescript-type": "Omit" + "x-typescript-type": "Omit" }, - "ServiceWithRelations": { - "title": "ServiceWithRelations", + "PlanWithRelations": { + "title": "PlanWithRelations", "type": "object", - "description": "(tsType: ServiceWithRelations, schemaOptions: { includeRelations: true })", + "description": "(tsType: PlanWithRelations, schemaOptions: { includeRelations: true })", "properties": { "deleted": { "type": "boolean" @@ -2815,17 +3531,60 @@ }, "name": { "type": "string", - "description": "name of the service" + "description": "name of the plan" + }, + "description": { + "type": "string", + "description": "description of the plan" + }, + "tier": { + "type": "number", + "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", + "enum": [ + 0, + 1 + ] + }, + "price": { + "type": "number" + }, + "metaData": { + "type": "object", + "description": "Meta data of the plan" + }, + "billingCycleId": { + "type": "string" + }, + "currencyId": { + "type": "string" + }, + "planItems": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PlanItemWithRelations" + } + }, + "billingCycle": { + "$ref": "#/components/schemas/BillingCycleWithRelations" + }, + "foreignKey": {}, + "currency": { + "$ref": "#/components/schemas/CurrencyWithRelations" } }, - "required": ["name"], + "required": [ + "name", + "description", + "tier", + "price" + ], "additionalProperties": false, - "x-typescript-type": "ServiceWithRelations" + "x-typescript-type": "PlanWithRelations" }, - "ServicePartial": { - "title": "ServicePartial", + "PlanPartial": { + "title": "PlanPartial", "type": "object", - "description": "(tsType: Partial, schemaOptions: { partial: true })", + "description": "(tsType: Partial, schemaOptions: { partial: true })", "properties": { "deleted": { "type": "boolean" @@ -2858,11 +3617,36 @@ }, "name": { "type": "string", - "description": "name of the service" + "description": "name of the plan" + }, + "description": { + "type": "string", + "description": "description of the plan" + }, + "tier": { + "type": "number", + "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", + "enum": [ + 0, + 1 + ] + }, + "price": { + "type": "number" + }, + "metaData": { + "type": "object", + "description": "Meta data of the plan" + }, + "billingCycleId": { + "type": "string" + }, + "currencyId": { + "type": "string" } }, "additionalProperties": false, - "x-typescript-type": "Partial" + "x-typescript-type": "Partial" }, "Resource": { "title": "Resource", @@ -2906,7 +3690,10 @@ "description": "config of the resource" } }, - "required": ["name", "config"], + "required": [ + "name", + "config" + ], "additionalProperties": false }, "NewResource": { @@ -2949,7 +3736,10 @@ "description": "config of the resource" } }, - "required": ["name", "config"], + "required": [ + "name", + "config" + ], "additionalProperties": false, "x-typescript-type": "Omit" }, @@ -2996,7 +3786,10 @@ "description": "config of the resource" } }, - "required": ["name", "config"], + "required": [ + "name", + "config" + ], "additionalProperties": false, "x-typescript-type": "ResourceWithRelations" }, @@ -3046,8 +3839,8 @@ "additionalProperties": false, "x-typescript-type": "Partial" }, - "Plan": { - "title": "Plan", + "Service": { + "title": "Service", "type": "object", "properties": { "deleted": { @@ -3081,38 +3874,60 @@ }, "name": { "type": "string", - "description": "name of the plan" + "description": "name of the service" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "NewService": { + "title": "NewService", + "type": "object", + "description": "(tsType: Omit, schemaOptions: { title: 'NewService', exclude: [ 'id' ] })", + "properties": { + "deleted": { + "type": "boolean" }, - "description": { + "deletedOn": { "type": "string", - "description": "description of the plan" + "format": "date-time", + "nullable": true }, - "tier": { - "type": "number", - "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", - "enum": [0, 1] + "deletedBy": { + "type": "string", + "nullable": true }, - "price": { - "type": "number" + "createdOn": { + "type": "string", + "format": "date-time" }, - "metaData": { - "type": "object", - "description": "Meta data of the plan" + "modifiedOn": { + "type": "string", + "format": "date-time" }, - "billingCycleId": { + "createdBy": { "type": "string" }, - "currencyId": { + "modifiedBy": { "type": "string" + }, + "name": { + "type": "string", + "description": "name of the service" } }, - "required": ["name", "description", "tier", "price"], - "additionalProperties": false + "required": [ + "name" + ], + "additionalProperties": false, + "x-typescript-type": "Omit" }, - "NewPlan": { - "title": "NewPlan", + "ServiceWithRelations": { + "title": "ServiceWithRelations", "type": "object", - "description": "(tsType: Omit, schemaOptions: { title: 'NewPlan', exclude: [ 'id' ] })", + "description": "(tsType: ServiceWithRelations, schemaOptions: { includeRelations: true })", "properties": { "deleted": { "type": "boolean" @@ -3140,41 +3955,65 @@ "modifiedBy": { "type": "string" }, + "id": { + "type": "string" + }, "name": { "type": "string", - "description": "name of the plan" + "description": "name of the service" + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "x-typescript-type": "ServiceWithRelations" + }, + "ServicePartial": { + "title": "ServicePartial", + "type": "object", + "description": "(tsType: Partial, schemaOptions: { partial: true })", + "properties": { + "deleted": { + "type": "boolean" }, - "description": { + "deletedOn": { "type": "string", - "description": "description of the plan" + "format": "date-time", + "nullable": true }, - "tier": { - "type": "number", - "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", - "enum": [0, 1] + "deletedBy": { + "type": "string", + "nullable": true }, - "price": { - "type": "number" + "createdOn": { + "type": "string", + "format": "date-time" }, - "metaData": { - "type": "object", - "description": "Meta data of the plan" + "modifiedOn": { + "type": "string", + "format": "date-time" }, - "billingCycleId": { + "createdBy": { "type": "string" }, - "currencyId": { + "modifiedBy": { + "type": "string" + }, + "id": { "type": "string" + }, + "name": { + "type": "string", + "description": "name of the service" } }, - "required": ["name", "description", "tier", "price"], "additionalProperties": false, - "x-typescript-type": "Omit" + "x-typescript-type": "Partial" }, - "PlanPartial": { - "title": "PlanPartial", + "Subscription": { + "title": "Subscription", "type": "object", - "description": "(tsType: Partial, schemaOptions: { partial: true })", "properties": { "deleted": { "type": "boolean" @@ -3205,39 +4044,48 @@ "id": { "type": "string" }, - "name": { - "type": "string", - "description": "name of the plan" - }, - "description": { - "type": "string", - "description": "description of the plan" + "subscriberId": { + "type": "string" }, - "tier": { - "type": "number", - "description": "Tier of the plan, it can be - 0(Pooled) and 1(Silo)", - "enum": [0, 1] + "startDate": { + "type": "string" }, - "price": { - "type": "number" + "endDate": { + "type": "string" }, - "metaData": { - "type": "object", - "description": "Meta data of the plan" + "status": { + "type": "number", + "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ] }, - "billingCycleId": { - "type": "string" + "planId": { + "type": "string", + "description": "plan id of the subscription" }, - "currencyId": { - "type": "string" + "planDetails": { + "type": "object", + "description": "Details of the plan with relations" } }, - "additionalProperties": false, - "x-typescript-type": "Partial" + "required": [ + "subscriberId", + "startDate", + "endDate", + "status", + "planDetails" + ], + "additionalProperties": false }, - "PlanItem": { - "title": "PlanItem", + "NewSubscription": { + "title": "NewSubscription", "type": "object", + "description": "(tsType: Omit, schemaOptions: { title: 'NewSubscription', exclude: [ 'id', 'startDate', 'endDate' ] })", "properties": { "deleted": { "type": "boolean" @@ -3265,33 +4113,41 @@ "modifiedBy": { "type": "string" }, - "id": { + "subscriberId": { "type": "string" }, - "name": { - "type": "string", - "description": "name of the plan item" + "status": { + "type": "number", + "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ] }, - "planItemType": { + "planId": { "type": "string", - "description": "type of the plan item" + "description": "plan id of the subscription" }, - "value": { + "planDetails": { "type": "object", - "description": "value of the plan item" - }, - "planId": { - "type": "string", - "description": "plan id of the plan item" + "description": "Details of the plan with relations" } }, - "required": ["name", "planItemType", "value"], - "additionalProperties": false + "required": [ + "subscriberId", + "status", + "planDetails" + ], + "additionalProperties": false, + "x-typescript-type": "Omit" }, - "NewPlanItem": { - "title": "NewPlanItem", + "SubscriptionWithRelations": { + "title": "SubscriptionWithRelations", "type": "object", - "description": "(tsType: Omit, schemaOptions: { title: 'NewPlanItem', exclude: [ 'id' ] })", + "description": "(tsType: SubscriptionWithRelations, schemaOptions: { includeRelations: true })", "properties": { "deleted": { "type": "boolean" @@ -3319,31 +4175,56 @@ "modifiedBy": { "type": "string" }, - "name": { - "type": "string", - "description": "name of the plan item" + "id": { + "type": "string" }, - "planItemType": { - "type": "string", - "description": "type of the plan item" + "subscriberId": { + "type": "string" }, - "value": { - "type": "object", - "description": "value of the plan item" + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "status": { + "type": "number", + "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ] }, "planId": { "type": "string", - "description": "plan id of the plan item" - } + "description": "plan id of the subscription" + }, + "planDetails": { + "type": "object", + "description": "Details of the plan with relations" + }, + "plan": { + "$ref": "#/components/schemas/PlanWithRelations" + }, + "foreignKey": {} }, - "required": ["name", "planItemType", "value"], + "required": [ + "subscriberId", + "startDate", + "endDate", + "status", + "planDetails" + ], "additionalProperties": false, - "x-typescript-type": "Omit" + "x-typescript-type": "SubscriptionWithRelations" }, - "PlanItemPartial": { - "title": "PlanItemPartial", + "SubscriptionPartial": { + "title": "SubscriptionPartial", "type": "object", - "description": "(tsType: Partial, schemaOptions: { partial: true })", + "description": "(tsType: Partial, schemaOptions: { partial: true })", "properties": { "deleted": { "type": "boolean" @@ -3374,98 +4255,92 @@ "id": { "type": "string" }, - "name": { - "type": "string", - "description": "name of the plan item" + "subscriberId": { + "type": "string" }, - "planItemType": { - "type": "string", - "description": "type of the plan item" + "startDate": { + "type": "string" }, - "value": { - "type": "object", - "description": "value of the plan item" + "endDate": { + "type": "string" + }, + "status": { + "type": "number", + "description": "status of the subscription, it can be - 0(pending), 1(active), 2(inactive), 3(cancelled) and 4(expired)", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ] }, "planId": { "type": "string", - "description": "plan id of the plan item" + "description": "plan id of the subscription" + }, + "planDetails": { + "type": "object", + "description": "Details of the plan with relations" } }, "additionalProperties": false, - "x-typescript-type": "Partial" + "x-typescript-type": "Partial" }, - "Currency": { - "title": "Currency", + "Feature": { + "title": "Feature", "type": "object", "properties": { - "id": { - "type": "string" + "deleted": { + "type": "boolean" }, - "currencyCode": { - "type": "string" + "deletedOn": { + "type": "string", + "format": "date-time", + "nullable": true }, - "currencyName": { - "type": "string" + "deletedBy": { + "type": "string", + "nullable": true }, - "symbol": { - "type": "string" + "createdOn": { + "type": "string", + "format": "date-time" }, - "country": { - "type": "string" - } - }, - "required": ["currencyCode", "currencyName"], - "additionalProperties": false - }, - "NewCurrency": { - "title": "NewCurrency", - "type": "object", - "description": "(tsType: Omit, schemaOptions: { title: 'NewCurrency', exclude: [ 'id' ] })", - "properties": { - "currencyCode": { - "type": "string" + "modifiedOn": { + "type": "string", + "format": "date-time" }, - "currencyName": { + "createdBy": { "type": "string" }, - "symbol": { + "modifiedBy": { "type": "string" }, - "country": { - "type": "string" - } - }, - "required": ["currencyCode", "currencyName"], - "additionalProperties": false, - "x-typescript-type": "Omit" - }, - "CurrencyPartial": { - "title": "CurrencyPartial", - "type": "object", - "description": "(tsType: Partial, schemaOptions: { partial: true })", - "properties": { "id": { "type": "string" }, - "currencyCode": { - "type": "string" - }, - "currencyName": { - "type": "string" + "name": { + "type": "string", + "description": "name of the feature" }, - "symbol": { - "type": "string" + "properties": { + "type": "object", + "description": " properties of the feature" }, - "country": { + "serviceId": { "type": "string" } }, - "additionalProperties": false, - "x-typescript-type": "Partial" + "required": [ + "name" + ], + "additionalProperties": false }, - "BillingCycle": { - "title": "BillingCycle", + "NewFeature": { + "title": "NewFeature", "type": "object", + "description": "(tsType: Omit, schemaOptions: { title: 'NewFeature', exclude: [ 'id' ] })", "properties": { "deleted": { "type": "boolean" @@ -3493,29 +4368,28 @@ "modifiedBy": { "type": "string" }, - "id": { - "type": "string" - }, - "cycleName": { - "type": "string" - }, - "duration": { - "type": "number" + "name": { + "type": "string", + "description": "name of the feature" }, - "durationUnit": { - "type": "string" + "properties": { + "type": "object", + "description": " properties of the feature" }, - "description": { + "serviceId": { "type": "string" } }, - "required": ["cycleName", "duration", "durationUnit"], - "additionalProperties": false + "required": [ + "name" + ], + "additionalProperties": false, + "x-typescript-type": "Omit" }, - "NewBillingCycle": { - "title": "NewBillingCycle", + "FeatureWithRelations": { + "title": "FeatureWithRelations", "type": "object", - "description": "(tsType: Omit, schemaOptions: { title: 'NewBillingCycle', exclude: [ 'id' ] })", + "description": "(tsType: FeatureWithRelations, schemaOptions: { includeRelations: true })", "properties": { "deleted": { "type": "boolean" @@ -3543,27 +4417,35 @@ "modifiedBy": { "type": "string" }, - "cycleName": { + "id": { "type": "string" }, - "duration": { - "type": "number" + "name": { + "type": "string", + "description": "name of the feature" }, - "durationUnit": { - "type": "string" + "properties": { + "type": "object", + "description": " properties of the feature" }, - "description": { + "serviceId": { "type": "string" - } + }, + "service": { + "$ref": "#/components/schemas/ServiceWithRelations" + }, + "foreignKey": {} }, - "required": ["cycleName", "duration", "durationUnit"], + "required": [ + "name" + ], "additionalProperties": false, - "x-typescript-type": "Omit" + "x-typescript-type": "FeatureWithRelations" }, - "BillingCyclePartial": { - "title": "BillingCyclePartial", + "FeaturePartial": { + "title": "FeaturePartial", "type": "object", - "description": "(tsType: Partial, schemaOptions: { partial: true })", + "description": "(tsType: Partial, schemaOptions: { partial: true })", "properties": { "deleted": { "type": "boolean" @@ -3594,33 +4476,135 @@ "id": { "type": "string" }, - "cycleName": { - "type": "string" + "name": { + "type": "string", + "description": "name of the feature" }, - "duration": { + "properties": { + "type": "object", + "description": " properties of the feature" + }, + "serviceId": { + "type": "string" + } + }, + "additionalProperties": false, + "x-typescript-type": "Partial" + }, + "loopback.Count": { + "type": "object", + "title": "loopback.Count", + "x-typescript-type": "@loopback/repository#Count", + "properties": { + "count": { "type": "number" + } + } + }, + "billing_cycles.Filter": { + "type": "object", + "title": "billing_cycles.Filter", + "properties": { + "offset": { + "type": "integer", + "minimum": 0 + }, + "limit": { + "type": "integer", + "minimum": 1, + "example": 100 + }, + "skip": { + "type": "integer", + "minimum": 0 }, - "durationUnit": { - "type": "string" + "order": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "description": { - "type": "string" + "fields": { + "oneOf": [ + { + "type": "object", + "properties": { + "deleted": { + "type": "boolean" + }, + "deletedOn": { + "type": "boolean" + }, + "deletedBy": { + "type": "boolean" + }, + "createdOn": { + "type": "boolean" + }, + "modifiedOn": { + "type": "boolean" + }, + "createdBy": { + "type": "boolean" + }, + "modifiedBy": { + "type": "boolean" + }, + "id": { + "type": "boolean" + }, + "cycleName": { + "type": "boolean" + }, + "duration": { + "type": "boolean" + }, + "durationUnit": { + "type": "boolean" + }, + "description": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "deleted", + "deletedOn", + "deletedBy", + "createdOn", + "modifiedOn", + "createdBy", + "modifiedBy", + "id", + "cycleName", + "duration", + "durationUnit", + "description" + ], + "example": "deleted" + }, + "uniqueItems": true + } + ], + "title": "billing_cycles.Fields" } }, "additionalProperties": false, - "x-typescript-type": "Partial" - }, - "loopback.Count": { - "type": "object", - "title": "loopback.Count", - "x-typescript-type": "@loopback/repository#Count", - "properties": { - "count": { - "type": "number" - } - } + "x-typescript-type": "@loopback/repository#Filter" }, - "billing_cycles.Filter": { + "billing_cycles.Filter1": { "type": "object", "title": "billing_cycles.Filter", "properties": { @@ -3650,6 +4634,11 @@ } ] }, + "where": { + "title": "billing_cycles.WhereFilter", + "type": "object", + "additionalProperties": true + }, "fields": { "oneOf": [ { @@ -3679,16 +4668,178 @@ "id": { "type": "boolean" }, - "cycleName": { + "cycleName": { + "type": "boolean" + }, + "duration": { + "type": "boolean" + }, + "durationUnit": { + "type": "boolean" + }, + "description": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "deleted", + "deletedOn", + "deletedBy", + "createdOn", + "modifiedOn", + "createdBy", + "modifiedBy", + "id", + "cycleName", + "duration", + "durationUnit", + "description" + ], + "example": "deleted" + }, + "uniqueItems": true + } + ], + "title": "billing_cycles.Fields" + } + }, + "additionalProperties": false, + "x-typescript-type": "@loopback/repository#Filter" + }, + "currencies.Filter": { + "type": "object", + "title": "currencies.Filter", + "properties": { + "offset": { + "type": "integer", + "minimum": 0 + }, + "limit": { + "type": "integer", + "minimum": 1, + "example": 100 + }, + "skip": { + "type": "integer", + "minimum": 0 + }, + "order": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "fields": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "boolean" + }, + "currencyCode": { + "type": "boolean" + }, + "currencyName": { + "type": "boolean" + }, + "symbol": { + "type": "boolean" + }, + "country": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "id", + "currencyCode", + "currencyName", + "symbol", + "country" + ], + "example": "id" + }, + "uniqueItems": true + } + ], + "title": "currencies.Fields" + } + }, + "additionalProperties": false, + "x-typescript-type": "@loopback/repository#Filter" + }, + "currencies.Filter1": { + "type": "object", + "title": "currencies.Filter", + "properties": { + "offset": { + "type": "integer", + "minimum": 0 + }, + "limit": { + "type": "integer", + "minimum": 1, + "example": 100 + }, + "skip": { + "type": "integer", + "minimum": 0 + }, + "order": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "where": { + "title": "currencies.WhereFilter", + "type": "object", + "additionalProperties": true + }, + "fields": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "boolean" + }, + "currencyCode": { "type": "boolean" }, - "duration": { + "currencyName": { "type": "boolean" }, - "durationUnit": { + "symbol": { "type": "boolean" }, - "description": { + "country": { "type": "boolean" } }, @@ -3699,33 +4850,25 @@ "items": { "type": "string", "enum": [ - "deleted", - "deletedOn", - "deletedBy", - "createdOn", - "modifiedOn", - "createdBy", - "modifiedBy", "id", - "cycleName", - "duration", - "durationUnit", - "description" + "currencyCode", + "currencyName", + "symbol", + "country" ], - "example": "deleted" + "example": "id" }, "uniqueItems": true } ], - "title": "billing_cycles.Fields" + "title": "currencies.Fields" } }, "additionalProperties": false, - "x-typescript-type": "@loopback/repository#Filter" + "x-typescript-type": "@loopback/repository#Filter" }, - "billing_cycles.Filter1": { + "features.ScopeFilter": { "type": "object", - "title": "billing_cycles.Filter", "properties": { "offset": { "type": "integer", @@ -3754,7 +4897,6 @@ ] }, "where": { - "title": "billing_cycles.WhereFilter", "type": "object", "additionalProperties": true }, @@ -3762,78 +4904,48 @@ "oneOf": [ { "type": "object", - "properties": { - "deleted": { - "type": "boolean" - }, - "deletedOn": { - "type": "boolean" - }, - "deletedBy": { - "type": "boolean" - }, - "createdOn": { - "type": "boolean" - }, - "modifiedOn": { - "type": "boolean" - }, - "createdBy": { - "type": "boolean" - }, - "modifiedBy": { - "type": "boolean" - }, - "id": { - "type": "boolean" - }, - "cycleName": { - "type": "boolean" - }, - "duration": { - "type": "boolean" - }, - "durationUnit": { - "type": "boolean" - }, - "description": { - "type": "boolean" - } - }, - "additionalProperties": false + "properties": {}, + "additionalProperties": true }, { "type": "array", "items": { - "type": "string", - "enum": [ - "deleted", - "deletedOn", - "deletedBy", - "createdOn", - "modifiedOn", - "createdBy", - "modifiedBy", - "id", - "cycleName", - "duration", - "durationUnit", - "description" - ], - "example": "deleted" + "type": "string" }, "uniqueItems": true } - ], - "title": "billing_cycles.Fields" + ] + }, + "include": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "additionalProperties": true + } } }, "additionalProperties": false, - "x-typescript-type": "@loopback/repository#Filter" + "title": "features.ScopeFilter" }, - "currencies.Filter": { + "features.IncludeFilter.Items": { + "title": "features.IncludeFilter.Items", "type": "object", - "title": "currencies.Filter", + "properties": { + "relation": { + "type": "string", + "enum": [ + "service" + ] + }, + "scope": { + "$ref": "#/components/schemas/features.ScopeFilter" + } + } + }, + "features.Filter": { + "type": "object", + "title": "features.Filter", "properties": { "offset": { "type": "integer", @@ -3866,19 +4978,37 @@ { "type": "object", "properties": { - "id": { + "deleted": { "type": "boolean" }, - "currencyCode": { + "deletedOn": { "type": "boolean" }, - "currencyName": { + "deletedBy": { "type": "boolean" }, - "symbol": { + "createdOn": { "type": "boolean" }, - "country": { + "modifiedOn": { + "type": "boolean" + }, + "createdBy": { + "type": "boolean" + }, + "modifiedBy": { + "type": "boolean" + }, + "id": { + "type": "boolean" + }, + "name": { + "type": "boolean" + }, + "properties": { + "type": "boolean" + }, + "serviceId": { "type": "boolean" } }, @@ -3889,26 +5019,46 @@ "items": { "type": "string", "enum": [ + "deleted", + "deletedOn", + "deletedBy", + "createdOn", + "modifiedOn", + "createdBy", + "modifiedBy", "id", - "currencyCode", - "currencyName", - "symbol", - "country" + "name", + "properties", + "serviceId" ], - "example": "id" + "example": "deleted" }, "uniqueItems": true } ], - "title": "currencies.Fields" + "title": "features.Fields" + }, + "include": { + "title": "features.IncludeFilter", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/features.IncludeFilter.Items" + }, + { + "type": "string" + } + ] + } } }, "additionalProperties": false, - "x-typescript-type": "@loopback/repository#Filter" + "x-typescript-type": "@loopback/repository#Filter" }, - "currencies.Filter1": { + "features.Filter1": { "type": "object", - "title": "currencies.Filter", + "title": "features.Filter", "properties": { "offset": { "type": "integer", @@ -3937,7 +5087,7 @@ ] }, "where": { - "title": "currencies.WhereFilter", + "title": "features.WhereFilter", "type": "object", "additionalProperties": true }, @@ -3946,19 +5096,37 @@ { "type": "object", "properties": { - "id": { + "deleted": { "type": "boolean" }, - "currencyCode": { + "deletedOn": { "type": "boolean" }, - "currencyName": { + "deletedBy": { "type": "boolean" }, - "symbol": { + "createdOn": { "type": "boolean" }, - "country": { + "modifiedOn": { + "type": "boolean" + }, + "createdBy": { + "type": "boolean" + }, + "modifiedBy": { + "type": "boolean" + }, + "id": { + "type": "boolean" + }, + "name": { + "type": "boolean" + }, + "properties": { + "type": "boolean" + }, + "serviceId": { "type": "boolean" } }, @@ -3969,22 +5137,42 @@ "items": { "type": "string", "enum": [ + "deleted", + "deletedOn", + "deletedBy", + "createdOn", + "modifiedOn", + "createdBy", + "modifiedBy", "id", - "currencyCode", - "currencyName", - "symbol", - "country" + "name", + "properties", + "serviceId" ], - "example": "id" + "example": "deleted" }, "uniqueItems": true } ], - "title": "currencies.Fields" + "title": "features.Fields" + }, + "include": { + "title": "features.IncludeFilter", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/features.IncludeFilter.Items" + }, + { + "type": "string" + } + ] + } } }, "additionalProperties": false, - "x-typescript-type": "@loopback/repository#Filter" + "x-typescript-type": "@loopback/repository#Filter" }, "PingResponse": { "type": "object", @@ -4077,7 +5265,9 @@ "properties": { "relation": { "type": "string", - "enum": ["plan"] + "enum": [ + "plan" + ] }, "scope": { "$ref": "#/components/schemas/plan_items.ScopeFilter" @@ -4390,7 +5580,11 @@ "properties": { "relation": { "type": "string", - "enum": ["planItems", "billingCycle", "currency"] + "enum": [ + "planItems", + "billingCycle", + "currency" + ] }, "scope": { "$ref": "#/components/schemas/plans.ScopeFilter" @@ -5109,7 +6303,9 @@ "properties": { "relation": { "type": "string", - "enum": ["plan"] + "enum": [ + "plan" + ] }, "scope": { "$ref": "#/components/schemas/subscriptions.ScopeFilter" @@ -5146,6 +6342,11 @@ } ] }, + "where": { + "title": "subscriptions.WhereFilter", + "type": "object", + "additionalProperties": true + }, "fields": { "oneOf": [ { @@ -5189,6 +6390,9 @@ }, "planId": { "type": "boolean" + }, + "planDetails": { + "type": "boolean" } }, "additionalProperties": false @@ -5210,7 +6414,8 @@ "startDate", "endDate", "status", - "planId" + "planId", + "planDetails" ], "example": "deleted" }, @@ -5267,11 +6472,6 @@ } ] }, - "where": { - "title": "subscriptions.WhereFilter", - "type": "object", - "additionalProperties": true - }, "fields": { "oneOf": [ { @@ -5315,6 +6515,9 @@ }, "planId": { "type": "boolean" + }, + "planDetails": { + "type": "boolean" } }, "additionalProperties": false @@ -5336,7 +6539,8 @@ "startDate", "endDate", "status", - "planId" + "planId", + "planDetails" ], "example": "deleted" }, @@ -5370,4 +6574,4 @@ "url": "/" } ] -} +} \ No newline at end of file diff --git a/services/subscription-service/src/repositories/feature.repository.ts b/services/subscription-service/src/repositories/feature.repository.ts new file mode 100644 index 0000000..efb95c5 --- /dev/null +++ b/services/subscription-service/src/repositories/feature.repository.ts @@ -0,0 +1,24 @@ +import {Getter, inject} from '@loopback/core'; +import { + DefaultUserModifyCrudRepository, + IAuthUserWithPermissions, +} from '@sourceloop/core'; +import {AuthenticationBindings} from 'loopback4-authentication'; +import {juggler} from '@loopback/repository'; +import {SubscriptionDbSourceName} from '../types'; +import {Feature, FeatureRelations} from '../models/feature.model'; + +export class FeatureRepository extends DefaultUserModifyCrudRepository< + Feature, + typeof Feature.prototype.id, + FeatureRelations +> { + constructor( + @inject(`datasources.${SubscriptionDbSourceName}`) + dataSource: juggler.DataSource, + @inject.getter(AuthenticationBindings.CURRENT_USER) + public readonly getCurrentUser: Getter, + ) { + super(Feature, dataSource, getCurrentUser); + } +} diff --git a/services/subscription-service/src/repositories/index.ts b/services/subscription-service/src/repositories/index.ts index 504174c..218499f 100644 --- a/services/subscription-service/src/repositories/index.ts +++ b/services/subscription-service/src/repositories/index.ts @@ -5,3 +5,4 @@ export * from './service.repository'; export * from './subscription.repository'; export * from './billing-cycle.repository'; export * from './currency.repository'; +export * from './feature.repository'; diff --git a/services/subscription-service/src/types.ts b/services/subscription-service/src/types.ts index 7f53cd8..a3e8c88 100644 --- a/services/subscription-service/src/types.ts +++ b/services/subscription-service/src/types.ts @@ -23,4 +23,13 @@ export type LeadUserWithToken = { } & LeadUser; export const SubscriptionDbSourceName = 'SubscriptionDB'; + +export interface IFeature { + name: string; + enabled: boolean; + [key: string]: Object; +} +export interface IService { + [key: string]: string | {[subKey: string]: IFeature[]}; +} // sonarignore:end diff --git a/services/tenant-management-service/src/types/i-subscription.interface.ts b/services/tenant-management-service/src/types/i-subscription.interface.ts index ce0f6f1..9d7d751 100644 --- a/services/tenant-management-service/src/types/i-subscription.interface.ts +++ b/services/tenant-management-service/src/types/i-subscription.interface.ts @@ -117,4 +117,5 @@ export interface IPlanItem { export interface IValue { name: string; value: number | string | boolean; + serviceId: string; }