Skip to content

feat: customer add command#40

Open
alanshaw wants to merge 1 commit into
mainfrom
ash/feat/customer-add
Open

feat: customer add command#40
alanshaw wants to merge 1 commit into
mainfrom
ash/feat/customer-add

Conversation

@alanshaw

Copy link
Copy Markdown
Member

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.

Comment on lines +8 to +9
// DID of the user account e.g. `did:mailto:agent`
Customer did.DID `cborgen:"customer" dagjsongen:"customer"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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?

Comment on lines +10 to +12
// 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"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +13 to +14
// Unique identifier of the product a.k.a plan.
Product did.DID `cborgen:"product" dagjsongen:"product"`

@bajtos bajtos Jun 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between Consumer (used by /provider/add command) and Customer?

Consumer did.DID `cborgen:"consumer" dagjsongen:"consumer"`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants