no more const enum, remove unused field

This commit is contained in:
Florian Dold 2020-09-02 11:21:42 +05:30
parent baaa11c37f
commit 0ffea74ad5
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
7 changed files with 23 additions and 35 deletions

View File

@ -37,7 +37,7 @@ import {
} from "./talerTypes"; } from "./talerTypes";
import { Timestamp, codecForTimestamp } from "../util/time"; import { Timestamp, codecForTimestamp } from "../util/time";
export const enum ReserveTransactionType { export enum ReserveTransactionType {
Withdraw = "WITHDRAW", Withdraw = "WITHDRAW",
Credit = "CREDIT", Credit = "CREDIT",
Recoup = "RECOUP", Recoup = "RECOUP",

View File

@ -151,7 +151,7 @@ export function initRetryInfo(
return info; return info;
} }
export const enum WalletReserveHistoryItemType { export enum WalletReserveHistoryItemType {
Credit = "credit", Credit = "credit",
Withdraw = "withdraw", Withdraw = "withdraw",
Closing = "closing", Closing = "closing",
@ -541,7 +541,7 @@ export interface ExchangeDetails {
lastUpdateTime: Timestamp; lastUpdateTime: Timestamp;
} }
export const enum ExchangeUpdateStatus { export enum ExchangeUpdateStatus {
FetchKeys = "fetch-keys", FetchKeys = "fetch-keys",
FetchWire = "fetch-wire", FetchWire = "fetch-wire",
FetchTerms = "fetch-terms", FetchTerms = "fetch-terms",
@ -558,15 +558,7 @@ export interface ExchangeWireInfo {
accounts: ExchangeBankAccount[]; accounts: ExchangeBankAccount[];
} }
/** export enum ExchangeUpdateReason {
* Summary of updates to the exchange.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ExchangeUpdateDiff {
// FIXME: implement!
}
export const enum ExchangeUpdateReason {
Initial = "initial", Initial = "initial",
Forced = "forced", Forced = "forced",
Scheduled = "scheduled", Scheduled = "scheduled",
@ -644,14 +636,10 @@ export interface ExchangeRecord {
updateReason?: ExchangeUpdateReason; updateReason?: ExchangeUpdateReason;
/**
* Update diff, will be incorporated when the update is finalized.
*/
updateDiff: ExchangeUpdateDiff | undefined;
lastError?: TalerErrorDetails; lastError?: TalerErrorDetails;
} }
/** /**
* A coin that isn't yet signed by an exchange. * A coin that isn't yet signed by an exchange.
*/ */
@ -721,7 +709,7 @@ export interface RefreshPlanchetRecord {
/** /**
* Status of a coin. * Status of a coin.
*/ */
export const enum CoinStatus { export enum CoinStatus {
/** /**
* Withdrawn and never shown to anybody. * Withdrawn and never shown to anybody.
*/ */
@ -732,7 +720,7 @@ export const enum CoinStatus {
Dormant = "dormant", Dormant = "dormant",
} }
export const enum CoinSourceType { export enum CoinSourceType {
Withdraw = "withdraw", Withdraw = "withdraw",
Refresh = "refresh", Refresh = "refresh",
Tip = "tip", Tip = "tip",
@ -827,7 +815,7 @@ export interface CoinRecord {
status: CoinStatus; status: CoinStatus;
} }
export const enum ProposalStatus { export enum ProposalStatus {
/** /**
* Not downloaded yet. * Not downloaded yet.
*/ */
@ -1170,7 +1158,7 @@ export interface RefundEventRecord {
proposalId: string; proposalId: string;
} }
export const enum RefundState { export enum RefundState {
Failed = "failed", Failed = "failed",
Applied = "applied", Applied = "applied",
Pending = "pending", Pending = "pending",
@ -1222,7 +1210,7 @@ export interface WalletRefundAppliedItem extends WalletRefundItemCommon {
type: RefundState.Applied; type: RefundState.Applied;
} }
export const enum RefundReason { export enum RefundReason {
/** /**
* Normal refund given by the merchant. * Normal refund given by the merchant.
*/ */
@ -1464,7 +1452,7 @@ export interface CoinsReturnRecord {
wire: any; wire: any;
} }
export const enum WithdrawalSourceType { export enum WithdrawalSourceType {
Tip = "tip", Tip = "tip",
Reserve = "reserve", Reserve = "reserve",
} }
@ -1613,7 +1601,7 @@ export interface RecoupGroupRecord {
lastError: TalerErrorDetails | undefined; lastError: TalerErrorDetails | undefined;
} }
export const enum ImportPayloadType { export enum ImportPayloadType {
CoreSchema = "core-schema", CoreSchema = "core-schema",
} }

View File

@ -25,7 +25,7 @@
import { TalerErrorDetails } from "./walletTypes"; import { TalerErrorDetails } from "./walletTypes";
import { WithdrawalSource } from "./dbTypes"; import { WithdrawalSource } from "./dbTypes";
export const enum NotificationType { export enum NotificationType {
CoinWithdrawn = "coin-withdrawn", CoinWithdrawn = "coin-withdrawn",
ProposalAccepted = "proposal-accepted", ProposalAccepted = "proposal-accepted",
ProposalDownloaded = "proposal-downloaded", ProposalDownloaded = "proposal-downloaded",

View File

@ -25,7 +25,7 @@ import { TalerErrorDetails, BalancesResponse } from "./walletTypes";
import { WithdrawalSource, RetryInfo, ReserveRecordStatus } from "./dbTypes"; import { WithdrawalSource, RetryInfo, ReserveRecordStatus } from "./dbTypes";
import { Timestamp, Duration } from "../util/time"; import { Timestamp, Duration } from "../util/time";
export const enum PendingOperationType { export enum PendingOperationType {
Bug = "bug", Bug = "bug",
ExchangeUpdate = "exchange-update", ExchangeUpdate = "exchange-update",
Pay = "pay", Pay = "pay",
@ -84,13 +84,13 @@ export interface PendingBugOperation {
/** /**
* Current state of an exchange update operation. * Current state of an exchange update operation.
*/ */
export const enum ExchangeUpdateOperationStage { export enum ExchangeUpdateOperationStage {
FetchKeys = "fetch-keys", FetchKeys = "fetch-keys",
FetchWire = "fetch-wire", FetchWire = "fetch-wire",
FinalizeUpdate = "finalize-update", FinalizeUpdate = "finalize-update",
} }
export const enum ReserveType { export enum ReserveType {
/** /**
* Manually created. * Manually created.
*/ */

View File

@ -96,7 +96,7 @@ export type Transaction =
| TransactionTip | TransactionTip
| TransactionRefresh; | TransactionRefresh;
export const enum TransactionType { export enum TransactionType {
Withdrawal = "withdrawal", Withdrawal = "withdrawal",
Payment = "payment", Payment = "payment",
Refund = "refund", Refund = "refund",
@ -104,7 +104,7 @@ export const enum TransactionType {
Tip = "tip", Tip = "tip",
} }
export const enum WithdrawalType { export enum WithdrawalType {
TalerBankIntegrationApi = "taler-bank-integration-api", TalerBankIntegrationApi = "taler-bank-integration-api",
ManualTransfer = "manual-transfer", ManualTransfer = "manual-transfer",
} }
@ -164,7 +164,7 @@ interface TransactionWithdrawal extends TransactionCommon {
withdrawalDetails: WithdrawalDetails; withdrawalDetails: WithdrawalDetails;
} }
export const enum PaymentStatus { export enum PaymentStatus {
/** /**
* Explicitly aborted after timeout / failure * Explicitly aborted after timeout / failure
*/ */

View File

@ -202,7 +202,7 @@ export function mkAmount(
return { value, fraction, currency }; return { value, fraction, currency };
} }
export const enum ConfirmPayResultType { export enum ConfirmPayResultType {
Done = "done", Done = "done",
Pending = "pending", Pending = "pending",
} }
@ -370,7 +370,7 @@ export interface BenchmarkResult {
repetitions: number; repetitions: number;
} }
export const enum PreparePayResultType { export enum PreparePayResultType {
PaymentPossible = "payment-possible", PaymentPossible = "payment-possible",
InsufficientBalance = "insufficient-balance", InsufficientBalance = "insufficient-balance",
AlreadyConfirmed = "already-confirmed", AlreadyConfirmed = "already-confirmed",
@ -529,7 +529,7 @@ export interface PlanchetCreationRequest {
/** /**
* Reasons for why a coin is being refreshed. * Reasons for why a coin is being refreshed.
*/ */
export const enum RefreshReason { export enum RefreshReason {
Manual = "manual", Manual = "manual",
Pay = "pay", Pay = "pay",
Refund = "refund", Refund = "refund",

View File

@ -64,7 +64,7 @@ export function parseWithdrawUri(s: string): WithdrawUriResult | undefined {
}; };
} }
export const enum TalerUriType { export enum TalerUriType {
TalerPay = "taler-pay", TalerPay = "taler-pay",
TalerWithdraw = "taler-withdraw", TalerWithdraw = "taler-withdraw",
TalerTip = "taler-tip", TalerTip = "taler-tip",