Exemplo n.º 1
0
        public ImportDocumentMetadataSource()
        {
            HierarchyMetadata importStatisticsMetadataRoot =
                HierarchyMetadata
                .Config
                .Id.Is(Metamodeling.Elements.Identities.Builder.Metadata.Id.For <ImportDocumentMetadataIdentity>())
                .Childs(ImportDocumentMetadata <FirmStatisticsDto>
                        .Config
                        .ImportToFacts(Specs.Find.Bit.FirmCategoryStatistics.ByBitDto, Specs.Map.Bit.FirmCategoryStatistics())
                        .LeadsToProjectStatisticsCalculation(),

                        ImportDocumentMetadata <CategoryStatisticsDto>
                        .Config
                        .ImportToFacts(Specs.Find.Bit.ProjectCategoryStatistics.ByBitDto, Specs.Map.Bit.ProjectCategoryStatistics())
                        .LeadsToProjectStatisticsCalculation(),

                        ImportDocumentMetadata <FirmForecastDto>
                        .Config
                        .ImportToFacts(Specs.Find.Bit.FirmCategoryForecast.ByBitDto, Specs.Map.Bit.FirmCategoryForecasts())
                        .ImportToFacts(Specs.Find.Bit.FirmForecast.ByBitDto, Specs.Map.Bit.FirmForecasts())
                        .LeadsToProjectStatisticsCalculation());

            _metadata = new Dictionary <Uri, IMetadataElement> {
                { importStatisticsMetadataRoot.Identity.Id, importStatisticsMetadataRoot }
            };
        }
Exemplo n.º 2
0
        public StatisticsRecalculationMetadataSource()
        {
            HierarchyMetadata statisticsRecalculationMetadataRoot =
                HierarchyMetadata
                .Config
                .Id.Is(Metamodeling.Elements.Identities.Builder.Metadata.Id.For <StatisticsRecalculationMetadataIdentity>())
                .Childs(StatisticsRecalculationMetadata <Statistics::FirmCategoryStatistics>
                        .Config
                        .HasSource(Specs.Map.Facts.ToStatistics.FirmCategoryStatistics)
                        .HasTarget(Specs.Map.CI.ToStatistics.FirmCategoryStatistics)
                        .HasFilter(
                            (projectId, categoryIds) =>
                            categoryIds.Contains(null)
                                        ? Specs.Find.CI.FirmCategoryStatistics.ByProject(projectId)
                                        : Specs.Find.CI.FirmCategoryStatistics.ByProjectAndCategories(projectId, categoryIds)));

            _metadata = new Dictionary <Uri, IMetadataElement> {
                { statisticsRecalculationMetadataRoot.Identity.Id, statisticsRecalculationMetadataRoot }
            };
        }
        public StatisticsRecalculationMetadataSource()
        {
            HierarchyMetadata statisticsRecalculationMetadataRoot =
                HierarchyMetadata
                .Config
                .Id.Is(Metamodeling.Elements.Identities.Builder.Metadata.Id.For <StatisticsRecalculationMetadataIdentity>())
                .Childs(StatisticsRecalculationMetadata <Statistics::FirmCategory3, StatisticsKey>
                        .Config
                        .HasSource(Specs.Map.Facts.ToStatistics.FirmCategory3)
                        .HasTarget(Specs.Map.CI.ToStatistics.FirmCategory3)
                        .HasFilter(Specs.Find.CI.FirmCategory3),

                        StatisticsRecalculationMetadata <Statistics::FirmForecast, StatisticsKey>
                        .Config
                        .HasSource(Specs.Map.Facts.ToStatistics.FirmForecast)
                        .HasTarget(Specs.Map.CI.ToStatistics.FirmForecast)
                        .HasFilter(Specs.Find.CI.FirmForecast));

            Metadata = new Dictionary <Uri, IMetadataElement> {
                { statisticsRecalculationMetadataRoot.Identity.Id, statisticsRecalculationMetadataRoot }
            };
        }
        public ImportStatisticsMetadataSource()
        {
            HierarchyMetadata importStatisticsMetadataRoot =
                HierarchyMetadata
                .Config
                .Id.Is(Metamodeling.Elements.Identities.Builder.Metadata.Id.For <ImportStatisticsMetadataIdentity>())
                .Childs(ImportStatisticsMetadata <Bit::FirmCategoryStatistics, FirmStatisticsDto>
                        .Config
                        .HasSource <FirmStatisticsDto>(Specs.Map.Bit.FirmCategoryStatistics())
                        .Aggregated(Specs.Find.Bit.FirmCategoryStatistics.ByBitDto)
                        .LeadsToProjectStatisticsCalculation(),

                        ImportStatisticsMetadata <Bit::ProjectCategoryStatistics, CategoryStatisticsDto>
                        .Config
                        .HasSource <CategoryStatisticsDto>(Specs.Map.Bit.ProjectCategoryStatistics())
                        .Aggregated(Specs.Find.Bit.ProjectCategoryStatistics.ByBitDto)
                        .LeadsToProjectStatisticsCalculation());

            _metadata = new Dictionary <Uri, IMetadataElement> {
                { importStatisticsMetadataRoot.Identity.Id, importStatisticsMetadataRoot }
            };
        }
        public AggregateConstructionMetadataSource()
        {
            HierarchyMetadata aggregateConstructionMetadataRoot =
                HierarchyMetadata
                .Config
                .Id.Is(Metamodeling.Elements.Identities.Builder.Metadata.Id.For <ReplicationMetadataIdentity>(ReplicationMetadataName.Aggregates))
                .Childs(AggregateMetadata <Firm, long>
                        .Config
                        .HasSource(Specs.Map.Facts.ToCI.Firms)
                        .HasValueObject(Specs.Map.Facts.ToCI.FirmActivities, Specs.Find.CI.FirmActivities)
                        .HasValueObject(Specs.Map.Facts.ToCI.FirmBalances, Specs.Find.CI.FirmBalances)
                        .HasValueObject(Specs.Map.Facts.ToCI.FirmCategories1, Specs.Find.CI.FirmCategories1)
                        .HasValueObject(Specs.Map.Facts.ToCI.FirmCategories2, Specs.Find.CI.FirmCategories2)
                        .HasValueObject(Specs.Map.Facts.ToCI.FirmTerritories, Specs.Find.CI.FirmTerritories),

                        AggregateMetadata <Client, long>
                        .Config
                        .HasSource(Specs.Map.Facts.ToCI.Clients)
                        .HasValueObject(Specs.Map.Facts.ToCI.ClientContacts, Specs.Find.CI.ClientContacts),

                        AggregateMetadata <Project, long>
                        .Config
                        .HasSource(Specs.Map.Facts.ToCI.Projects)
                        .HasValueObject(Specs.Map.Facts.ToCI.ProjectCategories, Specs.Find.CI.ProjectCategories),

                        AggregateMetadata <Territory, long>
                        .Config
                        .HasSource(Specs.Map.Facts.ToCI.Territories),

                        AggregateMetadata <CategoryGroup, long>
                        .Config
                        .HasSource(Specs.Map.Facts.ToCI.CategoryGroups));

            Metadata = new Dictionary <Uri, IMetadataElement> {
                { aggregateConstructionMetadataRoot.Identity.Id, aggregateConstructionMetadataRoot }
            };
        }
        public FactsReplicationMetadataSource()
        {
            HierarchyMetadata factsReplicationMetadataRoot =
                HierarchyMetadata
                    .Config
                    .Id.Is(Metamodeling.Elements.Identities.Builder.Metadata.Id.For<ReplicationMetadataIdentity>(ReplicationMetadataName.Facts))
                    .Childs(FactMetadata<Activity>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Activities)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByActivity)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByClientActivity),

                            FactMetadata<Account>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Accounts)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByAccount),

                            FactMetadata<BranchOfficeOrganizationUnit>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.BranchOfficeOrganizationUnits)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByBranchOfficeOrganizationUnit),

                            FactMetadata<Category>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Categories)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByCategory),

                            FactMetadata<CategoryFirmAddress>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.CategoryFirmAddresses)
                                .HasDependentEntity<Statistics::ProjectStatistics, StatisticsKey>(Specs.Map.Facts.ToStatistics.ByFirmAddressCategory)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByCategoryFirmAddress)
                                .HasDependentEntity<CI::Client, long>(Specs.Map.Facts.ToClientAggregate.ByCategoryFirmAddress),

                            FactMetadata<CategoryGroup>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.CategoryGroups)
                                .HasMatchedEntity<CI::CategoryGroup>()
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByCategoryGroup)
                                .HasDependentEntity<CI::Client, long>(Specs.Map.Facts.ToClientAggregate.ByCategoryGroup),

                            FactMetadata<CategoryOrganizationUnit>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.CategoryOrganizationUnits)
                                .HasDependentEntity<CI::Project, long>(Specs.Map.Facts.ToProjectAggregate.ByCategoryOrganizationUnit)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByCategoryOrganizationUnit)
                                .HasDependentEntity<CI::Client, long>(Specs.Map.Facts.ToClientAggregate.ByCategoryOrganizationUnit),

                            FactMetadata<Client>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Clients)
                                .HasMatchedEntity<CI::Client>()
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByClient),

                            FactMetadata<Contact>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Contacts)
                                .HasDependentEntity<CI::Client, long>(Specs.Map.Facts.ToClientAggregate.ByContacts)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByContacts),

                            FactMetadata<Firm>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Firms)
                                .HasMatchedEntity<CI::Firm>()
                                .HasDependentEntity<Statistics::ProjectStatistics, StatisticsKey>(Specs.Map.Facts.ToStatistics.ByFirm)
                                .HasDependentEntity<CI::Client, long>(Specs.Map.Facts.ToClientAggregate.ByFirm),

                            FactMetadata<FirmAddress>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.FirmAddresses)
                                .HasDependentEntity<Statistics::ProjectStatistics, StatisticsKey>(Specs.Map.Facts.ToStatistics.ByFirmAddress)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByFirmAddress)
                                .HasDependentEntity<CI::Client, long>(Specs.Map.Facts.ToClientAggregate.ByFirmAddress),

                            FactMetadata<FirmContact>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.FirmContacts)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByFirmContacts),

                            FactMetadata<LegalPerson>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.LegalPersons)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByLegalPerson),

                            FactMetadata<Order>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Orders)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByOrder),

                            FactMetadata<Project>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Projects)
                                .HasMatchedEntity<CI::Project>()
                                .HasDependentEntity<Statistics::ProjectStatistics, StatisticsKey>(Specs.Map.Facts.ToStatistics.ByProject)
                                .HasDependentEntity<CI::Territory, long>(Specs.Map.Facts.ToTerritoryAggregate.ByProject)
                                .HasDependentEntity<CI::Firm, long>(Specs.Map.Facts.ToFirmAggregate.ByProject),

                            FactMetadata<Territory>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.Territories)
                                .HasMatchedEntity<CI::Territory>(),

                            FactMetadata<SalesModelCategoryRestriction>
                                .Config
                                .HasSource(Specs.Map.Erm.ToFacts.SalesModelCategoryRestrictions)
                                .HasDependentEntity<CI::Project, long>(Specs.Map.Facts.ToProjectAggregate.BySalesModelCategoryRestriction));

            _metadata = new Dictionary<Uri, IMetadataElement> { { factsReplicationMetadataRoot.Identity.Id, factsReplicationMetadataRoot } };
        }