Feature/add prefix to coupon codes (#1562)

* Add prefix

* Update changelog
pull/1563/head
Thomas Kaul 2 years ago committed by GitHub
parent d97fe4da9c
commit 8818e09be8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Added a prefix to the codes of the coupon system
## 1.222.0 - 2022-12-29
### Added

@ -4,6 +4,7 @@ import { CacheService } from '@ghostfolio/client/services/cache.service';
import { DataService } from '@ghostfolio/client/services/data.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import {
ghostfolioPrefix,
PROPERTY_COUPONS,
PROPERTY_CURRENCIES,
PROPERTY_IS_READ_ONLY_MODE,
@ -97,7 +98,10 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
public onAddCoupon() {
const coupons = [
...this.coupons,
{ code: this.generateCouponCode(16), duration: this.couponDuration }
{
code: `${ghostfolioPrefix}${this.generateCouponCode(14)}`,
duration: this.couponDuration
}
];
this.putAdminSetting({ key: PROPERTY_COUPONS, value: coupons });
}

@ -4,7 +4,8 @@ import ms from 'ms';
export const DEMO_USER_ID = '9b112b4d-3b7d-4bad-9bdd-3b0f7b4dac2f';
export const ghostfolioScraperApiSymbolPrefix = '_GF_';
export const ghostfolioPrefix = 'GF';
export const ghostfolioScraperApiSymbolPrefix = `_${ghostfolioPrefix}_`;
export const ghostfolioCashSymbol = `${ghostfolioScraperApiSymbolPrefix}CASH`;
export const ghostfolioFearAndGreedIndexDataSource = DataSource.RAPID_API;
export const ghostfolioFearAndGreedIndexSymbol = `${ghostfolioScraperApiSymbolPrefix}FEAR_AND_GREED_INDEX`;

Loading…
Cancel
Save