fas-admin 0.0.117 → 0.0.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/views/subscriptions/subscription-form/badge-price.mjs +38 -0
- package/esm2022/lib/components/views/subscriptions/subscription-form/subscription-form.component.mjs +46 -4
- package/esm2022/lib/components/views/subscriptions/subscriptions-list/subscriptions-list.component.mjs +4 -2
- package/esm2022/lib/shared/tokens/subscription-price-kind.token.mjs +12 -0
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/fas-admin.mjs +95 -5
- package/fesm2022/fas-admin.mjs.map +1 -1
- package/lib/components/views/subscriptions/subscription-form/badge-price.d.ts +15 -0
- package/lib/components/views/subscriptions/subscription-form/subscription-form.component.d.ts +12 -0
- package/lib/components/views/subscriptions/subscriptions-list/subscriptions-list.component.d.ts +1 -0
- package/lib/shared/tokens/subscription-price-kind.token.d.ts +11 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface BadgePriceMismatch {
|
|
2
|
+
/** The amount as it is written in the badge, e.g. "9,99". */
|
|
3
|
+
written: string;
|
|
4
|
+
/** The price of the plan in the badge's own notation, e.g. "12,99". */
|
|
5
|
+
expected: string;
|
|
6
|
+
/** The badge with only its amount replaced by the price. */
|
|
7
|
+
correctedBadge: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The offer tile of the application shows the amount written in the badge
|
|
11
|
+
* ("9,99 / jednorazowo"), while the customer is charged the plan's price.
|
|
12
|
+
* Returns what differs when the two do not agree, or null when they do or
|
|
13
|
+
* when the badge carries no amount at all.
|
|
14
|
+
*/
|
|
15
|
+
export declare function badgePriceMismatch(badgeText: string | null | undefined, value: number | null | undefined): BadgePriceMismatch | null;
|
package/lib/components/views/subscriptions/subscription-form/subscription-form.component.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
2
2
|
import { IPlatformSubscriptionPlanVm } from '../../../../../api/platform-subscription-plan-vm.model';
|
|
3
3
|
import { IDynamicForm } from '../../../../shared/models/form';
|
|
4
|
+
import { BadgePriceMismatch } from './badge-price';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class SubscriptionFormComponent {
|
|
6
7
|
subscriptionDetailsFormGroup: FormGroup;
|
|
@@ -9,11 +10,22 @@ export declare class SubscriptionFormComponent {
|
|
|
9
10
|
get fc(): {
|
|
10
11
|
[key: string]: FormControl;
|
|
11
12
|
};
|
|
13
|
+
private priceKind;
|
|
12
14
|
formFields: IDynamicForm[];
|
|
15
|
+
private patchingForm;
|
|
13
16
|
editMode: import("@angular/core").ModelSignal<boolean>;
|
|
14
17
|
currentSubscriptionData: import("@angular/core").ModelSignal<IPlatformSubscriptionPlanVm | null>;
|
|
15
18
|
constructor();
|
|
16
19
|
ngOnInit(): void;
|
|
20
|
+
/** Set while the amount in the badge differs from the price of the plan. */
|
|
21
|
+
get badgePriceWarning(): BadgePriceMismatch | null;
|
|
22
|
+
fixBadgeText(): void;
|
|
23
|
+
/**
|
|
24
|
+
* While the operator edits the price, a badge that agreed with the old
|
|
25
|
+
* price follows the new one; a badge that already differed is left alone
|
|
26
|
+
* and stays flagged by the warning.
|
|
27
|
+
*/
|
|
28
|
+
private keepBadgeInStepWithPrice;
|
|
17
29
|
trimInput(controlName: string): void;
|
|
18
30
|
private buildForm;
|
|
19
31
|
patchFormValues(): void;
|
package/lib/components/views/subscriptions/subscriptions-list/subscriptions-list.component.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare class SubscriptionsListComponent implements OnInit {
|
|
|
9
9
|
private _platformAvailableSubscriptionPlansService;
|
|
10
10
|
private _platformSubscriptionUsageService;
|
|
11
11
|
private _messageService;
|
|
12
|
+
private priceKind;
|
|
12
13
|
subscriptionPlansLoading: boolean;
|
|
13
14
|
showUserTable: boolean;
|
|
14
15
|
resetUserTableTrigger: Subject<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/** Czym jest cena abonamentu (`value`) w danej aplikacji: kwotą netto czy brutto. */
|
|
3
|
+
export type FasSubscriptionPriceKind = 'net' | 'gross';
|
|
4
|
+
/**
|
|
5
|
+
* Podpis ceny abonamentu w widoku Abonamenty. Bez ustawienia cena jest opisana jako netto.
|
|
6
|
+
* Aplikacja, która pobiera od klienta dokładnie `value` (bez doliczania VAT), ustawia brutto:
|
|
7
|
+
* `{ provide: FAS_SUBSCRIPTION_PRICE_KIND, useValue: 'gross' }` w providers aplikacji.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FAS_SUBSCRIPTION_PRICE_KIND: InjectionToken<FasSubscriptionPriceKind>;
|
|
10
|
+
/** "netto" albo "brutto" - do podpisów pól i kolumn z ceną abonamentu. */
|
|
11
|
+
export declare function subscriptionPriceKindLabel(kind: FasSubscriptionPriceKind | null | undefined): string;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export * from './lib/shared/const/fas-default-config';
|
|
|
4
4
|
export * from './api/models/api-url.token';
|
|
5
5
|
export * from './api/platform-user-account-vm.model';
|
|
6
6
|
export * from './lib/shared/tokens/users-list-extra-columns.token';
|
|
7
|
+
export * from './lib/shared/tokens/subscription-price-kind.token';
|
|
7
8
|
export * from './lib/fas-admin.service';
|
|
8
9
|
export * from './lib/fas-admin.module';
|