This commit is contained in:
2026-04-30 01:17:17 +04:00
parent dc0f0409af
commit ed78bb603b
24 changed files with 1554 additions and 410 deletions

View File

@@ -0,0 +1,28 @@
import { Injectable, signal } from '@angular/core';
export interface FastcheckData {
fastcheck: string;
amount: number;
code: string;
expiration?: string;
}
/**
* Shared state between the home (Fastcheck) page and the create-new page.
* When a new fastcheck is created via POST /fastcheck, the create page stores
* the returned data here and the home page reads it to autofill its fields.
*/
@Injectable({ providedIn: 'root' })
export class FastcheckService {
readonly created = signal<FastcheckData | null>(null);
setCreated(data: FastcheckData): void {
this.created.set(data);
}
consume(): FastcheckData | null {
const value = this.created();
this.created.set(null);
return value;
}
}