private static StoreRevenueHistory CreateStoreRevenueHistory(ISession session, StoreRevenue storeRevenue) { return new StoreRevenueHistoryBuilder(session) .WithCurrency(storeRevenue.Currency) .WithInternalOrganisation(storeRevenue.InternalOrganisation) .WithStore(storeRevenue.Store) .WithRevenue(0) .Build(); }
public InternalOrganisationRevenue AppsFindOrCreateAsDependable(ISession session, StoreRevenue dependant) { var internalOrganisationRevenues = dependant.InternalOrganisation.InternalOrganisationRevenuesWhereInternalOrganisation; internalOrganisationRevenues.Filter.AddEquals(this.Meta.Year, dependant.Year); internalOrganisationRevenues.Filter.AddEquals(this.Meta.Month, dependant.Month); var internalOrganisationRevenue = internalOrganisationRevenues.First ?? new InternalOrganisationRevenueBuilder(session) .WithInternalOrganisation(dependant.InternalOrganisation) .WithYear(dependant.Year) .WithMonth(dependant.Month) .WithCurrency(dependant.Currency) .WithRevenue(0M) .Build(); return internalOrganisationRevenue; }