update table YclientsAccounts

This commit is contained in:
pasha1coil 2025-10-06 15:18:54 +03:00
parent 425ba10ad4
commit a2baabf928
6 changed files with 3 additions and 13 deletions

@ -1553,4 +1553,4 @@ update YclientsTokens set Expiration=$1, Active = $2 where AccountID = $3 RETURN
select * from YclientsTokens where AccountID = $1 and Expiration=false and Active = true; select * from YclientsTokens where AccountID = $1 and Expiration=false and Active = true;
-- name: CreateYclientsAccount :one -- name: CreateYclientsAccount :one
insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription,Active) values ($1,$2,$3,$4,$5,$6) RETURNING *; insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription) values ($1,$2,$3,$4,$5) RETURNING *;

@ -15,7 +15,6 @@ CREATE TABLE IF NOT EXISTS YclientsAccounts (
SalonID INT NOT NULL, -- ID компании SalonID INT NOT NULL, -- ID компании
Title text NOT NULL DEFAULT '', Title text NOT NULL DEFAULT '',
ShortDecription text NOT NULL DEFAULT '', ShortDecription text NOT NULL DEFAULT '',
Active INT NOT NULL,
Country VARCHAR(50) NOT NULL DEFAULT '', Country VARCHAR(50) NOT NULL DEFAULT '',
Deleted BOOLEAN NOT NULL DEFAULT FALSE, Deleted BOOLEAN NOT NULL DEFAULT FALSE,
CreatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP CreatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP

@ -405,7 +405,6 @@ type Yclientsaccount struct {
Salonid int32 `db:"salonid" json:"salonid"` Salonid int32 `db:"salonid" json:"salonid"`
Title string `db:"title" json:"title"` Title string `db:"title" json:"title"`
Shortdecription string `db:"shortdecription" json:"shortdecription"` Shortdecription string `db:"shortdecription" json:"shortdecription"`
Active int32 `db:"active" json:"active"`
Country string `db:"country" json:"country"` Country string `db:"country" json:"country"`
Deleted bool `db:"deleted" json:"deleted"` Deleted bool `db:"deleted" json:"deleted"`
Createdat time.Time `db:"createdat" json:"createdat"` Createdat time.Time `db:"createdat" json:"createdat"`

@ -1265,7 +1265,7 @@ func (q *Queries) CreateWebHook(ctx context.Context, arg CreateWebHookParams) er
} }
const createYclientsAccount = `-- name: CreateYclientsAccount :one const createYclientsAccount = `-- name: CreateYclientsAccount :one
insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription,Active) values ($1,$2,$3,$4,$5,$6) RETURNING id, accountid, salonid, title, shortdecription, active, country, deleted, createdat insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription) values ($1,$2,$3,$4,$5) RETURNING id, accountid, salonid, title, shortdecription, country, deleted, createdat
` `
type CreateYclientsAccountParams struct { type CreateYclientsAccountParams struct {
@ -1274,7 +1274,6 @@ type CreateYclientsAccountParams struct {
Title string `db:"title" json:"title"` Title string `db:"title" json:"title"`
Country string `db:"country" json:"country"` Country string `db:"country" json:"country"`
Shortdecription string `db:"shortdecription" json:"shortdecription"` Shortdecription string `db:"shortdecription" json:"shortdecription"`
Active int32 `db:"active" json:"active"`
} }
func (q *Queries) CreateYclientsAccount(ctx context.Context, arg CreateYclientsAccountParams) (Yclientsaccount, error) { func (q *Queries) CreateYclientsAccount(ctx context.Context, arg CreateYclientsAccountParams) (Yclientsaccount, error) {
@ -1284,7 +1283,6 @@ func (q *Queries) CreateYclientsAccount(ctx context.Context, arg CreateYclientsA
arg.Title, arg.Title,
arg.Country, arg.Country,
arg.Shortdecription, arg.Shortdecription,
arg.Active,
) )
var i Yclientsaccount var i Yclientsaccount
err := row.Scan( err := row.Scan(
@ -1293,7 +1291,6 @@ func (q *Queries) CreateYclientsAccount(ctx context.Context, arg CreateYclientsA
&i.Salonid, &i.Salonid,
&i.Title, &i.Title,
&i.Shortdecription, &i.Shortdecription,
&i.Active,
&i.Country, &i.Country,
&i.Deleted, &i.Deleted,
&i.Createdat, &i.Createdat,
@ -2461,7 +2458,7 @@ func (q *Queries) GetCurrentCompany(ctx context.Context, accountid string) (Acco
const getCurrentYclientsCompany = `-- name: GetCurrentYclientsCompany :one const getCurrentYclientsCompany = `-- name: GetCurrentYclientsCompany :one
SELECT id, accountid, salonid, title, shortdecription, active, country, deleted, createdat FROM YclientsAccounts WHERE AccountID = $1 AND Deleted = false SELECT id, accountid, salonid, title, shortdecription, country, deleted, createdat FROM YclientsAccounts WHERE AccountID = $1 AND Deleted = false
` `
// Yclients // Yclients
@ -2474,7 +2471,6 @@ func (q *Queries) GetCurrentYclientsCompany(ctx context.Context, accountid strin
&i.Salonid, &i.Salonid,
&i.Title, &i.Title,
&i.Shortdecription, &i.Shortdecription,
&i.Active,
&i.Country, &i.Country,
&i.Deleted, &i.Deleted,
&i.Createdat, &i.Createdat,

@ -17,7 +17,6 @@ type YclientsAccount struct {
SalonID int32 `json:"salon_id"` // ID "аккаунта который ГЛАВНЫЙ" SalonID int32 `json:"salon_id"` // ID "аккаунта который ГЛАВНЫЙ"
Title string `json:"title"` Title string `json:"title"`
ShortDecription string `json:"shortDecription"` ShortDecription string `json:"shortDecription"`
Active int32 `json:"active"`
Country string `json:"country"` Country string `json:"country"`
Deleted bool `json:"deleted"` Deleted bool `json:"deleted"`
CreatedAt time.Time `json:"createdAt"` CreatedAt time.Time `json:"createdAt"`

@ -109,7 +109,6 @@ func (r *YclientsRepository) GetCurrentAccount(ctx context.Context, accountID st
Title: row.Title, Title: row.Title,
Country: row.Country, Country: row.Country,
ShortDecription: row.Shortdecription, ShortDecription: row.Shortdecription,
Active: row.Active,
Deleted: row.Deleted, Deleted: row.Deleted,
CreatedAt: row.Createdat, CreatedAt: row.Createdat,
} }
@ -175,7 +174,6 @@ func (r *YclientsRepository) CreateAccount(ctx context.Context, account model.Yc
Title: account.Title, Title: account.Title,
Country: account.Country, Country: account.Country,
Shortdecription: account.ShortDecription, Shortdecription: account.ShortDecription,
Active: account.Active,
}) })
if err != nil { if err != nil {
return nil, err return nil, err
@ -188,7 +186,6 @@ func (r *YclientsRepository) CreateAccount(ctx context.Context, account model.Yc
Title: row.Title, Title: row.Title,
Country: row.Country, Country: row.Country,
ShortDecription: row.Shortdecription, ShortDecription: row.Shortdecription,
Active: row.Active,
Deleted: row.Deleted, Deleted: row.Deleted,
CreatedAt: row.Createdat, CreatedAt: row.Createdat,
}, nil }, nil