Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Add PropertyWrapper for Primitives #2

Open
Mordil opened this issue Jan 13, 2020 · 1 comment
Open

[RFC] Add PropertyWrapper for Primitives #2

Mordil opened this issue Jan 13, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Mordil
Copy link
Member

Mordil commented Jan 13, 2020

Desired Functionality

Rather than working with the protocol Money, or any of the concrete implementations directly, I would like the ability to progressively work with the Currency module by wrapping properties in my projects with a new PropertyWrapper that would handle all of the minorUnits and type constraints for me.

Proposed Naming

CurrencyValue

struct Foo {
    @CurrencyValue(USD.self) var price: Decimal
}

Format subtype

struct Foo {
    @USD.Format var price: Decimal
}
@Mordil
Copy link
Member Author

Mordil commented Jan 13, 2020

This was suggested from the Vapor Discord.

@Mordil Mordil added enhancement New feature or request help wanted Extra attention is needed labels Jan 20, 2020
@Mordil Mordil changed the title Add PropertyWrapper for Primitives [RFC] Add PropertyWrapper for Primitives Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant