-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
244 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
apps/backend-bff/src/app/remoteOffer/remote.offer.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Controller, Get } from "@nestjs/common"; | ||
import { container, Offer, OfferService, TYPES } from "@spos/services/common"; | ||
import { ApiProperty, ApiTags } from "@nestjs/swagger"; | ||
|
||
|
||
class AnnotatedOffer implements Offer { | ||
@ApiProperty() | ||
availableItems: string[]; | ||
@ApiProperty() | ||
name: string; | ||
} | ||
|
||
@Controller('remoteOffer') | ||
@ApiTags('remoteOffer') | ||
export class RemoteOfferController { | ||
@Get() | ||
async getOffers(): Promise<AnnotatedOffer[]> { | ||
return container.get<OfferService>(TYPES.OfferService).getOffers(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"openapi":"3.0.0","paths":{"/api/test":{"get":{"operationId":"AppController_getData","parameters":[],"responses":{"200":{"description":""}}}},"/api/remoteGroup":{"get":{"operationId":"RemoteGroupController_getGroups","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AnnotatedGroup"}}}}}},"tags":["remoteGroup"]},"post":{"operationId":"RemoteGroupController_addGroup","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotatedGroupCreateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotatedGroup"}}}}},"tags":["remoteGroup"]}},"/api/remoteGroup/{id}":{"get":{"operationId":"RemoteGroupController_getGroup","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotatedGroup"}}}}},"tags":["remoteGroup"]}},"/api/remoteTable":{"get":{"operationId":"RemoteTableController_getFreeTables","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AnnotatedTableWithOrderDto"}}}}}},"tags":["remoteTable"]},"post":{"operationId":"RemoteTableController_closeAllTables","parameters":[],"responses":{"201":{"description":""}},"tags":["remoteTable"]}},"/api/remoteCatalogue/filteredCatalog":{"get":{"operationId":"RemoteCatalogueController_getFilteredCatalog","parameters":[{"name":"offerName","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategorizedCatalogDto"}}}}},"tags":["remoteCatalogue"]}},"/api/remoteCatalogue/items":{"get":{"operationId":"RemoteCatalogueController_getFullItemFromItemIdsArray","parameters":[{"name":"ids","required":true,"in":"query","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MenuItemDto"}}}}}},"tags":["remoteCatalogue"]}}},"info":{"title":"BFF API","description":"Backend For Frontend API","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"TableDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"customerCount":{"type":"number"}},"required":["id","number","customerCount"]},"AnnotatedGroup":{"type":"object","properties":{"id":{"type":"string"},"tables":{"type":"array","items":{"$ref":"#/components/schemas/TableDto"}},"offer":{"type":"string"}},"required":["id","tables","offer"]},"AnnotatedCreateTableDto":{"type":"object","properties":{"number":{"type":"number"},"customerCount":{"type":"number"}},"required":["number","customerCount"]},"AnnotatedGroupCreateDto":{"type":"object","properties":{"offer":{"type":"string"},"tables":{"type":"array","items":{"$ref":"#/components/schemas/AnnotatedCreateTableDto"}}},"required":["offer","tables"]},"AnnotatedTableWithOrderDto":{"type":"object","properties":{"_id":{"type":"string"},"number":{"type":"number"},"tableOrderId":{"type":"string"},"taken":{"type":"boolean"}},"required":["_id","number","tableOrderId","taken"]},"CategorizedCatalogDto":{"type":"object","properties":{"categories":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/MenuItemDto"}}}},"required":["categories"]},"MenuItemDto":{"type":"object","properties":{"_id":{"type":"string"},"fullName":{"type":"string"},"shortName":{"type":"string"},"price":{"type":"number"},"category":{"type":"string","enum":["STARTER","MAIN","DESSERT","BEVERAGE"]},"image":{"type":"string"}},"required":["_id","fullName","shortName","price","category","image"]}}}} | ||
{"openapi":"3.0.0","paths":{"/api/test":{"get":{"operationId":"AppController_getData","parameters":[],"responses":{"200":{"description":""}}}},"/api/remoteGroup":{"get":{"operationId":"RemoteGroupController_getGroups","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AnnotatedGroup"}}}}}},"tags":["remoteGroup"]},"post":{"operationId":"RemoteGroupController_addGroup","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotatedGroupCreateDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotatedGroup"}}}}},"tags":["remoteGroup"]}},"/api/remoteGroup/{id}":{"get":{"operationId":"RemoteGroupController_getGroup","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotatedGroup"}}}}},"tags":["remoteGroup"]}},"/api/remoteTable":{"get":{"operationId":"RemoteTableController_getFreeTables","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AnnotatedTableWithOrderDto"}}}}}},"tags":["remoteTable"]},"post":{"operationId":"RemoteTableController_closeAllTables","parameters":[],"responses":{"201":{"description":""}},"tags":["remoteTable"]}},"/api/remoteOffer":{"get":{"operationId":"RemoteOfferController_getOffers","parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AnnotatedOffer"}}}}}},"tags":["remoteOffer"]}},"/api/remoteCatalogue/filteredCatalog":{"get":{"operationId":"RemoteCatalogueController_getFilteredCatalog","parameters":[{"name":"offerName","required":true,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategorizedCatalogDto"}}}}},"tags":["remoteCatalogue"]}},"/api/remoteCatalogue/items":{"get":{"operationId":"RemoteCatalogueController_getFullItemFromItemIdsArray","parameters":[{"name":"ids","required":true,"in":"query","schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MenuItemDto"}}}}}},"tags":["remoteCatalogue"]}}},"info":{"title":"BFF API","description":"Backend For Frontend API","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"schemas":{"TableDto":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"customerCount":{"type":"number"}},"required":["id","number","customerCount"]},"AnnotatedGroup":{"type":"object","properties":{"id":{"type":"string"},"tables":{"type":"array","items":{"$ref":"#/components/schemas/TableDto"}},"offer":{"type":"string"}},"required":["id","tables","offer"]},"AnnotatedCreateTableDto":{"type":"object","properties":{"number":{"type":"number"},"customerCount":{"type":"number"}},"required":["number","customerCount"]},"AnnotatedGroupCreateDto":{"type":"object","properties":{"offer":{"type":"string"},"tables":{"type":"array","items":{"$ref":"#/components/schemas/AnnotatedCreateTableDto"}}},"required":["offer","tables"]},"AnnotatedTableWithOrderDto":{"type":"object","properties":{"_id":{"type":"string"},"number":{"type":"number"},"tableOrderId":{"type":"string"},"taken":{"type":"boolean"}},"required":["_id","number","tableOrderId","taken"]},"AnnotatedOffer":{"type":"object","properties":{"availableItems":{"type":"array","items":{"type":"string"}},"name":{"type":"string"}},"required":["availableItems","name"]},"CategorizedCatalogDto":{"type":"object","properties":{"categories":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/MenuItemDto"}}}},"required":["categories"]},"MenuItemDto":{"type":"object","properties":{"_id":{"type":"string"},"fullName":{"type":"string"},"shortName":{"type":"string"},"price":{"type":"number"},"category":{"type":"string","enum":["STARTER","MAIN","DESSERT","BEVERAGE"]},"image":{"type":"string"}},"required":["_id","fullName","shortName","price","category","image"]}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* BFF API | ||
* Backend For Frontend API | ||
* | ||
* The version of the OpenAPI document: 1.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
import type { Configuration } from '../configuration'; | ||
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; | ||
import globalAxios from 'axios'; | ||
// Some imports not used depending on template conditions | ||
// @ts-ignore | ||
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; | ||
// @ts-ignore | ||
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; | ||
// @ts-ignore | ||
import type { AnnotatedOffer } from '../models'; | ||
/** | ||
* RemoteOfferApi - axios parameter creator | ||
* @export | ||
*/ | ||
export const RemoteOfferApiAxiosParamCreator = function (configuration?: Configuration) { | ||
return { | ||
/** | ||
* | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
remoteOfferControllerGetOffers: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { | ||
const localVarPath = `/api/remoteOffer`; | ||
// use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); | ||
let baseOptions; | ||
if (configuration) { | ||
baseOptions = configuration.baseOptions; | ||
} | ||
|
||
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; | ||
const localVarHeaderParameter = {} as any; | ||
const localVarQueryParameter = {} as any; | ||
|
||
|
||
|
||
setSearchParams(localVarUrlObj, localVarQueryParameter); | ||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; | ||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; | ||
|
||
return { | ||
url: toPathString(localVarUrlObj), | ||
options: localVarRequestOptions, | ||
}; | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* RemoteOfferApi - functional programming interface | ||
* @export | ||
*/ | ||
export const RemoteOfferApiFp = function(configuration?: Configuration) { | ||
const localVarAxiosParamCreator = RemoteOfferApiAxiosParamCreator(configuration) | ||
return { | ||
/** | ||
* | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async remoteOfferControllerGetOffers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<AnnotatedOffer>>> { | ||
const localVarAxiosArgs = await localVarAxiosParamCreator.remoteOfferControllerGetOffers(options); | ||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; | ||
const localVarOperationServerBasePath = operationServerMap['RemoteOfferApi.remoteOfferControllerGetOffers']?.[localVarOperationServerIndex]?.url; | ||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* RemoteOfferApi - factory interface | ||
* @export | ||
*/ | ||
export const RemoteOfferApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { | ||
const localVarFp = RemoteOfferApiFp(configuration) | ||
return { | ||
/** | ||
* | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
remoteOfferControllerGetOffers(options?: RawAxiosRequestConfig): AxiosPromise<Array<AnnotatedOffer>> { | ||
return localVarFp.remoteOfferControllerGetOffers(options).then((request) => request(axios, basePath)); | ||
}, | ||
}; | ||
}; | ||
|
||
/** | ||
* RemoteOfferApi - object-oriented interface | ||
* @export | ||
* @class RemoteOfferApi | ||
* @extends {BaseAPI} | ||
*/ | ||
export class RemoteOfferApi extends BaseAPI { | ||
/** | ||
* | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
* @memberof RemoteOfferApi | ||
*/ | ||
public remoteOfferControllerGetOffers(options?: RawAxiosRequestConfig) { | ||
return RemoteOfferApiFp(this.configuration).remoteOfferControllerGetOffers(options).then((request) => request(this.axios, this.basePath)); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* BFF API | ||
* Backend For Frontend API | ||
* | ||
* The version of the OpenAPI document: 1.0 | ||
* | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
* https://openapi-generator.tech | ||
* Do not edit the class manually. | ||
*/ | ||
|
||
|
||
|
||
/** | ||
* | ||
* @export | ||
* @interface AnnotatedOffer | ||
*/ | ||
export interface AnnotatedOffer { | ||
/** | ||
* | ||
* @type {Array<string>} | ||
* @memberof AnnotatedOffer | ||
*/ | ||
'availableItems': Array<string>; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof AnnotatedOffer | ||
*/ | ||
'name': string; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.