Skip to content

Commit c200191

Browse files
chore: wip
1 parent 53d8883 commit c200191

File tree

128 files changed

+46578
-44532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+46578
-44532
lines changed

app/Models/User.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default {
2121
useAuth: {
2222
usePasskey: true,
2323
},
24+
billable: true,
2425
useUuid: true,
2526
useTimestamps: true, // defaults to true, `timestampable` used as an alias
2627
useSearch: {

config/services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default {
7979
retryTimeout: env.SENDGRID_RETRY_TIMEOUT ? Number.parseInt(env.SENDGRID_RETRY_TIMEOUT) : 1000,
8080
},
8181
stripe: {
82-
appId: '',
83-
apiKey: '',
82+
secretKey: env.STRIPE_SECRET_KEY,
83+
publicKey: env.STRIPE_PUBLIC_KEY,
8484
},
8585
} satisfies ServicesConfig

storage/framework/core/payments/src/billable/checkout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface Checkout {
88

99
export const manageCheckout: Checkout = (() => {
1010
async function create(user: UserModel, params: Stripe.Checkout.SessionCreateParams): Promise<Stripe.Response<Stripe.Checkout.Session>> {
11+
1112
if (!user.hasStripeId()) {
1213
throw new Error('Customer does not exist in Stripe')
1314
}

storage/framework/core/payments/src/drivers/stripe.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import process from 'node:process'
21
import Stripe from 'stripe'
2+
import { config } from '@stacksjs/config'
33

4-
const apiKey = process.env.STRIPE_SECRET_KEY || ''
4+
const apiKey = config?.services?.stripe?.secretKey || ''
55

66
const client = new Stripe(apiKey, {
7-
apiVersion: '2024-10-28.acacia',
7+
apiVersion: '2025-02-24.acacia',
88
})
99

1010
export interface PaymentIntent {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type ModelNames = 'CourtHouse' | 'Judge' | 'JudgeReview' | 'OauthAccessToken' | 'OauthClient' | 'EmailSubscription' | 'User' | 'PersonalAccessToken' | 'PrintDevice' | 'Category' | 'Payment' | 'Driver' | 'WaitlistProduct' | 'DigitalDelivery' | 'Manufacturer' | 'OrderItem' | 'ShippingZone' | 'Customer' | 'Product' | 'Receipt' | 'ProductVariant' | 'LicenseKey' | 'WaitlistRestaurant' | 'Review' | 'ProductUnit' | 'GiftCard' | 'Order' | 'Coupon' | 'TaxRate' | 'Transaction' | 'LoyaltyPoint' | 'ProductItem' | 'LoyaltyReward' | 'ShippingMethod' | 'ShippingRate' | 'Cart' | 'DeliveryRoute' | 'CartItem' | 'PaymentProduct' | 'FailedJob' | 'PaymentMethod' | 'Page' | 'Author' | 'Post' | 'PaymentTransaction' | 'Websocket' | 'Request' | 'Job' | 'Log' | 'Subscription' | 'Error'
1+
export type ModelNames = 'CourtHouse' | 'Judge' | 'JudgeReview' | 'OauthAccessToken' | 'OauthClient' | 'EmailSubscription' | 'User' | 'PersonalAccessToken' | 'PrintDevice' | 'Category' | 'Payment' | 'Driver' | 'WaitlistProduct' | 'DigitalDelivery' | 'Manufacturer' | 'OrderItem' | 'ShippingZone' | 'Customer' | 'Product' | 'Receipt' | 'ProductVariant' | 'LicenseKey' | 'WaitlistRestaurant' | 'Review' | 'ProductUnit' | 'GiftCard' | 'Order' | 'Coupon' | 'TaxRate' | 'Transaction' | 'LoyaltyPoint' | 'ProductItem' | 'LoyaltyReward' | 'ShippingMethod' | 'ShippingRate' | 'Cart' | 'DeliveryRoute' | 'CartItem' | 'PaymentProduct' | 'FailedJob' | 'PaymentMethod' | 'Page' | 'Author' | 'Post' | 'PaymentTransaction' | 'Websocket' | 'Request' | 'Job' | 'Log' | 'Subscription' | 'Error'

storage/framework/core/types/src/services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ export interface ServicesOptions {
105105
}
106106

107107
stripe?: {
108-
appId: string
109-
apiKey: string
108+
secretKey: string
109+
publicKey: string
110110
}
111111

112112
// supabase?: {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type TableNames = 'taggables' | 'categorizables' | 'commentables' | 'commentable_upvotes' | 'passkeys' | 'password_resets' | 'query_logs' | 'migrations' | 'court_houses' | 'judges' | 'judge_reviews' | 'oauth_access_tokens' | 'oauth_clients' | 'email_subscriptions' | 'users' | 'personal_access_tokens' | 'print_devices' | 'categories' | 'payments' | 'drivers' | 'waitlist_products' | 'digital_deliveries' | 'manufacturers' | 'order_items' | 'shipping_zones' | 'customers' | 'products' | 'receipts' | 'product_variants' | 'license_keys' | 'waitlist_restaurants' | 'reviews' | 'product_units' | 'gift_cards' | 'orders' | 'coupons' | 'tax_rates' | 'transactions' | 'loyalty_points' | 'product_items' | 'loyalty_rewards' | 'shipping_methods' | 'shipping_rates' | 'carts' | 'delivery_routes' | 'cart_items' | 'payment_products' | 'failed_jobs' | 'payment_methods' | 'pages' | 'authors' | 'posts' | 'payment_transactions' | 'websockets' | 'requests' | 'jobs' | 'logs' | 'subscriptions' | 'errors'
1+
export type TableNames = 'taggables' | 'categorizables' | 'commentables' | 'commentable_upvotes' | 'passkeys' | 'password_resets' | 'query_logs' | 'migrations' | 'court_houses' | 'judges' | 'judge_reviews' | 'oauth_access_tokens' | 'oauth_clients' | 'email_subscriptions' | 'users' | 'personal_access_tokens' | 'print_devices' | 'categories' | 'payments' | 'drivers' | 'waitlist_products' | 'digital_deliveries' | 'manufacturers' | 'order_items' | 'shipping_zones' | 'customers' | 'products' | 'receipts' | 'product_variants' | 'license_keys' | 'waitlist_restaurants' | 'reviews' | 'product_units' | 'gift_cards' | 'orders' | 'coupons' | 'tax_rates' | 'transactions' | 'loyalty_points' | 'product_items' | 'loyalty_rewards' | 'shipping_methods' | 'shipping_rates' | 'carts' | 'delivery_routes' | 'cart_items' | 'payment_products' | 'failed_jobs' | 'payment_methods' | 'pages' | 'authors' | 'posts' | 'payment_transactions' | 'websockets' | 'requests' | 'jobs' | 'logs' | 'subscriptions' | 'errors'

storage/framework/env.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export const envKeys = [
4242
'MAIL_FROM_NAME',
4343
'MAIL_FROM_ADDRESS',
4444
'SEARCH_ENGINE_DRIVER',
45+
'STRIPE_SECRET_KEY',
46+
'STRIPE_PUBLIC_KEY',
4547
'MEILISEARCH_HOST',
4648
'MEILISEARCH_KEY',
4749
'FRONTEND_APP_ENV',

storage/framework/orm/routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { route } from '@stacksjs/router'
22

3+
34
route.get('court-houses', 'CourtHouseIndexOrmAction')
45

56
route.post('court-houses', 'CourtHouseStoreOrmAction')
@@ -55,3 +56,4 @@ route.post('requests', 'storage/framework/actions/src/RequestStoreOrmAction.ts')
5556
route.patch('requests/{id}', 'storage/framework/actions/src/RequestUpdateOrmAction.ts')
5657

5758
route.delete('requests/{id}', 'storage/framework/actions/src/RequestDestroyOrmAction.ts')
59+

storage/framework/orm/src/index.ts

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,102 @@
1-
export { default as Author, type AuthorJsonResponse, type AuthorUpdate, type NewAuthor } from './models/Author'
1+
export { default as CourtHouse, type CourtHouseJsonResponse, type NewCourtHouse, type CourtHouseUpdate } from './models/CourtHouse'
22

3-
export { default as Cart, type CartJsonResponse, type CartUpdate, type NewCart } from './models/Cart'
3+
export { default as Judge, type JudgeJsonResponse, type NewJudge, type JudgeUpdate } from './models/Judge'
44

5-
export { default as CartItem, type CartItemJsonResponse, type CartItemUpdate, type NewCartItem } from './models/CartItem'
5+
export { default as JudgeReview, type JudgeReviewJsonResponse, type NewJudgeReview, type JudgeReviewUpdate } from './models/JudgeReview'
66

7-
export { default as Category, type CategoryJsonResponse, type CategoryUpdate, type NewCategory } from './models/Category'
7+
export { default as OauthAccessToken, type OauthAccessTokenJsonResponse, type NewOauthAccessToken, type OauthAccessTokenUpdate } from './models/OauthAccessToken'
88

9-
export { default as Coupon, type CouponJsonResponse, type CouponUpdate, type NewCoupon } from './models/Coupon'
9+
export { default as OauthClient, type OauthClientJsonResponse, type NewOauthClient, type OauthClientUpdate } from './models/OauthClient'
1010

11-
export { default as CourtHouse, type CourtHouseJsonResponse, type CourtHouseUpdate, type NewCourtHouse } from './models/CourtHouse'
11+
export { default as EmailSubscription, type EmailSubscriptionJsonResponse, type NewEmailSubscription, type EmailSubscriptionUpdate } from './models/EmailSubscription'
1212

13-
export { default as Customer, type CustomerJsonResponse, type CustomerUpdate, type NewCustomer } from './models/Customer'
13+
export { default as User, type UserJsonResponse, type NewUser, type UserUpdate } from './models/User'
1414

15-
export { default as DeliveryRoute, type DeliveryRouteJsonResponse, type DeliveryRouteUpdate, type NewDeliveryRoute } from './models/DeliveryRoute'
15+
export { default as PersonalAccessToken, type PersonalAccessTokenJsonResponse, type NewPersonalAccessToken, type PersonalAccessTokenUpdate } from './models/PersonalAccessToken'
1616

17-
export { default as DigitalDelivery, type DigitalDeliveryJsonResponse, type DigitalDeliveryUpdate, type NewDigitalDelivery } from './models/DigitalDelivery'
17+
export { default as PrintDevice, type PrintDeviceJsonResponse, type NewPrintDevice, type PrintDeviceUpdate } from './models/PrintDevice'
1818

19-
export { default as Driver, type DriverJsonResponse, type DriverUpdate, type NewDriver } from './models/Driver'
19+
export { default as Category, type CategoryJsonResponse, type NewCategory, type CategoryUpdate } from './models/Category'
2020

21-
export { default as EmailSubscription, type EmailSubscriptionJsonResponse, type EmailSubscriptionUpdate, type NewEmailSubscription } from './models/EmailSubscription'
21+
export { default as Payment, type PaymentJsonResponse, type NewPayment, type PaymentUpdate } from './models/Payment'
2222

23-
export { default as Error, type ErrorJsonResponse, type ErrorUpdate, type NewError } from './models/Error'
23+
export { default as Driver, type DriverJsonResponse, type NewDriver, type DriverUpdate } from './models/Driver'
2424

25-
export { default as FailedJob, type FailedJobJsonResponse, type FailedJobUpdate, type NewFailedJob } from './models/FailedJob'
25+
export { default as WaitlistProduct, type WaitlistProductJsonResponse, type NewWaitlistProduct, type WaitlistProductUpdate } from './models/WaitlistProduct'
2626

27-
export { default as GiftCard, type GiftCardJsonResponse, type GiftCardUpdate, type NewGiftCard } from './models/GiftCard'
27+
export { default as DigitalDelivery, type DigitalDeliveryJsonResponse, type NewDigitalDelivery, type DigitalDeliveryUpdate } from './models/DigitalDelivery'
2828

29-
export { default as Job, type JobJsonResponse, type JobUpdate, type NewJob } from './models/Job'
29+
export { default as Manufacturer, type ManufacturerJsonResponse, type NewManufacturer, type ManufacturerUpdate } from './models/Manufacturer'
3030

31-
export { default as Judge, type JudgeJsonResponse, type JudgeUpdate, type NewJudge } from './models/Judge'
31+
export { default as OrderItem, type OrderItemJsonResponse, type NewOrderItem, type OrderItemUpdate } from './models/OrderItem'
3232

33-
export { default as JudgeReview, type JudgeReviewJsonResponse, type JudgeReviewUpdate, type NewJudgeReview } from './models/JudgeReview'
33+
export { default as ShippingZone, type ShippingZoneJsonResponse, type NewShippingZone, type ShippingZoneUpdate } from './models/ShippingZone'
3434

35-
export { default as LicenseKey, type LicenseKeyJsonResponse, type LicenseKeyUpdate, type NewLicenseKey } from './models/LicenseKey'
35+
export { default as Customer, type CustomerJsonResponse, type NewCustomer, type CustomerUpdate } from './models/Customer'
3636

37-
export { default as Log, type LogJsonResponse, type LogUpdate, type NewLog } from './models/Log'
37+
export { default as Product, type ProductJsonResponse, type NewProduct, type ProductUpdate } from './models/Product'
3838

39-
export { default as LoyaltyPoint, type LoyaltyPointJsonResponse, type LoyaltyPointUpdate, type NewLoyaltyPoint } from './models/LoyaltyPoint'
39+
export { default as Receipt, type ReceiptJsonResponse, type NewReceipt, type ReceiptUpdate } from './models/Receipt'
4040

41-
export { default as LoyaltyReward, type LoyaltyRewardJsonResponse, type LoyaltyRewardUpdate, type NewLoyaltyReward } from './models/LoyaltyReward'
41+
export { default as ProductVariant, type ProductVariantJsonResponse, type NewProductVariant, type ProductVariantUpdate } from './models/ProductVariant'
4242

43-
export { default as Manufacturer, type ManufacturerJsonResponse, type ManufacturerUpdate, type NewManufacturer } from './models/Manufacturer'
43+
export { default as LicenseKey, type LicenseKeyJsonResponse, type NewLicenseKey, type LicenseKeyUpdate } from './models/LicenseKey'
4444

45-
export { type NewOauthAccessToken, default as OauthAccessToken, type OauthAccessTokenJsonResponse, type OauthAccessTokenUpdate } from './models/OauthAccessToken'
45+
export { default as WaitlistRestaurant, type WaitlistRestaurantJsonResponse, type NewWaitlistRestaurant, type WaitlistRestaurantUpdate } from './models/WaitlistRestaurant'
4646

47-
export { type NewOauthClient, default as OauthClient, type OauthClientJsonResponse, type OauthClientUpdate } from './models/OauthClient'
47+
export { default as Review, type ReviewJsonResponse, type NewReview, type ReviewUpdate } from './models/Review'
4848

49-
export { type NewOrder, default as Order, type OrderJsonResponse, type OrderUpdate } from './models/Order'
49+
export { default as ProductUnit, type ProductUnitJsonResponse, type NewProductUnit, type ProductUnitUpdate } from './models/ProductUnit'
5050

51-
export { type NewOrderItem, default as OrderItem, type OrderItemJsonResponse, type OrderItemUpdate } from './models/OrderItem'
51+
export { default as GiftCard, type GiftCardJsonResponse, type NewGiftCard, type GiftCardUpdate } from './models/GiftCard'
5252

53-
export { type NewPage, default as Page, type PageJsonResponse, type PageUpdate } from './models/Page'
53+
export { default as Order, type OrderJsonResponse, type NewOrder, type OrderUpdate } from './models/Order'
5454

55-
export { type NewPayment, default as Payment, type PaymentJsonResponse, type PaymentUpdate } from './models/Payment'
55+
export { default as Coupon, type CouponJsonResponse, type NewCoupon, type CouponUpdate } from './models/Coupon'
5656

57-
export { type NewPaymentMethod, default as PaymentMethod, type PaymentMethodJsonResponse, type PaymentMethodUpdate } from './models/PaymentMethod'
57+
export { default as TaxRate, type TaxRateJsonResponse, type NewTaxRate, type TaxRateUpdate } from './models/TaxRate'
5858

59-
export { type NewPaymentProduct, default as PaymentProduct, type PaymentProductJsonResponse, type PaymentProductUpdate } from './models/PaymentProduct'
59+
export { default as Transaction, type TransactionJsonResponse, type NewTransaction, type TransactionUpdate } from './models/Transaction'
6060

61-
export { type NewPaymentTransaction, default as PaymentTransaction, type PaymentTransactionJsonResponse, type PaymentTransactionUpdate } from './models/PaymentTransaction'
61+
export { default as LoyaltyPoint, type LoyaltyPointJsonResponse, type NewLoyaltyPoint, type LoyaltyPointUpdate } from './models/LoyaltyPoint'
6262

63-
export { type NewPersonalAccessToken, default as PersonalAccessToken, type PersonalAccessTokenJsonResponse, type PersonalAccessTokenUpdate } from './models/PersonalAccessToken'
63+
export { default as ProductItem, type ProductItemJsonResponse, type NewProductItem, type ProductItemUpdate } from './models/ProductItem'
6464

65-
export { type NewPost, default as Post, type PostJsonResponse, type PostUpdate } from './models/Post'
65+
export { default as LoyaltyReward, type LoyaltyRewardJsonResponse, type NewLoyaltyReward, type LoyaltyRewardUpdate } from './models/LoyaltyReward'
6666

67-
export { type NewPrintDevice, default as PrintDevice, type PrintDeviceJsonResponse, type PrintDeviceUpdate } from './models/PrintDevice'
67+
export { default as ShippingMethod, type ShippingMethodJsonResponse, type NewShippingMethod, type ShippingMethodUpdate } from './models/ShippingMethod'
6868

69-
export { type NewProduct, default as Product, type ProductJsonResponse, type ProductUpdate } from './models/Product'
69+
export { default as ShippingRate, type ShippingRateJsonResponse, type NewShippingRate, type ShippingRateUpdate } from './models/ShippingRate'
7070

71-
export { type NewProductItem, default as ProductItem, type ProductItemJsonResponse, type ProductItemUpdate } from './models/ProductItem'
71+
export { default as Cart, type CartJsonResponse, type NewCart, type CartUpdate } from './models/Cart'
7272

73-
export { type NewProductUnit, default as ProductUnit, type ProductUnitJsonResponse, type ProductUnitUpdate } from './models/ProductUnit'
73+
export { default as DeliveryRoute, type DeliveryRouteJsonResponse, type NewDeliveryRoute, type DeliveryRouteUpdate } from './models/DeliveryRoute'
7474

75-
export { type NewProductVariant, default as ProductVariant, type ProductVariantJsonResponse, type ProductVariantUpdate } from './models/ProductVariant'
75+
export { default as CartItem, type CartItemJsonResponse, type NewCartItem, type CartItemUpdate } from './models/CartItem'
7676

77-
export { type NewReceipt, default as Receipt, type ReceiptJsonResponse, type ReceiptUpdate } from './models/Receipt'
77+
export { default as PaymentProduct, type PaymentProductJsonResponse, type NewPaymentProduct, type PaymentProductUpdate } from './models/PaymentProduct'
7878

79-
export { type NewRequest, default as Request, type RequestJsonResponse, type RequestUpdate } from './models/Request'
79+
export { default as FailedJob, type FailedJobJsonResponse, type NewFailedJob, type FailedJobUpdate } from './models/FailedJob'
8080

81-
export { type NewReview, default as Review, type ReviewJsonResponse, type ReviewUpdate } from './models/Review'
81+
export { default as PaymentMethod, type PaymentMethodJsonResponse, type NewPaymentMethod, type PaymentMethodUpdate } from './models/PaymentMethod'
8282

83-
export { type NewShippingMethod, default as ShippingMethod, type ShippingMethodJsonResponse, type ShippingMethodUpdate } from './models/ShippingMethod'
83+
export { default as Page, type PageJsonResponse, type NewPage, type PageUpdate } from './models/Page'
8484

85-
export { type NewShippingRate, default as ShippingRate, type ShippingRateJsonResponse, type ShippingRateUpdate } from './models/ShippingRate'
85+
export { default as Author, type AuthorJsonResponse, type NewAuthor, type AuthorUpdate } from './models/Author'
8686

87-
export { type NewShippingZone, default as ShippingZone, type ShippingZoneJsonResponse, type ShippingZoneUpdate } from './models/ShippingZone'
87+
export { default as Post, type PostJsonResponse, type NewPost, type PostUpdate } from './models/Post'
8888

89-
export { type NewSubscription, default as Subscription, type SubscriptionJsonResponse, type SubscriptionUpdate } from './models/Subscription'
89+
export { default as PaymentTransaction, type PaymentTransactionJsonResponse, type NewPaymentTransaction, type PaymentTransactionUpdate } from './models/PaymentTransaction'
9090

91-
export { type NewTaxRate, default as TaxRate, type TaxRateJsonResponse, type TaxRateUpdate } from './models/TaxRate'
91+
export { default as Websocket, type WebsocketJsonResponse, type NewWebsocket, type WebsocketUpdate } from './models/Websocket'
9292

93-
export { type NewTransaction, default as Transaction, type TransactionJsonResponse, type TransactionUpdate } from './models/Transaction'
93+
export { default as Request, type RequestJsonResponse, type NewRequest, type RequestUpdate } from './models/Request'
9494

95-
export { type NewUser, default as User, type UserJsonResponse, type UserUpdate } from './models/User'
95+
export { default as Job, type JobJsonResponse, type NewJob, type JobUpdate } from './models/Job'
9696

97-
export { type NewWaitlistProduct, default as WaitlistProduct, type WaitlistProductJsonResponse, type WaitlistProductUpdate } from './models/WaitlistProduct'
97+
export { default as Log, type LogJsonResponse, type NewLog, type LogUpdate } from './models/Log'
9898

99-
export { type NewWaitlistRestaurant, default as WaitlistRestaurant, type WaitlistRestaurantJsonResponse, type WaitlistRestaurantUpdate } from './models/WaitlistRestaurant'
99+
export { default as Subscription, type SubscriptionJsonResponse, type NewSubscription, type SubscriptionUpdate } from './models/Subscription'
100+
101+
export { default as Error, type ErrorJsonResponse, type NewError, type ErrorUpdate } from './models/Error'
100102

101-
export { type NewWebsocket, default as Websocket, type WebsocketJsonResponse, type WebsocketUpdate } from './models/Websocket'

0 commit comments

Comments
 (0)