// 假设 NotificationObject 类的定义如下
class NotificationObject {
    protected raisePropertyChanged(propertyName: string) {
        // 这里可以实现属性变更通知的逻辑
        console.log(`Property ${propertyName} has changed.`);
    }
}

// 假设 TradeModelHelper 类的定义如下
class TradeModelHelper {
    static GetMetadata(model: TradeModel): { [key: string]: string } {
        // 实现获取元数据的逻辑
        return {};
    }

    static SetMetadata(model: TradeModel, dic: { [key: string]: string }) {
        // 实现设置元数据的逻辑
    }

    static GetRight(model: TradeModel): string[] {
        // 实现获取权限的逻辑
        return [];
    }

    static SetRight(model: TradeModel, right: string[]) {
        // 实现设置权限的逻辑
    }
}

class TradeModel extends NotificationObject {
    private _guid: string;
    private _name: string;
    private _code: string;
    private _action: string;
    private _type: string;
    private _parentID: string;

    get GUID(): string {
        return this._guid;
    }

    set GUID(value: string) {
        this._guid = value;
    }

    get Name(): string {
        return this._name;
    }

    set Name(value: string) {
        this._name = value;
        this.raisePropertyChanged("Name");
    }

    get Code(): string {
        return this._code;
    }

    set Code(value: string) {
        this._code = value;
        this.raisePropertyChanged("Code");
    }

    get Action(): string {
        return this._action;
    }

    set Action(value: string) {
        this._action = value;
    }

    get Metadata(): { [key: string]: string } {
        return TradeModelHelper.GetMetadata(this);
    }

    SetMetadata(dic: { [key: string]: string }) {
        TradeModelHelper.SetMetadata(this, dic);
    }

    get Right(): string[] {
        return TradeModelHelper.GetRight(this);
    }

    SetRight(right: string[]) {
        TradeModelHelper.SetRight(this, right);
    }

    get Type(): string {
        return this._type;
    }

    set Type(value: string) {
        this._type = value;
    }

    get ParentID(): string {
        return this._parentID;
    }

    set ParentID(value: string) {
        this._parentID = value;
    }

    constructor() {
        super();
    }
}

export default TradeModel;