prici-io / prici Goto Github PK
View Code? Open in Web Editor NEWmanage plans and pricing for any SaaS application
Home Page: https://prici.io
License: MIT License
manage plans and pricing for any SaaS application
Home Page: https://prici.io
License: MIT License
They should be auto generated on pre-save
A developer wants to trigger increment state of feature, but instead of using http request - to trigger a redis message.
Prici should register to the redis event, in case a redis url was given as environment variable.
Architectural design needed before implementing this issue.
docs to express middleware usage
Currently, when creating a new Prici SDK instance in a NestJs app the app does not know about
the SDK instance in any way. This means that the SDK does not work in tandem with the Nest runtime.
By abstracting the SDK instance in a custom module, the following could be achieved:
@nestjs/config
scenario:
state.isAllowed
should be true in this case, but also have another property to mention the limit has reached (maybe state.hasReachedLimit
).The latest version of remult includes an Admin UI feature.
add the ability to turn the admin UI on using environment variable (ADMIN_UI=true)
right now, errorMessage is a require field in both express middleware and nest guard.
it should be optional, and if not exists - a default error message will appear.
let's say there's a user with multiple plans:
when the user uses the feature, the increment should first come from the monthly package, and only when it's over - it should use the credits plan first.
same as when the user has multiple renewal plans - when it comes to a first plan limit - the counter should increment the second plan, and so on.
when coding:
@Post("todos")
@UseGuards(new IsAllowedGuard({
// @ts-ignore
sdk: priciSdk,
errorMessage: "User is out of quota",
getAccountId: (_) => "demo-account",
getFieldId: (_) => featureId
}))
createTodo(@Body() body: any) {
return this.appService.createTodo(body);
}
without the ts-ignore - this code will never pass the build.
the error is:
TS2739: Type PriciSdk is missing the following properties from type PriciSdk: #remult, #accountFields
those are js private properties, and it's literally the same class, so it's weird that it's not passing.
Fields Groups should have a name and priority (for order).
a plan field should have a "group" property (optional) with a group id.
next issue to open after that PR will be merged:
getGroupState method - to validate an entire group.
Use Nuxt docs or vitepress.
First content:
Provide a count API for a basic property.
Get the count for specific dates of that property.
That way users will be able to call an API call and charge by usage.
Assumption a Plan is composed of many properties which might be charged differently and dervied from different plans. The point is to do so by not knowing the whole plan's complexity - just the property.
the shared-remult and sdk packages should have links to thefull docs on prici.io
isAllowed
calculated value.A user would like to know anything that happened between/until/after certain dates.
A usage log entity can achieve this goal.
The usage log entity should persist:
The usage log should be set asynchronously on every increment action.
The usage property should be equal to the incementAmount given to the method (even if the field kind is boolean or string).
We should have an optional property to the increment method to support the additional info property, that will be stored in the usage log.
The user would like to add additional information about the increment action to add some context to the usage).
need to add:
Currently, account plans have reset modes - monthly, yearly, and manually.
But sometimes, certain feature counters (for example - storage) shouldn't reset at the reset action.
this mission is to add a "resetMode" to the plan fields' entity and store it on the account plan state when its created.
the default is empty (undefined), so the reset mode of the field is the same as the account plan reset mode.
A developer wants to trigger an increment of a feature state - it should be able to push a message into a kafka topic.
Prici should register to this topic in case kafka arguments were given in environment variables.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.