2017 © Pedro Peláez
 

library fundraising-store

Persistence services around the fundraising database

image

wmde/fundraising-store

Persistence services around the fundraising database

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 7 Open issues
  • 28 Versions
  • 5 % Grown

The README.md

Persistence Services for WMDE Fundraising

Build Status Scrutinizer Code Quality Code Coverage Download count License, (*1)

Latest Stable Version Latest Unstable Version, (*2)

Fundraising Store contains persistence services for the WMDE fundraising codebase., (*3)

Installation

You can use Composer to download and install this package as well as its dependencies., (*4)

To add this package as a local, per-project dependency to your project, run:, (*5)

composer require wmde/fundraising-store

This package provides vendor/bin/cli-config.php file required by the Doctrine Console. A default database configuration, compatible with the container used for integration tests (see docker-compose.yml), can be found in local-db-config.php. Applications wanting to use this package in conjunction with the Doctrine Console should provide their own cli-config.php., (*6)

Architecture and Future

This library and the tables it creates is used by the fundraising Bounded Contexts and by the Fundaising Operation Center application. The idea is to migrate this library away by moving all code specific to a Bounded Context into that Bounded Context and all code specific to an application to that application. This way the Bounded Contexts can have truely private peristance and follow the Clean Architecture + Bounded Contexts architecture rules., (*7)

For a short history of we ended up with this library, see Bounded Contexts in the Wikimedia Fundraising Software, (*8)

Development

In order to create a level playing field for development this project uses docker & docker-compose, as well as composer for dependency management., (*9)

Provision the system

docker-compose build

Install dependencies

docker run -it --rm --user $(id -u):$(id -g) -v "$PWD":/code -v ~/.composer:/composer -w /code composer composer install

Tests

docker-compose run --rm app vendor/bin/phpunit

Running test and code-style checks with composer

All committed code is checked by our CI against the unit tests and the coding styleguide. The configuration for these tools can be found in the root directory. After installation through composer you can either call the tools directly from their location in vendor/bin or use the provided composer tasks:, (*10)

composer ci   # Run all checks
composer cs   # Run style checks
composer test # Run unit tests

Be aware that the concepts of composer as a script runner and containerization might not work together out-of-the-box., (*11)

Release notes

Scheduled for next release (11.x)

  • Invert relationship of Donation and Membership to AddressChange. WARNING: This gets rid of the "cascade" feature (automatic creation of AddressChange records when creating Donations/memberships). The FundraisingFrontend would have to implement an event handler that does the creation.

Version 10.5.0 (2020-01-31)

  • Add $additionalMetadataDrivers parameter to Factory to support XML-mapped entities (e.g. in the AddressChange bounded context).

Version 10.4.1 (2020-01-30)

  • Change donationReceipt default to true

Version 10.4.0 (2019-05-29)

  • Add donationReceipt to AddressChange

Version 10.3.3 (2019-02-04)

  • Fix address change migration

Version 10.3.2 (2019-01-31)

  • Allow getAddress to return null in AddressChange

Version 10.3.1 (2019-01-30)

  • Fix column names in database for createdAt and modifiedAt to AddressChange

Version 10.3.0 (2019-01-29)

  • Add createdAt and modifiedAt to AddressChange

Version 10.2.0 (2019-01-18)

  • Add exportDate to AddressChange

Version 10.1.0 (2019-01-16)

  • Remove thirdPartyIdentifier from AddressChange

Version 10.0.0 (2019-01-11)

  • Add addressType and thirdPartyIdentifier to AddressChange

Version 9.0.0 (2018-08-16)

  • Remove User, ActionLog, BackendBanner, BackendImpression doctrine entity and move them to fundraising-backend repository

Version 8.0.0 (2018-06-06)

  • Add AddressChange entity for address export functionality

Version 7.0.1 (2017-12-05)

  • Changed default timestamp value from "0" to "current time", prevening errors on newer versions of MySQL

Version 7.0.0 (2017-11-01)

  • Introduced MembershipApplication::setDonationReceipt() et al.

Version 6.1.0 (2017-08-16)

  • Introduced constant Donation::STATUS_EXPORTED for historical reasons.

Version 6.0.1 (2017-08-02)

  • Updated Doctrine DBAL and ORM min version.

Version 6.0.0 (2017-07-18)

  • Added DonationPayments\SofortPayment entity

Version 5.0.0 (2017-03-30)

Breaking changes

  • Added full text indices for donations and memberships. This breaks backward compatibility for MySQL versions < 5.6.
  • Prefixed all indices of donations with d_.
  • Mark donation_id of MembershipApplication as deprecated. It's no longer written by the fundraising frontend, but still referenced in some places by the backend, so for now we just mark it as deprecated instead of removing it.

Version 4.2.0 (2017-01-04)

  • Added MembershipApplication::isDeleted()

Version 4.1.0 (2016-12-06)

  • Add parameter for setting proxy dir to Factory. For backwards compatibility it's optional and defaults to /tmp.

Version 4.0.0 (2016-11-25)

Breaking changes

  • The subscription confirmation code is now a plain string instead of a binary (blob). This makes it easier to read and test.

Version 3.0.0 (2016-11-16)

Breaking changes

  • The Subscription status flags have been removed and usage of setStatus and getStatus is now discouraged
  • Changed the minimum PHP version to 7.0

New features

  • Added source field to subscription table. This field indicates what led to the subscription, for instance the "remind me later" feature.
  • Added Subscription::getSource and Subscription::setSource
  • Added Subscription::markAsConfirmed
  • Added Subscription::markForModeration
  • Added Subscription::needsModeration

Bug fixes

  • Subscription::isUnconfirmed now correctly returns true when a subscription has been marked for moderation

Version 2.1.0 (2016-10-10)

  • Schema change: Added payment_type field column to the request table
  • Added MembershipApplication::setPaymentType and MembershipApplication::getPaymentType
  • Ability ro re-ruse the file cli-config.php when including FundraisingStore in an application is removed.

Version 2.0.1 (2016-09-28)

By the rules of semantic versioning, this version should have been 2.1 but was tagged wrongly., (*12)

  • Added MembershipApplicationData::setPreservedStatus and MembershipApplicationData::getPreservedStatus. This is used to store the previous status when the status changes from a positive to a negative value.

Version 2.0.0 (2016-08-03)

Breaking changes

  • Renamed several entities. Database table names where not changed to remain backwards compatible.
    • Spenden => Donation.
    • Users => User
    • BackendImpressions => BackendImpression
    • Request was split into MembershipApplication and Subscription (the type field was removed)
  • The public PHP interfaces of Donation and MembershipApplication were changed to English.
  • Creation timestamps are now added automatically to donations, membership requests and subscriptions. Donation creation timestamp dt_new is now mandatory (not nullable).
  • The guid field of MembershipApplication was removed.
  • Changed the minimum PHP version to 5.6

New features

  • Added Address entity
  • Added DonationData class to provide nicer access to the data field
  • Added new methods to Donation
    • setId
    • getDecodedData
    • encodeAndSetData
    • getDataObject
    • setDataObject
    • modifyDataObject
  • Added MembershipApplicationData class to provide nicer access to the data field
  • Added new methods to MembershipApplication
    • setId
    • getDecodedData
    • encodeAndSetData
    • getDataObject
    • setDataObject
    • modifyDataObject

Version 1.0 (2016-01-11)

  • Added CLI configuration for Doctrine ORM shell commands
  • Added request type and status constants
  • Automatically set the full name in Request when first or last name is set.
  • Changed the minimum PHP version to 5.5

Version 0.1 (2015-07-10)

Initial release with Store\Factory, Store\Installer and these entities:, (*13)

  • ActionLog
  • BackendBanner
  • BackendImpressions
  • Request
  • Spenden
  • Users

Future Plans

  • Migrate the payment metadata from Donation::data to specific subclasses of the DonationPayment abstract class.

The Versions

21/06 2018
19/06 2018
18/06 2018
11/06 2018

8.0.0-beta

8.0.0.0-beta

Persistence services around the fundraising database

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

05/12 2017

7.0.1

7.0.1.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

29/11 2017

dev-fix-action-log-defaults

dev-fix-action-log-defaults

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

26/10 2017

7.0.0

7.0.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

17/08 2017

6.1.0

6.1.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

02/08 2017

6.0.1

6.0.1.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

02/08 2017

dev-update-doctrine

dev-update-doctrine

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

18/07 2017

6.0.0

6.0.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

03/07 2017

dev-payments

dev-payments

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

31/03 2017

5.0.0

5.0.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

06/01 2017

4.2.0

4.2.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

07/12 2016

4.1.0

4.1.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

27/11 2016

4.0.0

4.0.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

22/11 2016

3.0.1

3.0.1.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

16/11 2016

3.0.0

3.0.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

03/11 2016

dev-deprecated-setstatus

dev-deprecated-setstatus

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

11/10 2016

2.1.0

2.1.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

28/09 2016

2.0.1

2.0.1.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

03/08 2016

2.0.0

2.0.0.0

Persistence services around the fundraising database

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

19/07 2016

dev-MembershipApplicationRepository

dev-MembershipApplicationRepository

Persistence services around the fundraising database

  Sources   Download

The Requires

 

The Development Requires

11/01 2016

0.2.x-dev

0.2.9999999.9999999-dev

Persistence services around the fundraising database

  Sources   Download

The Requires

 

The Development Requires

11/01 2016

1.0.0

1.0.0.0

Persistence services around the fundraising database

  Sources   Download

The Requires

 

The Development Requires

10/07 2015

v0.1

0.1.0.0

Persistence services around the fundraising database

  Sources   Download

The Requires

 

The Development Requires