refactor(private-zone): use canonical product name
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
|
||||
import type { PrivateAlbum } from "@/data/schemas/private-zone";
|
||||
|
||||
export interface PrivateZoneUnlockPaywallRequest {
|
||||
albumId: string;
|
||||
reason: string;
|
||||
requiredCredits: number;
|
||||
currentCredits: number;
|
||||
shortfallCredits: number;
|
||||
}
|
||||
|
||||
export interface PrivateZoneState {
|
||||
characterId: string;
|
||||
items: readonly PrivateAlbum[];
|
||||
creditBalance: number;
|
||||
errorMessage: string | null;
|
||||
unlockingAlbumId: string | null;
|
||||
unlockErrorMessage: string | null;
|
||||
pendingConfirmAlbumId: string | null;
|
||||
unlockPaywallRequest: PrivateZoneUnlockPaywallRequest | null;
|
||||
unlockSuccessNonce: number;
|
||||
}
|
||||
|
||||
export function createInitialPrivateZoneState(
|
||||
characterId: string,
|
||||
): PrivateZoneState {
|
||||
return {
|
||||
characterId,
|
||||
items: [],
|
||||
creditBalance: 0,
|
||||
errorMessage: null,
|
||||
unlockingAlbumId: null,
|
||||
unlockErrorMessage: null,
|
||||
pendingConfirmAlbumId: null,
|
||||
unlockPaywallRequest: null,
|
||||
unlockSuccessNonce: 0,
|
||||
};
|
||||
}
|
||||
|
||||
export const initialState = createInitialPrivateZoneState(DEFAULT_CHARACTER_ID);
|
||||
Reference in New Issue
Block a user