Bloks

Blok rea

class anyblok_rea.bloks.rea.REABlok(registry)

Bases: anyblok.blok.Blok

Base entity REA blok

author = 'ANDRE Simon'
conditional_by = []
conflicting_by = []
classmethod import_declaration_module()
name = 'rea'
optional_by = []
classmethod reload_declaration_module(reload)
required = ['anyblok-core']
required_by = ['rea-commitment', 'rea-group']
version = '0.0.1'

API doc

class anyblok_rea.bloks.rea.entity.Entity

Bases: object

Declaration type:
 Model
Registry name:Model.REA.Entity
Tablename:rea_entity
Inherit model or mixin:
 
field name Description
entity_type
  • is crypted - False
  • Field type - <class ‘anyblok.column.String’>
  • size - 64
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • Label - Entity type
  • foreign_key - None
  • DB column name - None
id
  • autoincrement - True
  • is crypted - False
  • Field type - <class ‘anyblok.column.Integer’>
  • primary_key - True
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • DB column name - None
  • Label - None
  • foreign_key - None
class anyblok_rea.bloks.rea.entity.Resource

Bases: anyblok.model.Entity

Economic Resource is a thing that is scarce, and has utility for economic agents, and is something users of business applications want to plan, monitor, and control. Examples of economic resources are products and services, money, raw materials, labor, tools, and services the enterprise uses.

Just like agents, Resources contain an ID and Name. In addition a re- source has a Value which is defined as the value in US dollars of a single unit of the resource, i.e., the price of a single pizza

# Model-Driven Design Using Business Patterns # Authors: Hruby, Pavel # ISBN-10 3-540-30154-2 Springer Berlin Heidelberg New York # ISBN-13 978-3-540-30154-7 Springer Berlin Heidelberg New York

Declaration type:
 

Model

Registry name:

Model.REA.Resource

Tablename:

rea_resource

Inherit model or mixin:
 
  • <class ‘anyblok.model.Entity’>
field name Description
id
  • autoincrement - True
  • is crypted - False
  • Field type - <class ‘anyblok.column.Integer’>
  • primary_key - True
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • DB column name - None
  • Label - None
  • foreign_key - Model.REA.Entity => id
class anyblok_rea.bloks.rea.entity.Agent

Bases: anyblok.model.Entity

Economic Agent is an individual or organization capable of having control over economic resources, and transferring or receiving the control to or from other individuals or organizations. Examples of economic agents are customers, vendors, employees, and enterprises. The enterprise is an economic agent from whose perspective we create the REA model.

# Model-Driven Design Using Business Patterns # Authors: Hruby, Pavel # ISBN-10 3-540-30154-2 Springer Berlin Heidelberg New York # ISBN-13 978-3-540-30154-7 Springer Berlin Heidelberg New York

Declaration type:
 

Model

Registry name:

Model.REA.Agent

Tablename:

rea_agent

Inherit model or mixin:
 
  • <class ‘anyblok.model.Entity’>
field name Description
id
  • autoincrement - True
  • is crypted - False
  • Field type - <class ‘anyblok.column.Integer’>
  • primary_key - True
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • DB column name - None
  • Label - None
  • foreign_key - Model.REA.Entity => id
class anyblok_rea.bloks.rea.entity.IncrementEvent

Bases: anyblok.model.Entity

Economic Event represents either an increment or a decrement in the value of economic resources that are under the control of the enterprise. Some economic events occur instantaneously, such as sales of goods; some occur over time, such as rentals, labor acquisition, and provision and use of services.

# Model-Driven Design Using Business Patterns # Authors: Hruby, Pavel # ISBN-10 3-540-30154-2 Springer Berlin Heidelberg New York # ISBN-13 978-3-540-30154-7 Springer Berlin Heidelberg New York

Declaration type:
 

Model

Registry name:

Model.REA.IncrementEvent

Tablename:

rea_incrementevent

Inherit model or mixin:
 
  • <class ‘anyblok.model.Entity’>
field name Description
resource
  • model - Model.REA.Resource
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Resource
  • Context:
  • unique - False
  • Label - Resource Inflow
value
  • is crypted - False
  • Field type - <class ‘anyblok.column.Decimal’>
  • default - 0
  • Context:
  • Label - increment value
  • foreign_key - None
  • DB column name - None
id
  • autoincrement - True
  • is crypted - False
  • Field type - <class ‘anyblok.column.Integer’>
  • primary_key - True
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • DB column name - None
  • Label - None
  • foreign_key - Model.REA.Entity => id
provider
  • model - Model.REA.Agent
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Agent
  • Context:
  • unique - False
  • Label - Agent provider
date
  • is crypted - False
  • Field type - <class ‘anyblok.column.DateTime’>
  • default - <function IncrementEvent.<lambda> at
0x7f2eaf0b5d08>
  • Context:
  • Label - Event Date
  • foreign_key - None
  • DB column name - None
class anyblok_rea.bloks.rea.entity.DecrementEvent

Bases: anyblok.model.Entity

Economic Event represents either an increment or a decrement in the value of economic resources that are under the control of the enterprise. Some economic events occur instantaneously, such as sales of goods; some occur over time, such as rentals, labor acquisition, and provision and use of services.

# Model-Driven Design Using Business Patterns # Authors: Hruby, Pavel # ISBN-10 3-540-30154-2 Springer Berlin Heidelberg New York # ISBN-13 978-3-540-30154-7 Springer Berlin Heidelberg New York

Declaration type:
 

Model

Registry name:

Model.REA.DecrementEvent

Tablename:

rea_decrementevent

Inherit model or mixin:
 
  • <class ‘anyblok.model.Entity’>
field name Description
resource
  • model - Model.REA.Resource
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Resource
  • Context:
  • unique - False
  • Label - Resource Outflow
recipient
  • model - Model.REA.Agent
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Agent
  • Context:
  • unique - False
  • Label - Agent recipient
value
  • is crypted - False
  • Field type - <class ‘anyblok.column.Decimal’>
  • default - 0
  • Context:
  • Label - decrement value
  • foreign_key - None
  • DB column name - None
id
  • autoincrement - True
  • is crypted - False
  • Field type - <class ‘anyblok.column.Integer’>
  • primary_key - True
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • DB column name - None
  • Label - None
  • foreign_key - Model.REA.Entity => id
date
  • is crypted - False
  • Field type - <class ‘anyblok.column.DateTime’>
  • default - <function DecrementEvent.<lambda> at
0x7f2eaf0b5e18>
  • Context:
  • Label - Event Date
  • foreign_key - None
  • DB column name - None
class anyblok_rea.bloks.rea.utility.Utility

Bases: object

Declaration type:
 Model
Registry name:Model.Utility
Tablename:utility
Inherit model or mixin:
 
classmethod get_resource_value(resource, agent)

Get all event value about an agent and a resource.

Parameters:
  • agent – Which agent is used to compute resource value
  • resource – What resource is used to compute resource value
Returns:

value

class anyblok_rea.bloks.rea.exceptions.REABlokException

Bases: Exception

Blok rea commitment

class anyblok_rea.bloks.rea_commitment.REACommitmentBlok(registry)

Bases: anyblok.blok.Blok

Commitment pattern REA blok

conditional_by = []
conflicting_by = []
classmethod import_declaration_module()
name = 'rea-commitment'
optional_by = []
classmethod reload_declaration_module(reload)
required = ['rea']
required_by = ['rea-contract']
version = '0.0.1'

API doc

class anyblok_rea.bloks.rea_commitment.entity.IncrementCommitment

Bases: anyblok.model.Entity

Commitment is a promise or obligation of economic agents to perform an economic event in the future. For example, line items on a sales order represent commitments to sell goods.

# Model-Driven Design Using Business Patterns # Authors: Hruby, Pavel # ISBN-10 3-540-30154-2 Springer Berlin Heidelberg New York # ISBN-13 978-3-540-30154-7 Springer Berlin Heidelberg New York

Declaration type:
 

Model

Registry name:

Model.REA.IncrementCommitment

Tablename:

rea_incrementcommitment

Inherit model or mixin:
 
  • <class ‘anyblok.model.Entity’>
field name Description
fulfilled
  • is crypted - False
  • Field type - <class ‘anyblok.column.Boolean’>
  • default - False
  • Context:
  • Label - Is Fulfilled
  • foreign_key - None
  • DB column name - None
resource
  • model - Model.REA.Resource
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Resource
  • Context:
  • unique - False
  • Label - Reservation Resource
value
  • is crypted - False
  • Field type - <class ‘anyblok.column.Decimal’>
  • default - 0
  • Context:
  • Label - Value increment
  • foreign_key - None
  • DB column name - None
id
  • autoincrement - True
  • is crypted - False
  • Field type - <class ‘anyblok.column.Integer’>
  • primary_key - True
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • DB column name - None
  • Label - None
  • foreign_key - Model.REA.Entity => id
provider
  • model - Model.REA.Agent
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Agent
  • Context:
  • unique - False
  • Label - Agent provider
fulfill()
Returns:True if commitment is fulfilled
class anyblok_rea.bloks.rea_commitment.entity.DecrementCommitment

Bases: anyblok.model.Entity

Commitment is a promise or obligation of economic agents to perform an economic event in the future. For example, line items on a sales order represent commitments to sell goods.

# Model-Driven Design Using Business Patterns # Authors: Hruby, Pavel # ISBN-10 3-540-30154-2 Springer Berlin Heidelberg New York # ISBN-13 978-3-540-30154-7 Springer Berlin Heidelberg New York

Declaration type:
 

Model

Registry name:

Model.REA.DecrementCommitment

Tablename:

rea_decrementcommitment

Inherit model or mixin:
 
  • <class ‘anyblok.model.Entity’>
field name Description
fulfilled
  • is crypted - False
  • Field type - <class ‘anyblok.column.Boolean’>
  • default - False
  • Context:
  • Label - Is Fulfilled
  • foreign_key - None
  • DB column name - None
recipient
  • model - Model.REA.Agent
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Agent
  • Context:
  • unique - False
  • Label - Agent recipient
value
  • is crypted - False
  • Field type - <class ‘anyblok.column.Decimal’>
  • default - 0
  • Context:
  • Label - Value decrement
  • foreign_key - None
  • DB column name - None
id
  • autoincrement - True
  • is crypted - False
  • Field type - <class ‘anyblok.column.Integer’>
  • primary_key - True
  • default - <class ‘anyblok.column.NoDefaultValue’>
  • Context:
  • DB column name - None
  • Label - None
  • foreign_key - Model.REA.Entity => id
resource
  • model - Model.REA.Resource
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • nullable - False
  • remote_model - Model.REA.Resource
  • Context:
  • unique - False
  • Label - Reservation Resource
fulfill()
Returns:True if commitment is fulfilled
class anyblok_rea.bloks.rea_commitment.entity.IncrementEvent

Bases: object

Declaration type:
 Model
Registry name:Model.REA.IncrementEvent
Tablename:rea_incrementevent
Inherit model or mixin:
 
field name Description
fulfillment
  • model - Model.REA.IncrementCommitment
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • remote_model - Model.REA.IncrementCommitment
  • Context:
  • unique - False
  • Label - FulFilled commitment
class anyblok_rea.bloks.rea_commitment.entity.DecrementEvent

Bases: object

Declaration type:
 Model
Registry name:Model.REA.DecrementEvent
Tablename:rea_decrementevent
Inherit model or mixin:
 
field name Description
fulfillment
  • model - Model.REA.DecrementCommitment
  • _column_names - None
  • _remote_columns - None
  • Field type - <class ‘anyblok.relationship.Many2One’>
  • info:
  • remote_model - Model.REA.DecrementCommitment
  • Context:
  • unique - False
  • Label - FulFilled commitment
class anyblok_rea.bloks.rea_commitment.utility.Utility

Bases: object

Declaration type:
 Model
Registry name:Model.Utility
Tablename:utility
Inherit model or mixin:
 
class anyblok_rea.bloks.rea_commitment.exceptions.FulfillmentException

Bases: anyblok_rea.bloks.rea.exceptions.REABlokException