add medreport schema

This commit is contained in:
Danel Kungla
2025-07-09 13:31:37 +03:00
parent 9371ff7710
commit d9198a8a12
73 changed files with 420 additions and 270 deletions

View File

@@ -17,6 +17,7 @@ class AccountsApi {
*/
async getAccount(id: string) {
const { data, error } = await this.client
.schema('medreport')
.from('accounts')
.select('*')
.eq('id', id)
@@ -35,6 +36,7 @@ class AccountsApi {
*/
async getAccountWorkspace() {
const { data, error } = await this.client
.schema('medreport')
.from('user_account_workspace')
.select(`*`)
.single();
@@ -63,6 +65,7 @@ class AccountsApi {
const { user } = data;
const { data: accounts, error } = await this.client
.schema('medreport')
.from('accounts_memberships')
.select(
`
@@ -91,6 +94,7 @@ class AccountsApi {
async loadTempUserAccounts() {
const { data: accounts, error } = await this.client
.schema('medreport')
.from('user_accounts')
.select(`name, slug`);
@@ -131,6 +135,7 @@ class AccountsApi {
*/
async getOrder(accountId: string) {
const response = await this.client
.schema('medreport')
.from('orders')
.select('*, items: order_items !inner (*)')
.eq('account_id', accountId)
@@ -151,6 +156,7 @@ class AccountsApi {
*/
async getCustomerId(accountId: string) {
const response = await this.client
.schema('medreport')
.from('billing_customers')
.select('customer_id')
.eq('account_id', accountId)