def memory_repository() -> MemoryRepository: tenant_provider = StandardTenantProvider() tenant_provider.setup(Tenant(id='001', name="Default")) auth_provider = StandardAuthProvider() auth_provider.setup(User(id='001', name='johndoe')) parser = QueryParser() repository: MemoryRepository = MemoryRepository(parser, tenant_provider, auth_provider) repository.load({"default": {}}) return repository
def process_repository(tenant_provider, auth_provider): process_repository = MemoryProcessRepository(QueryParser(), tenant_provider, auth_provider) process_repository.load({ 'default': { '001': Process(id='001', name='Sync Inventory Transactions'), '002': Process(id='002', name='Send Promotion Emails') } }) return process_repository
def trigger_repository(tenant_provider, auth_provider): trigger_repository = MemoryTriggerRepository(QueryParser(), tenant_provider, auth_provider) trigger_repository.load({ 'default': { '001': Trigger(id='001', process_id='002'), '002': Trigger(id='002', process_id='001') } }) return trigger_repository
def job_repository(tenant_provider, auth_provider): job_repository = MemoryJobRepository(QueryParser(), tenant_provider, auth_provider) job_repository.load({ 'default': { '001': Job(id='001', name='Download Transactions'), '002': Job(id='002', name='Transform Transactions'), '003': Job(id='003', name='Load Transactions'), '004': Job(id='004', name='Design Promotion Email'), '005': Job(id='005', name='Send Email') } }) return job_repository
def trigger_repository(tenant_provider, auth_provider): trigger_repository = MemoryTriggerRepository(QueryParser(), tenant_provider, auth_provider) return trigger_repository
def allocation_repository(tenant_provider, auth_provider): allocation_repository = MemoryAllocationRepository(QueryParser(), tenant_provider, auth_provider) return allocation_repository
def parser() -> QueryParser: return QueryParser()
def parser(): return QueryParser()