oak-general-business/lib/entities/UserEntityGrant.d.ts

38 lines
1.2 KiB
TypeScript

import { String, Text, Datetime, Boolean } from 'oak-domain/lib/types/DataType';
import { Schema as User } from './User';
import { Schema as WechatQrCode } from './WechatQrCode';
import { QrCodeType } from '../types/Config';
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
import { Schema as UserEntityGrant } from 'oak-domain/lib/entities/UserEntityGrant';
export type RedirectToProps = {
pathname: string;
props?: Record<string, any>;
state?: Record<string, any>;
isTabBar?: boolean;
};
type Rule = 'single' | 'all' | 'free';
export interface Schema extends UserEntityGrant {
entity: String<32>;
entityId: String<64>;
type: 'grant' | 'transfer';
rule: Rule;
ruleOnRow: Rule;
multiple?: Boolean;
remark?: Text;
granter: User;
codes: Array<WechatQrCode>;
qrCodeType: QrCodeType;
expiresAt?: Datetime;
expired?: Boolean;
redirectTo?: RedirectToProps;
claimUrl: String<128>;
}
export type Action = 'claim' | 'disable';
export declare const entityDesc: EntityDesc<Schema, Action, '', {
type: Schema['type'];
qrCodeType: QrCodeType;
rule: Schema['rule'];
ruleOnRow: Schema['ruleOnRow'];
}>;
export {};