Skip to content

Commit

Permalink
chore: add support for PAYG billing
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Oct 29, 2024
1 parent ba4ba85 commit 473c9a6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/component/menu/Footer/ApiDetails/ApiDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ interface IApiDetailsProps {
export const ApiDetails = (props: IApiDetailsProps): ReactElement => {
const instanceId = props.uiConfig.versionInfo?.instanceId;
const { name, version, buildNumber } = formatCurrentVersion(props.uiConfig);
const environment = props.uiConfig.environment;
const { environment, billing } = props.uiConfig;
const updateNotification = formatUpdateNotification(props.uiConfig);

const buildInfo = buildNumber ? <small>({buildNumber})</small> : '';
return (
<section title='API details'>
<FooterTitle>
{name} {environment ? environment : ''} {version} {buildInfo}
{name} {environment ? environment : ''}{' '}
{billing === 'pay-as-you-go' ? 'Pay-as-You-Go' : ''} {version}{' '}
{buildInfo}
</FooterTitle>
<ConditionallyRender
condition={Boolean(updateNotification)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IPartialUiConfig {
version: string;
slogan?: string;
environment?: string;
billing?: string;
versionInfo?: IVersionInfo;
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface IUiConfig {
name: string;
slogan: string;
environment?: string;
billing?: 'subscription' | 'pay-as-you-go';
unleashUrl?: string;
version: string;
versionInfo?: IVersionInfo;
Expand Down
6 changes: 6 additions & 0 deletions src/lib/openapi/spec/ui-config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export const uiConfigSchema = {
'What kind of Unleash instance it is: Enterprise, Pro, or Open source',
example: 'Enterprise',
},
billing: {
type: 'string',
description: 'The billing model in use for this Unleash instance.',
example: 'subscription',
enum: ['subscription', 'pay-as-you-go'],
},
unleashUrl: {
type: 'string',
description: 'The URL of the Unleash instance.',
Expand Down

0 comments on commit 473c9a6

Please sign in to comment.