github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/Decentralized-Energy-Composer-master/angular-app/src/app/org.decentralized.energy.network.ts (about)

     1  import {Asset} from './org.hyperledger.composer.system';
     2  import {Participant} from './org.hyperledger.composer.system';
     3  import {Transaction} from './org.hyperledger.composer.system';
     4  import {Event} from './org.hyperledger.composer.system';
     5  // export namespace org.decentralized.energy.network{
     6     export class Resident extends Participant {
     7        residentID: string;
     8        firstName: string;
     9        lastName: string;
    10        coins: Coins;
    11        cash: Cash;
    12        energy: Energy;
    13     }
    14     export class Bank extends Participant {
    15        bankID: string;
    16        name: string;
    17        coins: Coins;
    18        cash: Cash;
    19     }
    20     export class UtilityCompany extends Participant {
    21        utilityID: string;
    22        name: string;
    23        coins: Coins;
    24        energy: Energy;
    25     }
    26     export enum OwnerEntity {
    27        Resident,
    28        Bank,
    29        UtilityCompany,
    30     }
    31     export class Coins extends Asset {
    32        coinsID: string;
    33        value: number;
    34        ownerID: string;
    35        ownerEntity: OwnerEntity;
    36     }
    37     export class Energy extends Asset {
    38        energyID: string;
    39        units: string;
    40        value: number;
    41        ownerID: string;
    42        ownerEntity: OwnerEntity;
    43     }
    44     export class Cash extends Asset {
    45        cashID: string;
    46        currency: string;
    47        value: number;
    48        ownerID: string;
    49        ownerEntity: OwnerEntity;
    50     }
    51     export class EnergyToCoins extends Transaction {
    52        energyRate: number;
    53        energyValue: number;
    54        coinsInc: Coins;
    55        coinsDec: Coins;
    56        energyInc: Energy;
    57        energyDec: Energy;
    58     }
    59     export class CashToCoins extends Transaction {
    60        cashRate: number;
    61        cashValue: number;
    62        coinsInc: Coins;
    63        coinsDec: Coins;
    64        cashInc: Cash;
    65        cashDec: Cash;
    66     }   
    67  // }