From 32a2509138cd9d1f24e370ac117f3b8d2a5b3754 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Wed, 31 May 2023 16:05:13 +0700 Subject: [PATCH 01/17] chore: clean up the code --- pkg/consts/consts.go | 104 --------------------- pkg/controller/invoice/update_status.go | 11 +-- pkg/handler/accounting/accounting.go | 2 +- pkg/handler/payroll/payroll.go | 30 +++--- pkg/handler/payroll/payroll_calculator.go | 2 +- pkg/handler/webhook/basecamp_accounting.go | 2 +- pkg/handler/webhook/basecamp_expense.go | 6 +- pkg/handler/webhook/basecamp_invoice.go | 2 +- pkg/model/webhook.go | 13 +-- pkg/service/discord/discord.go | 48 +++++----- 10 files changed, 53 insertions(+), 167 deletions(-) delete mode 100644 pkg/consts/consts.go diff --git a/pkg/consts/consts.go b/pkg/consts/consts.go deleted file mode 100644 index 75a43e3f0..000000000 --- a/pkg/consts/consts.go +++ /dev/null @@ -1,104 +0,0 @@ -package consts - -const ( - S3BucketURL = "https://s3-ap-southeast-1.amazonaws.com/fortress-images/" - CriteriaCorp = "DO-NOT-REPLY@criteriacorp.com" - - // Basecamp section - WoodlandScheduleID int64 = 1346305137 - PlaygroundScheduleID int64 = 1941398077 - WoodlandID = 9403032 - PlaygroundID = 12984857 - PlaygroundCampfireID = 1941398072 - HiringID = 13171568 - HiringScheduleID = 1974612191 - PlaygroundTodoID = 1941398075 - PlaygroundDynamicsTodoID = 2235833582 - PlaygroundExpenseTodoID = 2436015405 - FoundationID = 9405283 - FoundationTodoID = 1346687281 - FoundationCampfireID = 1346687275 - WoodlandDynamicsTodoID = 2566078344 - VenturesID = 13484002 - DesignID = 9404034 - OperationID = 9403043 - ManagementID = 15240223 - AccountingID = 15258324 - TechRadarID = 13307382 - ReadifyID = 16277845 - ReadifyCampfireID = 2502884934 - HookID = 393058 - WoodlandTodoID = 1346305133 - OperationTodoID = 1346306047 - ManagementTodoID = 2326974480 - AccountingTodoID = 2329633561 - ExpenseTodoID = 2353511928 - AutoBotID = 25727627 - WoodlandMessageBoardID = 1346305130 - PlaygroundMessageBoardID = 1941398073 - HiringMessageBoardID = 1974612189 - CompanyBasecampID = 4108948 - ProjectManagementID = 1970322248 - TechRadarProjectID = 13307382 - TechRadarMessageBoardID = 1998256729 - TechRadarTodoSetID = 1998256730 - TechRadarAssessTodoListID = 1998259939 // temporary hardcode - HiringTodoSetID = 1974612190 - HRTodoID = 2040601263 - TechRadarCampfireID = 1998256728 - OperationCampfireID = 1346306044 - WoodlandCampfireID = 1346305126 - FortressCampfireID = 1347531395 - HiringCampfireID = 1974612188 - FortressID = 9410372 - OnleaveID = 1998275183 - OnleavePlaygroundID = 2243342506 - WarehouseID = 15921521 - PlaygroundHRTodoID = 2475678340 - BirthdayGift2020 = 2576503375 - BirthdayGift2021 = 3338845535 - PaperTrailTodoListID = 2685205937 - PlaygroundPaperTrailTodoListID = 2685503124 - ShareholderID = 16944388 - ShareholderCampfireID = 2635581864 - SudoID = 16473245 - SudoCampfireID = 2538063314 - OpsExpenseTodoID = 4665885355 - - // People - LyBasecampID = 21564173 - HanBasecampID = 21562923 - QuangBasecampID = 22659105 - AnBasecampID = 21562943 - HuyNguyenBasecampID = 22658825 - HuyGiangBasecampID = 22658816 - MinhTranBasecampID = 21564151 - NamTranBasecampID = 21675130 - DuyenBasecampID = 26160403 - TrungPhanBasecampID = 21574701 - PhuongTruongBasecampID = 21842626 - ThanhNguyenBasecampID = 21572501 - VanNguyenBasecampID = 26595807 - KhaiLeBasecampID = 24006290 - KhanhTruongBasecampID = 24419646 - GiangThanBasecampID = 26160802 - HelenBasecampID = 40439249 - ThuongBasecampID = 38246363 - - // Orgchart - ManagementLevel = 3 - - AccountTempPassword = "pleasechangenow" - GoogleAPIAppName = "Fortress" - S3Bucket = "fortress-images" - - // Basecamp kind list - TodoCreate = "todo_created" - TodoComplete = "todo_completed" - TodoUncomplete = "todo_uncompleted" - CommentCreate = "comment_created" - MessageBoardCreate = "message_created" - MessageBoardActive = "message_active" - - AutobotSgID = "BAh7CEkiCGdpZAY6BkVUSSIpZ2lkOi8vYmMzL1BlcnNvbi8yNTcyNzYyNz9leHBpcmVzX2luBjsAVEkiDHB1cnBvc2UGOwBUSSIPYXR0YWNoYWJsZQY7AFRJIg9leHBpcmVzX2F0BjsAVDA=--5a1528460315bfd57bc41cf6bd3f899b1c346e7b" -) diff --git a/pkg/controller/invoice/update_status.go b/pkg/controller/invoice/update_status.go index c0a64ffcc..14e9bc4bf 100644 --- a/pkg/controller/invoice/update_status.go +++ b/pkg/controller/invoice/update_status.go @@ -11,10 +11,9 @@ import ( "gorm.io/gorm" - "github.com/dwarvesf/fortress-api/pkg/consts" "github.com/dwarvesf/fortress-api/pkg/logger" "github.com/dwarvesf/fortress-api/pkg/model" - bcConst "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" + "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" sInvoice "github.com/dwarvesf/fortress-api/pkg/store/invoice" "github.com/dwarvesf/fortress-api/pkg/utils/timeutil" @@ -192,7 +191,7 @@ func (c *controller) processPaidInvoiceData(l logger.Logger, wg *sync.WaitGroup, // Start Transaction tx, done := c.repo.NewTransaction() - msg := bcConst.CommentUpdateInvoiceFailed + msg := consts.CommentUpdateInvoiceFailed msgType := bcModel.CommentMsgTypeFailed defer func() { wg.Done() @@ -256,14 +255,14 @@ func (c *controller) processPaidInvoiceData(l logger.Logger, wg *sync.WaitGroup, return done(err) } - msg = bcConst.CommentUpdateInvoiceSuccessfully + msg = consts.CommentUpdateInvoiceSuccessfully msgType = bcModel.CommentMsgTypeCompleted return done(nil) } func (c *controller) sendThankYouEmail(l logger.Logger, wg *sync.WaitGroup, req *processPaidInvoiceRequest) { - msg := c.service.Basecamp.BuildCommentMessage(req.InvoiceBucketID, req.InvoiceTodoID, bcConst.CommentThankYouEmailSent, bcModel.CommentMsgTypeCompleted) + msg := c.service.Basecamp.BuildCommentMessage(req.InvoiceBucketID, req.InvoiceTodoID, consts.CommentThankYouEmailSent, bcModel.CommentMsgTypeCompleted) defer func() { c.worker.Enqueue(bcModel.BasecampCommentMsg, msg) @@ -273,7 +272,7 @@ func (c *controller) sendThankYouEmail(l logger.Logger, wg *sync.WaitGroup, req err := c.service.GoogleMail.SendInvoiceThankYouMail(req.Invoice) if err != nil { l.Errorf(err, "failed to send invoice thank you mail", "invoice", req.Invoice) - msg = c.service.Basecamp.BuildCommentMessage(req.InvoiceBucketID, req.InvoiceTodoID, bcConst.CommentThankYouEmailFailed, bcModel.CommentMsgTypeFailed) + msg = c.service.Basecamp.BuildCommentMessage(req.InvoiceBucketID, req.InvoiceTodoID, consts.CommentThankYouEmailFailed, bcModel.CommentMsgTypeFailed) return } } diff --git a/pkg/handler/accounting/accounting.go b/pkg/handler/accounting/accounting.go index a461ca8c7..a762ec412 100644 --- a/pkg/handler/accounting/accounting.go +++ b/pkg/handler/accounting/accounting.go @@ -9,10 +9,10 @@ import ( "github.com/gin-gonic/gin" "github.com/dwarvesf/fortress-api/pkg/config" - "github.com/dwarvesf/fortress-api/pkg/consts" "github.com/dwarvesf/fortress-api/pkg/logger" "github.com/dwarvesf/fortress-api/pkg/model" "github.com/dwarvesf/fortress-api/pkg/service" + "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" "github.com/dwarvesf/fortress-api/pkg/store" "github.com/dwarvesf/fortress-api/pkg/store/project" diff --git a/pkg/handler/payroll/payroll.go b/pkg/handler/payroll/payroll.go index 1728535bb..dd23ad2fb 100644 --- a/pkg/handler/payroll/payroll.go +++ b/pkg/handler/payroll/payroll.go @@ -15,12 +15,12 @@ import ( "gorm.io/gorm" "github.com/dwarvesf/fortress-api/pkg/config" - "github.com/dwarvesf/fortress-api/pkg/consts" "github.com/dwarvesf/fortress-api/pkg/controller" "github.com/dwarvesf/fortress-api/pkg/handler/payroll/errs" "github.com/dwarvesf/fortress-api/pkg/logger" "github.com/dwarvesf/fortress-api/pkg/model" "github.com/dwarvesf/fortress-api/pkg/service" + "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" "github.com/dwarvesf/fortress-api/pkg/service/currency" "github.com/dwarvesf/fortress-api/pkg/store" "github.com/dwarvesf/fortress-api/pkg/store/employee" @@ -148,7 +148,7 @@ func GetPayrollBHXHHandler(h *handler) (interface{}, error) { var res []payrollBHXHResponse isLeft := false - for _, b := range []int{int(model.FirstBatch), int(model.SecondBatch)} { + for _, b := range []int{int(model.FirstBatch), model.SecondBatch} { date := time.Date(time.Now().Year(), time.Now().Month(), b, 0, 0, 0, 0, time.Now().Location()) us, _, err := h.store.Employee.All(h.repo.DB(), employee.EmployeeFilter{IsLeft: &isLeft, BatchDate: &date, Preload: true}, model.Pagination{Page: 0, Size: 500}) if err != nil { @@ -183,19 +183,19 @@ func GetPayrollDetailHandler(h *handler, month, year, batch int, email string) ( year = date.Year() batch = int(model.FirstBatch) if date.Day() == int(model.FirstBatch) { - batch = int(model.SecondBatch) + batch = model.SecondBatch month, year = timeutil.LastMonthYear(month, year) } } else { month, year = timeutil.LastMonthYear(month, year) } - res := []payrollResponse{} + var res []payrollResponse isPaid := true var subTotal int64 var bonusTotal model.VietnamDong - for _, b := range []int{int(model.FirstBatch), int(model.SecondBatch)} { + for _, b := range []int{int(model.FirstBatch), model.SecondBatch} { if batch != 0 && batch != b { continue } @@ -450,7 +450,7 @@ func preparePayroll(h *handler, c string, p *model.Payroll, markPaid bool) (floa } func getProjectBonusExplains(p *model.Payroll) ([]model.ProjectBonusExplain, error) { - projectBonusExplains := []model.ProjectBonusExplain{} + projectBonusExplains := make([]model.ProjectBonusExplain, 0) err := json.Unmarshal( p.ProjectBonusExplain, &projectBonusExplains, @@ -475,7 +475,7 @@ func getProjectBonusExplains(p *model.Payroll) ([]model.ProjectBonusExplain, err } func getCommissionExplains(h *handler, p *model.Payroll, markPaid bool) ([]model.CommissionExplain, error) { - commissionExplains := []model.CommissionExplain{} + commissionExplains := make([]model.CommissionExplain, 0) err := json.Unmarshal( p.CommissionExplain, &commissionExplains, @@ -532,7 +532,7 @@ func storePayrollTransaction(h *handler, p []model.Payroll, batchDate time.Time) if err != nil { return err } - var organization string = "Dwarves Foundation" + var organization = "Dwarves Foundation" now := time.Now() // baseSalaryConversionAmount = total - bonus and reimbursement (commission + projectBonus) - contract, cannot use origin baseSalary becauuse it is not converted to VND @@ -573,7 +573,7 @@ func storePayrollTransaction(h *handler, p []model.Payroll, batchDate time.Time) // bonusConversionAmount = total bonus (commission + projectBonus) - reimbursement (total - conversionAmount) bonusConversionAmount := p[i].CommissionAmount + p[i].ProjectBonusAmount - (p[i].Total - p[i].ConversionAmount) if bonusConversionAmount != 0 { - currency, err := h.store.Currency.GetByName(h.repo.DB(), currency.VNDCurrency) + cur, err := h.store.Currency.GetByName(h.repo.DB(), currency.VNDCurrency) if err != nil { return err } @@ -601,9 +601,9 @@ func storePayrollTransaction(h *handler, p []model.Payroll, batchDate time.Time) ConversionAmount: bonusConversionAmount, Name: fmt.Sprintf("Bonus - %v %v", p[i].Employee.FullName, batchDate.Format("02 January 2006")), Category: category, - Currency: currency.Name, + Currency: cur.Name, Date: &now, - CurrencyID: ¤cy.ID, + CurrencyID: &cur.ID, Organization: organization, Metadata: bonusBytes, ConversionRate: 1, @@ -697,7 +697,7 @@ func (h *handler) commitPayrollHandler(month, year, batch int, email string) err return errors.New("cannot commit payroll too far away") } } - for _, b := range []int{int(model.FirstBatch), int(model.SecondBatch)} { + for _, b := range []int{int(model.FirstBatch), model.SecondBatch} { if batch != b { continue } @@ -759,13 +759,13 @@ func (h *handler) commitPayrollHandler(month, year, batch int, email string) err var wg sync.WaitGroup wg.Add(len(payrolls)) c := make(chan *model.Payroll, len(payrolls)+1) - for _, payroll := range payrolls { + for _, pr := range payrolls { go func(p model.Payroll) { defer wg.Done() if h.config.Env == "prod" || p.Employee.TeamEmail == "quang@d.foundation" || p.Employee.TeamEmail == "huy@d.foundation" { c <- &p } - }(payroll) + }(pr) } wg.Wait() c <- nil @@ -825,7 +825,7 @@ func markBonusAsDone(h *handler, p *model.Payroll) error { } func (h *handler) MarkPayrollAsPaid(c *gin.Context) { - ids := []string{} + var ids []string if err := c.Bind(&ids); err != nil { return } diff --git a/pkg/handler/payroll/payroll_calculator.go b/pkg/handler/payroll/payroll_calculator.go index 8ec4dd5d6..37c1ff5c6 100644 --- a/pkg/handler/payroll/payroll_calculator.go +++ b/pkg/handler/payroll/payroll_calculator.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "github.com/dwarvesf/fortress-api/pkg/consts" "github.com/dwarvesf/fortress-api/pkg/model" + "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" "github.com/dwarvesf/fortress-api/pkg/service/currency" commissionStore "github.com/dwarvesf/fortress-api/pkg/store/employeecommission" diff --git a/pkg/handler/webhook/basecamp_accounting.go b/pkg/handler/webhook/basecamp_accounting.go index 1da38c025..55ad6981c 100644 --- a/pkg/handler/webhook/basecamp_accounting.go +++ b/pkg/handler/webhook/basecamp_accounting.go @@ -10,8 +10,8 @@ import ( "gorm.io/gorm" - "github.com/dwarvesf/fortress-api/pkg/consts" "github.com/dwarvesf/fortress-api/pkg/model" + "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" "github.com/dwarvesf/fortress-api/pkg/service/currency" "github.com/dwarvesf/fortress-api/pkg/utils/timeutil" ) diff --git a/pkg/handler/webhook/basecamp_expense.go b/pkg/handler/webhook/basecamp_expense.go index d07905bde..220c4cb81 100644 --- a/pkg/handler/webhook/basecamp_expense.go +++ b/pkg/handler/webhook/basecamp_expense.go @@ -5,9 +5,9 @@ import ( "fmt" "strings" - "github.com/dwarvesf/fortress-api/pkg/consts" "github.com/dwarvesf/fortress-api/pkg/model" bc "github.com/dwarvesf/fortress-api/pkg/service/basecamp" + "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" ) @@ -149,11 +149,11 @@ func (h *handler) ExtractExpenseData(msg model.BasecampWebhookMessage) (*bc.Base // extract reason datetime := fmt.Sprintf(" %s %v", msg.Recording.UpdatedAt.Month().String(), msg.Recording.UpdatedAt.Year()) - res.Reason = strings.TrimSpace((parts[0])) + res.Reason = strings.TrimSpace(parts[0]) res.Reason += datetime // extract amount - amount := h.service.Basecamp.ExtractBasecampExpenseAmount(strings.TrimSpace((parts[1]))) + amount := h.service.Basecamp.ExtractBasecampExpenseAmount(strings.TrimSpace(parts[1])) if amount == 0 { err := errors.New("invalid amount section of expense format") return nil, err diff --git a/pkg/handler/webhook/basecamp_invoice.go b/pkg/handler/webhook/basecamp_invoice.go index 2e3406623..40ec4673c 100644 --- a/pkg/handler/webhook/basecamp_invoice.go +++ b/pkg/handler/webhook/basecamp_invoice.go @@ -5,8 +5,8 @@ import ( "regexp" "strings" - "github.com/dwarvesf/fortress-api/pkg/consts" "github.com/dwarvesf/fortress-api/pkg/model" + "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" "github.com/dwarvesf/fortress-api/pkg/store/invoice" ) diff --git a/pkg/model/webhook.go b/pkg/model/webhook.go index 72b0842e3..52938c86b 100644 --- a/pkg/model/webhook.go +++ b/pkg/model/webhook.go @@ -24,12 +24,9 @@ func (msg *BasecampWebhookMessage) Read(rc io.ReadCloser) []byte { return body } -// isOperationComplete return true when parent (Todolist) title contain "Operations" example title ("Operations | July 2019") -func (req *BasecampWebhookMessage) IsOperationComplete() bool { - split := strings.Split( - strings.Replace(req.Recording.Parent.Title, " ", "", -1), - "|", - ) +// IsOperationComplete true when parent (Todolist) title contain "Operations" example title ("Operations | July 2019") +func (msg *BasecampWebhookMessage) IsOperationComplete() bool { + split := strings.Split(strings.Replace(msg.Recording.Parent.Title, " ", "", -1), "|") if len(split) < 2 { return false } @@ -40,8 +37,8 @@ func (req *BasecampWebhookMessage) IsOperationComplete() bool { return true } -func (req *BasecampWebhookMessage) IsExpenseComplete() bool { - pt := req.Recording.Parent.Title +func (msg *BasecampWebhookMessage) IsExpenseComplete() bool { + pt := msg.Recording.Parent.Title if len(pt) < 8 || strings.ToLower(pt[:8]) != "expenses" { return false } diff --git a/pkg/service/discord/discord.go b/pkg/service/discord/discord.go index e106dec3a..57bd78185 100644 --- a/pkg/service/discord/discord.go +++ b/pkg/service/discord/discord.go @@ -195,7 +195,7 @@ func (d *discordClient) RemoveRole(userID string, roleID string) error { type Roles discordgo.Roles func (r Roles) DwarvesRoles() []*discordgo.Role { - roleMap := getDwarvesRoleMap() + roleMap := getDwarvesRolesMap() dwarvesRoles := make([]*discordgo.Role, 0) for _, dRole := range r { @@ -218,30 +218,24 @@ func (r Roles) ByCode(code string) *discordgo.Role { return nil } -func getDwarvesRoleMap() map[string]bool { - roleMap := make(map[string]bool) - var dwarvesRoleCodes = []string{ - "moderator", - "dwarf", - "booster", - "apprentice", - "crafter", - "specialist", - "principal", - "peeps", - "learning", - "engagement", - "delivery", - "labs", - "baby dwarf", - "ladies", - "sers", - "consultant", - "chad", - } - for _, code := range dwarvesRoleCodes { - roleMap[code] = true - } - - return roleMap +func getDwarvesRolesMap() map[string]bool { + return map[string]bool{ + "moderator": true, + "dwarf": true, + "booster": true, + "apprentice": true, + "crafter": true, + "specialist": true, + "principal": true, + "peeps": true, + "learning": true, + "engagement": true, + "delivery": true, + "labs": true, + "baby dwarf": true, + "ladies": true, + "sers": true, + "consultant": true, + "chad": true, + } } From 555d6c806e76f8770bf169dcbcad2b3551755628 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 11:17:23 +0700 Subject: [PATCH 02/17] feat: allow using discord in dev --- pkg/controller/employee/update_employee_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/employee/update_employee_status.go b/pkg/controller/employee/update_employee_status.go index 1d22fa0a8..b6f437d28 100644 --- a/pkg/controller/employee/update_employee_status.go +++ b/pkg/controller/employee/update_employee_status.go @@ -94,7 +94,7 @@ func (r *controller) processOffBoardingEmployee(l logger.Logger, e *model.Employ } func (r *controller) updateDiscordRoles(discordUserID string) error { - if r.config.Env != "prod" { + if !(r.config.Env == "prod" || r.config.Env == "dev") { return nil } From 1c54ee327500ee206a303f043f1b8c4c37c9da4b Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 11:17:37 +0700 Subject: [PATCH 03/17] feat: allow using discord in dev --- pkg/handler/profile/profile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/handler/profile/profile.go b/pkg/handler/profile/profile.go index 85f965e59..3b1e2c696 100644 --- a/pkg/handler/profile/profile.go +++ b/pkg/handler/profile/profile.go @@ -871,7 +871,7 @@ func (h *handler) assignDiscordRole(discordName string) error { return nil } - if h.config.Env != "prod" { + if !(h.config.Env == "prod" || h.config.Env == "dev") { return nil } From 50584e3f2a004cfdb5ff151a71525278477062e7 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 14:22:20 +0700 Subject: [PATCH 04/17] chore: add migration down to migrate file without down script --- .../schemas/20221127165238-create_invoices_table.sql | 1 + .../schemas/20230307184910-create_payroll_tables.sql | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/migrations/schemas/20221127165238-create_invoices_table.sql b/migrations/schemas/20221127165238-create_invoices_table.sql index de6ebe168..00da57985 100644 --- a/migrations/schemas/20221127165238-create_invoices_table.sql +++ b/migrations/schemas/20221127165238-create_invoices_table.sql @@ -89,5 +89,6 @@ ALTER TABLE invoices -- +migrate Down DROP TABLE IF EXISTS invoices; DROP TABLE IF EXISTS bank_accounts; +DROP TABLE IF EXISTS base_salaries; DROP TABLE IF EXISTS currencies; DROP TYPE IF EXISTS invoice_statuses; diff --git a/migrations/schemas/20230307184910-create_payroll_tables.sql b/migrations/schemas/20230307184910-create_payroll_tables.sql index 2d86c7203..c564d2e80 100644 --- a/migrations/schemas/20230307184910-create_payroll_tables.sql +++ b/migrations/schemas/20230307184910-create_payroll_tables.sql @@ -130,3 +130,12 @@ CREATE TABLE IF NOT EXISTS "cached_payrolls" ( ALTER TABLE "cached_payrolls" ADD CONSTRAINT "cached_payrolls_month_year_batch_key" UNIQUE ("month", "year", "batch"); -- +migrate Down +DROP TABLE IF EXISTS "base_salaries"; +DROP TABLE IF EXISTS "accounting_transactions"; +DROP TABLE IF EXISTS "accounting_categories"; +DROP TABLE IF EXISTS "employee_commissions"; +DROP TABLE IF EXISTS "employee_bonuses"; +DROP TABLE IF EXISTS "payrolls"; +DROP TABLE IF EXISTS "project_commission_configs"; +DROP TABLE IF EXISTS "cached_payrolls"; +DROP TABLE IF EXISTS "base_salaries"; \ No newline at end of file From 4b0c11fc1850caed550507341f567fc3337107d0 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 14:22:48 +0700 Subject: [PATCH 05/17] chore: clean up seed data --- migrations/seed/metadata.sql | 7 +- migrations/seed/permissions.sql | 176 +++++++-------- migrations/seed/projects.sql | 20 +- migrations/seed/role_permissions.sql | 309 ++++++++++++++------------- 4 files changed, 258 insertions(+), 254 deletions(-) diff --git a/migrations/seed/metadata.sql b/migrations/seed/metadata.sql index 3cd014289..c9937af0a 100644 --- a/migrations/seed/metadata.sql +++ b/migrations/seed/metadata.sql @@ -216,7 +216,10 @@ INSERT INTO public.company_infos (id, deleted_at, created_at, updated_at, name, -- ('25938962-611b-45ad-b6be-c0a1365ea1de', null, '2023-02-07 18:57:47.312554', '2023-02-07 18:57:47.312554', 'year_invoice_2023', 1), -- ('10fa5046-199d-4d9a-bbf9-44345127be79', null, '2023-02-07 18:59:45.024935', '2023-02-07 18:59:45.024935', 'project_invoice_fortress_2023', 1); -INSERT INTO public.bank_accounts (id, deleted_at, created_at, updated_at, account_number, bank_name, currency_id, owner_name, address, swift_code, routing_number, name, uk_sort_code) VALUES -('fc6b1743-05c5-4152-9340-1d20d96d8fc0', null, '2023-02-07 18:39:35.547782', '2023-02-07 18:39:35.547782', '0999999888', 'ACB', '7037bdb6-584e-4e35-996d-ef28a243f48a', 'Dwarves Foundation', 'Hado Centrosa', 'AVBWFPW', null, 'DF Bank Account', null); +INSERT INTO public.bank_accounts (id, deleted_at, created_at, updated_at, account_number, bank_name, currency_id, owner_name, address, swift_code, routing_number, name, uk_sort_code, intermediary_bank_address, intermediary_bank_name) VALUES +('e447d23b-2786-4463-82e1-bbe139dd939f', null, '2023-02-07 18:39:35.547782', '2023-02-07 18:39:35.547782', '0394882818', 'Bank of America', 'f00498e4-7a4c-4f61-b126-b84b5faeee06', 'Lorem Ipsum Inc', '3629 Riverside Drive, Menlo, GA, 30731', 'DAKJFKSJD', '98149281', 'Lorem Ipsum Inc', '198249-231', 'Intermediary Bank Address', 'Intermediary Bank Name'), +('fc6b1743-05c5-4152-9340-1d20d96d8fc0', null, '2023-02-07 18:39:35.547782', '2023-02-07 18:39:35.547782', '0999999888', 'ACB', 'bf256e69-28b0-4d9f-bf48-3662854157a9', 'Dwarves Foundation', 'Hado Centrosa', 'AVBWFPW', null, 'DF Bank Account', null, 'Intermediary Bank Address', 'Intermediary Bank Name'); + + diff --git a/migrations/seed/permissions.sql b/migrations/seed/permissions.sql index 53e150e39..ad7146df8 100644 --- a/migrations/seed/permissions.sql +++ b/migrations/seed/permissions.sql @@ -1,89 +1,89 @@ INSERT INTO public.permissions (id, deleted_at, created_at, updated_at, name, code) VALUES -('495c96ae-60f9-4c57-bc96-9504d0fedde6', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Auth Read', 'auth.read'), -('5820dd37-a9bd-455e-b49b-b54ad7df180e', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Auth Create', 'auth.create'), -('01ed1076-4028-4fdf-9a92-cb57a8e041af', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read', 'employees.read'), -('20a442b2-9763-41d4-b3c9-e436b37bf534', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Access', 'employees.read.fullAccess'), -('c353c4fd-5915-47f3-a59b-66ae75eae195', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Get Active', 'employees.read.readActive'), -('dc6fde9f-0b49-46d6-96bb-93be669b502b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Personal Info', 'employees.read.personalInfo.fullAccess'), -('f75677d6-3e22-45d4-b921-81d6a3645157', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full General Info', 'employees.read.generalInfo.fullAccess'), -('9be246ac-2e53-4268-814a-dc760afd3758', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Base Salary Read', 'employees.baseSalary.read'), -('84aa4653-4bd8-428b-9521-618a67a6be6b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Base Salary Edit', 'employees.baseSalary.edit'), -('6add4087-e586-4313-b157-54d416bdc8d5', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Project Belong to One Employee', 'employees.read.projects.fullAccess'), -('911df73b-b860-4319-8944-c274781591ca', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Project Belong to One Employee', 'employees.read.projects.readActive'), -('834ce06a-2797-4974-bbdd-2dfffc431c5f', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Filter By All Statuses', 'employees.read.filterByAllStatuses'), -('11e16c63-87b2-4874-8961-c21716bdd97e', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Filter By All Statuses', 'employees.read.filterByProject'), -('5c1745b6-d920-47d2-986a-fe6c48802ace', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Line Manager', 'employees.read.lineManager.fullAccess'), -('a7549f30-987c-47d1-9266-452f3cfc68b7', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Create', 'employees.create'), -('e4e68398-da67-438f-9fb0-07a779b504a0', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Edit', 'employees.edit'), -('33279d12-6daa-41d3-a037-9f805e8ebf61', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Delete', 'employees.delete'), -('09a5fa4c-ad07-4dec-a16d-34e0f567ef1d', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Create', 'projects.create'), -('35bb795a-0b9f-428c-861d-48c1e8d4e73a', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read', 'projects.read'), -('a8299847-4d10-41e9-8327-42e13e0672ae', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read Full Access', 'projects.read.fullAccess'), -('7bd3d8e3-8b0b-4f3a-8ee7-0b6bec1c8913', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read Monthly Revenue', 'projects.read.monthlyRevenue'), -('3c26a977-f4b9-4bc4-8d31-a2dcf075d254', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read Active', 'projects.read.readActive'), -('80a2c800-02ea-4264-9289-57b92e911097', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Edit', 'projects.edit'), -('6118a1da-aa9a-40eb-b664-87a6969c5759', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Commission Rate Read', 'projects.commissionRate.read'), -('79b1a377-7b73-4bea-90c2-330bda11b635', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Commission Rate Edit', 'projects.commissionRate.edit'), -('6797aeac-7d5e-4216-b260-a8a3f62d3cf6', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Create', 'projectMembers.create'), -('57ead3c5-b09f-4cd8-ac38-d9c0d4654af5', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Read', 'projectMembers.read'), -('58719469-e01d-4667-bafa-12020931e317', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Edit', 'projectMembers.edit'), -('1a1303f3-a929-41b3-be7f-d372e6aab87a', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Delete', 'projectMembers.delete'), -('e33cc269-3a12-436e-aab7-75f14953388f', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Rate Read', 'projectMembers.rate.read'), -('2f6c957c-725b-4da4-ad6d-9a23a1e18a98', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Rate Edit', 'projectMembers.rate.edit'), -('819adaec-f4a2-4438-937d-fcd9cc15d76b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Create', 'projectWorkUnits.create'), -('7c7937f6-f3ae-47a4-8ee1-fb03f2a5197b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Create Full Access', 'projectWorkUnits.create.fullAccess'), -- -('7c2d5fef-3096-4b68-bd76-f26cb2a3baea', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Read', 'projectWorkUnits.read'), -('d2d5dad6-efa3-4d20-9b30-34c6c933fa5e', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Read Full Access', 'projectWorkUnits.read.fullAccess'), -- -('cb90c56a-60a8-4345-8001-bb7ab172b302', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Edit', 'projectWorkUnits.edit'), -('8bae7a76-9f0e-4074-bfb9-31c3ad9c88e6', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Edit Full Access', 'projectWorkUnits.edit.fullAccess'), -- -('6eb3bf29-87dc-490b-85b4-e591d416ac8f', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Delete', 'projectWorkUnits.delete'), -('455368b3-abbe-4bc7-beb3-01f070addc14', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Delete Full Access', 'projectWorkUnits.delete.fullAccess'), -- -('615cf3a6-89cb-4200-81b4-47542ae8b145', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Create', 'feedbacks.create'), -('cc88051f-7eea-468e-a9ac-91757dde2581', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Read', 'feedbacks.read'), -('3b542878-f597-421f-b4ac-5f71b0e22ddb', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Edit', 'feedbacks.edit'), -('2969fd2a-ae44-414a-85ac-7a930c6de987', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Delete', 'feedbacks.delete'), -('37219e6a-34f1-4d68-8727-db90ddd6f97e', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Create', 'employeeEventQuestions.create'), -('bfd6144d-0161-41f2-9cf5-3467d2a505fd', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Edit', 'employeeEventQuestions.edit'), -('be88150b-3ad5-4cef-8716-90873d194207', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Read', 'employeeEventQuestions.read'), -('23fe9fa0-d848-491f-8b6d-04ada45b9c51', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Delete', 'employeeEventQuestions.delete'), -('d5c1142a-86a6-4347-bdef-2ad41492b738', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Create', 'surveys.create'), -('ef32d604-42ec-40f8-9c34-08431d2c20d8', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Read', 'surveys.read'), -('f5906795-60d1-4e5f-88f2-e15f2fae2327', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Edit', 'surveys.edit'), -('dfc32d81-abfa-49ce-a8f6-cdc83c8da78b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Delete', 'surveys.delete'), -('ed107409-30c5-4555-ba2e-7d77ee8027dc', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Create', 'employeeMentees.create'), -('0b8bc573-c8a8-49f4-8274-486990e76540', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Read', 'employeeMentees.read'), -('910cd3bd-3b9b-4243-899f-86ed47e9d1c9', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Edit', 'employeeMentees.edit'), -('967f2d24-1bd9-4b62-8136-7fed60dee6d9', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Delete', 'employeeMentees.delete'), -('050ee781-7f32-4d79-b3d3-1e9d550d4a8f', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Create', 'metadata.create'), -('476156c1-70d8-4eb1-adc5-f8f5ec209666', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Read', 'metadata.read'), -('a87e99c2-c40e-42e0-9310-943f2faa654b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Edit', 'metadata.edit'), -('befac4bf-bb20-4b46-9e56-f8175c93b191', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Delete', 'metadata.delete'), -('f632f18c-98da-4c1a-b2c6-9ccd0c7c5a39', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Create', 'employeeRoles.create'), -('5c5919b5-e74b-4854-bdf6-b91396a8317c', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Read', 'employeeRoles.read'), -('68fe5bcf-38ae-446a-8cbb-8f88b5c6eb44', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Edit', 'employeeRoles.edit'), -('98744d43-f14b-4235-8dfc-5265668daa21', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Delete', 'employeeRoles.delete'), -('4be48741-f8b2-4562-964e-65c081fec7a9', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Create', 'dashboards.create'), -('f5854cfd-f990-46fd-a6cb-77b48a80b24b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Read', 'dashboards.read'), -('6f4fe3df-9ab8-46c1-a8b7-9458413980f3', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Edit', 'dashboards.edit'), -('d93ede75-8fd5-4f88-b119-07493b757f4b', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Delete', 'dashboards.delete'), -('a66215da-48dc-419d-8e2d-3f409aa038e3', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Projects Read', 'dashboards.project.read'), -('36e9c7bd-c98f-4414-a8f4-164da5299874', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Resources Read', 'dashboards.resources.read'), -('ca0af093-65ed-48d4-a6d1-62985a35fd8f', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Engagement Read', 'dashboards.engagement.read'), -('9c644140-c71d-4435-bd6b-a81171913046', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Create', 'invoices.create'), -('259fb434-5321-43be-b007-76f3c2dfbfcc', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Read', 'invoices.read'), -('fa6961f1-1cee-494f-8f1f-f4552b49b6fa', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Edit', 'invoices.edit'), -('60768a38-8ff1-493a-85ba-b62df98a60d4', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Delete', 'invoices.delete'), -('78d617f8-b155-4051-b128-7f2d00ca31fd', NULL, '2023-01-10 05:19:00.330571', '2023-01-10 05:19:00.330571', 'Valuation Read', 'valuations.read'), -('738ae6ae-e961-4fc2-b941-079e130f4213', NULL, '2023-02-13 13:32:29.330571', '2023-02-13 13:32:29.330571', 'Bank Account Read', 'bankAccounts.read'), -('75ae4f79-cef1-4dfd-be66-064c118ba6cf', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Create', 'clients.create'), -('97a02a4d-b8fb-486d-af1a-25139014b375', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Read', 'clients.read'), -('92031f1a-b745-42cf-aac1-a067bbee08e6', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Edit', 'clients.edit'), -('7fb332e7-3231-42e6-8f38-a5c8b224d84e', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Delete', 'clients.delete'), -('475d8075-aec7-4d75-aa79-dc90c9dd9edb', NULL, '2023-02-20 09:50:25.714604', '2023-02-20 09:50:25.714604', 'Cronjob Execute', 'cronjobs.execute'), -('93886b0b-6592-4838-b024-1aefb123fed6', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Asset Upload', 'assets.upload'), -('f75db77f-e299-4135-81b7-0784b452f7b7', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Notion Read', 'notion.read'), -('d500ea57-da9a-4b24-b147-59d009f0d7bc', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Notion Write', 'notion.write'), -('c604d238-3c43-4825-93eb-db7b01480098', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Notion Write', 'notion.send'), -('be186320-bef0-48cc-805e-f7b4810a3b30', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Payrolls Create', 'payrolls.create'), -('f1bef8de-8a6b-4d7d-ae1a-e09ec631fd94', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Payrolls Edit', 'payrolls.edit'), -('9be15ffa-3695-4d7f-93aa-ef594a08c36a', NULL, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Payrolls Read', 'payrolls.read'); +('93886b0b-6592-4838-b024-1aefb123fed6', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Asset Upload', 'assets.upload'), +('5820dd37-a9bd-455e-b49b-b54ad7df180e', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Auth Create', 'auth.create'), +('495c96ae-60f9-4c57-bc96-9504d0fedde6', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Auth Read', 'auth.read'), +('738ae6ae-e961-4fc2-b941-079e130f4213', null, '2023-02-13 13:32:29.330571', '2023-02-13 13:32:29.330571', 'Bank Account Read', 'bankAccounts.read'), +('75ae4f79-cef1-4dfd-be66-064c118ba6cf', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Create', 'clients.create'), +('7fb332e7-3231-42e6-8f38-a5c8b224d84e', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Delete', 'clients.delete'), +('92031f1a-b745-42cf-aac1-a067bbee08e6', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Edit', 'clients.edit'), +('97a02a4d-b8fb-486d-af1a-25139014b375', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Clients Read', 'clients.read'), +('475d8075-aec7-4d75-aa79-dc90c9dd9edb', null, '2023-02-20 09:50:25.714604', '2023-02-20 09:50:25.714604', 'Cronjob Execute', 'cronjobs.execute'), +('4be48741-f8b2-4562-964e-65c081fec7a9', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Create', 'dashboards.create'), +('d93ede75-8fd5-4f88-b119-07493b757f4b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Delete', 'dashboards.delete'), +('6f4fe3df-9ab8-46c1-a8b7-9458413980f3', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Edit', 'dashboards.edit'), +('ca0af093-65ed-48d4-a6d1-62985a35fd8f', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Engagement Read', 'dashboards.engagement.read'), +('a66215da-48dc-419d-8e2d-3f409aa038e3', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Projects Read', 'dashboards.project.read'), +('f5854cfd-f990-46fd-a6cb-77b48a80b24b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Read', 'dashboards.read'), +('36e9c7bd-c98f-4414-a8f4-164da5299874', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Dashboard Resources Read', 'dashboards.resources.read'), +('37219e6a-34f1-4d68-8727-db90ddd6f97e', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Create', 'employeeEventQuestions.create'), +('23fe9fa0-d848-491f-8b6d-04ada45b9c51', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Delete', 'employeeEventQuestions.delete'), +('bfd6144d-0161-41f2-9cf5-3467d2a505fd', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Edit', 'employeeEventQuestions.edit'), +('be88150b-3ad5-4cef-8716-90873d194207', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Event Question Read', 'employeeEventQuestions.read'), +('ed107409-30c5-4555-ba2e-7d77ee8027dc', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Create', 'employeeMentees.create'), +('967f2d24-1bd9-4b62-8136-7fed60dee6d9', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Delete', 'employeeMentees.delete'), +('910cd3bd-3b9b-4243-899f-86ed47e9d1c9', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Edit', 'employeeMentees.edit'), +('0b8bc573-c8a8-49f4-8274-486990e76540', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Mentees Read', 'employeeMentees.read'), +('f632f18c-98da-4c1a-b2c6-9ccd0c7c5a39', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Create', 'employeeRoles.create'), +('98744d43-f14b-4235-8dfc-5265668daa21', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Delete', 'employeeRoles.delete'), +('68fe5bcf-38ae-446a-8cbb-8f88b5c6eb44', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Edit', 'employeeRoles.edit'), +('5c5919b5-e74b-4854-bdf6-b91396a8317c', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Roles Read', 'employeeRoles.read'), +('84aa4653-4bd8-428b-9521-618a67a6be6b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Base Salary Edit', 'employees.baseSalary.edit'), +('9be246ac-2e53-4268-814a-dc760afd3758', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Base Salary Read', 'employees.baseSalary.read'), +('a7549f30-987c-47d1-9266-452f3cfc68b7', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Create', 'employees.create'), +('33279d12-6daa-41d3-a037-9f805e8ebf61', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Delete', 'employees.delete'), +('e4e68398-da67-438f-9fb0-07a779b504a0', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Edit', 'employees.edit'), +('01ed1076-4028-4fdf-9a92-cb57a8e041af', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read', 'employees.read'), +('834ce06a-2797-4974-bbdd-2dfffc431c5f', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Filter By All Statuses', 'employees.read.filterByAllStatuses'), +('11e16c63-87b2-4874-8961-c21716bdd97e', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Filter By All Statuses', 'employees.read.filterByProject'), +('20a442b2-9763-41d4-b3c9-e436b37bf534', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Access', 'employees.read.fullAccess'), +('f75677d6-3e22-45d4-b921-81d6a3645157', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full General Info', 'employees.read.generalInfo.fullAccess'), +('5c1745b6-d920-47d2-986a-fe6c48802ace', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Line Manager', 'employees.read.lineManager.fullAccess'), +('dc6fde9f-0b49-46d6-96bb-93be669b502b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Personal Info', 'employees.read.personalInfo.fullAccess'), +('6add4087-e586-4313-b157-54d416bdc8d5', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Project Belong to One Employee', 'employees.read.projects.fullAccess'), +('911df73b-b860-4319-8944-c274781591ca', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Full Project Belong to One Employee', 'employees.read.projects.readActive'), +('c353c4fd-5915-47f3-a59b-66ae75eae195', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Employee Read Get Active', 'employees.read.readActive'), +('615cf3a6-89cb-4200-81b4-47542ae8b145', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Create', 'feedbacks.create'), +('2969fd2a-ae44-414a-85ac-7a930c6de987', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Delete', 'feedbacks.delete'), +('3b542878-f597-421f-b4ac-5f71b0e22ddb', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Edit', 'feedbacks.edit'), +('cc88051f-7eea-468e-a9ac-91757dde2581', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Feedback Read', 'feedbacks.read'), +('9c644140-c71d-4435-bd6b-a81171913046', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Create', 'invoices.create'), +('60768a38-8ff1-493a-85ba-b62df98a60d4', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Delete', 'invoices.delete'), +('fa6961f1-1cee-494f-8f1f-f4552b49b6fa', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Edit', 'invoices.edit'), +('259fb434-5321-43be-b007-76f3c2dfbfcc', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Invoice Read', 'invoices.read'), +('050ee781-7f32-4d79-b3d3-1e9d550d4a8f', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Create', 'metadata.create'), +('befac4bf-bb20-4b46-9e56-f8175c93b191', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Delete', 'metadata.delete'), +('a87e99c2-c40e-42e0-9310-943f2faa654b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Edit', 'metadata.edit'), +('476156c1-70d8-4eb1-adc5-f8f5ec209666', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Metadata Read', 'metadata.read'), +('f75db77f-e299-4135-81b7-0784b452f7b7', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Notion Read', 'notion.read'), +('c604d238-3c43-4825-93eb-db7b01480098', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Notion Send', 'notion.send'), +('d500ea57-da9a-4b24-b147-59d009f0d7bc', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Notion Write', 'notion.write'), +('be186320-bef0-48cc-805e-f7b4810a3b30', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Payrolls Create', 'payrolls.create'), +('f1bef8de-8a6b-4d7d-ae1a-e09ec631fd94', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Payrolls Edit', 'payrolls.edit'), +('9be15ffa-3695-4d7f-93aa-ef594a08c36a', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Payrolls Read', 'payrolls.read'), +('6797aeac-7d5e-4216-b260-a8a3f62d3cf6', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Create', 'projectMembers.create'), +('1a1303f3-a929-41b3-be7f-d372e6aab87a', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Delete', 'projectMembers.delete'), +('58719469-e01d-4667-bafa-12020931e317', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Edit', 'projectMembers.edit'), +('2f6c957c-725b-4da4-ad6d-9a23a1e18a98', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Rate Edit', 'projectMembers.rate.edit'), +('e33cc269-3a12-436e-aab7-75f14953388f', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Rate Read', 'projectMembers.rate.read'), +('57ead3c5-b09f-4cd8-ac38-d9c0d4654af5', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Member Read', 'projectMembers.read'), +('79b1a377-7b73-4bea-90c2-330bda11b635', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Commission Rate Edit', 'projects.commissionRate.edit'), +('6118a1da-aa9a-40eb-b664-87a6969c5759', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Commission Rate Read', 'projects.commissionRate.read'), +('09a5fa4c-ad07-4dec-a16d-34e0f567ef1d', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Create', 'projects.create'), +('80a2c800-02ea-4264-9289-57b92e911097', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Edit', 'projects.edit'), +('35bb795a-0b9f-428c-861d-48c1e8d4e73a', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read', 'projects.read'), +('a8299847-4d10-41e9-8327-42e13e0672ae', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read Full Access', 'projects.read.fullAccess'), +('7bd3d8e3-8b0b-4f3a-8ee7-0b6bec1c8913', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read Monthly Revenue', 'projects.read.monthlyRevenue'), +('3c26a977-f4b9-4bc4-8d31-a2dcf075d254', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Project Read Active', 'projects.read.readActive'), +('819adaec-f4a2-4438-937d-fcd9cc15d76b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Create', 'projectWorkUnits.create'), +('7c7937f6-f3ae-47a4-8ee1-fb03f2a5197b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Create Full Access', 'projectWorkUnits.create.fullAccess'), +('6eb3bf29-87dc-490b-85b4-e591d416ac8f', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Delete', 'projectWorkUnits.delete'), +('455368b3-abbe-4bc7-beb3-01f070addc14', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Delete Full Access', 'projectWorkUnits.delete.fullAccess'), +('cb90c56a-60a8-4345-8001-bb7ab172b302', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Edit', 'projectWorkUnits.edit'), +('8bae7a76-9f0e-4074-bfb9-31c3ad9c88e6', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Edit Full Access', 'projectWorkUnits.edit.fullAccess'), +('7c2d5fef-3096-4b68-bd76-f26cb2a3baea', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Read', 'projectWorkUnits.read'), +('d2d5dad6-efa3-4d20-9b30-34c6c933fa5e', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Work Unit Read Full Access', 'projectWorkUnits.read.fullAccess'), +('d5c1142a-86a6-4347-bdef-2ad41492b738', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Create', 'surveys.create'), +('dfc32d81-abfa-49ce-a8f6-cdc83c8da78b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Delete', 'surveys.delete'), +('f5906795-60d1-4e5f-88f2-e15f2fae2327', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Edit', 'surveys.edit'), +('ef32d604-42ec-40f8-9c34-08431d2c20d8', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Read', 'surveys.read'), +('78d617f8-b155-4051-b128-7f2d00ca31fd', null, '2023-01-10 05:19:00.330571', '2023-01-10 05:19:00.330571', 'Valuation Read', 'valuations.read'); diff --git a/migrations/seed/projects.sql b/migrations/seed/projects.sql index 1f78c34ed..dfc62d588 100644 --- a/migrations/seed/projects.sql +++ b/migrations/seed/projects.sql @@ -1,11 +1,11 @@ INSERT INTO public.projects (id, deleted_at, created_at, updated_at, name, type, start_date, end_date, status, country_id, client_email, project_email, code, allows_sending_survey, function, bank_account_id, client_id, company_info_id) VALUES -('dfa182fc-1d2d-49f6-a877-c01da9ce4207', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Lorem ipsum', 'time-material', '2022-07-06', NULL, 'active', NULL, NULL, NULL, 'lorem-ipsum', TRUE, 'development', NULL, NULL, NULL), -('8dc3be2e-19a4-4942-8a79-56db391a0b15', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Fortress', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'team@d.foundation', 'fortress@d.foundation', 'fortress', TRUE, 'development', 'fc6b1743-05c5-4152-9340-1d20d96d8fc0', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), -('2df3256d-ea4a-45ed-a91b-4b3d2a7250e2', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Nghe Nhan', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'nghenhan@d.foundation', 'nghenhan@d.foundation', 'nghenhan', TRUE, 'development', NULL, NULL, NULL), -('81ffc0a7-52ee-43fd-92ae-8603b02008e8', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Icrosschain', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'icrosschain@d.foundation', 'icrosschain@d.foundation', 'icrosschain', TRUE, 'development', NULL, NULL, NULL), -('c59cd991-809e-4bcf-a9b5-ee46d61217d7', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Voconic', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'voconic@d.foundation', 'voconic@d.foundation', 'voconic', TRUE, 'development', NULL, NULL, NULL), -('2907613b-a86e-4b20-b8c6-4405a590fff7', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'SP', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'sp@d.foundation', 'sp@d.foundation', 'sp', TRUE, 'development', NULL, NULL, NULL), -('672a9da4-d037-4fde-821e-7d7a4bc0770a', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Droppii', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'droppii@d.foundation', 'droppii@d.foundation', 'droppii', TRUE, 'development', NULL, NULL, NULL), -('62dc0545-9548-4761-9a62-625cad4f4246', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Konvoy', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'konvoy@d.foundation', 'konvoy@d.foundation', 'konvoy', TRUE, 'development', NULL, NULL, NULL), -('72f64a6c-1be0-474c-a40c-0c3091e5be1e', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Setel', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'setel@d.foundation', 'setel@d.foundation', 'setel', TRUE, 'development', NULL, NULL, NULL), -('22f925ad-9788-4deb-a7fa-420b92651a02', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Gravity', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'graviry@d.foundation', 'graviry@d.foundation', 'graviry', TRUE, 'development', NULL, NULL, NULL); +('dfa182fc-1d2d-49f6-a877-c01da9ce4207', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Lorem ipsum', 'time-material', '2022-07-06', NULL, 'active', NULL, NULL, NULL, 'lorem-ipsum', TRUE, 'development', 'fc6b1743-05c5-4152-9340-1d20d96d8fc0', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('8dc3be2e-19a4-4942-8a79-56db391a0b15', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Fortress', 'time-material', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'team@d.foundation', 'fortress@d.foundation', 'fortress', TRUE, 'development', 'e447d23b-2786-4463-82e1-bbe139dd939f', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('2df3256d-ea4a-45ed-a91b-4b3d2a7250e2', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Nghe Nhan', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'nghenhan@d.foundation', 'nghenhan@d.foundation', 'nghenhan', TRUE, 'development', 'e447d23b-2786-4463-82e1-bbe139dd939f', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('81ffc0a7-52ee-43fd-92ae-8603b02008e8', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Icrosschain', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'icrosschain@d.foundation', 'icrosschain@d.foundation', 'icrosschain', TRUE, 'development', 'fc6b1743-05c5-4152-9340-1d20d96d8fc0', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('c59cd991-809e-4bcf-a9b5-ee46d61217d7', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Voconic', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'voconic@d.foundation', 'voconic@d.foundation', 'voconic', TRUE, 'development', 'e447d23b-2786-4463-82e1-bbe139dd939f', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('2907613b-a86e-4b20-b8c6-4405a590fff7', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'SP', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'sp@d.foundation', 'sp@d.foundation', 'sp', TRUE, 'development', 'e447d23b-2786-4463-82e1-bbe139dd939f', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('672a9da4-d037-4fde-821e-7d7a4bc0770a', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Droppii', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'droppii@d.foundation', 'droppii@d.foundation', 'droppii', TRUE, 'development', 'fc6b1743-05c5-4152-9340-1d20d96d8fc0', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('62dc0545-9548-4761-9a62-625cad4f4246', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Konvoy', 'time-material', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'konvoy@d.foundation', 'konvoy@d.foundation', 'konvoy', TRUE, 'development', 'e447d23b-2786-4463-82e1-bbe139dd939f', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('72f64a6c-1be0-474c-a40c-0c3091e5be1e', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Setel', 'time-material', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'setel@d.foundation', 'setel@d.foundation', 'setel', TRUE, 'development', 'e447d23b-2786-4463-82e1-bbe139dd939f', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'), +('22f925ad-9788-4deb-a7fa-420b92651a02', NULL, '2022-11-11 18:06:56.362902', '2022-11-11 18:06:56.362902', 'Gravity', 'dwarves', '2022-11-01', NULL, 'active', '4ef64490-c906-4192-a7f9-d2221dadfe4c', 'graviry@d.foundation', 'graviry@d.foundation', 'graviry', TRUE, 'development', 'e447d23b-2786-4463-82e1-bbe139dd939f', 'afb9cf05-9517-4fb9-a4f2-66e6d90ad215', '2b57ec32-19c2-46f0-8cf5-04623241a464'); diff --git a/migrations/seed/role_permissions.sql b/migrations/seed/role_permissions.sql index cc02d7808..cef0c8591 100644 --- a/migrations/seed/role_permissions.sql +++ b/migrations/seed/role_permissions.sql @@ -97,160 +97,161 @@ INSERT INTO public.role_permissions (id, deleted_at, created_at, updated_at, rol -- ENGINEERING MANAGER INSERT INTO public.role_permissions (id, deleted_at, created_at, updated_at, role_id, permission_id) VALUES -('6ef5b987-0a8d-42e8-b52c-fe683cd7a060', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '495c96ae-60f9-4c57-bc96-9504d0fedde6'), -('f73306cc-5b01-49bb-87af-a2c2af14bfae', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '01ed1076-4028-4fdf-9a92-cb57a8e041af'), -('9b63e271-261c-4f2f-9675-5b760fe6fa29', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '20a442b2-9763-41d4-b3c9-e436b37bf534'), -('64b381e6-039e-42dc-bc13-b5ed46bac99d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'c353c4fd-5915-47f3-a59b-66ae75eae195'), -('642691b3-ac2e-45eb-9caa-0442e696d0da', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'dc6fde9f-0b49-46d6-96bb-93be669b502b'), -('bfed95b5-6dd7-4f67-91b3-10ef314f8d9c', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'f75677d6-3e22-45d4-b921-81d6a3645157'), -('db1f6ec9-11e5-427a-8b3d-1f93103c9648', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6add4087-e586-4313-b157-54d416bdc8d5'), -('76ac9b8b-f8c4-488c-bc5b-6f7afc9e336a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '911df73b-b860-4319-8944-c274781591ca'), -('2d1a7f12-8b50-4bec-918a-8ec7f1505e38', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '3c26a977-f4b9-4bc4-8d31-a2dcf075d254'), -('2c373ed3-7464-4933-9778-70b34f893494', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '834ce06a-2797-4974-bbdd-2dfffc431c5f'), -('2de51d66-7ba8-4144-8db6-f55ad2b90966', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '11e16c63-87b2-4874-8961-c21716bdd97e'), -('43a5255c-f739-4de5-9014-e1531f88366c', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '5c1745b6-d920-47d2-986a-fe6c48802ace'), -('ef3e5ee2-69b5-44a6-85fd-0b8e5329ae6b', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a7549f30-987c-47d1-9266-452f3cfc68b7'), -('6ad4a140-86ee-442b-8a7a-a0566dbab1f4', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'e4e68398-da67-438f-9fb0-07a779b504a0'), -('531e689e-9be2-442b-ac31-111f12e11a89', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '33279d12-6daa-41d3-a037-9f805e8ebf61'), -('29a63fdc-136d-4f5b-8103-32a16f3dc565', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '09a5fa4c-ad07-4dec-a16d-34e0f567ef1d'), -('b3c345fd-e800-4a64-9f8c-56158e5918c5', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '35bb795a-0b9f-428c-861d-48c1e8d4e73a'), -('4f023ef5-4b02-4254-a28b-a60d4e1e7efe', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a8299847-4d10-41e9-8327-42e13e0672ae'), -('4a5fd07a-e308-4032-9a73-ace558e043c6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '80a2c800-02ea-4264-9289-57b92e911097'), -('a7b14563-51a8-4df9-a976-830ee2b12d47', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6797aeac-7d5e-4216-b260-a8a3f62d3cf6'), -('d08730ac-c3ff-44b9-983c-9effda8284ac', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '57ead3c5-b09f-4cd8-ac38-d9c0d4654af5'), -('e2558cc9-73cf-4f60-be90-2a39ee2e95d1', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '58719469-e01d-4667-bafa-12020931e317'), -('4d5ab598-e4e9-43ed-9b26-a4f42454c46d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '1a1303f3-a929-41b3-be7f-d372e6aab87a'), -('e242544a-24da-4820-8d28-8aa67001033d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '819adaec-f4a2-4438-937d-fcd9cc15d76b'), -('d33d31c3-217c-417e-9d42-8fc266540060', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '7c7937f6-f3ae-47a4-8ee1-fb03f2a5197b'), -('1aef6c68-cc6c-4db3-b78f-c40b714ca4aa', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '7c2d5fef-3096-4b68-bd76-f26cb2a3baea'), -('a5b34914-298b-4b29-912a-585478d39b44', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'd2d5dad6-efa3-4d20-9b30-34c6c933fa5e'), -('62256fae-d6af-4246-807f-83cd580b1ad3', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'cb90c56a-60a8-4345-8001-bb7ab172b302'), -('373882f2-3529-46f2-af14-8ca18611708d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '8bae7a76-9f0e-4074-bfb9-31c3ad9c88e6'), -('05043830-fb1a-4558-9b5c-be9bea090cad', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6eb3bf29-87dc-490b-85b4-e591d416ac8f'), -('063388c2-8da3-4812-b15b-9c8f4ad4f330', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '455368b3-abbe-4bc7-beb3-01f070addc14'), -('8419b6c4-c09a-4dc9-ad0a-73dad343b1f0', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '615cf3a6-89cb-4200-81b4-47542ae8b145'), -('659369d5-577a-444f-b4c9-fc9c3b3bae2d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'cc88051f-7eea-468e-a9ac-91757dde2581'), -('24783453-3676-4419-b46c-bbfff792bfda', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '3b542878-f597-421f-b4ac-5f71b0e22ddb'), -('71dffa83-cc11-4dad-a63e-4ef750941e8a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '2969fd2a-ae44-414a-85ac-7a930c6de987'), -('b10b076f-c7bc-4c1a-a591-50baf56e125b', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '37219e6a-34f1-4d68-8727-db90ddd6f97e'), -('57b6a898-1e39-4bf5-b2ea-132d10455202', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'bfd6144d-0161-41f2-9cf5-3467d2a505fd'), -('76d22f5c-8301-4e4a-b50a-da6a7d663ba0', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'be88150b-3ad5-4cef-8716-90873d194207'), -('917e223d-dd4c-4a4c-be5c-72542e172878', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '23fe9fa0-d848-491f-8b6d-04ada45b9c51'), -('3f8e359e-610f-430a-be64-355ae8c15161', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'd5c1142a-86a6-4347-bdef-2ad41492b738'), -('f949284f-5c23-40c9-bdc9-5987e5301c50', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'ef32d604-42ec-40f8-9c34-08431d2c20d8'), -('263e57fc-f171-4a6f-a285-2b7d538ecec6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'f5906795-60d1-4e5f-88f2-e15f2fae2327'), -('d1b42bd7-32f1-4f14-8dcc-009375ae196f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'dfc32d81-abfa-49ce-a8f6-cdc83c8da78b'), -('067dbc36-ca1b-40be-bfc1-9289ea617a8d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'ed107409-30c5-4555-ba2e-7d77ee8027dc'), -('be045620-f435-4220-850d-d4b2be887746', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '0b8bc573-c8a8-49f4-8274-486990e76540'), -('357c4d81-59bd-46d7-8c9b-78a7b697e52d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '910cd3bd-3b9b-4243-899f-86ed47e9d1c9'), -('a6e38701-6efb-4a86-92b7-a6db7ada7064', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '967f2d24-1bd9-4b62-8136-7fed60dee6d9'), -('995e790d-b8bc-44ee-a04d-1cc7cae4e6c3', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '050ee781-7f32-4d79-b3d3-1e9d550d4a8f'), -('f77dd4e7-b472-4e90-baaa-35d79854f24f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '476156c1-70d8-4eb1-adc5-f8f5ec209666'), -('080fd0f5-8e12-4b2d-936e-a012615bd563', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a87e99c2-c40e-42e0-9310-943f2faa654b'), -('d052884a-f03f-4f27-a99b-8aff6edfe5f5', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'befac4bf-bb20-4b46-9e56-f8175c93b191'), -('2125b270-507d-4760-8f08-84cff8b0794a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '5c5919b5-e74b-4854-bdf6-b91396a8317c'), -('1e7e7b3c-fc0d-46ad-b822-4bce45d82ad1', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '68fe5bcf-38ae-446a-8cbb-8f88b5c6eb44'), -('86aae609-c38d-407c-9428-06e9cc812302', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '4be48741-f8b2-4562-964e-65c081fec7a9'), -('f8054472-8545-41ed-a654-ce6e84844b55', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'f5854cfd-f990-46fd-a6cb-77b48a80b24b'), -('15796145-1534-4362-977e-69699646cda0', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6f4fe3df-9ab8-46c1-a8b7-9458413980f3'), -('4dcc0416-d5e8-43a7-8694-2cd55c2f160e', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'd93ede75-8fd5-4f88-b119-07493b757f4b'), -('15c8cef9-b9b1-43b2-96e8-f44e551ecf90', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '738ae6ae-e961-4fc2-b941-079e130f4213'), -('3416baf7-43d2-45e9-b6ec-f7f12c8c3d1f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '75ae4f79-cef1-4dfd-be66-064c118ba6cf'), -('5957cf4d-6f48-4a2e-83b5-4d0dba9fb4e7', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '97a02a4d-b8fb-486d-af1a-25139014b375'), -('df33dc00-62b5-4adf-8496-7ce23303b4b3', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '92031f1a-b745-42cf-aac1-a067bbee08e6'), -('51d9267f-e26d-4ca9-b369-c455ebc7d9f9', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '7fb332e7-3231-42e6-8f38-a5c8b224d84e'), -('eef810aa-2079-44f1-9d3d-c0e2ea2f48e8', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '475d8075-aec7-4d75-aa79-dc90c9dd9edb'), -('e3db8e5a-0f9d-4ab9-8d6f-f16e3e3f8bbe', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a66215da-48dc-419d-8e2d-3f409aa038e3'), -('9b175068-7a0f-415c-8e98-5fa92895984f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '36e9c7bd-c98f-4414-a8f4-164da5299874'), -('e84db5f8-66bc-408c-a38b-659cdf254b0b', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'ca0af093-65ed-48d4-a6d1-62985a35fd8f'), -('2d9525a9-827a-4664-90e7-6e73ef3f073c', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '93886b0b-6592-4838-b024-1aefb123fed6'); +('2d9525a9-827a-4664-90e7-6e73ef3f073c', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '93886b0b-6592-4838-b024-1aefb123fed6'), +('6ef5b987-0a8d-42e8-b52c-fe683cd7a060', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '495c96ae-60f9-4c57-bc96-9504d0fedde6'), +('15c8cef9-b9b1-43b2-96e8-f44e551ecf90', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '738ae6ae-e961-4fc2-b941-079e130f4213'), +('3416baf7-43d2-45e9-b6ec-f7f12c8c3d1f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '75ae4f79-cef1-4dfd-be66-064c118ba6cf'), +('51d9267f-e26d-4ca9-b369-c455ebc7d9f9', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '7fb332e7-3231-42e6-8f38-a5c8b224d84e'), +('df33dc00-62b5-4adf-8496-7ce23303b4b3', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '92031f1a-b745-42cf-aac1-a067bbee08e6'), +('5957cf4d-6f48-4a2e-83b5-4d0dba9fb4e7', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '97a02a4d-b8fb-486d-af1a-25139014b375'), +('eef810aa-2079-44f1-9d3d-c0e2ea2f48e8', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '475d8075-aec7-4d75-aa79-dc90c9dd9edb'), +('86aae609-c38d-407c-9428-06e9cc812302', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '4be48741-f8b2-4562-964e-65c081fec7a9'), +('4dcc0416-d5e8-43a7-8694-2cd55c2f160e', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'd93ede75-8fd5-4f88-b119-07493b757f4b'), +('15796145-1534-4362-977e-69699646cda0', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6f4fe3df-9ab8-46c1-a8b7-9458413980f3'), +('e84db5f8-66bc-408c-a38b-659cdf254b0b', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'ca0af093-65ed-48d4-a6d1-62985a35fd8f'), +('e3db8e5a-0f9d-4ab9-8d6f-f16e3e3f8bbe', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a66215da-48dc-419d-8e2d-3f409aa038e3'), +('f8054472-8545-41ed-a654-ce6e84844b55', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'f5854cfd-f990-46fd-a6cb-77b48a80b24b'), +('9b175068-7a0f-415c-8e98-5fa92895984f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '36e9c7bd-c98f-4414-a8f4-164da5299874'), +('b10b076f-c7bc-4c1a-a591-50baf56e125b', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '37219e6a-34f1-4d68-8727-db90ddd6f97e'), +('917e223d-dd4c-4a4c-be5c-72542e172878', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '23fe9fa0-d848-491f-8b6d-04ada45b9c51'), +('57b6a898-1e39-4bf5-b2ea-132d10455202', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'bfd6144d-0161-41f2-9cf5-3467d2a505fd'), +('76d22f5c-8301-4e4a-b50a-da6a7d663ba0', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'be88150b-3ad5-4cef-8716-90873d194207'), +('067dbc36-ca1b-40be-bfc1-9289ea617a8d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'ed107409-30c5-4555-ba2e-7d77ee8027dc'), +('a6e38701-6efb-4a86-92b7-a6db7ada7064', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '967f2d24-1bd9-4b62-8136-7fed60dee6d9'), +('357c4d81-59bd-46d7-8c9b-78a7b697e52d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '910cd3bd-3b9b-4243-899f-86ed47e9d1c9'), +('be045620-f435-4220-850d-d4b2be887746', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '0b8bc573-c8a8-49f4-8274-486990e76540'), +('1e7e7b3c-fc0d-46ad-b822-4bce45d82ad1', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '68fe5bcf-38ae-446a-8cbb-8f88b5c6eb44'), +('2125b270-507d-4760-8f08-84cff8b0794a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '5c5919b5-e74b-4854-bdf6-b91396a8317c'), +('ef3e5ee2-69b5-44a6-85fd-0b8e5329ae6b', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a7549f30-987c-47d1-9266-452f3cfc68b7'), +('531e689e-9be2-442b-ac31-111f12e11a89', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '33279d12-6daa-41d3-a037-9f805e8ebf61'), +('6ad4a140-86ee-442b-8a7a-a0566dbab1f4', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'e4e68398-da67-438f-9fb0-07a779b504a0'), +('f73306cc-5b01-49bb-87af-a2c2af14bfae', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '01ed1076-4028-4fdf-9a92-cb57a8e041af'), +('2c373ed3-7464-4933-9778-70b34f893494', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '834ce06a-2797-4974-bbdd-2dfffc431c5f'), +('2de51d66-7ba8-4144-8db6-f55ad2b90966', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '11e16c63-87b2-4874-8961-c21716bdd97e'), +('9b63e271-261c-4f2f-9675-5b760fe6fa29', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '20a442b2-9763-41d4-b3c9-e436b37bf534'), +('bfed95b5-6dd7-4f67-91b3-10ef314f8d9c', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'f75677d6-3e22-45d4-b921-81d6a3645157'), +('43a5255c-f739-4de5-9014-e1531f88366c', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '5c1745b6-d920-47d2-986a-fe6c48802ace'), +('642691b3-ac2e-45eb-9caa-0442e696d0da', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'dc6fde9f-0b49-46d6-96bb-93be669b502b'), +('db1f6ec9-11e5-427a-8b3d-1f93103c9648', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6add4087-e586-4313-b157-54d416bdc8d5'), +('76ac9b8b-f8c4-488c-bc5b-6f7afc9e336a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '911df73b-b860-4319-8944-c274781591ca'), +('64b381e6-039e-42dc-bc13-b5ed46bac99d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'c353c4fd-5915-47f3-a59b-66ae75eae195'), +('8419b6c4-c09a-4dc9-ad0a-73dad343b1f0', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '615cf3a6-89cb-4200-81b4-47542ae8b145'), +('71dffa83-cc11-4dad-a63e-4ef750941e8a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '2969fd2a-ae44-414a-85ac-7a930c6de987'), +('24783453-3676-4419-b46c-bbfff792bfda', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '3b542878-f597-421f-b4ac-5f71b0e22ddb'), +('659369d5-577a-444f-b4c9-fc9c3b3bae2d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'cc88051f-7eea-468e-a9ac-91757dde2581'), +('995e790d-b8bc-44ee-a04d-1cc7cae4e6c3', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '050ee781-7f32-4d79-b3d3-1e9d550d4a8f'), +('d052884a-f03f-4f27-a99b-8aff6edfe5f5', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'befac4bf-bb20-4b46-9e56-f8175c93b191'), +('080fd0f5-8e12-4b2d-936e-a012615bd563', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a87e99c2-c40e-42e0-9310-943f2faa654b'), +('f77dd4e7-b472-4e90-baaa-35d79854f24f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '476156c1-70d8-4eb1-adc5-f8f5ec209666'), +('a7b14563-51a8-4df9-a976-830ee2b12d47', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6797aeac-7d5e-4216-b260-a8a3f62d3cf6'), +('4d5ab598-e4e9-43ed-9b26-a4f42454c46d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '1a1303f3-a929-41b3-be7f-d372e6aab87a'), +('e2558cc9-73cf-4f60-be90-2a39ee2e95d1', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '58719469-e01d-4667-bafa-12020931e317'), +('d08730ac-c3ff-44b9-983c-9effda8284ac', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '57ead3c5-b09f-4cd8-ac38-d9c0d4654af5'), +('29a63fdc-136d-4f5b-8103-32a16f3dc565', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '09a5fa4c-ad07-4dec-a16d-34e0f567ef1d'), +('4a5fd07a-e308-4032-9a73-ace558e043c6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '80a2c800-02ea-4264-9289-57b92e911097'), +('b3c345fd-e800-4a64-9f8c-56158e5918c5', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '35bb795a-0b9f-428c-861d-48c1e8d4e73a'), +('4f023ef5-4b02-4254-a28b-a60d4e1e7efe', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'a8299847-4d10-41e9-8327-42e13e0672ae'), +('2d1a7f12-8b50-4bec-918a-8ec7f1505e38', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '3c26a977-f4b9-4bc4-8d31-a2dcf075d254'), +('e242544a-24da-4820-8d28-8aa67001033d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '819adaec-f4a2-4438-937d-fcd9cc15d76b'), +('d33d31c3-217c-417e-9d42-8fc266540060', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '7c7937f6-f3ae-47a4-8ee1-fb03f2a5197b'), +('05043830-fb1a-4558-9b5c-be9bea090cad', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '6eb3bf29-87dc-490b-85b4-e591d416ac8f'), +('063388c2-8da3-4812-b15b-9c8f4ad4f330', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '455368b3-abbe-4bc7-beb3-01f070addc14'), +('62256fae-d6af-4246-807f-83cd580b1ad3', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'cb90c56a-60a8-4345-8001-bb7ab172b302'), +('373882f2-3529-46f2-af14-8ca18611708d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '8bae7a76-9f0e-4074-bfb9-31c3ad9c88e6'), +('1aef6c68-cc6c-4db3-b78f-c40b714ca4aa', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', '7c2d5fef-3096-4b68-bd76-f26cb2a3baea'), +('a5b34914-298b-4b29-912a-585478d39b44', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'd2d5dad6-efa3-4d20-9b30-34c6c933fa5e'), +('3f8e359e-610f-430a-be64-355ae8c15161', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'd5c1142a-86a6-4347-bdef-2ad41492b738'), +('d1b42bd7-32f1-4f14-8dcc-009375ae196f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'dfc32d81-abfa-49ce-a8f6-cdc83c8da78b'), +('263e57fc-f171-4a6f-a285-2b7d538ecec6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'f5906795-60d1-4e5f-88f2-e15f2fae2327'), +('f949284f-5c23-40c9-bdc9-5987e5301c50', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '11ccffea-2cc9-4e98-9bef-3464dfe4dec8', 'ef32d604-42ec-40f8-9c34-08431d2c20d8'); -- ADMIN INSERT INTO public.role_permissions (id, deleted_at, created_at, updated_at, role_id, permission_id) VALUES -('8bfac1eb-3d44-49f3-a4cd-69126605448b', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '495c96ae-60f9-4c57-bc96-9504d0fedde6'), -('19f61ff9-003e-4ea2-8ede-fea5f671530b', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '5820dd37-a9bd-455e-b49b-b54ad7df180e'), -('6b743076-6aee-42d9-8d62-1167e97bcac3', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '01ed1076-4028-4fdf-9a92-cb57a8e041af'), -('49e744bb-4576-48c5-982e-27df21ba811b', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '20a442b2-9763-41d4-b3c9-e436b37bf534'), -('1a4f45a9-2d81-46a1-bb22-064f6783e863', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'c353c4fd-5915-47f3-a59b-66ae75eae195'), -('cdbfc1b0-6d85-44bc-bc2e-a1703be7f554', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'dc6fde9f-0b49-46d6-96bb-93be669b502b'), -('b8aef4ef-fd4a-4824-9d90-8e865693ca66', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f75677d6-3e22-45d4-b921-81d6a3645157'), -('6cb9ef40-7124-42c3-8a6a-8b7aaf78305a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6add4087-e586-4313-b157-54d416bdc8d5'), -('d0f585a1-333e-40a8-a618-e37111e85fff', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '911df73b-b860-4319-8944-c274781591ca'), -('ff06837d-bd0d-4a76-af55-c6fe6325533a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '3c26a977-f4b9-4bc4-8d31-a2dcf075d254'), -('025038dc-1a43-4d24-b53e-b8b473f5b6d7', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '834ce06a-2797-4974-bbdd-2dfffc431c5f'), -('86cada38-48d0-47e7-a21c-cfac6425a481', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '11e16c63-87b2-4874-8961-c21716bdd97e'), -('2cc739df-e690-4bc8-994f-3a8e80f8da84', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '5c1745b6-d920-47d2-986a-fe6c48802ace'), -('c9a96594-10b8-47e4-a39a-82907f57c204', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a7549f30-987c-47d1-9266-452f3cfc68b7'), -('e4971507-c5d1-4115-a1c6-d92fcec31c14', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'e4e68398-da67-438f-9fb0-07a779b504a0'), -('0b48d93f-e18f-4bde-9e63-0078d5ea06b9', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '33279d12-6daa-41d3-a037-9f805e8ebf61'), -('20ee6d4c-aff1-4cf8-8378-62a92e553652', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '09a5fa4c-ad07-4dec-a16d-34e0f567ef1d'), -('b536089c-19d3-4f32-b8da-1f0b17b19960', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '35bb795a-0b9f-428c-861d-48c1e8d4e73a'), -('adcfd0da-56d1-4ae6-ad38-7995800d49e6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a8299847-4d10-41e9-8327-42e13e0672ae'), -('6fcc4688-4e88-4bdc-a082-4f40a525ce3e', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '80a2c800-02ea-4264-9289-57b92e911097'), -('5e769b0b-1068-49b4-bc25-ac05351fa089', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6797aeac-7d5e-4216-b260-a8a3f62d3cf6'), -('b8c7a9b0-9fbe-49e1-86cf-8ec10d6949e6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '57ead3c5-b09f-4cd8-ac38-d9c0d4654af5'), -('236ff33e-8283-4d17-b747-71051807f15a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '58719469-e01d-4667-bafa-12020931e317'), -('98b621d4-c6e2-47fa-9d6f-7a973887786f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '1a1303f3-a929-41b3-be7f-d372e6aab87a'), -('34d5ae7a-2310-4bb8-ad49-33c764c576ce', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '819adaec-f4a2-4438-937d-fcd9cc15d76b'), -('1fb9c6e1-2c2b-4249-9a54-ae8d4a7a8b71', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7c7937f6-f3ae-47a4-8ee1-fb03f2a5197b'), -('c89ad249-5b8c-4bbd-9309-1226b84a83c3', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7c2d5fef-3096-4b68-bd76-f26cb2a3baea'), -('643c373a-4088-4ff4-a31c-fee5e40a058c', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd2d5dad6-efa3-4d20-9b30-34c6c933fa5e'), -('e6bee19a-6e36-45c0-a8a5-ad62463f03e9', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'cb90c56a-60a8-4345-8001-bb7ab172b302'), -('3fff7f1d-504a-4d36-a296-76ddac3cfdce', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '8bae7a76-9f0e-4074-bfb9-31c3ad9c88e6'), -('a2c93f38-8728-4295-90a1-70b7071d6a8a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6eb3bf29-87dc-490b-85b4-e591d416ac8f'), -('dfe62730-a93f-4ca3-ad85-8efa321bebd6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '455368b3-abbe-4bc7-beb3-01f070addc14'), -('57f4fed8-b57f-4816-a667-8c17d2532313', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '615cf3a6-89cb-4200-81b4-47542ae8b145'), -('6fcbf0bf-1d17-426b-9a94-4b05bf122c4e', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'cc88051f-7eea-468e-a9ac-91757dde2581'), -('588f4b89-fff7-4f8b-b2a6-ce93605c401d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '3b542878-f597-421f-b4ac-5f71b0e22ddb'), -('25c42ef8-2433-436f-af57-344e2201aa84', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '2969fd2a-ae44-414a-85ac-7a930c6de987'), -('26bfd290-bf70-4303-ad84-db0f61ce785a', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '37219e6a-34f1-4d68-8727-db90ddd6f97e'), -('241f4aaa-88b3-4816-aabd-b2c2be2f3ac0', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'bfd6144d-0161-41f2-9cf5-3467d2a505fd'), -('029ef924-0eee-4872-9b66-7e26495715d7', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'be88150b-3ad5-4cef-8716-90873d194207'), -('50751316-8bba-40c3-8814-b18f28262f52', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '23fe9fa0-d848-491f-8b6d-04ada45b9c51'), -('2cf3a985-33d1-436d-a751-19373bbb296b', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd5c1142a-86a6-4347-bdef-2ad41492b738'), -('e281924d-5466-49b8-8db9-0134c5a727c1', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'ef32d604-42ec-40f8-9c34-08431d2c20d8'), -('be3e3319-28b2-45a7-a825-8da9d10a1eb9', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f5906795-60d1-4e5f-88f2-e15f2fae2327'), -('e72e2b1e-24c6-466c-9070-209e837ccd86', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'dfc32d81-abfa-49ce-a8f6-cdc83c8da78b'), -('09c756ca-5697-4393-8e40-16590ecc2ec6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'ed107409-30c5-4555-ba2e-7d77ee8027dc'), -('1c89cf58-3ec6-4ac9-8852-43c7ec8deab8', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '0b8bc573-c8a8-49f4-8274-486990e76540'), -('859223ce-b42c-4cc1-a108-0adfa86846a6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '910cd3bd-3b9b-4243-899f-86ed47e9d1c9'), -('76469d94-fc26-493f-a85c-1eca34419ca6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '967f2d24-1bd9-4b62-8136-7fed60dee6d9'), -('c00c7965-0dc3-4cc9-aaed-60673f398a67', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '050ee781-7f32-4d79-b3d3-1e9d550d4a8f'), -('9bec4cae-8c97-402e-bf2a-8777b5cbbb79', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '476156c1-70d8-4eb1-adc5-f8f5ec209666'), -('a1d0df5f-08d3-429d-8f1b-50f1d50fa7be', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a87e99c2-c40e-42e0-9310-943f2faa654b'), -('a4f31bdc-7518-4133-8a8a-cb5716c41518', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'befac4bf-bb20-4b46-9e56-f8175c93b191'), -('7d90e477-c49b-4476-9bf2-c849042c4992', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f632f18c-98da-4c1a-b2c6-9ccd0c7c5a39'), -('28999186-5d39-4e96-b23b-e2dd4c1d42b4', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '5c5919b5-e74b-4854-bdf6-b91396a8317c'), -('4f8b439c-2118-4a77-8790-1a78e391b9b7', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '68fe5bcf-38ae-446a-8cbb-8f88b5c6eb44'), -('99c4789b-c1d9-499f-b8f0-030dee831a9e', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '98744d43-f14b-4235-8dfc-5265668daa21'), -('d07821d9-1be7-4dac-b88b-3c586fa21890', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '4be48741-f8b2-4562-964e-65c081fec7a9'), -('8ee25add-562d-407d-9228-3e826f3da4db', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f5854cfd-f990-46fd-a6cb-77b48a80b24b'), -('af3885ae-4099-46f2-9e68-52e4308f0753', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6f4fe3df-9ab8-46c1-a8b7-9458413980f3'), -('eaaac8fa-346d-4977-94d7-d7d5435ec2c8', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd93ede75-8fd5-4f88-b119-07493b757f4b'), -('6cd703ce-72b6-466b-8262-ba3fdf1d1d57', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '9c644140-c71d-4435-bd6b-a81171913046'), -('39a58779-f4c3-4e46-b9af-3ae867554d2e', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '259fb434-5321-43be-b007-76f3c2dfbfcc'), -('cad5bfb9-2421-487b-a217-e8e2108271c7', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'fa6961f1-1cee-494f-8f1f-f4552b49b6fa'), -('a5c9bbc2-5ab6-4219-add8-532763ff9490', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '60768a38-8ff1-493a-85ba-b62df98a60d4'), -('6846c003-6219-42ef-9bd8-b88ea8ddea76', NULL, '2023-01-10 05:19:48.256921', '2023-01-10 05:19:48.256921', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '78d617f8-b155-4051-b128-7f2d00ca31fd'), -('2ef6aaa8-8980-4f8d-8df8-0d7e1ee22dd2', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '738ae6ae-e961-4fc2-b941-079e130f4213'), -('c5f35ac8-de0f-4146-a659-37292cc88045', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '75ae4f79-cef1-4dfd-be66-064c118ba6cf'), -('835d4178-9125-437e-864b-2fd651fdc52d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '97a02a4d-b8fb-486d-af1a-25139014b375'), -('cde4fd2e-5274-44c5-9dc3-0e7db96c53e6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '92031f1a-b745-42cf-aac1-a067bbee08e6'), -('c0966cd2-36e0-48d8-b9ea-41dc6b055082', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7fb332e7-3231-42e6-8f38-a5c8b224d84e'), -('c0b9f38f-f64a-40ae-9d32-7ee41fe5471d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '475d8075-aec7-4d75-aa79-dc90c9dd9edb'), -('5ac4cfeb-51b5-476c-aedf-38bef38d0100', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a66215da-48dc-419d-8e2d-3f409aa038e3'), -('b719dee9-5549-4a54-a605-a0b01d5ca25d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '36e9c7bd-c98f-4414-a8f4-164da5299874'), -('172bfff5-4a37-496b-ad9e-fd8a9c2fbb79', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'ca0af093-65ed-48d4-a6d1-62985a35fd8f'), -('3dc8e4ab-8402-4655-9795-0c1ade988e64', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '93886b0b-6592-4838-b024-1aefb123fed6'), -('0e81ad40-f5c5-4f32-8352-67bbe512ad40', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6118a1da-aa9a-40eb-b664-87a6969c5759'), -('8ad125a0-be77-4a51-86d3-8e01fab9ef3f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '79b1a377-7b73-4bea-90c2-330bda11b635'), -('0f987cdd-1af4-4d54-bd5f-017ce5a6f64d', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'e33cc269-3a12-436e-aab7-75f14953388f'), -('09c991c4-bb65-4088-badb-80f916a51600', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '2f6c957c-725b-4da4-ad6d-9a23a1e18a98'), -('13305903-965d-4174-962f-8799726e330f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f75db77f-e299-4135-81b7-0784b452f7b7'), -('e0482950-8e09-4dd5-adac-7274a96cc9b2', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd500ea57-da9a-4b24-b147-59d009f0d7bc'), -('0f03ebae-15fe-4a0c-bb0b-c2fad0d9a9fb', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '9be246ac-2e53-4268-814a-dc760afd3758'), -('fab38772-1430-4a7d-996f-aacb5aa049b0', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '84aa4653-4bd8-428b-9521-618a67a6be6b'), -('37e9c42e-d280-4b00-a395-2af8ecda6d5e', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7bd3d8e3-8b0b-4f3a-8ee7-0b6bec1c8913'), -('f02caffb-0025-4fc0-8ba9-d7ef198df3c6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'be186320-bef0-48cc-805e-f7b4810a3b30'), -('e21447f0-3c57-4f1b-9547-e8b21825fbeb', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f1bef8de-8a6b-4d7d-ae1a-e09ec631fd94'), -('314936d3-e9d3-4a4f-ab29-d47ec9ccd06f', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '9be15ffa-3695-4d7f-93aa-ef594a08c36a'); +('3dc8e4ab-8402-4655-9795-0c1ade988e64', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '93886b0b-6592-4838-b024-1aefb123fed6'), +('19f61ff9-003e-4ea2-8ede-fea5f671530b', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '5820dd37-a9bd-455e-b49b-b54ad7df180e'), +('8bfac1eb-3d44-49f3-a4cd-69126605448b', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '495c96ae-60f9-4c57-bc96-9504d0fedde6'), +('2ef6aaa8-8980-4f8d-8df8-0d7e1ee22dd2', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '738ae6ae-e961-4fc2-b941-079e130f4213'), +('c5f35ac8-de0f-4146-a659-37292cc88045', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '75ae4f79-cef1-4dfd-be66-064c118ba6cf'), +('c0966cd2-36e0-48d8-b9ea-41dc6b055082', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7fb332e7-3231-42e6-8f38-a5c8b224d84e'), +('cde4fd2e-5274-44c5-9dc3-0e7db96c53e6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '92031f1a-b745-42cf-aac1-a067bbee08e6'), +('835d4178-9125-437e-864b-2fd651fdc52d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '97a02a4d-b8fb-486d-af1a-25139014b375'), +('c0b9f38f-f64a-40ae-9d32-7ee41fe5471d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '475d8075-aec7-4d75-aa79-dc90c9dd9edb'), +('d07821d9-1be7-4dac-b88b-3c586fa21890', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '4be48741-f8b2-4562-964e-65c081fec7a9'), +('eaaac8fa-346d-4977-94d7-d7d5435ec2c8', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd93ede75-8fd5-4f88-b119-07493b757f4b'), +('af3885ae-4099-46f2-9e68-52e4308f0753', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6f4fe3df-9ab8-46c1-a8b7-9458413980f3'), +('172bfff5-4a37-496b-ad9e-fd8a9c2fbb79', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'ca0af093-65ed-48d4-a6d1-62985a35fd8f'), +('5ac4cfeb-51b5-476c-aedf-38bef38d0100', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a66215da-48dc-419d-8e2d-3f409aa038e3'), +('8ee25add-562d-407d-9228-3e826f3da4db', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f5854cfd-f990-46fd-a6cb-77b48a80b24b'), +('b719dee9-5549-4a54-a605-a0b01d5ca25d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '36e9c7bd-c98f-4414-a8f4-164da5299874'), +('26bfd290-bf70-4303-ad84-db0f61ce785a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '37219e6a-34f1-4d68-8727-db90ddd6f97e'), +('50751316-8bba-40c3-8814-b18f28262f52', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '23fe9fa0-d848-491f-8b6d-04ada45b9c51'), +('241f4aaa-88b3-4816-aabd-b2c2be2f3ac0', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'bfd6144d-0161-41f2-9cf5-3467d2a505fd'), +('029ef924-0eee-4872-9b66-7e26495715d7', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'be88150b-3ad5-4cef-8716-90873d194207'), +('09c756ca-5697-4393-8e40-16590ecc2ec6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'ed107409-30c5-4555-ba2e-7d77ee8027dc'), +('76469d94-fc26-493f-a85c-1eca34419ca6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '967f2d24-1bd9-4b62-8136-7fed60dee6d9'), +('859223ce-b42c-4cc1-a108-0adfa86846a6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '910cd3bd-3b9b-4243-899f-86ed47e9d1c9'), +('1c89cf58-3ec6-4ac9-8852-43c7ec8deab8', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '0b8bc573-c8a8-49f4-8274-486990e76540'), +('7d90e477-c49b-4476-9bf2-c849042c4992', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f632f18c-98da-4c1a-b2c6-9ccd0c7c5a39'), +('99c4789b-c1d9-499f-b8f0-030dee831a9e', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '98744d43-f14b-4235-8dfc-5265668daa21'), +('4f8b439c-2118-4a77-8790-1a78e391b9b7', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '68fe5bcf-38ae-446a-8cbb-8f88b5c6eb44'), +('28999186-5d39-4e96-b23b-e2dd4c1d42b4', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '5c5919b5-e74b-4854-bdf6-b91396a8317c'), +('fab38772-1430-4a7d-996f-aacb5aa049b0', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '84aa4653-4bd8-428b-9521-618a67a6be6b'), +('0f03ebae-15fe-4a0c-bb0b-c2fad0d9a9fb', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '9be246ac-2e53-4268-814a-dc760afd3758'), +('c9a96594-10b8-47e4-a39a-82907f57c204', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a7549f30-987c-47d1-9266-452f3cfc68b7'), +('0b48d93f-e18f-4bde-9e63-0078d5ea06b9', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '33279d12-6daa-41d3-a037-9f805e8ebf61'), +('e4971507-c5d1-4115-a1c6-d92fcec31c14', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'e4e68398-da67-438f-9fb0-07a779b504a0'), +('6b743076-6aee-42d9-8d62-1167e97bcac3', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '01ed1076-4028-4fdf-9a92-cb57a8e041af'), +('025038dc-1a43-4d24-b53e-b8b473f5b6d7', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '834ce06a-2797-4974-bbdd-2dfffc431c5f'), +('86cada38-48d0-47e7-a21c-cfac6425a481', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '11e16c63-87b2-4874-8961-c21716bdd97e'), +('49e744bb-4576-48c5-982e-27df21ba811b', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '20a442b2-9763-41d4-b3c9-e436b37bf534'), +('b8aef4ef-fd4a-4824-9d90-8e865693ca66', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f75677d6-3e22-45d4-b921-81d6a3645157'), +('2cc739df-e690-4bc8-994f-3a8e80f8da84', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '5c1745b6-d920-47d2-986a-fe6c48802ace'), +('cdbfc1b0-6d85-44bc-bc2e-a1703be7f554', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'dc6fde9f-0b49-46d6-96bb-93be669b502b'), +('6cb9ef40-7124-42c3-8a6a-8b7aaf78305a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6add4087-e586-4313-b157-54d416bdc8d5'), +('d0f585a1-333e-40a8-a618-e37111e85fff', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '911df73b-b860-4319-8944-c274781591ca'), +('1a4f45a9-2d81-46a1-bb22-064f6783e863', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'c353c4fd-5915-47f3-a59b-66ae75eae195'), +('57f4fed8-b57f-4816-a667-8c17d2532313', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '615cf3a6-89cb-4200-81b4-47542ae8b145'), +('25c42ef8-2433-436f-af57-344e2201aa84', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '2969fd2a-ae44-414a-85ac-7a930c6de987'), +('588f4b89-fff7-4f8b-b2a6-ce93605c401d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '3b542878-f597-421f-b4ac-5f71b0e22ddb'), +('6fcbf0bf-1d17-426b-9a94-4b05bf122c4e', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'cc88051f-7eea-468e-a9ac-91757dde2581'), +('6cd703ce-72b6-466b-8262-ba3fdf1d1d57', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '9c644140-c71d-4435-bd6b-a81171913046'), +('a5c9bbc2-5ab6-4219-add8-532763ff9490', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '60768a38-8ff1-493a-85ba-b62df98a60d4'), +('cad5bfb9-2421-487b-a217-e8e2108271c7', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'fa6961f1-1cee-494f-8f1f-f4552b49b6fa'), +('39a58779-f4c3-4e46-b9af-3ae867554d2e', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '259fb434-5321-43be-b007-76f3c2dfbfcc'), +('c00c7965-0dc3-4cc9-aaed-60673f398a67', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '050ee781-7f32-4d79-b3d3-1e9d550d4a8f'), +('a4f31bdc-7518-4133-8a8a-cb5716c41518', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'befac4bf-bb20-4b46-9e56-f8175c93b191'), +('a1d0df5f-08d3-429d-8f1b-50f1d50fa7be', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a87e99c2-c40e-42e0-9310-943f2faa654b'), +('9bec4cae-8c97-402e-bf2a-8777b5cbbb79', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '476156c1-70d8-4eb1-adc5-f8f5ec209666'), +('13305903-965d-4174-962f-8799726e330f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f75db77f-e299-4135-81b7-0784b452f7b7'), +('39479191-ada4-4cbb-a21a-5715c5b6bc15', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'c604d238-3c43-4825-93eb-db7b01480098'), +('e0482950-8e09-4dd5-adac-7274a96cc9b2', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd500ea57-da9a-4b24-b147-59d009f0d7bc'), +('f02caffb-0025-4fc0-8ba9-d7ef198df3c6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'be186320-bef0-48cc-805e-f7b4810a3b30'), +('e21447f0-3c57-4f1b-9547-e8b21825fbeb', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f1bef8de-8a6b-4d7d-ae1a-e09ec631fd94'), +('314936d3-e9d3-4a4f-ab29-d47ec9ccd06f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '9be15ffa-3695-4d7f-93aa-ef594a08c36a'), +('5e769b0b-1068-49b4-bc25-ac05351fa089', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6797aeac-7d5e-4216-b260-a8a3f62d3cf6'), +('98b621d4-c6e2-47fa-9d6f-7a973887786f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '1a1303f3-a929-41b3-be7f-d372e6aab87a'), +('236ff33e-8283-4d17-b747-71051807f15a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '58719469-e01d-4667-bafa-12020931e317'), +('09c991c4-bb65-4088-badb-80f916a51600', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '2f6c957c-725b-4da4-ad6d-9a23a1e18a98'), +('0f987cdd-1af4-4d54-bd5f-017ce5a6f64d', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'e33cc269-3a12-436e-aab7-75f14953388f'), +('b8c7a9b0-9fbe-49e1-86cf-8ec10d6949e6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '57ead3c5-b09f-4cd8-ac38-d9c0d4654af5'), +('8ad125a0-be77-4a51-86d3-8e01fab9ef3f', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '79b1a377-7b73-4bea-90c2-330bda11b635'), +('0e81ad40-f5c5-4f32-8352-67bbe512ad40', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6118a1da-aa9a-40eb-b664-87a6969c5759'), +('20ee6d4c-aff1-4cf8-8378-62a92e553652', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '09a5fa4c-ad07-4dec-a16d-34e0f567ef1d'), +('6fcc4688-4e88-4bdc-a082-4f40a525ce3e', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '80a2c800-02ea-4264-9289-57b92e911097'), +('b536089c-19d3-4f32-b8da-1f0b17b19960', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '35bb795a-0b9f-428c-861d-48c1e8d4e73a'), +('adcfd0da-56d1-4ae6-ad38-7995800d49e6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a8299847-4d10-41e9-8327-42e13e0672ae'), +('37e9c42e-d280-4b00-a395-2af8ecda6d5e', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7bd3d8e3-8b0b-4f3a-8ee7-0b6bec1c8913'), +('ff06837d-bd0d-4a76-af55-c6fe6325533a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '3c26a977-f4b9-4bc4-8d31-a2dcf075d254'), +('34d5ae7a-2310-4bb8-ad49-33c764c576ce', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '819adaec-f4a2-4438-937d-fcd9cc15d76b'), +('1fb9c6e1-2c2b-4249-9a54-ae8d4a7a8b71', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7c7937f6-f3ae-47a4-8ee1-fb03f2a5197b'), +('a2c93f38-8728-4295-90a1-70b7071d6a8a', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '6eb3bf29-87dc-490b-85b4-e591d416ac8f'), +('dfe62730-a93f-4ca3-ad85-8efa321bebd6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '455368b3-abbe-4bc7-beb3-01f070addc14'), +('e6bee19a-6e36-45c0-a8a5-ad62463f03e9', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'cb90c56a-60a8-4345-8001-bb7ab172b302'), +('3fff7f1d-504a-4d36-a296-76ddac3cfdce', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '8bae7a76-9f0e-4074-bfb9-31c3ad9c88e6'), +('c89ad249-5b8c-4bbd-9309-1226b84a83c3', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '7c2d5fef-3096-4b68-bd76-f26cb2a3baea'), +('643c373a-4088-4ff4-a31c-fee5e40a058c', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd2d5dad6-efa3-4d20-9b30-34c6c933fa5e'), +('2cf3a985-33d1-436d-a751-19373bbb296b', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'd5c1142a-86a6-4347-bdef-2ad41492b738'), +('e72e2b1e-24c6-466c-9070-209e837ccd86', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'dfc32d81-abfa-49ce-a8f6-cdc83c8da78b'), +('be3e3319-28b2-45a7-a825-8da9d10a1eb9', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f5906795-60d1-4e5f-88f2-e15f2fae2327'), +('e281924d-5466-49b8-8db9-0134c5a727c1', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'ef32d604-42ec-40f8-9c34-08431d2c20d8'), +('6846c003-6219-42ef-9bd8-b88ea8ddea76', null, '2023-01-10 05:19:48.256921', '2023-01-10 05:19:48.256921', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '78d617f8-b155-4051-b128-7f2d00ca31fd'); From e6be4f3d4878052abb0cc0972f2d81fa566b8686 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 23:28:17 +0700 Subject: [PATCH 06/17] chore: seed discord template data --- migrations/seed/discord_log_templates.sql | 12 ++++++++++++ migrations/seed/seed.sql | 1 + pkg/view/invoice.go | 8 +++++--- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 migrations/seed/discord_log_templates.sql diff --git a/migrations/seed/discord_log_templates.sql b/migrations/seed/discord_log_templates.sql new file mode 100644 index 000000000..d1b8db265 --- /dev/null +++ b/migrations/seed/discord_log_templates.sql @@ -0,0 +1,12 @@ +INSERT INTO public.discord_log_templates (id, deleted_at, created_at, updated_at, type, content) VALUES +('d511ac81-e098-44a3-8712-3e0cbfa57386', null, '2023-05-09 06:25:33.019333', '2023-05-09 06:25:33.019333', 'employee_update_base_salary', '{{ employee_id }} update {{ updated_employee_id }} salary to new one: {{ new_salary }}.'), +('3fc86aaf-32ed-4c44-a100-69c6d1c43db5', null, '2023-05-09 06:25:18.021158', '2023-05-09 06:25:18.021158', 'employee_update_working_status', '{{ employee_id }} update {{ updated_employee_id }} working status to {{ working_status }}.'), +('a1de8a0a-4e91-45c4-b093-5f525b1adbda', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_add', '{{ employee_id }} add {{ updated_employee_id }} to project {{ project_name }} as {{ deployment_type }} deployment'), +('3ced7070-959f-408b-9155-00cdab019fab', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_remove', '{{ employee_id }} remove {{ updated_employee_id }} to project {{ project_name }}'), +('f6ed892e-5c3c-4bca-a738-9805e767084c', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'invoice_send', '{{ employee_id }} just sent invoice #{{ invoice_number }}.'), +('15bc0057-42df-4bca-9749-9e1a3a07970d', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'invoice_paid', 'Invoice #{{ invoice_number }} paid.'), +('9616d2bd-22d7-43b4-8a2a-067927b0d875', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_update_status', '{{ employee_id }} update {{ updated_employee_id }} project member status in {{ project_name }} to {{ status }}.'), +('a427c903-2932-408c-8f55-f7e0213a1432', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_update_charge_rate', '{{ employee_id }} update {{ updated_employee_id }} charge rate in {{ project_name }} to {{ rate }}.'), +('4a0c264a-0b90-48d7-b217-19d9a5d66bc7', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'payroll_commit', 'payroll batch.{{ batch_number }}-{{ month }}-{{ year }} is committed.'), +('b15fd037-ffac-407d-b878-10809236868f', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'employee_submit_onboarding_form', '{{ employee_id }} submit new employee onboarding form. '), +('cb2610ac-5c7d-45f7-8d71-50c815526a75', null, '2023-05-09 06:26:16.634402', '2023-05-09 06:26:16.634402', 'project_member_update_end_date', '{{ employee_id }} update {{ updated_employee_id }} end date in {{ project_name }} to {{ end_date }}.'); diff --git a/migrations/seed/seed.sql b/migrations/seed/seed.sql index ee15085f7..210d7b6fd 100644 --- a/migrations/seed/seed.sql +++ b/migrations/seed/seed.sql @@ -21,6 +21,7 @@ \ir employee_mentees.sql \ir social_accounts.sql \ir accounting_categories.sql +\ir discord_log_templates.sql -- \ir feedback_events.sql -- \ir employee_event_topics.sql -- \ir employee_event_reviewers.sql diff --git a/pkg/view/invoice.go b/pkg/view/invoice.go index 0d8582c5d..ada36b893 100644 --- a/pkg/view/invoice.go +++ b/pkg/view/invoice.go @@ -114,9 +114,11 @@ type InvoiceTemplateResponse struct { func ToInvoiceInfo(invoice *model.Invoice) (*Invoice, error) { if invoice != nil { cc := make([]string, 0) - err := json.Unmarshal(invoice.CC, &cc) - if err != nil { - return nil, err + if invoice.CC != nil { + err := json.Unmarshal(invoice.CC, &cc) + if err != nil { + return nil, err + } } invoiceItems, err := toInvoiceItem(invoice.LineItems) From 69d44d777d523df53e7264de646e5208a85a0322 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 23:32:32 +0700 Subject: [PATCH 07/17] fix: send invoice without cc list err --- pkg/model/invoice.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/model/invoice.go b/pkg/model/invoice.go index ade40ae63..9582cee8e 100644 --- a/pkg/model/invoice.go +++ b/pkg/model/invoice.go @@ -91,6 +91,9 @@ func (i *Invoice) Validate() error { } func GatherAddresses(CCs JSON) (string, error) { + if CCs == nil { + return "", nil + } var ccList []string if err := json.Unmarshal(CCs, &ccList); err != nil { return "", err From 00dee42c54f65731d5bc6f7bfdcc1f190feba407 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 23:33:54 +0700 Subject: [PATCH 08/17] fix: comment basecamp message --- pkg/handler/handler.go | 2 +- pkg/handler/payroll/payroll.go | 59 ++++++++++-------- pkg/handler/payroll/payroll_calculator.go | 29 ++++----- pkg/handler/webhook/basecamp.go | 16 ++--- pkg/handler/webhook/basecamp_expense.go | 76 +++++++++++------------ pkg/handler/webhook/interface.go | 6 +- pkg/handler/webhook/webhook.go | 5 +- pkg/model/worker_message.go | 21 ------- pkg/routes/v1.go | 4 +- pkg/routes/v1_test.go | 4 +- pkg/service/basecamp/basecamp.go | 17 ++--- pkg/service/basecamp/consts/consts.go | 7 ++- pkg/service/basecamp/integration.go | 8 +-- pkg/service/googlemail/google_mail.go | 2 + 14 files changed, 120 insertions(+), 136 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index ddbe8a9e8..f05174e5e 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -79,7 +79,7 @@ func New(store *store.Store, repo store.DBRepo, service *service.Service, ctrl * Project: project.New(ctrl, store, repo, service, logger, cfg), Survey: survey.New(store, repo, service, logger, cfg), Valuation: valuation.New(store, repo, service, logger, cfg), - Webhook: webhook.New(ctrl, store, repo, service, logger, cfg), + Webhook: webhook.New(ctrl, store, repo, service, logger, cfg, worker), Vault: vault.New(store, repo, service, logger, cfg), } } diff --git a/pkg/handler/payroll/payroll.go b/pkg/handler/payroll/payroll.go index dd23ad2fb..3d4589f29 100644 --- a/pkg/handler/payroll/payroll.go +++ b/pkg/handler/payroll/payroll.go @@ -21,6 +21,7 @@ import ( "github.com/dwarvesf/fortress-api/pkg/model" "github.com/dwarvesf/fortress-api/pkg/service" "github.com/dwarvesf/fortress-api/pkg/service/basecamp/consts" + bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" "github.com/dwarvesf/fortress-api/pkg/service/currency" "github.com/dwarvesf/fortress-api/pkg/store" "github.com/dwarvesf/fortress-api/pkg/store/employee" @@ -69,7 +70,7 @@ func (h *handler) GetPayrollsByMonth(c *gin.Context) { email := q.Get("email") if q.Get("next") == "true" { - res, err := GetPayrollDetailHandler(h, 0, 0, 0, email) + res, err := h.getPayrollDetailHandler(0, 0, 0, email) if err != nil { c.JSON(http.StatusInternalServerError, view.CreateResponse[any](nil, nil, err, nil, "")) return @@ -101,7 +102,7 @@ func (h *handler) GetPayrollsByMonth(c *gin.Context) { month = int64(time.Now().Month()) } - res, err := GetPayrollDetailHandler(h, int(month), int(year), int(batch), email) + res, err := h.getPayrollDetailHandler(int(month), int(year), int(batch), email) if err != nil { c.JSON(http.StatusInternalServerError, view.CreateResponse[any](nil, nil, err, nil, "")) return @@ -171,7 +172,7 @@ func GetPayrollBHXHHandler(h *handler) (interface{}, error) { return res, nil } -func GetPayrollDetailHandler(h *handler, month, year, batch int, email string) (interface{}, error) { +func (h *handler) getPayrollDetailHandler(month, year, batch int, email string) (interface{}, error) { tx, done := h.repo.NewTransaction() if month == 0 && year == 0 && batch == 0 { date, err := h.store.Payroll.GetLatestCommitTime(tx.DB()) @@ -232,7 +233,7 @@ func GetPayrollDetailHandler(h *handler, month, year, batch int, email string) ( } var tempPayrolls []model.Payroll - newPayrolls, err := calculatePayrolls(h, us, batchDate) + newPayrolls, err := h.calculatePayrolls(us, batchDate) if err != nil { h.logger.Error(err, "can't calculate payroll") return nil, err @@ -290,7 +291,7 @@ func GetPayrollDetailHandler(h *handler, month, year, batch int, email string) ( } } - bonus, sub, err := preparePayroll(h, c, &payrolls[i], false) + bonus, sub, err := h.preparePayroll(c, &payrolls[i], false) if err != nil { return nil, err } @@ -353,7 +354,7 @@ func GetPayrollDetailHandler(h *handler, month, year, batch int, email string) ( res = append(res, r) } if email == "" { - err = cachePayroll(h, month, year, batch, payrolls) + err = h.cachePayroll(month, year, batch, payrolls) if err != nil { return nil, err } @@ -369,25 +370,29 @@ func GetPayrollDetailHandler(h *handler, month, year, batch int, email string) ( }, nil } -func cachePayroll(h *handler, month, year, batch int, payrolls []model.Payroll) error { +func (h *handler) cachePayroll(month, year, batch int, payrolls []model.Payroll) error { payrollsBytes, err := json.Marshal(&payrolls) if err != nil { return err } + cPayroll, err := h.store.CachedPayroll.Get(h.repo.DB(), month, year, batch) if err != nil && err != gorm.ErrRecordNotFound { return err } + cPayroll.Month = month cPayroll.Year = year cPayroll.Batch = batch cPayroll.Payrolls = payrollsBytes + return h.store.CachedPayroll.Set(h.repo.DB(), cPayroll) } -func preparePayroll(h *handler, c string, p *model.Payroll, markPaid bool) (float64, int64, error) { +func (h *handler) preparePayroll(c string, p *model.Payroll, markPaid bool) (float64, int64, error) { var bonus float64 var subTotal int64 + if p.Employee.BaseSalary.Currency.Name != currency.VNDCurrency { c, _, err := h.service.Wise.Convert(float64(p.CommissionAmount), currency.VNDCurrency, p.Employee.BaseSalary.Currency.Name) if err != nil { @@ -416,21 +421,21 @@ func preparePayroll(h *handler, c string, p *model.Payroll, markPaid bool) (floa } p.ProjectBonusExplains = projectBonusExplains - commissionExplains, err := getCommissionExplains(h, p, markPaid) + commissionExplains, err := h.getCommissionExplains(p, markPaid) if err != nil { return 0, 0, err } p.CommissionExplains = commissionExplains for i, v := range p.ProjectBonusExplains { - formattedAmount, err := getFormattedAmount(h, p, v.Amount) + formattedAmount, err := h.getFormattedAmount(p, v.Amount) if err != nil { return 0, 0, err } p.ProjectBonusExplains[i].FormattedAmount = formattedAmount } for i, v := range p.CommissionExplains { - formattedAmount, err := getFormattedAmount(h, p, v.Amount) + formattedAmount, err := h.getFormattedAmount(p, v.Amount) if err != nil { return 0, 0, err } @@ -471,10 +476,11 @@ func getProjectBonusExplains(p *model.Payroll) ([]model.ProjectBonusExplain, err for i := range tempBonus { tempBonusExplains = append(tempBonusExplains, *tempBonus[i]) } + return tempBonusExplains, nil } -func getCommissionExplains(h *handler, p *model.Payroll, markPaid bool) ([]model.CommissionExplain, error) { +func (h *handler) getCommissionExplains(p *model.Payroll, markPaid bool) ([]model.CommissionExplain, error) { commissionExplains := make([]model.CommissionExplain, 0) err := json.Unmarshal( p.CommissionExplain, @@ -510,7 +516,7 @@ func getCommissionExplains(h *handler, p *model.Payroll, markPaid bool) ([]model return tempCommissionExplains, nil } -func getFormattedAmount(h *handler, p *model.Payroll, amount model.VietnamDong) (string, error) { +func (h *handler) getFormattedAmount(p *model.Payroll, amount model.VietnamDong) (string, error) { if p.Employee.BaseSalary.Currency.Name != currency.VNDCurrency { temp, _, err := h.service.Wise.Convert(float64(amount), currency.VNDCurrency, p.Employee.BaseSalary.Currency.Name) if err != nil { @@ -521,7 +527,7 @@ func getFormattedAmount(h *handler, p *model.Payroll, amount model.VietnamDong) return amount.String(), nil } -func storePayrollTransaction(h *handler, p []model.Payroll, batchDate time.Time) error { +func (h *handler) storePayrollTransaction(p []model.Payroll, batchDate time.Time) error { var transactions []*model.AccountingTransaction for i := range p { m := model.AccountingMetadata{ @@ -613,10 +619,10 @@ func storePayrollTransaction(h *handler, p []model.Payroll, batchDate time.Time) } } - return StoreMultipleTransaction(h, transactions) + return h.storeMultipleTransaction(transactions) } -func StoreMultipleTransaction(h *handler, transactions []*model.AccountingTransaction) error { +func (h *handler) storeMultipleTransaction(transactions []*model.AccountingTransaction) error { if err := h.store.Accounting.CreateMultipleTransaction(h.repo.DB(), transactions); err != nil { return err } @@ -739,12 +745,12 @@ func (h *handler) commitPayrollHandler(month, year, batch int, email string) err for i := range payrolls { payrolls[i].IsPaid = true - err = markBonusAsDone(h, &payrolls[i]) + err = h.markBonusAsDone(&payrolls[i]) if err != nil { return err } // hacky way to mark done commission - if _, err := getCommissionExplains(h, &payrolls[i], true); err != nil { + if _, err := h.getCommissionExplains(&payrolls[i], true); err != nil { return err } } @@ -768,10 +774,11 @@ func (h *handler) commitPayrollHandler(month, year, batch int, email string) err }(pr) } wg.Wait() + c <- nil - go activateGmailQueue(h, c) + go h.activateGmailQueue(c) - err = storePayrollTransaction(h, payrolls, batchDate) + err = h.storePayrollTransaction(payrolls, batchDate) if err != nil { return err } @@ -780,7 +787,7 @@ func (h *handler) commitPayrollHandler(month, year, batch int, email string) err return nil } -func markBonusAsDone(h *handler, p *model.Payroll) error { +func (h *handler) markBonusAsDone(p *model.Payroll) error { var projectBonusExplains []model.ProjectBonusExplain err := json.Unmarshal( p.ProjectBonusExplain, @@ -817,7 +824,7 @@ func markBonusAsDone(h *handler, p *model.Payroll) error { } msg := fmt.Sprintf("Amount has been deposited in your payroll %v", mention) cm := h.service.Basecamp.BuildCommentMessage(projectBonusExplains[i].BasecampBucketID, projectBonusExplains[i].BasecampTodoID, msg, "") - h.worker.Enqueue(model.BasecampCommentMsg, cm) + h.worker.Enqueue(bcModel.BasecampCommentMsg, cm) } } } @@ -830,17 +837,17 @@ func (h *handler) MarkPayrollAsPaid(c *gin.Context) { return } - err := markPayrollAsPaid(h, ids) + err := h.markPayrollAsPaid(ids) if err != nil { c.JSON(http.StatusInternalServerError, view.CreateResponse[any](nil, nil, err, nil, "")) } c.JSON(http.StatusOK, view.CreateResponse[any](nil, nil, nil, nil, "marking the payroll as paid was successful")) } -// MarkPayrollAsPaid from selected payroll row in database +// markPayrollAsPaid from selected payroll row in database // update the is_paid and is_sent_mail in payroll table // send email into the users that marked as paid -func markPayrollAsPaid(h *handler, ids []string) error { +func (h *handler) markPayrollAsPaid(ids []string) error { for _, id := range ids { q := payroll.GetListPayrollInput{ ID: id, @@ -867,7 +874,7 @@ func markPayrollAsPaid(h *handler, ids []string) error { return nil } -func activateGmailQueue(h *handler, p chan *model.Payroll) { +func (h *handler) activateGmailQueue(p chan *model.Payroll) { h.logger.Info("gmail queue activated") ticker := time.NewTicker(time.Second) defer ticker.Stop() diff --git a/pkg/handler/payroll/payroll_calculator.go b/pkg/handler/payroll/payroll_calculator.go index 37c1ff5c6..7d9d62649 100644 --- a/pkg/handler/payroll/payroll_calculator.go +++ b/pkg/handler/payroll/payroll_calculator.go @@ -15,7 +15,7 @@ import ( ) // calculatePayrolls return list of payrolls for all given users in batchDate -func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) (res []*model.Payroll, err error) { +func (h *handler) calculatePayrolls(users []*model.Employee, batchDate time.Time) (res []*model.Payroll, err error) { isForecast := false batch := batchDate.Day() // HACK: sneak quang into this @@ -33,12 +33,14 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) expenseID := consts.PlaygroundExpenseTodoID opsID := consts.PlaygroundID opsExpenseID := consts.PlaygroundExpenseTodoID + approver := consts.NamNguyenBasecampID if h.config.Env == "prod" { woodlandID = consts.WoodlandID expenseID = consts.ExpenseTodoID opsID = consts.OperationID opsExpenseID = consts.OpsExpenseTodoID + approver = consts.HanBasecampID } opsTodoLists, err := h.service.Basecamp.Todo.GetAllInList(opsExpenseID, opsID) @@ -46,6 +48,7 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) h.logger.Error(err, "can't get ops expense todo") return nil, err } + for _, exps := range opsTodoLists { isApproved := false cmts, err := h.service.Basecamp.Comment.Gets(opsID, exps.ID) @@ -53,12 +56,14 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) h.logger.Error(err, "can't get basecamp approved message") return nil, err } + for _, cmt := range cmts { - if cmt.Creator.ID == consts.HanBasecampID && strings.Contains(strings.ToLower(cmt.Content), "approve") { + if cmt.Creator.ID == approver && strings.Contains(strings.ToLower(cmt.Content), "approve") { isApproved = true break } } + if isApproved { expenses = append(expenses, exps) } @@ -70,6 +75,7 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) h.logger.Error(err, "can't get groups expense") return nil, err } + for i := range todolists { e, err := h.service.Basecamp.Todo.GetAllInList(todolists[i].ID, woodlandID) if err != nil { @@ -84,7 +90,7 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) return nil, err } for k := range cmts { - if cmts[k].Creator.ID == consts.HanBasecampID && strings.Contains(strings.ToLower(cmts[k].Content), "approve") { + if cmts[k].Creator.ID == approver && strings.Contains(strings.ToLower(cmts[k].Content), "approve") { isApproved = true break } @@ -95,7 +101,7 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) } } - accountingExpenses, err := getAccountingExpense(h, batch) + accountingExpenses, err := h.getAccountingExpense(batch) if err != nil { h.logger.Error(err, "can't get accounting todo") return nil, err @@ -130,7 +136,7 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) // TODO... // get bonus if !isForecast { - bonus, commission, reimbursementAmount, bonusExplains, commissionExplains = getBonus(h, *users[i], batchDate, expenses) + bonus, commission, reimbursementAmount, bonusExplains, commissionExplains = h.getBonus(*users[i], batchDate, expenses) } commBytes, err := json.Marshal(&commissionExplains) @@ -223,12 +229,7 @@ func calculatePayrolls(h *handler, users []*model.Employee, batchDate time.Time) return res, nil } -func getBonus( - h *handler, - u model.Employee, - batchDate time.Time, - expenses []bcModel.Todo, -) (bonus, commission, reimbursementAmount model.VietnamDong, bonusExplain, commissionExplain []model.CommissionExplain) { +func (h *handler) getBonus(u model.Employee, batchDate time.Time, expenses []bcModel.Todo) (bonus, commission, reimbursementAmount model.VietnamDong, bonusExplain, commissionExplain []model.CommissionExplain) { h.logger.Info("get bonus") var explanation string bonusRecords, err := h.store.Bonus.GetByUserID(h.repo.DB(), u.ID) @@ -264,7 +265,7 @@ func getBonus( } } if hasReimbursement { - name, amount, err := getReimbursement(h, expenses[i].Title) + name, amount, err := h.getReimbursement(expenses[i].Title) if err != nil { return } @@ -384,7 +385,7 @@ func calculatePartialPayroll(startDate time.Time, endDate time.Time, dueDate tim return total, fmt.Sprintf("Work from %s to %s", startDate.Format("2 Jan"), endDate.Format("2 Jan")), nil } -func getReimbursement(h *handler, expense string) (string, model.VietnamDong, error) { +func (h *handler) getReimbursement(expense string) (string, model.VietnamDong, error) { var amount model.VietnamDong splits := strings.Split(expense, "|") if len(splits) < 3 { @@ -405,7 +406,7 @@ func getReimbursement(h *handler, expense string) (string, model.VietnamDong, er return strings.TrimSpace(splits[0]), amount.Format(), nil } -func getAccountingExpense(h *handler, batch int) (res []bcModel.Todo, err error) { +func (h *handler) getAccountingExpense(batch int) (res []bcModel.Todo, err error) { accountingID := consts.AccountingID accountingTodoID := consts.AccountingTodoID diff --git a/pkg/handler/webhook/basecamp.go b/pkg/handler/webhook/basecamp.go index 576aa2ca1..66946e77b 100644 --- a/pkg/handler/webhook/basecamp.go +++ b/pkg/handler/webhook/basecamp.go @@ -1,6 +1,7 @@ package webhook import ( + bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" "net/http" "github.com/gin-gonic/gin" @@ -18,15 +19,15 @@ func basecampWebhookMessageFromCtx(c *gin.Context) (model.BasecampWebhookMessage return msg, nil } -// BasecampExpenseValidate dry-run expense request for validation -func (h *handler) BasecampExpenseValidate(c *gin.Context) { +// ValidateBasecampExpense dry-run expense request for validation +func (h *handler) ValidateBasecampExpense(c *gin.Context) { msg, err := basecampWebhookMessageFromCtx(c) if err != nil { c.JSON(http.StatusOK, view.CreateResponse[any](nil, nil, nil, nil, "")) return } - err = h.BasecampExpenseValidateHandler(msg) + err = h.basecampExpenseValidate(msg) if err != nil { c.JSON(http.StatusOK, view.CreateResponse[any](nil, nil, err, nil, "")) return @@ -35,15 +36,15 @@ func (h *handler) BasecampExpenseValidate(c *gin.Context) { c.JSON(http.StatusOK, view.CreateResponse[any](nil, nil, nil, nil, "")) } -// BasecampExpense runs expense process in basecamp -func (h *handler) BasecampExpense(c *gin.Context) { +// CreateBasecampExpense runs expense process in basecamp +func (h *handler) CreateBasecampExpense(c *gin.Context) { msg, err := basecampWebhookMessageFromCtx(c) if err != nil { c.JSON(http.StatusOK, view.CreateResponse[any](nil, nil, nil, nil, "")) return } - err = h.BasecampExpenseHandler(msg, msg.Read(c.Request.Body)) + err = h.createBasecampExpense(msg, msg.Read(c.Request.Body)) if err != nil { c.JSON(http.StatusOK, view.CreateResponse[any](nil, nil, err, nil, "")) return @@ -105,7 +106,7 @@ func (h *handler) MarkInvoiceAsPaidViaBasecamp(c *gin.Context) { func (h *handler) markInvoiceAsPaid(msg *model.BasecampWebhookMessage) error { invoice, err := h.GetInvoiceViaBasecampTitle(msg) if err != nil { - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, msg.Recording.ID, h.service.Basecamp.BuildFailedComment(err.Error())) + h.worker.Enqueue(bcModel.BasecampCommentMsg, h.service.Basecamp.BuildCommentMessage(msg.Recording.Bucket.ID, msg.Recording.ID, err.Error(), bcModel.CommentMsgTypeFailed)) return err } @@ -114,7 +115,6 @@ func (h *handler) markInvoiceAsPaid(msg *model.BasecampWebhookMessage) error { } if _, err := h.controller.Invoice.MarkInvoiceAsPaidByBasecampWebhookMessage(invoice, msg); err != nil { - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, msg.Recording.ID, h.service.Basecamp.BuildFailedComment(err.Error())) return err } diff --git a/pkg/handler/webhook/basecamp_expense.go b/pkg/handler/webhook/basecamp_expense.go index 220c4cb81..c74f87ebd 100644 --- a/pkg/handler/webhook/basecamp_expense.go +++ b/pkg/handler/webhook/basecamp_expense.go @@ -11,11 +11,20 @@ import ( bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" ) -func (h *handler) BasecampExpenseValidateHandler(msg model.BasecampWebhookMessage) error { - if msg.Recording.Bucket.Name != "Woodland" { - return nil +func (h *handler) basecampExpenseValidate(msg model.BasecampWebhookMessage) error { + recordingBucketName := consts.BucketNameWoodLand + assigneeIDs := []int{consts.HanBasecampID} + projectID := consts.WoodlandID + + if h.config.Env != "prod" { + recordingBucketName = consts.BucketNamePlayGround + assigneeIDs = []int{consts.NamNguyenBasecampID} + projectID = consts.PlaygroundID } + if msg.Recording.Bucket.Name != recordingBucketName { + return nil + } // Todo ref: https://3.basecamp.com/4108948/buckets/9410372/todos/3204666678 // Assign HanNgo whenever expense todo was created if msg.Kind == consts.TodoCreate { @@ -23,12 +32,7 @@ func (h *handler) BasecampExpenseValidateHandler(msg model.BasecampWebhookMessag if err != nil { return err } - assigneeIDs := []int{consts.HanBasecampID} - projectID := consts.WoodlandID - if h.config.Env != "prod" { - assigneeIDs = []int{consts.KhanhTruongBasecampID} - projectID = consts.PlaygroundID - } + todo.AssigneeIDs = assigneeIDs _, err = h.service.Basecamp.Todo.Update(projectID, *todo) if err != nil { @@ -36,7 +40,7 @@ func (h *handler) BasecampExpenseValidateHandler(msg model.BasecampWebhookMessag } } - _, err := h.ExtractExpenseData(msg) + _, err := h.extractExpenseData(msg) if err != nil { m, err := h.service.Basecamp.BasecampMention(msg.Creator.ID) if err != nil { @@ -53,30 +57,29 @@ func (h *handler) BasecampExpenseValidateHandler(msg model.BasecampWebhookMessag Title: Tiền mèo | 400.000 | VND Assign To: Han Ngo, < payee >`, m) - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, - msg.Recording.ID, - &bcModel.Comment{Content: errMsg}, - ) + h.worker.Enqueue(bcModel.BasecampCommentMsg, h.service.Basecamp.BuildCommentMessage(msg.Recording.Bucket.ID, msg.Recording.ID, errMsg, "")) return nil } - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, + + commentMessage := h.service.Basecamp.BuildCommentMessage(msg.Recording.Bucket.ID, msg.Recording.ID, - &bcModel.Comment{Content: `Your format looks good 👍`}) + "Your format looks good 👍", + "", + ) + + h.worker.Enqueue(bcModel.BasecampCommentMsg, commentMessage) return nil } -func (h *handler) BasecampExpenseHandler(msg model.BasecampWebhookMessage, rawData []byte) error { - var comment func() +func (h *handler) createBasecampExpense(msg model.BasecampWebhookMessage, rawData []byte) error { + commentMessage := h.service.Basecamp.BuildCommentMessage(msg.Recording.Bucket.ID, msg.Recording.ID, model.CommentCreateExpenseFailed, bcModel.CommentMsgTypeFailed) + defer func() { - if comment == nil { - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, msg.Recording.ID, h.service.Basecamp.BuildFailedComment(model.CommentCreateExpenseFailed)) - return - } - comment() + h.worker.Enqueue(bcModel.BasecampCommentMsg, commentMessage) }() - obj, err := h.ExtractExpenseData(msg) + obj, err := h.extractExpenseData(msg) if err != nil { return err } @@ -90,29 +93,24 @@ func (h *handler) BasecampExpenseHandler(msg model.BasecampWebhookMessage, rawDa return err } - err = h.service.Basecamp.BasecampExpenseHandler(*obj) + err = h.service.Basecamp.CreateBasecampExpense(*obj) if err != nil { return err } - comment = func() { - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, msg.Recording.ID, h.service.Basecamp.BuildCompletedComment(model.CommentCreateExpenseSuccessfully)) - } + commentMessage = h.service.Basecamp.BuildCommentMessage(msg.Recording.Bucket.ID, msg.Recording.ID, model.CommentCreateExpenseSuccessfully, bcModel.CommentMsgTypeCompleted) return nil } func (h *handler) UncheckBasecampExpenseHandler(msg model.BasecampWebhookMessage, rawData []byte) error { - var comment func() + commentMsg := h.service.Basecamp.BuildCommentMessage(msg.Recording.Bucket.ID, msg.Recording.ID, model.CommentDeleteExpenseFailed, bcModel.CommentMsgTypeFailed) + defer func() { - if comment == nil { - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, msg.Recording.ID, h.service.Basecamp.BuildFailedComment(model.CommentDeleteExpenseFailed)) - return - } - comment() + h.worker.Enqueue(bcModel.BasecampCommentMsg, commentMsg) }() - obj, err := h.ExtractExpenseData(msg) + obj, err := h.extractExpenseData(msg) if err != nil { return err } @@ -130,15 +128,13 @@ func (h *handler) UncheckBasecampExpenseHandler(msg model.BasecampWebhookMessage return err } - comment = func() { - h.service.Basecamp.CommentResult(msg.Recording.Bucket.ID, msg.Recording.ID, h.service.Basecamp.BuildCompletedComment(model.CommentDeleteExpenseSuccessfully)) - } + commentMsg = h.service.Basecamp.BuildCommentMessage(msg.Recording.Bucket.ID, msg.Recording.ID, model.CommentDeleteExpenseSuccessfully, bcModel.CommentMsgTypeCompleted) return nil } -// ExtractExpenseData takes a webhook message and parse it into BasecampExpenseData structure -func (h *handler) ExtractExpenseData(msg model.BasecampWebhookMessage) (*bc.BasecampExpenseData, error) { +// extractExpenseData takes a webhook message and parse it into BasecampExpenseData structure +func (h *handler) extractExpenseData(msg model.BasecampWebhookMessage) (*bc.BasecampExpenseData, error) { res := &bc.BasecampExpenseData{BasecampID: msg.Recording.ID} parts := strings.Split(msg.Recording.Title, "|") diff --git a/pkg/handler/webhook/interface.go b/pkg/handler/webhook/interface.go index 1b6a73c5a..173867b27 100644 --- a/pkg/handler/webhook/interface.go +++ b/pkg/handler/webhook/interface.go @@ -4,9 +4,9 @@ import "github.com/gin-gonic/gin" type IHandler interface { N8n(c *gin.Context) - BasecampExpenseValidate(c *gin.Context) - BasecampExpense(c *gin.Context) - UncheckBasecampExpense(c *gin.Context) + CreateBasecampExpense(c *gin.Context) MarkInvoiceAsPaidViaBasecamp(c *gin.Context) StoreAccountingTransaction(c *gin.Context) + UncheckBasecampExpense(c *gin.Context) + ValidateBasecampExpense(c *gin.Context) } diff --git a/pkg/handler/webhook/webhook.go b/pkg/handler/webhook/webhook.go index d9a9246ef..c2d55eb56 100644 --- a/pkg/handler/webhook/webhook.go +++ b/pkg/handler/webhook/webhook.go @@ -6,6 +6,7 @@ import ( "github.com/dwarvesf/fortress-api/pkg/logger" "github.com/dwarvesf/fortress-api/pkg/service" "github.com/dwarvesf/fortress-api/pkg/store" + "github.com/dwarvesf/fortress-api/pkg/worker" ) type handler struct { @@ -15,16 +16,18 @@ type handler struct { logger logger.Logger repo store.DBRepo config *config.Config + worker *worker.Worker } // New returns a handler -func New(ctrl *controller.Controller, store *store.Store, repo store.DBRepo, service *service.Service, logger logger.Logger, cfg *config.Config) IHandler { +func New(ctrl *controller.Controller, store *store.Store, repo store.DBRepo, service *service.Service, logger logger.Logger, cfg *config.Config, worker *worker.Worker) IHandler { return &handler{ store: store, repo: repo, service: service, logger: logger, config: cfg, + worker: worker, controller: ctrl, } } diff --git a/pkg/model/worker_message.go b/pkg/model/worker_message.go index 03f2ac37c..a63d51ef7 100644 --- a/pkg/model/worker_message.go +++ b/pkg/model/worker_message.go @@ -1,29 +1,8 @@ package model -import bcModel "github.com/dwarvesf/fortress-api/pkg/service/basecamp/model" - type Action uint8 -const ( - BasecampCommentMsg string = "basecamp_comment" - BasecampTodoMsg string = "basecamp_todo" - BasecampHiringTodoMsg string = "basecamp_todo_hiring" -) - type WorkerMessage struct { Type string Payload interface{} } - -// BasecampCommentMessageModel is use for worker to create a basecamp comment -type BasecampCommentMessageModel struct { - ProjectID int - RecordingID int - Payload *bcModel.Comment -} - -type BasecampTodoMessageModel struct { - ProjectID int - ListID int - Payload bcModel.Todo -} diff --git a/pkg/routes/v1.go b/pkg/routes/v1.go index 6e837ddca..3639b48be 100644 --- a/pkg/routes/v1.go +++ b/pkg/routes/v1.go @@ -38,8 +38,8 @@ func loadV1Routes(r *gin.Engine, h *handler.Handler, repo store.DBRepo, s *store { expenseGroup := basecampGroup.Group("/expense") { - expenseGroup.POST("/validate", h.Webhook.BasecampExpenseValidate) - expenseGroup.POST("", h.Webhook.BasecampExpense) + expenseGroup.POST("/validate", h.Webhook.ValidateBasecampExpense) + expenseGroup.POST("", h.Webhook.CreateBasecampExpense) expenseGroup.DELETE("", h.Webhook.UncheckBasecampExpense) } operationGroup := basecampGroup.Group("/operation") diff --git a/pkg/routes/v1_test.go b/pkg/routes/v1_test.go index 37c62c85e..a8949aafe 100644 --- a/pkg/routes/v1_test.go +++ b/pkg/routes/v1_test.go @@ -636,13 +636,13 @@ func Test_loadV1Routes(t *testing.T) { "/webhooks/basecamp/expense/validate": { "POST": { Method: "POST", - Handler: "github.com/dwarvesf/fortress-api/pkg/handler/webhook.IHandler.BasecampExpenseValidate-fm", + Handler: "github.com/dwarvesf/fortress-api/pkg/handler/webhook.IHandler.ValidateBasecampExpense-fm", }, }, "/webhooks/basecamp/expense": { "POST": { Method: "POST", - Handler: "github.com/dwarvesf/fortress-api/pkg/handler/webhook.IHandler.BasecampExpense-fm", + Handler: "github.com/dwarvesf/fortress-api/pkg/handler/webhook.IHandler.CreateBasecampExpense-fm", }, "DELETE": { Method: "DELETE", diff --git a/pkg/service/basecamp/basecamp.go b/pkg/service/basecamp/basecamp.go index 88fa862d2..58daa9246 100644 --- a/pkg/service/basecamp/basecamp.go +++ b/pkg/service/basecamp/basecamp.go @@ -5,7 +5,6 @@ import ( "github.com/dwarvesf/fortress-api/pkg/config" "github.com/dwarvesf/fortress-api/pkg/logger" - aModel "github.com/dwarvesf/fortress-api/pkg/model" "github.com/dwarvesf/fortress-api/pkg/service/basecamp/attachment" "github.com/dwarvesf/fortress-api/pkg/service/basecamp/campfire" "github.com/dwarvesf/fortress-api/pkg/service/basecamp/client" @@ -81,9 +80,9 @@ func (s *Service) BuildCommentMessage(bucketID, recordID int, content string, ms var cmtPayload *model.Comment switch msgType { case model.CommentMsgTypeFailed: - cmtPayload = s.BuildFailedComment(content) + cmtPayload = s.buildFailedComment(content) case model.CommentMsgTypeCompleted: - cmtPayload = s.BuildCompletedComment(content) + cmtPayload = s.buildCompletedComment(content) default: cmtPayload = &model.Comment{Content: content} } @@ -120,7 +119,7 @@ func (s *Service) BasecampMention(basecampID int) (res string, err error) { return fmt.Sprintf(``, employee.BasecampAttachableSGID), nil } -func (s *Service) BuildFailedComment(content string) *model.Comment { +func (s *Service) buildFailedComment(content string) *model.Comment { if s.config.Env == "prod" { m, _ := s.BasecampMention(consts.HuyNguyenBasecampID) return &model.Comment{Content: fmt.Sprintf(`
%s %s
`, content, m)} @@ -128,14 +127,6 @@ func (s *Service) BuildFailedComment(content string) *model.Comment { return &model.Comment{Content: fmt.Sprintf(`
%s
`, content)} } -func (s *Service) BuildCompletedComment(content string) *model.Comment { +func (s *Service) buildCompletedComment(content string) *model.Comment { return &model.Comment{Content: fmt.Sprintf(`
%s
`, content)} } - -func (s *Service) CommentResult(bucketID, recordID int, content *model.Comment) aModel.BasecampCommentMessageModel { - return aModel.BasecampCommentMessageModel{ - RecordingID: recordID, - ProjectID: bucketID, - Payload: content, - } -} diff --git a/pkg/service/basecamp/consts/consts.go b/pkg/service/basecamp/consts/consts.go index 0a24a3951..03925a576 100644 --- a/pkg/service/basecamp/consts/consts.go +++ b/pkg/service/basecamp/consts/consts.go @@ -1,7 +1,7 @@ package consts +// Define basecamp resource id const ( - // Basecamp section WoodlandScheduleID int64 = 1346305137 PlaygroundScheduleID int64 = 1941398077 WoodlandID = 9403032 @@ -83,6 +83,11 @@ const ( GiangThanBasecampID = 26160802 HelenBasecampID = 40439249 ThuongBasecampID = 38246363 + NamNguyenBasecampID = 21581534 + + // BucketName + BucketNameWoodLand = "Woodland" + BucketNamePlayGround = "Fortress | Playground" // OrgChart ManagementLevel = 3 diff --git a/pkg/service/basecamp/integration.go b/pkg/service/basecamp/integration.go index 003ed03bf..1e786ff0a 100644 --- a/pkg/service/basecamp/integration.go +++ b/pkg/service/basecamp/integration.go @@ -40,18 +40,18 @@ func (s *Service) ExtractBasecampExpenseAmount(source string) int { return getAmount(strings.Replace(source, ".", "", -1)) } -// BasecampExpenseHandler -- -func (s *Service) BasecampExpenseHandler( +// CreateBasecampExpense -- +func (s *Service) CreateBasecampExpense( data BasecampExpenseData, ) error { employee, err := s.store.Employee.OneByEmail(s.repo.DB(), data.CreatorEmail) if err != nil { - return errors.New("can't find employee by email: " + data.CreatorEmail) + return errors.New("failed to get employee by email: " + data.CreatorEmail) } c, err := s.store.Currency.GetByName(s.repo.DB(), data.CurrencyType) if err != nil { - return errors.New("can't get currency by name: " + data.CurrencyType) + return errors.New("failed to get currency by name: " + data.CurrencyType) } date := time.Now() diff --git a/pkg/service/googlemail/google_mail.go b/pkg/service/googlemail/google_mail.go index f6a9e3144..8b8705071 100644 --- a/pkg/service/googlemail/google_mail.go +++ b/pkg/service/googlemail/google_mail.go @@ -73,6 +73,7 @@ func (g *googleService) SendInvoiceMail(invoice *model.Invoice) (msgID string, e if err != nil { return "", err } + funcMap := template.FuncMap{ "formatDate": func(t *time.Time) string { return timeutil.FormatDatetime(*t) @@ -155,6 +156,7 @@ func (g *googleService) SendInvoiceThankYouMail(invoice *model.Invoice) (err err if err != nil { return err } + funcMap := template.FuncMap{ "gatherAddress": func() string { return addresses From f413879bdfa4f88e21b9350718cc49622e3f8515 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Thu, 1 Jun 2023 23:34:19 +0700 Subject: [PATCH 09/17] fix: updatr query get payroll and update expense --- pkg/store/expense/expense.go | 2 +- pkg/store/payroll/payroll.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/store/expense/expense.go b/pkg/store/expense/expense.go index f8ac74c85..ad1add128 100644 --- a/pkg/store/expense/expense.go +++ b/pkg/store/expense/expense.go @@ -22,7 +22,7 @@ func (s *store) Delete(db *gorm.DB, e *model.Expense) (*model.Expense, error) { } func (s *store) Update(db *gorm.DB, e *model.Expense) (*model.Expense, error) { - return e, db.Model(&model.Expense{}).Updates(&e).Error + return e, db.Model(&model.Expense{}).Where("id = ?", e.ID).Updates(&e).First(&e).Error } func (s *store) GetValuation(db *gorm.DB, y int) (*model.CurrencyView, error) { diff --git a/pkg/store/payroll/payroll.go b/pkg/store/payroll/payroll.go index e6348ebb5..bf88e8122 100644 --- a/pkg/store/payroll/payroll.go +++ b/pkg/store/payroll/payroll.go @@ -51,7 +51,7 @@ func (s *store) GetList(db *gorm.DB, q GetListPayrollInput) ([]model.Payroll, er payrollQuery = payrollQuery.Where("payrolls.id = ?", q.ID) } if q.UserID != "" { - payrollQuery = payrollQuery.Where("payrolls.user_id = ?", q.UserID) + payrollQuery = payrollQuery.Where("payrolls.employee_id = ?", q.UserID) } if q.Month != 0 { payrollQuery = payrollQuery.Where("payrolls.month = ?", q.Month) From caf0dc8e044e763d3c5bf9a310cd8c8954affc93 Mon Sep 17 00:00:00 2001 From: lmquang Date: Thu, 30 Mar 2023 21:17:15 +0700 Subject: [PATCH 10/17] chore: add wg to fetch expense --- pkg/handler/payroll/payroll_calculator.go | 64 ++++++++++++++--------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/pkg/handler/payroll/payroll_calculator.go b/pkg/handler/payroll/payroll_calculator.go index 7d9d62649..e9a2af4ec 100644 --- a/pkg/handler/payroll/payroll_calculator.go +++ b/pkg/handler/payroll/payroll_calculator.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "strings" + "sync" "time" "github.com/dwarvesf/fortress-api/pkg/model" @@ -422,42 +423,53 @@ func (h *handler) getAccountingExpense(batch int) (res []bcModel.Todo, err error return nil, err } + var wg sync.WaitGroup + var mu sync.Mutex // get all group in each list for i := range lists { - groups, err := h.service.Basecamp.Todo.GetGroups(lists[i].ID, accountingID) - if err != nil { - return nil, err - } + wg.Add(1) + go func(i int) { + defer wg.Done() + groups, err := h.service.Basecamp.Todo.GetGroups(lists[i].ID, accountingID) + if err != nil { + h.logger.Error(err, "can't get groups in todo list") + return + } - // filter out group only - for j := range groups { - if strings.ToLower(groups[j].Title) == "out" { - // get all todo in out grou - todos, err := h.service.Basecamp.Todo.GetAllInList(groups[j].ID, accountingID) - if err != nil { - h.logger.Error(err, "can't get todo in out group") - } + // filter out group only + for j := range groups { + if strings.ToLower(groups[j].Title) == "out" { + // get all todo in out grou + todos, err := h.service.Basecamp.Todo.GetAllInList(groups[j].ID, accountingID) + if err != nil { + h.logger.Error(err, "can't get todo in out group") + return + } - // find expense in list of todos - for k := range todos { - if len(todos[k].Assignees) == 1 && todos[k].Assignees[0].ID != consts.HanBasecampID { - // HACK: some todo is specific batch only - if strings.Contains(todos[k].Title, "Tiền điện") { - if batch != 1 { - continue - } - } else if strings.Contains(todos[k].Title, "Office Rental") || strings.Contains(todos[k].Title, "CBRE") { - if batch != 15 { - continue + // find expense in list of todos + for k := range todos { + if len(todos[k].Assignees) == 1 && todos[k].Assignees[0].ID != consts.HanBasecampID { + // HACK: some todo is specific batch only + if strings.Contains(todos[k].Title, "Tiền điện") { + if batch != 1 { + continue + } + } else if strings.Contains(todos[k].Title, "Office Rental") || strings.Contains(todos[k].Title, "CBRE") { + if batch != 15 { + continue + } } + mu.Lock() + res = append(res, todos[k]) + mu.Unlock() } - - res = append(res, todos[k]) } } + } - } + }(i) } + wg.Wait() return res, nil } From f775f07f53fd5ab52e51350e5fe77cd1425a5618 Mon Sep 17 00:00:00 2001 From: lmquang Date: Fri, 31 Mar 2023 13:40:32 +0700 Subject: [PATCH 11/17] chore: fix lint --- pkg/handler/payroll/payroll_calculator.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/handler/payroll/payroll_calculator.go b/pkg/handler/payroll/payroll_calculator.go index e9a2af4ec..954202b2b 100644 --- a/pkg/handler/payroll/payroll_calculator.go +++ b/pkg/handler/payroll/payroll_calculator.go @@ -465,7 +465,6 @@ func (h *handler) getAccountingExpense(batch int) (res []bcModel.Todo, err error } } } - } }(i) } From fd73b3d9008291ca468b26cc3469925abb9a5066 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Fri, 2 Jun 2023 11:29:48 +0700 Subject: [PATCH 12/17] fix: assign discord id when submit onboarding form --- .../employee/update_employee_status.go | 4 +- pkg/handler/profile/profile.go | 69 ++++++++++++------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/pkg/controller/employee/update_employee_status.go b/pkg/controller/employee/update_employee_status.go index b6f437d28..a551566e3 100644 --- a/pkg/controller/employee/update_employee_status.go +++ b/pkg/controller/employee/update_employee_status.go @@ -66,7 +66,7 @@ func (r *controller) UpdateEmployeeStatus(employeeID string, body UpdateWorkingS func (r *controller) processOffBoardingEmployee(l logger.Logger, e *model.Employee) { discordInfo := model.SocialAccounts(e.SocialAccounts).GetDiscord() if discordInfo != nil { - err := r.updateDiscordRoles(discordInfo.AccountID) + err := r.removeDiscordRoles(discordInfo.AccountID) if err != nil { l.Errorf(err, "failed to update discord roles", "employeeID", e.ID.String(), "discordID", discordInfo.AccountID) } @@ -93,7 +93,7 @@ func (r *controller) processOffBoardingEmployee(l logger.Logger, e *model.Employ } } -func (r *controller) updateDiscordRoles(discordUserID string) error { +func (r *controller) removeDiscordRoles(discordUserID string) error { if !(r.config.Env == "prod" || r.config.Env == "dev") { return nil } diff --git a/pkg/handler/profile/profile.go b/pkg/handler/profile/profile.go index 3b1e2c696..9c748ebb9 100644 --- a/pkg/handler/profile/profile.go +++ b/pkg/handler/profile/profile.go @@ -70,7 +70,7 @@ func (h *handler) GetProfile(c *gin.Context) { "method": "GetProfile", }) - rs, err := h.store.Employee.One(h.repo.DB(), userID, false) + rs, err := h.store.Employee.One(h.repo.DB(), userID, true) if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { l.Info("employee not found") @@ -202,6 +202,7 @@ type socialAccountInput struct { NotionID string NotionName string NotionEmail string + DiscordID string DiscordName string LinkedInName string } @@ -236,6 +237,7 @@ func (h *handler) updateSocialAccounts(db *gorm.DB, input socialAccountInput, em model.SocialAccountTypeDiscord: { Type: model.SocialAccountTypeDiscord, EmployeeID: employeeID, + AccountID: input.DiscordID, Name: input.DiscordName, }, model.SocialAccountTypeLinkedIn: { @@ -755,13 +757,23 @@ func (h *handler) SubmitOnboardingForm(c *gin.Context) { return } + // Get discord info + discordMember, err := h.getDiscordInfo(input.DiscordName) + if err != nil { + l.Error(err, "failed to get discord info") + c.JSON(http.StatusInternalServerError, view.CreateResponse[any](nil, nil, done(err), input, "")) + return + } + // Update social accounts saInput := socialAccountInput{ GithubID: input.GithubID, NotionName: input.NotionName, DiscordName: input.DiscordName, + DiscordID: discordMember.User.ID, LinkedInName: input.LinkedInName, } + if err := h.updateSocialAccounts(tx.DB(), saInput, employee.ID); err != nil { l.Error(err, "failed to update employee") c.JSON(http.StatusInternalServerError, view.CreateResponse[any](nil, nil, done(err), input, "")) @@ -789,7 +801,7 @@ func (h *handler) SubmitOnboardingForm(c *gin.Context) { } if !employeeInvitation.IsDiscordRoleAssigned { - err = h.assignDiscordRole(input.DiscordName) + err = h.assignDiscordRole(discordMember) if err != nil { l.Error(err, "failed to assign discord role") } @@ -866,20 +878,20 @@ func (h *handler) createBasecampAccount(employee *model.Employee) error { return nil } -func (h *handler) assignDiscordRole(discordName string) error { +func (h *handler) getDiscordInfo(discordName string) (*discordgo.Member, error) { if len(discordName) == 0 { - return nil + return nil, nil } if !(h.config.Env == "prod" || h.config.Env == "dev") { - return nil + return nil, nil } discordNameParts := strings.Split(discordName, "#") guildMembers, err := h.service.Discord.SearchMember(discordNameParts[0]) if err != nil { - return err + return nil, err } var discordMember *discordgo.Member @@ -898,31 +910,36 @@ func (h *handler) assignDiscordRole(discordName string) error { } } + return discordMember, nil +} + +func (h *handler) assignDiscordRole(discordMember *discordgo.Member) error { if discordMember != nil { - // Get list discord role - dRoles, err := h.service.Discord.GetRoles() - if err != nil { - return err - } + return nil + } + // Get list discord role + dRoles, err := h.service.Discord.GetRoles() + if err != nil { + return err + } - peepsRoleID := "" - for _, r := range dRoles { - if r.Name == model.DiscordRolePeeps.String() { - peepsRoleID = r.ID - break - } + peepsRoleID := "" + for _, r := range dRoles { + if r.Name == model.DiscordRolePeeps.String() { + peepsRoleID = r.ID + break } + } - if peepsRoleID != "" { - // Check if user already has peeps role - if utils.Contains(discordMember.Roles, peepsRoleID) { - return nil - } + if peepsRoleID != "" { + // Check if user already has peeps role + if utils.Contains(discordMember.Roles, peepsRoleID) { + return nil + } - err := h.service.Discord.AddRole(discordMember.User.ID, peepsRoleID) - if err != nil { - return err - } + err := h.service.Discord.AddRole(discordMember.User.ID, peepsRoleID) + if err != nil { + return err } } From 8f7504a5a67eab73f5ea82e47aae5f2ffee2632d Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Fri, 2 Jun 2023 11:45:09 +0700 Subject: [PATCH 13/17] fix: remove env restriction when add/remove discord role --- pkg/controller/employee/update_employee_status.go | 4 ---- pkg/handler/profile/profile.go | 4 ---- 2 files changed, 8 deletions(-) diff --git a/pkg/controller/employee/update_employee_status.go b/pkg/controller/employee/update_employee_status.go index a551566e3..26e2f8329 100644 --- a/pkg/controller/employee/update_employee_status.go +++ b/pkg/controller/employee/update_employee_status.go @@ -94,10 +94,6 @@ func (r *controller) processOffBoardingEmployee(l logger.Logger, e *model.Employ } func (r *controller) removeDiscordRoles(discordUserID string) error { - if !(r.config.Env == "prod" || r.config.Env == "dev") { - return nil - } - if discordUserID == "" { return nil } diff --git a/pkg/handler/profile/profile.go b/pkg/handler/profile/profile.go index 9c748ebb9..4735f3e18 100644 --- a/pkg/handler/profile/profile.go +++ b/pkg/handler/profile/profile.go @@ -883,10 +883,6 @@ func (h *handler) getDiscordInfo(discordName string) (*discordgo.Member, error) return nil, nil } - if !(h.config.Env == "prod" || h.config.Env == "dev") { - return nil, nil - } - discordNameParts := strings.Split(discordName, "#") guildMembers, err := h.service.Discord.SearchMember(discordNameParts[0]) From a339b48ac06b51143492d3a8c13431fb4f2f7335 Mon Sep 17 00:00:00 2001 From: minhlq Date: Fri, 2 Jun 2023 12:41:49 +0700 Subject: [PATCH 14/17] feat: get icy distribution weekly --- Makefile | 4 +-- pkg/handler/project/interface.go | 1 + pkg/handler/project/project.go | 27 +++++++++++++++++++ pkg/model/icy_distribution.go | 9 +++++++ pkg/routes/v1.go | 1 + pkg/routes/v1_test.go | 6 +++++ pkg/store/icydistribution/icy_distribution.go | 27 +++++++++++++++++++ pkg/store/icydistribution/interface.go | 12 +++++++++ pkg/store/store.go | 3 +++ 9 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 pkg/model/icy_distribution.go create mode 100644 pkg/store/icydistribution/icy_distribution.go create mode 100644 pkg/store/icydistribution/interface.go diff --git a/Makefile b/Makefile index cb1b551f3..3634aeb23 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ cronjob: go run ./cmd/cronjob/main.go test: - golangci-lint run + make lint docker rm --volumes -f ${POSTGRES_TEST_CONTAINER} docker-compose up -d ${POSTGRES_TEST_SERVICE} @while ! docker exec $(POSTGRES_TEST_CONTAINER) pg_isready > /dev/null; do \ @@ -107,4 +107,4 @@ ci: init WD := $(shell pwd) lint: - docker run -t --rm -v $(WD):/app -w /app golangci/golangci-lint:v1.52.2 golangci-lint run -v \ No newline at end of file + docker run -t --rm -v $(WD):/app -w /app golangci/golangci-lint:v1.52.2 golangci-lint run -v diff --git a/pkg/handler/project/interface.go b/pkg/handler/project/interface.go index cb632e721..ffbab42f2 100644 --- a/pkg/handler/project/interface.go +++ b/pkg/handler/project/interface.go @@ -23,4 +23,5 @@ type IHandler interface { UpdateSendingSurveyState(c *gin.Context) UpdateWorkUnit(c *gin.Context) UploadAvatar(c *gin.Context) + IcyWeeklyDistribution(c *gin.Context) } diff --git a/pkg/handler/project/project.go b/pkg/handler/project/project.go index 3eacf6561..2b50535b7 100644 --- a/pkg/handler/project/project.go +++ b/pkg/handler/project/project.go @@ -47,6 +47,33 @@ func New(controller *controller.Controller, store *store.Store, repo store.DBRep } } +// IcyWeeklyDistribution godoc +// @Summary Get Icy Weekly Distribution +// @Description Get Icy Weekly Distribution +// @Tags Project +// @Accept json +// @Produce json +// @Param Authorization header string true "jwt token" +// @PSuccess 200 {object} view.IcyWeeklyDistribution +// @Failure 400 {object} view.ErrorResponse +// @Failure 500 {object} view.ErrorResponse +// @Router /projects/icy-weekly-distribution [get] +func (h *handler) IcyWeeklyDistribution(c *gin.Context) { + l := h.logger.Fields(logger.Fields{ + "handler": "project", + "method": "IcyWeeklyDistribution", + }) + + weeklyIcyDistribution, err := h.store.IcyDistribution.GetWeekly(h.repo.DB()) + if err != nil { + l.Error(err, "failed to weekly icy distribution") + c.JSON(http.StatusBadRequest, view.CreateResponse[any](nil, nil, err, "", "can't get weekly icy distribution")) + return + } + + c.JSON(http.StatusOK, view.CreateResponse[any](weeklyIcyDistribution, nil, nil, "", "")) +} + // List godoc // @Summary Get list of project // @Description Get list of project diff --git a/pkg/model/icy_distribution.go b/pkg/model/icy_distribution.go new file mode 100644 index 000000000..708ba7c8d --- /dev/null +++ b/pkg/model/icy_distribution.go @@ -0,0 +1,9 @@ +package model + +// IcyDistribution is a model for icy_distribution table +type IcyDistribution struct { + BaseModel + Team string `json:"team"` + Period string `json:"period"` + Amount string `json:"amount"` +} diff --git a/pkg/routes/v1.go b/pkg/routes/v1.go index 3639b48be..877c1ed16 100644 --- a/pkg/routes/v1.go +++ b/pkg/routes/v1.go @@ -143,6 +143,7 @@ func loadV1Routes(r *gin.Engine, h *handler.Handler, repo store.DBRepo, s *store projectGroup.PUT("/:id/work-units/:workUnitID", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.UpdateWorkUnit) projectGroup.PUT("/:id/work-units/:workUnitID/archive", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.ArchiveWorkUnit) projectGroup.PUT("/:id/work-units/:workUnitID/unarchive", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.UnarchiveWorkUnit) + projectGroup.GET("/icy-distribution/weekly", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.IcyWeeklyDistribution) } clientGroup := v1.Group("/clients") diff --git a/pkg/routes/v1_test.go b/pkg/routes/v1_test.go index a8949aafe..625de9c0b 100644 --- a/pkg/routes/v1_test.go +++ b/pkg/routes/v1_test.go @@ -219,6 +219,12 @@ func Test_loadV1Routes(t *testing.T) { Handler: "github.com/dwarvesf/fortress-api/pkg/handler/project.IHandler.Create-fm", }, }, + "/api/v1/projects/icy-distribution/weekly": { + "GET": { + Method: "GET", + Handler: "github.com/dwarvesf/fortress-api/pkg/handler/project.IHandler.IcyWeeklyDistribution-fm", + }, + }, "/api/v1/projects/:id": { "GET": { Method: "GET", diff --git a/pkg/store/icydistribution/icy_distribution.go b/pkg/store/icydistribution/icy_distribution.go new file mode 100644 index 000000000..4280e70b4 --- /dev/null +++ b/pkg/store/icydistribution/icy_distribution.go @@ -0,0 +1,27 @@ +package icydistribution + +import ( + "gorm.io/gorm" + + "github.com/dwarvesf/fortress-api/pkg/model" +) + +type store struct{} + +// New implements IStore. +func New() IStore { + return &store{} +} + +// GetWeekly implements IStore. +func (*store) GetWeekly(db *gorm.DB) ([]model.IcyDistribution, error) { + res := []model.IcyDistribution{} + return res, db.Raw(`SELECT v.period, v.team, v.amount + FROM vw_icy_earning_by_team_weekly v + JOIN ( + SELECT team, MAX(period) AS max_period + FROM vw_icy_earning_by_team_weekly + GROUP BY team + ) t ON v.team = t.team AND v.period = t.max_period + ORDER BY v.period DESC;`).Find(&res).Error +} diff --git a/pkg/store/icydistribution/interface.go b/pkg/store/icydistribution/interface.go new file mode 100644 index 000000000..451b8dccf --- /dev/null +++ b/pkg/store/icydistribution/interface.go @@ -0,0 +1,12 @@ +package icydistribution + +import ( + "gorm.io/gorm" + + "github.com/dwarvesf/fortress-api/pkg/model" +) + +// IStore is an interface for icydistribution store +type IStore interface { + GetWeekly(db *gorm.DB) ([]model.IcyDistribution, error) +} diff --git a/pkg/store/store.go b/pkg/store/store.go index 8b1318e0b..2c74eae5a 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -36,6 +36,7 @@ import ( "github.com/dwarvesf/fortress-api/pkg/store/employeestack" "github.com/dwarvesf/fortress-api/pkg/store/expense" "github.com/dwarvesf/fortress-api/pkg/store/feedbackevent" + "github.com/dwarvesf/fortress-api/pkg/store/icydistribution" "github.com/dwarvesf/fortress-api/pkg/store/icytransaction" "github.com/dwarvesf/fortress-api/pkg/store/invoice" "github.com/dwarvesf/fortress-api/pkg/store/invoicenumbercaching" @@ -130,6 +131,7 @@ type Store struct { OperationalService operationalservice.IStore DiscordLogTemplate discordtemplate.IStore IcyTransaction icytransaction.IStore + IcyDistribution icydistribution.IStore } func New() *Store { @@ -197,5 +199,6 @@ func New() *Store { OperationalService: operationalservice.New(), DiscordLogTemplate: discordtemplate.New(), IcyTransaction: icytransaction.New(), + IcyDistribution: icydistribution.New(), } } From 143fb75569646b6ee40d4474ab97247ee74ff3da Mon Sep 17 00:00:00 2001 From: minhlq Date: Fri, 2 Jun 2023 13:04:10 +0700 Subject: [PATCH 15/17] feat: get icy distribution weekly --- docs/docs.go | 38 ++++++++++++++++++++++++++++++++++++++ docs/swagger.json | 38 ++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 25 +++++++++++++++++++++++++ pkg/routes/v1.go | 2 +- 4 files changed, 102 insertions(+), 1 deletion(-) diff --git a/docs/docs.go b/docs/docs.go index 9d4f16caa..cf7e53fd0 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -4360,6 +4360,44 @@ const docTemplate = `{ } } }, + "/projects/icy-weekly-distribution": { + "get": { + "description": "Get Icy Weekly Distribution", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Project" + ], + "summary": "Get Icy Weekly Distribution", + "parameters": [ + { + "type": "string", + "description": "jwt token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/view.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/view.ErrorResponse" + } + } + } + } + }, "/projects/{id}": { "get": { "description": "Get details of a project", diff --git a/docs/swagger.json b/docs/swagger.json index 6bcaab915..b950021cc 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -4352,6 +4352,44 @@ } } }, + "/projects/icy-weekly-distribution": { + "get": { + "description": "Get Icy Weekly Distribution", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Project" + ], + "summary": "Get Icy Weekly Distribution", + "parameters": [ + { + "type": "string", + "description": "jwt token", + "name": "Authorization", + "in": "header", + "required": true + } + ], + "responses": { + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/view.ErrorResponse" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/view.ErrorResponse" + } + } + } + } + }, "/projects/{id}": { "get": { "description": "Get details of a project", diff --git a/docs/swagger.yaml b/docs/swagger.yaml index c3b0b8ad3..21557cd1d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -7802,6 +7802,31 @@ paths: summary: Unarchive an archive work unit of a project tags: - Project + /projects/icy-weekly-distribution: + get: + consumes: + - application/json + description: Get Icy Weekly Distribution + parameters: + - description: jwt token + in: header + name: Authorization + required: true + type: string + produces: + - application/json + responses: + "400": + description: Bad Request + schema: + $ref: '#/definitions/view.ErrorResponse' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/view.ErrorResponse' + summary: Get Icy Weekly Distribution + tags: + - Project /surveys: get: consumes: diff --git a/pkg/routes/v1.go b/pkg/routes/v1.go index 877c1ed16..edd861561 100644 --- a/pkg/routes/v1.go +++ b/pkg/routes/v1.go @@ -143,7 +143,7 @@ func loadV1Routes(r *gin.Engine, h *handler.Handler, repo store.DBRepo, s *store projectGroup.PUT("/:id/work-units/:workUnitID", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.UpdateWorkUnit) projectGroup.PUT("/:id/work-units/:workUnitID/archive", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.ArchiveWorkUnit) projectGroup.PUT("/:id/work-units/:workUnitID/unarchive", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.UnarchiveWorkUnit) - projectGroup.GET("/icy-distribution/weekly", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.IcyWeeklyDistribution) + projectGroup.GET("/icy-distribution/weekly", h.Project.IcyWeeklyDistribution) } clientGroup := v1.Group("/clients") From 43ddfa0b1ab8ce0913321eeefcbcdd52aca66598 Mon Sep 17 00:00:00 2001 From: minhlq Date: Fri, 2 Jun 2023 13:15:14 +0700 Subject: [PATCH 16/17] feat: get icy distribution weekly --- migrations/seed/permissions.sql | 3 ++- migrations/seed/role_permissions.sql | 2 ++ pkg/model/permissions.go | 1 + pkg/routes/v1.go | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/migrations/seed/permissions.sql b/migrations/seed/permissions.sql index ad7146df8..aeb6a0fdf 100644 --- a/migrations/seed/permissions.sql +++ b/migrations/seed/permissions.sql @@ -86,4 +86,5 @@ INSERT INTO public.permissions (id, deleted_at, created_at, updated_at, name, co ('dfc32d81-abfa-49ce-a8f6-cdc83c8da78b', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Delete', 'surveys.delete'), ('f5906795-60d1-4e5f-88f2-e15f2fae2327', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Edit', 'surveys.edit'), ('ef32d604-42ec-40f8-9c34-08431d2c20d8', null, '2022-11-11 18:34:14.743263', '2022-11-11 18:34:14.743263', 'Survey Read', 'surveys.read'), -('78d617f8-b155-4051-b128-7f2d00ca31fd', null, '2023-01-10 05:19:00.330571', '2023-01-10 05:19:00.330571', 'Valuation Read', 'valuations.read'); +('78d617f8-b155-4051-b128-7f2d00ca31fd', null, '2023-01-10 05:19:00.330571', '2023-01-10 05:19:00.330571', 'Valuation Read', 'valuations.read'), +('a1ee5039-69e9-4977-be39-b9008c8a791b', null, '2023-01-10 05:19:00.330571', '2023-01-10 05:19:00.330571', 'Icy Distribution Read', 'icyDistribution.read'); diff --git a/migrations/seed/role_permissions.sql b/migrations/seed/role_permissions.sql index cef0c8591..36ccd55f2 100644 --- a/migrations/seed/role_permissions.sql +++ b/migrations/seed/role_permissions.sql @@ -15,6 +15,7 @@ INSERT INTO public.role_permissions (id, deleted_at, created_at, updated_at, rol ('6daf127e-00e3-41ab-a09b-0c89c453aeab', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '3fcf9e36-2501-4f86-8418-cfe3a137b7f9', 'c604d238-3c43-4825-93eb-db7b01480098'), ('2e0636b9-bc48-4480-b155-10ea405b95e6', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '3fcf9e36-2501-4f86-8418-cfe3a137b7f9', 'be186320-bef0-48cc-805e-f7b4810a3b30'), ('82019185-343e-4f76-bd18-85fd7ecada28', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '3fcf9e36-2501-4f86-8418-cfe3a137b7f9', 'f1bef8de-8a6b-4d7d-ae1a-e09ec631fd94'), +('40e8b32a-f0aa-4e69-bd6f-e75b3c17a2cd', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '3fcf9e36-2501-4f86-8418-cfe3a137b7f9', 'a1ee5039-69e9-4977-be39-b9008c8a791b'), ('cd345436-3ae6-4349-948c-dc5fefc30934', NULL, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', '3fcf9e36-2501-4f86-8418-cfe3a137b7f9', '9be15ffa-3695-4d7f-93aa-ef594a08c36a'); -- CONTRACTOR @@ -254,4 +255,5 @@ INSERT INTO public.role_permissions (id, deleted_at, created_at, updated_at, rol ('e72e2b1e-24c6-466c-9070-209e837ccd86', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'dfc32d81-abfa-49ce-a8f6-cdc83c8da78b'), ('be3e3319-28b2-45a7-a825-8da9d10a1eb9', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'f5906795-60d1-4e5f-88f2-e15f2fae2327'), ('e281924d-5466-49b8-8db9-0134c5a727c1', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'ef32d604-42ec-40f8-9c34-08431d2c20d8'), +('24f5b8d4-43b3-42bf-8632-bc8f71dc48b6', null, '2022-11-11 18:35:27.069944', '2022-11-11 18:35:27.069944', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', 'a1ee5039-69e9-4977-be39-b9008c8a791b'), ('6846c003-6219-42ef-9bd8-b88ea8ddea76', null, '2023-01-10 05:19:48.256921', '2023-01-10 05:19:48.256921', 'c23c1c1c-bfaf-41e6-a4d7-6ef196fd2736', '78d617f8-b155-4051-b128-7f2d00ca31fd'); diff --git a/pkg/model/permissions.go b/pkg/model/permissions.go index dca1af042..e4ee7546c 100644 --- a/pkg/model/permissions.go +++ b/pkg/model/permissions.go @@ -105,6 +105,7 @@ const ( PermissionSurveysEdit PermissionCode = "surveys.edit" PermissionSurveysRead PermissionCode = "surveys.read" PermissionValuationRead PermissionCode = "valuations.read" + PermissionIcyDistributionRead PermissionCode = "icyDistribution.read" ) func (p PermissionCode) String() string { diff --git a/pkg/routes/v1.go b/pkg/routes/v1.go index edd861561..877c1ed16 100644 --- a/pkg/routes/v1.go +++ b/pkg/routes/v1.go @@ -143,7 +143,7 @@ func loadV1Routes(r *gin.Engine, h *handler.Handler, repo store.DBRepo, s *store projectGroup.PUT("/:id/work-units/:workUnitID", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.UpdateWorkUnit) projectGroup.PUT("/:id/work-units/:workUnitID/archive", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.ArchiveWorkUnit) projectGroup.PUT("/:id/work-units/:workUnitID/unarchive", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.UnarchiveWorkUnit) - projectGroup.GET("/icy-distribution/weekly", h.Project.IcyWeeklyDistribution) + projectGroup.GET("/icy-distribution/weekly", amw.WithAuth, pmw.WithPerm(model.PermissionProjectWorkUnitsEdit), h.Project.IcyWeeklyDistribution) } clientGroup := v1.Group("/clients") From b1b1f35af7e20922074188478e1eeac9805fd959 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Fri, 2 Jun 2023 13:42:52 +0700 Subject: [PATCH 17/17] chore: fix update onboarding form --- pkg/handler/profile/errs/errors.go | 1 + pkg/handler/profile/profile.go | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/handler/profile/errs/errors.go b/pkg/handler/profile/errs/errors.go index c7c6f2e98..1ea69abe0 100644 --- a/pkg/handler/profile/errs/errors.go +++ b/pkg/handler/profile/errs/errors.go @@ -15,4 +15,5 @@ var ( ErrOnboardingFormAlreadyDone = errors.New("onboarding form already done") ErrMissingDocuments = errors.New("missing id/passport documents") ErrInvalidDate = errors.New("invalid date") + ErrInvalidDiscordMemberInfo = errors.New("invalid discord member info") ) diff --git a/pkg/handler/profile/profile.go b/pkg/handler/profile/profile.go index 4735f3e18..f02a7a174 100644 --- a/pkg/handler/profile/profile.go +++ b/pkg/handler/profile/profile.go @@ -783,33 +783,33 @@ func (h *handler) SubmitOnboardingForm(c *gin.Context) { // Commit transaction update employee info _ = done(nil) employeeInvitation.IsInfoUpdated = true + employeeInvitation.IsCompleted = true if !employeeInvitation.IsTeamEmailCreated { err = h.createTeamEmail(employee.TeamEmail, employee.PersonalEmail) if err != nil { l.Error(err, "failed to create create team email") + } else { + employeeInvitation.IsTeamEmailCreated = true } - employeeInvitation.IsTeamEmailCreated = true } if !employeeInvitation.IsBasecampAccountCreated { err = h.createBasecampAccount(employee) if err != nil { l.Error(err, "failed to create basecamp account") + } else { + employeeInvitation.IsBasecampAccountCreated = true } - employeeInvitation.IsBasecampAccountCreated = true } if !employeeInvitation.IsDiscordRoleAssigned { err = h.assignDiscordRole(discordMember) if err != nil { l.Error(err, "failed to assign discord role") + } else { + employeeInvitation.IsDiscordRoleAssigned = true } - employeeInvitation.IsDiscordRoleAssigned = true - } - - if employeeInvitation.IsInfoUpdated && employeeInvitation.IsTeamEmailCreated && employeeInvitation.IsBasecampAccountCreated && employeeInvitation.IsDiscordRoleAssigned { - employeeInvitation.IsCompleted = true } err = h.store.EmployeeInvitation.Save(h.repo.DB(), employeeInvitation) @@ -910,8 +910,8 @@ func (h *handler) getDiscordInfo(discordName string) (*discordgo.Member, error) } func (h *handler) assignDiscordRole(discordMember *discordgo.Member) error { - if discordMember != nil { - return nil + if discordMember == nil { + return errs.ErrInvalidDiscordMemberInfo } // Get list discord role dRoles, err := h.service.Discord.GetRoles()