feat: customer add command#40
Conversation
| // DID of the user account e.g. `did:mailto:agent` | ||
| Customer did.DID `cborgen:"customer" dagjsongen:"customer"` |
There was a problem hiding this comment.
We must be careful here.
At the moment, FilOne Console assumes user=organization. We know we will need to support multi-user organisations in the future, FilOne Console's database model is a sort of half-way there.
In the context of libforge, we should make it clear whether Customer is "FilOne organization account" or "FilOne user account".
Since buckets are owned by organizations, not users, I am arguing that we should treat Customer as "organization account" here.
| // DID of the user account e.g. `did:mailto:agent` | |
| Customer did.DID `cborgen:"customer" dagjsongen:"customer"` | |
| // DID of the FilOne organization account e.g. `did:mailto:agent` | |
| Customer did.DID `cborgen:"customer" dagjsongen:"customer"` |
But since I see Account below, perhaps I misunderstood the proposed data model. Is there any prior documentation describing how Forge components will use these customer records?
| // Opaque identifier representing an account in the payment system | ||
| // e.g. Stripe customer ID (stripe:cus_9s6XKzkNRiz8i3) | ||
| Account *string `cborgen:"account,omitempty" dagjsongen:"account,omitempty"` |
There was a problem hiding this comment.
Is it a good idea to use Stripe customer ID here? FilOne is using orgId (a UUID generated by FilOne backend) as the unique identifier of the organisation account.
Conceptually, I believe each FilOne organization account has exactly one linked Stripe customer record.
In the current FilOne backend data model, Stripe customer ID is stored in BillingTable with pk: CUSTOMER#{userId}, sk: SUBSCRIPTION, I guess that's something we will need to change.
@pyropy is my understanding correct?
| // Unique identifier of the product a.k.a plan. | ||
| Product did.DID `cborgen:"product" dagjsongen:"product"` |
There was a problem hiding this comment.
Do you have any examples of the products/plans? How are we going to use that information in Forge? If a customer is paying for more than one product (e.g. storage + RAG), will they get two customer records?
|
|
||
| type AddArguments struct { | ||
| // DID of the user account e.g. `did:mailto:agent` | ||
| Customer did.DID `cborgen:"customer" dagjsongen:"customer"` |
There was a problem hiding this comment.
What is the difference between Consumer (used by /provider/add command) and Customer?
libforge/commands/provider/types.go
Line 7 in eb26d87
An invocation that Hilt can make to insert a customer directly into the upload service DB.
Customers added by Hilt are "tenants" that are authenticated, authorized and billed by fil.one. However they need to be registered in the upload service to allow spaces to be provisioned and used.