feat: new models, sorting fix

This commit is contained in:
2025-03-15 21:12:15 +07:00
parent db7076182e
commit 2b8df155d3
103 changed files with 16214 additions and 4048 deletions

View File

@@ -5,163 +5,183 @@
// @ts-ignore: Unused imports
import {Create as $Create} from "@wailsio/runtime";
export class Author {
export class Customer {
"Id": number;
"Name": string;
"Posts": Post[];
"Comments": Comment[];
"Title": string;
"Contact": string;
"Orders": Order[];
/** Creates a new Author instance. */
constructor($$source: Partial<Author> = {}) {
/** Creates a new Customer instance. */
constructor($$source: Partial<Customer> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Name" in $$source)) {
this["Name"] = "";
if (!("Title" in $$source)) {
this["Title"] = "";
}
if (!("Posts" in $$source)) {
this["Posts"] = [];
if (!("Contact" in $$source)) {
this["Contact"] = "";
}
if (!("Comments" in $$source)) {
this["Comments"] = [];
if (!("Orders" in $$source)) {
this["Orders"] = [];
}
Object.assign(this, $$source);
}
/**
* Creates a new Author instance from a string or object.
* Creates a new Customer instance from a string or object.
*/
static createFrom($$source: any = {}): Author {
const $$createField2_0 = $$createType1;
const $$createField3_0 = $$createType3;
static createFrom($$source: any = {}): Customer {
const $$createField3_0 = $$createType1;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("Posts" in $$parsedSource) {
$$parsedSource["Posts"] = $$createField2_0($$parsedSource["Posts"]);
if ("Orders" in $$parsedSource) {
$$parsedSource["Orders"] = $$createField3_0($$parsedSource["Orders"]);
}
if ("Comments" in $$parsedSource) {
$$parsedSource["Comments"] = $$createField3_0($$parsedSource["Comments"]);
}
return new Author($$parsedSource as Partial<Author>);
return new Customer($$parsedSource as Partial<Customer>);
}
}
export class Comment {
export class Order {
"Id": number;
"Text": string;
"AuthorId": number;
"Author": Author;
"Posts": Post[];
/** Creates a new Comment instance. */
constructor($$source: Partial<Comment> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Text" in $$source)) {
this["Text"] = "";
}
if (!("AuthorId" in $$source)) {
this["AuthorId"] = 0;
}
if (!("Author" in $$source)) {
this["Author"] = (new Author());
}
if (!("Posts" in $$source)) {
this["Posts"] = [];
}
Object.assign(this, $$source);
}
/**
* Creates a new Comment instance from a string or object.
*/
static createFrom($$source: any = {}): Comment {
const $$createField3_0 = $$createType4;
const $$createField4_0 = $$createType1;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("Author" in $$parsedSource) {
$$parsedSource["Author"] = $$createField3_0($$parsedSource["Author"]);
}
if ("Posts" in $$parsedSource) {
$$parsedSource["Posts"] = $$createField4_0($$parsedSource["Posts"]);
}
return new Comment($$parsedSource as Partial<Comment>);
}
}
export class Post {
"Id": number;
"Text": string;
"Deadline": number;
"Status": string;
"Description": string;
"ProductTypeId": number;
"ProductType": ProductType;
"ProductAmount": number;
"CustomerId": number;
"Customer": Customer;
"Tasks": Task[];
"CreatedAt": number;
"AuthorId": number;
"Author": Author;
"PostTypeId": number;
"PostType": PostType;
"Comments": Comment[];
"DeadlineDate": number;
/** Creates a new Post instance. */
constructor($$source: Partial<Post> = {}) {
/** Creates a new Order instance. */
constructor($$source: Partial<Order> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Text" in $$source)) {
this["Text"] = "";
if (!("Status" in $$source)) {
this["Status"] = "";
}
if (!("Deadline" in $$source)) {
this["Deadline"] = 0;
if (!("Description" in $$source)) {
this["Description"] = "";
}
if (!("ProductTypeId" in $$source)) {
this["ProductTypeId"] = 0;
}
if (!("ProductType" in $$source)) {
this["ProductType"] = (new ProductType());
}
if (!("ProductAmount" in $$source)) {
this["ProductAmount"] = 0;
}
if (!("CustomerId" in $$source)) {
this["CustomerId"] = 0;
}
if (!("Customer" in $$source)) {
this["Customer"] = (new Customer());
}
if (!("Tasks" in $$source)) {
this["Tasks"] = [];
}
if (!("CreatedAt" in $$source)) {
this["CreatedAt"] = 0;
}
if (!("AuthorId" in $$source)) {
this["AuthorId"] = 0;
}
if (!("Author" in $$source)) {
this["Author"] = (new Author());
}
if (!("PostTypeId" in $$source)) {
this["PostTypeId"] = 0;
}
if (!("PostType" in $$source)) {
this["PostType"] = (new PostType());
}
if (!("Comments" in $$source)) {
this["Comments"] = [];
if (!("DeadlineDate" in $$source)) {
this["DeadlineDate"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new Post instance from a string or object.
* Creates a new Order instance from a string or object.
*/
static createFrom($$source: any = {}): Post {
const $$createField5_0 = $$createType4;
const $$createField7_0 = $$createType5;
const $$createField8_0 = $$createType3;
static createFrom($$source: any = {}): Order {
const $$createField4_0 = $$createType2;
const $$createField7_0 = $$createType3;
const $$createField8_0 = $$createType5;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("Author" in $$parsedSource) {
$$parsedSource["Author"] = $$createField5_0($$parsedSource["Author"]);
if ("ProductType" in $$parsedSource) {
$$parsedSource["ProductType"] = $$createField4_0($$parsedSource["ProductType"]);
}
if ("PostType" in $$parsedSource) {
$$parsedSource["PostType"] = $$createField7_0($$parsedSource["PostType"]);
if ("Customer" in $$parsedSource) {
$$parsedSource["Customer"] = $$createField7_0($$parsedSource["Customer"]);
}
if ("Comments" in $$parsedSource) {
$$parsedSource["Comments"] = $$createField8_0($$parsedSource["Comments"]);
if ("Tasks" in $$parsedSource) {
$$parsedSource["Tasks"] = $$createField8_0($$parsedSource["Tasks"]);
}
return new Post($$parsedSource as Partial<Post>);
return new Order($$parsedSource as Partial<Order>);
}
}
export class PostType {
export class PrepTask {
"Id": number;
"Status": string;
"Description": string;
"TaskId": number;
"Task": Task;
"WorkAreaId": number;
"WorkArea": WorkArea;
"CreatedAt": number;
"Deadline": number;
/** Creates a new PrepTask instance. */
constructor($$source: Partial<PrepTask> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Status" in $$source)) {
this["Status"] = "";
}
if (!("Description" in $$source)) {
this["Description"] = "";
}
if (!("TaskId" in $$source)) {
this["TaskId"] = 0;
}
if (!("Task" in $$source)) {
this["Task"] = (new Task());
}
if (!("WorkAreaId" in $$source)) {
this["WorkAreaId"] = 0;
}
if (!("WorkArea" in $$source)) {
this["WorkArea"] = (new WorkArea());
}
if (!("CreatedAt" in $$source)) {
this["CreatedAt"] = 0;
}
if (!("Deadline" in $$source)) {
this["Deadline"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new PrepTask instance from a string or object.
*/
static createFrom($$source: any = {}): PrepTask {
const $$createField4_0 = $$createType4;
const $$createField6_0 = $$createType6;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("Task" in $$parsedSource) {
$$parsedSource["Task"] = $$createField4_0($$parsedSource["Task"]);
}
if ("WorkArea" in $$parsedSource) {
$$parsedSource["WorkArea"] = $$createField6_0($$parsedSource["WorkArea"]);
}
return new PrepTask($$parsedSource as Partial<PrepTask>);
}
}
export class ProductType {
"Id": number;
"Name": string;
/** Creates a new PostType instance. */
constructor($$source: Partial<PostType> = {}) {
/** Creates a new ProductType instance. */
constructor($$source: Partial<ProductType> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
@@ -173,18 +193,437 @@ export class PostType {
}
/**
* Creates a new PostType instance from a string or object.
* Creates a new ProductType instance from a string or object.
*/
static createFrom($$source: any = {}): PostType {
static createFrom($$source: any = {}): ProductType {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new PostType($$parsedSource as Partial<PostType>);
return new ProductType($$parsedSource as Partial<ProductType>);
}
}
export class Shift {
"Id": number;
"Description": string;
"ProductTypeId": number;
"ProductType": ProductType;
"ProductAmount": number;
"ShiftDate": number;
"WorkAreaId": number;
"WorkArea": WorkArea;
"CreatedAt": number;
/** Creates a new Shift instance. */
constructor($$source: Partial<Shift> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Description" in $$source)) {
this["Description"] = "";
}
if (!("ProductTypeId" in $$source)) {
this["ProductTypeId"] = 0;
}
if (!("ProductType" in $$source)) {
this["ProductType"] = (new ProductType());
}
if (!("ProductAmount" in $$source)) {
this["ProductAmount"] = 0;
}
if (!("ShiftDate" in $$source)) {
this["ShiftDate"] = 0;
}
if (!("WorkAreaId" in $$source)) {
this["WorkAreaId"] = 0;
}
if (!("WorkArea" in $$source)) {
this["WorkArea"] = (new WorkArea());
}
if (!("CreatedAt" in $$source)) {
this["CreatedAt"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new Shift instance from a string or object.
*/
static createFrom($$source: any = {}): Shift {
const $$createField3_0 = $$createType2;
const $$createField7_0 = $$createType6;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("ProductType" in $$parsedSource) {
$$parsedSource["ProductType"] = $$createField3_0($$parsedSource["ProductType"]);
}
if ("WorkArea" in $$parsedSource) {
$$parsedSource["WorkArea"] = $$createField7_0($$parsedSource["WorkArea"]);
}
return new Shift($$parsedSource as Partial<Shift>);
}
}
export class Task {
"Id": number;
"Description": string;
"ProductTypeId": number;
"ProductType": ProductType;
"Workshops": (Workshop | null)[];
"OrderId": number;
"Order": Order;
"PrepTasks": PrepTask[];
"ProductionStart": number;
"CreatedAt": number;
"Amount": number;
/** Creates a new Task instance. */
constructor($$source: Partial<Task> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Description" in $$source)) {
this["Description"] = "";
}
if (!("ProductTypeId" in $$source)) {
this["ProductTypeId"] = 0;
}
if (!("ProductType" in $$source)) {
this["ProductType"] = (new ProductType());
}
if (!("Workshops" in $$source)) {
this["Workshops"] = [];
}
if (!("OrderId" in $$source)) {
this["OrderId"] = 0;
}
if (!("Order" in $$source)) {
this["Order"] = (new Order());
}
if (!("PrepTasks" in $$source)) {
this["PrepTasks"] = [];
}
if (!("ProductionStart" in $$source)) {
this["ProductionStart"] = 0;
}
if (!("CreatedAt" in $$source)) {
this["CreatedAt"] = 0;
}
if (!("Amount" in $$source)) {
this["Amount"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new Task instance from a string or object.
*/
static createFrom($$source: any = {}): Task {
const $$createField3_0 = $$createType2;
const $$createField4_0 = $$createType9;
const $$createField6_0 = $$createType0;
const $$createField7_0 = $$createType11;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("ProductType" in $$parsedSource) {
$$parsedSource["ProductType"] = $$createField3_0($$parsedSource["ProductType"]);
}
if ("Workshops" in $$parsedSource) {
$$parsedSource["Workshops"] = $$createField4_0($$parsedSource["Workshops"]);
}
if ("Order" in $$parsedSource) {
$$parsedSource["Order"] = $$createField6_0($$parsedSource["Order"]);
}
if ("PrepTasks" in $$parsedSource) {
$$parsedSource["PrepTasks"] = $$createField7_0($$parsedSource["PrepTasks"]);
}
return new Task($$parsedSource as Partial<Task>);
}
}
export class TeamTask {
"Id": number;
"TeamTypeId": number;
"TeamType": TeamType;
"TeamLeaderId": number;
"TeamLeader": Worker;
"TeamMembers": (Worker | null)[];
"WorkStartDate": number;
"WorkAreaId": number;
"WorkArea": WorkArea;
"ShiftDuties": string;
/** Creates a new TeamTask instance. */
constructor($$source: Partial<TeamTask> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("TeamTypeId" in $$source)) {
this["TeamTypeId"] = 0;
}
if (!("TeamType" in $$source)) {
this["TeamType"] = (new TeamType());
}
if (!("TeamLeaderId" in $$source)) {
this["TeamLeaderId"] = 0;
}
if (!("TeamLeader" in $$source)) {
this["TeamLeader"] = (new Worker());
}
if (!("TeamMembers" in $$source)) {
this["TeamMembers"] = [];
}
if (!("WorkStartDate" in $$source)) {
this["WorkStartDate"] = 0;
}
if (!("WorkAreaId" in $$source)) {
this["WorkAreaId"] = 0;
}
if (!("WorkArea" in $$source)) {
this["WorkArea"] = (new WorkArea());
}
if (!("ShiftDuties" in $$source)) {
this["ShiftDuties"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new TeamTask instance from a string or object.
*/
static createFrom($$source: any = {}): TeamTask {
const $$createField2_0 = $$createType12;
const $$createField4_0 = $$createType13;
const $$createField5_0 = $$createType15;
const $$createField8_0 = $$createType6;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("TeamType" in $$parsedSource) {
$$parsedSource["TeamType"] = $$createField2_0($$parsedSource["TeamType"]);
}
if ("TeamLeader" in $$parsedSource) {
$$parsedSource["TeamLeader"] = $$createField4_0($$parsedSource["TeamLeader"]);
}
if ("TeamMembers" in $$parsedSource) {
$$parsedSource["TeamMembers"] = $$createField5_0($$parsedSource["TeamMembers"]);
}
if ("WorkArea" in $$parsedSource) {
$$parsedSource["WorkArea"] = $$createField8_0($$parsedSource["WorkArea"]);
}
return new TeamTask($$parsedSource as Partial<TeamTask>);
}
}
export class TeamType {
"Id": number;
"Name": string;
/** Creates a new TeamType instance. */
constructor($$source: Partial<TeamType> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Name" in $$source)) {
this["Name"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new TeamType instance from a string or object.
*/
static createFrom($$source: any = {}): TeamType {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new TeamType($$parsedSource as Partial<TeamType>);
}
}
export class WorkArea {
"Id": number;
"Name": string;
"Description": string;
"Performance": number;
"WorkshopId": number;
"Workshop": Workshop;
"PrepTasks": PrepTask[];
"Shifts": Shift[];
"TeamTasks": TeamTask[];
/** Creates a new WorkArea instance. */
constructor($$source: Partial<WorkArea> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Name" in $$source)) {
this["Name"] = "";
}
if (!("Description" in $$source)) {
this["Description"] = "";
}
if (!("Performance" in $$source)) {
this["Performance"] = 0;
}
if (!("WorkshopId" in $$source)) {
this["WorkshopId"] = 0;
}
if (!("Workshop" in $$source)) {
this["Workshop"] = (new Workshop());
}
if (!("PrepTasks" in $$source)) {
this["PrepTasks"] = [];
}
if (!("Shifts" in $$source)) {
this["Shifts"] = [];
}
if (!("TeamTasks" in $$source)) {
this["TeamTasks"] = [];
}
Object.assign(this, $$source);
}
/**
* Creates a new WorkArea instance from a string or object.
*/
static createFrom($$source: any = {}): WorkArea {
const $$createField5_0 = $$createType7;
const $$createField6_0 = $$createType11;
const $$createField7_0 = $$createType17;
const $$createField8_0 = $$createType19;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("Workshop" in $$parsedSource) {
$$parsedSource["Workshop"] = $$createField5_0($$parsedSource["Workshop"]);
}
if ("PrepTasks" in $$parsedSource) {
$$parsedSource["PrepTasks"] = $$createField6_0($$parsedSource["PrepTasks"]);
}
if ("Shifts" in $$parsedSource) {
$$parsedSource["Shifts"] = $$createField7_0($$parsedSource["Shifts"]);
}
if ("TeamTasks" in $$parsedSource) {
$$parsedSource["TeamTasks"] = $$createField8_0($$parsedSource["TeamTasks"]);
}
return new WorkArea($$parsedSource as Partial<WorkArea>);
}
}
export class Worker {
"Id": number;
"Name": string;
"TeamTasks": (TeamTask | null)[];
"Workshop": Workshop;
"WorkshopId": number;
/** Creates a new Worker instance. */
constructor($$source: Partial<Worker> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Name" in $$source)) {
this["Name"] = "";
}
if (!("TeamTasks" in $$source)) {
this["TeamTasks"] = [];
}
if (!("Workshop" in $$source)) {
this["Workshop"] = (new Workshop());
}
if (!("WorkshopId" in $$source)) {
this["WorkshopId"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new Worker instance from a string or object.
*/
static createFrom($$source: any = {}): Worker {
const $$createField2_0 = $$createType21;
const $$createField3_0 = $$createType7;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("TeamTasks" in $$parsedSource) {
$$parsedSource["TeamTasks"] = $$createField2_0($$parsedSource["TeamTasks"]);
}
if ("Workshop" in $$parsedSource) {
$$parsedSource["Workshop"] = $$createField3_0($$parsedSource["Workshop"]);
}
return new Worker($$parsedSource as Partial<Worker>);
}
}
export class Workshop {
"Id": number;
"Name": string;
"WorkAreas": WorkArea[];
"Tasks": (Task | null)[];
"Workers": Worker[];
/** Creates a new Workshop instance. */
constructor($$source: Partial<Workshop> = {}) {
if (!("Id" in $$source)) {
this["Id"] = 0;
}
if (!("Name" in $$source)) {
this["Name"] = "";
}
if (!("WorkAreas" in $$source)) {
this["WorkAreas"] = [];
}
if (!("Tasks" in $$source)) {
this["Tasks"] = [];
}
if (!("Workers" in $$source)) {
this["Workers"] = [];
}
Object.assign(this, $$source);
}
/**
* Creates a new Workshop instance from a string or object.
*/
static createFrom($$source: any = {}): Workshop {
const $$createField2_0 = $$createType22;
const $$createField3_0 = $$createType24;
const $$createField4_0 = $$createType25;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("WorkAreas" in $$parsedSource) {
$$parsedSource["WorkAreas"] = $$createField2_0($$parsedSource["WorkAreas"]);
}
if ("Tasks" in $$parsedSource) {
$$parsedSource["Tasks"] = $$createField3_0($$parsedSource["Tasks"]);
}
if ("Workers" in $$parsedSource) {
$$parsedSource["Workers"] = $$createField4_0($$parsedSource["Workers"]);
}
return new Workshop($$parsedSource as Partial<Workshop>);
}
}
// Private type creation functions
const $$createType0 = Post.createFrom;
const $$createType0 = Order.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = Comment.createFrom;
const $$createType3 = $Create.Array($$createType2);
const $$createType4 = Author.createFrom;
const $$createType5 = PostType.createFrom;
const $$createType2 = ProductType.createFrom;
const $$createType3 = Customer.createFrom;
const $$createType4 = Task.createFrom;
const $$createType5 = $Create.Array($$createType4);
const $$createType6 = WorkArea.createFrom;
const $$createType7 = Workshop.createFrom;
const $$createType8 = $Create.Nullable($$createType7);
const $$createType9 = $Create.Array($$createType8);
const $$createType10 = PrepTask.createFrom;
const $$createType11 = $Create.Array($$createType10);
const $$createType12 = TeamType.createFrom;
const $$createType13 = Worker.createFrom;
const $$createType14 = $Create.Nullable($$createType13);
const $$createType15 = $Create.Array($$createType14);
const $$createType16 = Shift.createFrom;
const $$createType17 = $Create.Array($$createType16);
const $$createType18 = TeamTask.createFrom;
const $$createType19 = $Create.Array($$createType18);
const $$createType20 = $Create.Nullable($$createType18);
const $$createType21 = $Create.Array($$createType20);
const $$createType22 = $Create.Array($$createType6);
const $$createType23 = $Create.Nullable($$createType4);
const $$createType24 = $Create.Array($$createType23);
const $$createType25 = $Create.Array($$createType13);

View File

@@ -0,0 +1,86 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as utils$0 from "../utils/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(2456694737) as any;
return $resultPromise;
}
export function Create(item: $models.Customer): Promise<$models.Customer> & { cancel(): void } {
let $resultPromise = $Call.ByID(2428713966, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(351568709, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Customer | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2094111829) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Customer | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(1898783026, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.Customer | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1677934916, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Customer | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3880190910, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.Customer): Promise<$models.Customer> & { cancel(): void } {
let $resultPromise = $Call.ByID(2724586067, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Customer.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -1,17 +1,31 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import * as AuthorService from "./authorservice.js";
import * as CommentService from "./commentservice.js";
import * as CustomerService from "./customerservice.js";
import * as ExcelModule from "./excelmodule.js";
import * as PostService from "./postservice.js";
import * as PostTypeService from "./posttypeservice.js";
import * as OrderService from "./orderservice.js";
import * as PrepTaskService from "./preptaskservice.js";
import * as ProductTypeService from "./producttypeservice.js";
import * as ShiftService from "./shiftservice.js";
import * as TaskService from "./taskservice.js";
import * as TeamTaskService from "./teamtaskservice.js";
import * as TeamTypeService from "./teamtypeservice.js";
import * as WorkAreaService from "./workareaservice.js";
import * as WorkerService from "./workerservice.js";
import * as WorkshopService from "./workshopservice.js";
export {
AuthorService,
CommentService,
CustomerService,
ExcelModule,
PostService,
PostTypeService
OrderService,
PrepTaskService,
ProductTypeService,
ShiftService,
TaskService,
TeamTaskService,
TeamTypeService,
WorkAreaService,
WorkerService,
WorkshopService
};
export * from "./models.js";

View File

@@ -9,14 +9,35 @@ import {Create as $Create} from "@wailsio/runtime";
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
export const Author = models$0.Author;
export type Author = models$0.Author;
export const Customer = models$0.Customer;
export type Customer = models$0.Customer;
export const Comment = models$0.Comment;
export type Comment = models$0.Comment;
export const Order = models$0.Order;
export type Order = models$0.Order;
export const Post = models$0.Post;
export type Post = models$0.Post;
export const PrepTask = models$0.PrepTask;
export type PrepTask = models$0.PrepTask;
export const PostType = models$0.PostType;
export type PostType = models$0.PostType;
export const ProductType = models$0.ProductType;
export type ProductType = models$0.ProductType;
export const Shift = models$0.Shift;
export type Shift = models$0.Shift;
export const Task = models$0.Task;
export type Task = models$0.Task;
export const TeamTask = models$0.TeamTask;
export type TeamTask = models$0.TeamTask;
export const TeamType = models$0.TeamType;
export type TeamType = models$0.TeamType;
export const WorkArea = models$0.WorkArea;
export type WorkArea = models$0.WorkArea;
export const Worker = models$0.Worker;
export type Worker = models$0.Worker;
export const Workshop = models$0.Workshop;
export type Workshop = models$0.Workshop;

View File

@@ -17,12 +17,12 @@ import * as utils$0 from "../utils/models.js";
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3225397984) as any;
let $resultPromise = $Call.ByID(2566189339) as any;
return $resultPromise;
}
export function Create(item: $models.Comment): Promise<$models.Comment> & { cancel(): void } {
let $resultPromise = $Call.ByID(4239106089, item) as any;
export function Create(item: $models.Order): Promise<$models.Order> & { cancel(): void } {
let $resultPromise = $Call.ByID(4046033040, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -31,12 +31,12 @@ export function Create(item: $models.Comment): Promise<$models.Comment> & { canc
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2553503582, id) as any;
let $resultPromise = $Call.ByID(1974545647, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Comment | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1805763390) as any;
export function GetAll(): Promise<($models.Order | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1679856851) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -44,8 +44,8 @@ export function GetAll(): Promise<($models.Comment | null)[]> & { cancel(): void
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Comment | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3217823099, id) as any;
export function GetById(id: number): Promise<$models.Order | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(1201282680, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
@@ -53,8 +53,8 @@ export function GetById(id: number): Promise<$models.Comment | null> & { cancel(
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.Comment | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(480333285, phrase) as any;
export function SearchByAllTextFields(phrase: string): Promise<($models.Order | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(963444842, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -62,8 +62,8 @@ export function SearchByAllTextFields(phrase: string): Promise<($models.Comment
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Comment | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(4244533291, fieldsSortingOrder) as any;
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Order | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3596187064, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -71,8 +71,8 @@ export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<
return $typingPromise;
}
export function Update(item: $models.Comment): Promise<$models.Comment> & { cancel(): void } {
let $resultPromise = $Call.ByID(3080970936, item) as any;
export function Update(item: $models.Order): Promise<$models.Order> & { cancel(): void } {
let $resultPromise = $Call.ByID(358288261, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -81,6 +81,6 @@ export function Update(item: $models.Comment): Promise<$models.Comment> & { canc
}
// Private type creation functions
const $$createType0 = models$0.Comment.createFrom;
const $$createType0 = models$0.Order.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -17,12 +17,12 @@ import * as utils$0 from "../utils/models.js";
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(554487955) as any;
let $resultPromise = $Call.ByID(3107879827) as any;
return $resultPromise;
}
export function Create(item: $models.PostType): Promise<$models.PostType> & { cancel(): void } {
let $resultPromise = $Call.ByID(1092898136, item) as any;
export function Create(item: $models.PrepTask): Promise<$models.PrepTask> & { cancel(): void } {
let $resultPromise = $Call.ByID(3612638808, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -31,12 +31,12 @@ export function Create(item: $models.PostType): Promise<$models.PostType> & { ca
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2114913543, id) as any;
let $resultPromise = $Call.ByID(339686919, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.PostType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(416231387) as any;
export function GetAll(): Promise<($models.PrepTask | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2935972059) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -44,8 +44,8 @@ export function GetAll(): Promise<($models.PostType | null)[]> & { cancel(): voi
return $typingPromise;
}
export function GetById(id: number): Promise<$models.PostType | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3237123344, id) as any;
export function GetById(id: number): Promise<$models.PrepTask | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(785365008, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
@@ -53,8 +53,8 @@ export function GetById(id: number): Promise<$models.PostType | null> & { cancel
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.PostType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(4207540242, phrase) as any;
export function SearchByAllTextFields(phrase: string): Promise<($models.PrepTask | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2705089298, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -62,8 +62,8 @@ export function SearchByAllTextFields(phrase: string): Promise<($models.PostType
return $typingPromise;
}
export function SortedByOrder(fieldsSortOrder: utils$0.SortField[]): Promise<($models.PostType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1097313920, fieldsSortOrder) as any;
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.PrepTask | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(423868800, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -71,8 +71,8 @@ export function SortedByOrder(fieldsSortOrder: utils$0.SortField[]): Promise<($m
return $typingPromise;
}
export function Update(item: $models.PostType): Promise<$models.PostType> & { cancel(): void } {
let $resultPromise = $Call.ByID(2773888269, item) as any;
export function Update(item: $models.PrepTask): Promise<$models.PrepTask> & { cancel(): void } {
let $resultPromise = $Call.ByID(998661645, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -81,6 +81,6 @@ export function Update(item: $models.PostType): Promise<$models.PostType> & { ca
}
// Private type creation functions
const $$createType0 = models$0.PostType.createFrom;
const $$createType0 = models$0.PrepTask.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,86 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as utils$0 from "../utils/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3869103122) as any;
return $resultPromise;
}
export function Create(item: $models.ProductType): Promise<$models.ProductType> & { cancel(): void } {
let $resultPromise = $Call.ByID(2892206627, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2075432208, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.ProductType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(4237247244) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.ProductType | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3965758897, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.ProductType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2567053163, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.ProductType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2110028149, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.ProductType): Promise<$models.ProductType> & { cancel(): void } {
let $resultPromise = $Call.ByID(2015721618, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.ProductType.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,86 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as utils$0 from "../utils/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3190120795) as any;
return $resultPromise;
}
export function Create(item: $models.Shift): Promise<$models.Shift> & { cancel(): void } {
let $resultPromise = $Call.ByID(1438106576, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2919255855, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Shift | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1919901971) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Shift | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(2418071992, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.Shift | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2703093162, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Shift | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1476306424, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.Shift): Promise<$models.Shift> & { cancel(): void } {
let $resultPromise = $Call.ByID(132402373, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Shift.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -17,12 +17,12 @@ import * as utils$0 from "../utils/models.js";
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3109924027) as any;
let $resultPromise = $Call.ByID(2626684778) as any;
return $resultPromise;
}
export function Create(item: $models.Post): Promise<$models.Post> & { cancel(): void } {
let $resultPromise = $Call.ByID(1443399856, item) as any;
export function Create(item: $models.Task): Promise<$models.Task> & { cancel(): void } {
let $resultPromise = $Call.ByID(893779179, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -31,12 +31,12 @@ export function Create(item: $models.Post): Promise<$models.Post> & { cancel():
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2924549135, id) as any;
let $resultPromise = $Call.ByID(3033756968, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Post | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(65691059) as any;
export function GetAll(): Promise<($models.Task | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1660059028) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -44,8 +44,8 @@ export function GetAll(): Promise<($models.Post | null)[]> & { cancel(): void }
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Post | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(4074736792, id) as any;
export function GetById(id: number): Promise<$models.Task | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3152185033, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
@@ -53,8 +53,8 @@ export function GetById(id: number): Promise<$models.Post | null> & { cancel():
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.Post | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(591521802, phrase) as any;
export function SearchByAllTextFields(phrase: string): Promise<($models.Task | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3905257587, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -62,8 +62,8 @@ export function SearchByAllTextFields(phrase: string): Promise<($models.Post | n
return $typingPromise;
}
export function SortedByOrder(fieldsSortOrder: utils$0.SortField[]): Promise<($models.Post | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(471862744, fieldsSortOrder) as any;
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Task | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2942045693, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -71,8 +71,8 @@ export function SortedByOrder(fieldsSortOrder: utils$0.SortField[]): Promise<($m
return $typingPromise;
}
export function Update(item: $models.Post): Promise<$models.Post> & { cancel(): void } {
let $resultPromise = $Call.ByID(137798821, item) as any;
export function Update(item: $models.Task): Promise<$models.Task> & { cancel(): void } {
let $resultPromise = $Call.ByID(3997472442, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -81,6 +81,6 @@ export function Update(item: $models.Post): Promise<$models.Post> & { cancel():
}
// Private type creation functions
const $$createType0 = models$0.Post.createFrom;
const $$createType0 = models$0.Task.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,86 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as utils$0 from "../utils/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3706236529) as any;
return $resultPromise;
}
export function Create(item: $models.TeamTask): Promise<$models.TeamTask> & { cancel(): void } {
let $resultPromise = $Call.ByID(757028622, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3016324197, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.TeamTask | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2153018165) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.TeamTask | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(457048658, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.TeamTask | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(352409060, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.TeamTask | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1507635678, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.TeamTask): Promise<$models.TeamTask> & { cancel(): void } {
let $resultPromise = $Call.ByID(1052797555, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.TeamTask.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,86 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as utils$0 from "../utils/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(1823045730) as any;
return $resultPromise;
}
export function Create(item: $models.TeamType): Promise<$models.TeamType> & { cancel(): void } {
let $resultPromise = $Call.ByID(3331874131, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(1006566688, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.TeamType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(63845852) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.TeamType | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(1530543873, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.TeamType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(201965595, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.TeamType | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2936929733, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.TeamType): Promise<$models.TeamType> & { cancel(): void } {
let $resultPromise = $Call.ByID(918118946, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.TeamType.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,86 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as utils$0 from "../utils/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(2628202257) as any;
return $resultPromise;
}
export function Create(item: $models.WorkArea): Promise<$models.WorkArea> & { cancel(): void } {
let $resultPromise = $Call.ByID(969170222, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(421967749, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.WorkArea | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2440807317) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.WorkArea | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(2721437042, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.WorkArea | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3482576004, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.WorkArea | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(571753726, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.WorkArea): Promise<$models.WorkArea> & { cancel(): void } {
let $resultPromise = $Call.ByID(2753408403, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.WorkArea.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -17,12 +17,12 @@ import * as utils$0 from "../utils/models.js";
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(3969879864) as any;
let $resultPromise = $Call.ByID(3131879451) as any;
return $resultPromise;
}
export function Create(item: $models.Author): Promise<$models.Author> & { cancel(): void } {
let $resultPromise = $Call.ByID(3684602449, item) as any;
export function Create(item: $models.Worker): Promise<$models.Worker> & { cancel(): void } {
let $resultPromise = $Call.ByID(90914192, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -31,12 +31,12 @@ export function Create(item: $models.Author): Promise<$models.Author> & { cancel
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2096845974, id) as any;
let $resultPromise = $Call.ByID(2314394095, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Author | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3248293926) as any;
export function GetAll(): Promise<($models.Worker | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(2019705299) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -44,8 +44,8 @@ export function GetAll(): Promise<($models.Author | null)[]> & { cancel(): void
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Author | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(1703016211, id) as any;
export function GetById(id: number): Promise<$models.Worker | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(721253752, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
@@ -53,8 +53,8 @@ export function GetById(id: number): Promise<$models.Author | null> & { cancel()
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.Author | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3812644109, phrase) as any;
export function SearchByAllTextFields(phrase: string): Promise<($models.Worker | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(4245847914, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -62,8 +62,8 @@ export function SearchByAllTextFields(phrase: string): Promise<($models.Author |
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Author | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3046628691, fieldsSortingOrder) as any;
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Worker | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3186234552, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -71,8 +71,8 @@ export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<
return $typingPromise;
}
export function Update(item: $models.Author): Promise<$models.Author> & { cancel(): void } {
let $resultPromise = $Call.ByID(2240704960, item) as any;
export function Update(item: $models.Worker): Promise<$models.Worker> & { cancel(): void } {
let $resultPromise = $Call.ByID(698136709, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
@@ -81,6 +81,6 @@ export function Update(item: $models.Author): Promise<$models.Author> & { cancel
}
// Private type creation functions
const $$createType0 = models$0.Author.createFrom;
const $$createType0 = models$0.Worker.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -0,0 +1,86 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../models/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as utils$0 from "../utils/models.js";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";
export function Count(): Promise<number> & { cancel(): void } {
let $resultPromise = $Call.ByID(2983034394) as any;
return $resultPromise;
}
export function Create(item: $models.Workshop): Promise<$models.Workshop> & { cancel(): void } {
let $resultPromise = $Call.ByID(982947003, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Delete(id: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3145051352, id) as any;
return $resultPromise;
}
export function GetAll(): Promise<($models.Workshop | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(806282052) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function GetById(id: number): Promise<$models.Workshop | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(1829452217, id) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SearchByAllTextFields(phrase: string): Promise<($models.Workshop | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(283835139, phrase) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function SortedByOrder(fieldsSortingOrder: utils$0.SortField[]): Promise<($models.Workshop | null)[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(3581052397, fieldsSortingOrder) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
export function Update(item: $models.Workshop): Promise<$models.Workshop> & { cancel(): void } {
let $resultPromise = $Call.ByID(1795717546, item) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
// Private type creation functions
const $$createType0 = models$0.Workshop.createFrom;
const $$createType1 = $Create.Nullable($$createType0);
const $$createType2 = $Create.Array($$createType1);

View File

@@ -1,89 +0,0 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./author.service.ts";
import type { Scheme } from "../types/scheme.type";
import { Author } from "../../bindings/app/internal/services";
import { SortedByOrder } from "../../bindings/app/internal/services/authorservice.ts";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import PostService from "../post/post.service.ts";
const postService = new PostService();
import CommentService from "../comment/comment.service.ts";
const commentService = new CommentService();
const service = new Service();
const items = ref<Author[]>([]);
const load = async () => {
(scheme as any).Posts.type!.nested!.values = await postService.readAll();
(scheme as any).Comments.type!.nested!.values =
await commentService.readAll();
items.value = await service.readAll();
return items.value;
};
onMounted(async () => {
await load();
});
const scheme: Scheme<Author> = reactive({
entityId: "AuthorId",
Id: {
hidden: true,
type: {
primitive: "number",
},
},
Name: {
russian: "Имя",
type: {
primitive: "string",
},
},
Posts: {
russian: "Посты",
many: true,
type: {
nested: {
values: [],
field: ["Text"],
},
},
},
Comments: {
russian: "Комментарии",
many: true,
type: {
nested: {
values: [],
field: ["Text"],
},
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Author> = (entity) => {
return {
status: "success",
};
};
</script>
<template>
<main class="w-screen h-screen">
<Table name="Author" :scheme :service :get-defaults :load :items :validate></Table>
</main>
</template>

View File

@@ -1,36 +0,0 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
} from "../../bindings/app/internal/services/authorservice.ts";
import type { Author } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type.ts";
export default class AuthorService implements IService<Author> {
async read(id: number) {
return (await GetById(id)) as Author;
}
async readAll() {
return (await GetAll()) as Author[];
}
async create(item: Author) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Author) {
await Update(item);
}
async count() {
return await Count();
}
}

View File

@@ -1,93 +0,0 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./comment.service.ts";
import type { Scheme } from "../types/scheme.type";
import { Comment } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import AuthorService from "../author/author.service.ts";
const authorService = new AuthorService();
import PostService from "../post/post.service.ts";
const postService = new PostService();
const service = new Service();
const items = ref<Comment[]>([]);
const load = async () => {
(scheme as any).Author.type!.nested!.values = await authorService.readAll();
(scheme as any).Posts.type!.nested!.values = await postService.readAll();
items.value = await service.readAll();
return items.value;
};
onMounted(async () => {
load();
});
const scheme: Scheme<Comment> = reactive({
entityId: "CommentId",
Id: {
hidden: true,
type: {
primitive: "number",
},
},
Text: {
russian: "Текст",
type: {
primitive: "string",
},
},
AuthorId: {
hidden: true,
type: {
primitive: "number",
},
},
Author: {
russian: "Автор",
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
Posts: {
russian: "Посты",
many: true,
type: {
nested: {
values: [],
field: ["Text"],
},
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Comment> = (entity) => {
return {
status: "success",
};
};
</script>
<template>
<main class="w-screen h-screen">
<Table :scheme :service :get-defaults :load :items :validate></Table>
</main>
</template>

View File

@@ -1,36 +0,0 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
} from "../../bindings/app/internal/services/commentservice.ts";
import type { Comment } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type.ts";
export default class CommentService implements IService<Comment> {
async read(id: number) {
return (await GetById(id)) as Comment;
}
async readAll() {
return (await GetAll()) as Comment[];
}
async create(item: Comment) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Comment) {
await Update(item);
}
async count() {
return await Count();
}
}

View File

@@ -0,0 +1,95 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./customer.service";
import type { Scheme } from "../types/scheme.type";
import { Customer } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import OrderService from "../order/order.service";
const orderService = new OrderService();
const service = new Service();
const items = ref<Customer[]>([]);
const load = async () => {
(scheme as any).Orders.type!.nested!.values = await orderService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<Customer> = reactive({
entityId: "CustomerId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Title: {
russian: "Название",
type: {
primitive: "string",
},
},
Contact: {
russian: "Контакт",
type: {
primitive: "string",
},
},
Orders: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Customer> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/customerservice";
import type { Customer } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class CustomerService implements IService<Customer> {
async read(id: number) {
return (await GetById(id)) as Customer;
}
async readAll() {
return (await GetAll()) as Customer[];
}
async create(item: Customer) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Customer) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as Customer[];
}
async sort(options: SortOptions<Customer>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as Customer[];
}
}

View File

@@ -0,0 +1,165 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./order.service";
import type { Scheme } from "../types/scheme.type";
import { Order } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import ProducttypeService from "../producttype/producttype.service";
const producttypeService = new ProducttypeService();
import CustomerService from "../customer/customer.service";
const customerService = new CustomerService();
import TaskService from "../task/task.service";
const taskService = new TaskService();
const service = new Service();
const items = ref<Order[]>([]);
const load = async () => {
(scheme as any).ProductType.type!.nested!.values =
await producttypeService.readAll();
(scheme as any).Customer.type!.nested!.values =
await customerService.readAll();
(scheme as any).Tasks.type!.nested!.values = await taskService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<Order> = reactive({
entityId: "OrderId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Status: {
russian: "Статус",
type: {
primitive: "string",
},
},
Description: {
russian: "Описание",
type: {
primitive: "string",
},
},
ProductTypeId: {
hidden: true,
type: {
primitive: "number",
},
},
ProductType: {
russian: "Тип",
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
ProductAmount: {
russian: "Количество продукции",
type: {
primitive: "number",
},
},
CustomerId: {
hidden: true,
type: {
primitive: "number",
},
},
Customer: {
russian: "Клиент",
type: {
nested: {
values: [],
field: ["Title"],
},
},
},
Tasks: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
CreatedAt: {
russian: "Дата создания",
readonly: true,
date: true,
type: {
primitive: "date",
},
},
DeadlineDate: {
russian: "Крайний срок",
date: true,
type: {
primitive: "date",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Order> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/orderservice";
import type { Order } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class OrderService implements IService<Order> {
async read(id: number) {
return (await GetById(id)) as Order;
}
async readAll() {
return (await GetAll()) as Order[];
}
async create(item: Order) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Order) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as Order[];
}
async sort(options: SortOptions<Order>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as Order[];
}
}

View File

@@ -1,34 +1,43 @@
<script setup lang="ts">
import { Button } from 'primevue';
import NavCard from '../components/cards/NavCard.vue';
import { ExportAllEntities, ImportAllEntities } from '../../bindings/app/internal/services/excelmodule';
import { useErrorStore } from '../stores/error.store';
const errorStore = useErrorStore()
<!--<script setup lang="ts">-->
<!--import { Button } from 'primevue';-->
<!--import NavCard from '../components/cards/NavCard.vue';-->
<!--import { ExportAllEntities, ImportAllEntities } from '../../bindings/app/internal/services/excelmodule';-->
<!--import { useErrorStore } from '../stores/error.store';-->
const importFromExcel = async () => {
try {
await ImportAllEntities()
} catch(e) {
errorStore.summon((e as Error).message)
}
}
<!--const errorStore = useErrorStore()-->
const exportFromExcel = async () => {
try {
await ExportAllEntities()
} catch(e) {
errorStore.summon((e as Error).message)
}
}
</script>
<!--const importFromExcel = async () => {-->
<!-- try {-->
<!-- await ImportAllEntities()-->
<!-- } catch(e) {-->
<!-- errorStore.summon((e as Error).message)-->
<!-- }-->
<!--}-->
<!--const exportFromExcel = async () => {-->
<!-- try {-->
<!-- await ExportAllEntities()-->
<!-- } catch(e) {-->
<!-- errorStore.summon((e as Error).message)-->
<!-- }-->
<!--}-->
<!--</script>-->
<!--<template>-->
<!-- <div class="flex w-screen h-screen items-center gap-5 justify-center">-->
<!-- <NavCard :title="'Пользователь'" :to="'/user'" :content="'Не может пользоваться туалетной бумагой'" />-->
<!-- </div>-->
<!-- <footer class="fixed w-full bottom-10 flex items-center justify-center gap-2">-->
<!-- <Button severity="secondary" @click="importFromExcel">Импортировать данные</Button>-->
<!-- <Button severity="secondary" @click="exportFromExcel">Экспортировать данные</Button>-->
<!-- </footer>-->
<!--</template>-->
<template>
<div class="flex w-screen h-screen items-center gap-5 justify-center">
<NavCard :title="'Пользователь'" :to="'/user'" :content="'Не может пользоваться туалетной бумагой'" />
</div>
<footer class="fixed w-full bottom-10 flex items-center justify-center gap-2">
<Button severity="secondary" @click="importFromExcel">Импортировать данные</Button>
<Button severity="secondary" @click="exportFromExcel">Экспортировать данные</Button>
</footer>
</template>
<TaskScheme></TaskScheme>
</template>
<script setup lang="ts">
import ProducttypeScheme from "../producttype/ProducttypeScheme.vue";
import TaskScheme from "../task/TaskScheme.vue";
</script>

View File

@@ -1,3 +0,0 @@
<template>
<h1>GREBEN</h1>
</template>

View File

@@ -1,14 +0,0 @@
<script setup lang="ts">
import { RouterView, useRoute, type RouteRecordRaw } from 'vue-router';
import NavModal, { type Route } from '../../components/modals/NavModal.vue';
import { routes } from '../../router/router';
const route = useRoute()
const lastRouteName = route.matched[route.matched.length - 2].path
</script>
<template>
<NavModal :routes="<Route[]>routes[routes.findIndex(r => r.path == lastRouteName)].children" />
<RouterView />
</template>

View File

@@ -1,7 +0,0 @@
<script setup lang="ts">
import PostScheme from '../../post/PostScheme.vue';
</script>
<template>
<PostScheme />
</template>

View File

@@ -1,144 +0,0 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import {onMounted, reactive, watch} from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./post.service.ts";
import type { Scheme } from "../types/scheme.type";
import { Author, Post } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import AuthorService from "../author/author.service.ts";
const authorService = new AuthorService();
import PosttypeService from "../posttype/posttype.service.ts";
const posttypeService = new PosttypeService();
import CommentService from "../comment/comment.service.ts";
import { SortedByOrder } from "../../bindings/app/internal/services/postservice.ts";
import {getDefaultSortOptions} from "../utils/structs/default-sort-options.util.ts";
const commentService = new CommentService();
const service = new Service();
const items = ref<Post[]>([]);
const load = async () => {
(scheme as any).Author.type!.nested!.values = await authorService.readAll();
(scheme as any).PostType.type!.nested!.values =
await posttypeService.readAll();
(scheme as any).Comments.type!.nested!.values =
await commentService.readAll();
items.value = await service.sort(sortOptions.value) ;
return items.value;
};
onMounted(async () => {
await load();
});
const scheme: Scheme<Post> = reactive({
entityId: "PostId",
Id: {
hidden: true,
russian: 'Id',
type: {
primitive: "number",
}
},
Text: {
russian: "Текст",
type: {
primitive: "string",
},
},
Deadline: {
russian: "Дедлайн",
date: true,
type: {
primitive: "date",
},
},
CreatedAt: {
russian: "Дата создания",
type: {
primitive: "date",
},
},
AuthorId: {
hidden: true,
type: {
primitive: "number",
},
},
Author: {
russian: "Автор",
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
PostTypeId: {
hidden: true,
type: {
primitive: "number",
},
},
PostType: {
russian: "Тип",
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
Comments: {
russian: "Комментарии",
many: true,
type: {
nested: {
values: [],
field: ["Text"],
},
}
},
});
const getDefaults = () => {
return ({ ...getDefaultValues(scheme), AuthorId: 1, PostTypeId: 1 });
};
const validate: Validate<Post> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input)
}
const sortOptions = ref(getDefaultSortOptions(scheme))
</script>
<template>
<Table :scheme :service :get-defaults :load :items :validate @on-search="search" v-model:sort-options="sortOptions"></Table>
</template>

View File

@@ -1,47 +0,0 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count, SortedByOrder,
} from "../../bindings/app/internal/services/postservice.ts";
import type { Post } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type.ts";
import type {SortOptions} from "../types/sort-options.type.ts";
import {SortField} from "../../bindings/app/internal/utils";
import { SearchByAllTextFields } from "../../bindings/app/internal/services/postservice.ts";
export default class PostService implements IService<Post> {
async read(id: number) {
return (await GetById(id)) as Post;
}
async readAll() {
return (await GetAll()) as Post[];
}
async create(item: Post) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Post) {
await Update(item);
}
async count() {
return await Count();
}
async sort(options: SortOptions<Post>) {
return await SortedByOrder(Object.entries(options).map(item => ({Name: item[0], Order: item[1]}))) as Post[]
}
async search(input: string): Promise<Post[]> {
return await SearchByAllTextFields(input) as Post[]
}
}

View File

@@ -1,62 +0,0 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./posttype.service.ts";
import type { Scheme } from "../types/scheme.type";
import { PostType } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
const service = new Service();
const items = ref<PostType[]>([]);
const load = async () => {
items.value = await service.readAll();
return items.value;
};
onMounted(async () => {
await load();
});
const scheme: Scheme<PostType> = reactive({
entityId: "PostTypeId",
Id: {
hidden: true,
type: {
primitive: "number",
},
},
Name: {
russian: "Название",
type: {
primitive: "string",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<PostType> = (entity) => {
return {
status: "success",
};
};
const colorize = (data: PostType): string => {
if (data.Name === "test") {
return "red";
}
return ''
}
</script>
<template>
<main class="w-screen h-screen">
<Table :scheme :service :get-defaults :load :items :validate :colorize></Table>
</main>
</template>

View File

@@ -1,36 +0,0 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
} from "../../bindings/app/internal/services/posttypeservice.ts";
import type { PostType } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type.ts";
export default class PostTypeService implements IService<PostType> {
async read(id: number) {
return (await GetById(id)) as PostType;
}
async readAll() {
return (await GetAll()) as PostType[];
}
async create(item: PostType) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: PostType) {
await Update(item);
}
async count() {
return await Count();
}
}

View File

@@ -0,0 +1,141 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./preptask.service";
import type { Scheme } from "../types/scheme.type";
import { PrepTask } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import TaskService from "../task/task.service";
const taskService = new TaskService();
import WorkareaService from "../workarea/workarea.service";
const workareaService = new WorkareaService();
const service = new Service();
const items = ref<PrepTask[]>([]);
const load = async () => {
(scheme as any).Task.type!.nested!.values = await taskService.readAll();
(scheme as any).WorkArea.type!.nested!.values =
await workareaService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<PrepTask> = reactive({
entityId: "PrepTaskId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Status: {
russian: "Статус",
type: {
primitive: "string",
},
},
Description: {
russian: "Описание",
type: {
primitive: "string",
},
},
TaskId: {
hidden: true,
type: {
primitive: "number",
},
},
Task: {
russian: "Задача",
type: {
nested: {
values: [],
field: ["Description"],
},
},
},
WorkAreaId: {
hidden: true,
type: {
primitive: "number",
},
},
WorkArea: {
russian: "Рабочая зона",
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
CreatedAt: {
russian: "Дата создания",
readonly: true,
date: true,
type: {
primitive: "date",
},
},
Deadline: {
russian: "Крайний срок",
date: true,
type: {
primitive: "date",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<PrepTask> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/preptaskservice";
import type { PrepTask } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class PrepTaskService implements IService<PrepTask> {
async read(id: number) {
return (await GetById(id)) as PrepTask;
}
async readAll() {
return (await GetAll()) as PrepTask[];
}
async create(item: PrepTask) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: PrepTask) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as PrepTask[];
}
async sort(options: SortOptions<PrepTask>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as PrepTask[];
}
}

View File

@@ -0,0 +1,72 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./producttype.service";
import type { Scheme } from "../types/scheme.type";
import { ProductType } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
const service = new Service();
const items = ref<ProductType[]>([]);
const load = async () => {
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<ProductType> = reactive({
entityId: "ProductTypeId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Name: {
russian: "Название",
type: {
primitive: "string",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<ProductType> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/producttypeservice";
import type { ProductType } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class ProductTypeService implements IService<ProductType> {
async read(id: number) {
return (await GetById(id)) as ProductType;
}
async readAll() {
return (await GetAll()) as ProductType[];
}
async create(item: ProductType) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: ProductType) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as ProductType[];
}
async sort(options: SortOptions<ProductType>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as ProductType[];
}
}

View File

@@ -1,32 +1,32 @@
import { createRouter, createWebHistory, type RouteRecordRaw } from "vue-router";
import Index from "../pages/Index.vue";
import UserPage from "../pages/pages/UserPage.vue";
import PostTablePage from "../pages/tables/PostTablePage.vue";
import GrebenPage from "../pages/pages/GrebenPage.vue";
export const routes: RouteRecordRaw[] = [{
path: "/",
component: Index,
name: 'Главная'
}, {
path: '/user',
name: 'Пользователь',
component: UserPage,
redirect: '/user/post',
children: [
{
component: PostTablePage,
path: '/user/post',
name: 'Новости'
}, {
component: GrebenPage,
path: '/user/greben',
name: 'Страница гребня'
}
]
}] as const
}, ] as const
export const router = createRouter({
history: createWebHistory(),
routes,
});
});
// {
// path: '/user',
// name: 'Пользователь',
// component: UserPage,
// redirect: '/user/post',
// children: [
// {
// component: PostTablePage,
// path: '/user/post',
// name: 'Новости'
// }, {
// component: GrebenPage,
// path: '/user/greben',
// name: 'Страница гребня'
// }
// ]
// }

View File

@@ -0,0 +1,140 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./shift.service";
import type { Scheme } from "../types/scheme.type";
import { Shift } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import ProducttypeService from "../producttype/producttype.service";
const producttypeService = new ProducttypeService();
import WorkareaService from "../workarea/workarea.service";
const workareaService = new WorkareaService();
const service = new Service();
const items = ref<Shift[]>([]);
const load = async () => {
(scheme as any).ProductType.type!.nested!.values =
await producttypeService.readAll();
(scheme as any).WorkArea.type!.nested!.values =
await workareaService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<Shift> = reactive({
entityId: "ShiftId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Description: {
russian: "Описание",
type: {
primitive: "string",
},
},
ProductTypeId: {
hidden: true,
type: {
primitive: "number",
},
},
ProductType: {
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
ProductAmount: {
russian: "Количество продукции",
type: {
primitive: "number",
},
},
ShiftDate: {
russian: "Дата смены",
date: true,
type: {
primitive: "date",
},
},
WorkAreaId: {
hidden: true,
type: {
primitive: "number",
},
},
WorkArea: {
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
CreatedAt: {
russian: "Дата создания",
readonly: true,
date: true,
type: {
primitive: "date",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Shift> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/shiftservice";
import type { Shift } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class ShiftService implements IService<Shift> {
async read(id: number) {
return (await GetById(id)) as Shift;
}
async readAll() {
return (await GetAll()) as Shift[];
}
async create(item: Shift) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Shift) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as Shift[];
}
async sort(options: SortOptions<Shift>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as Shift[];
}
}

View File

@@ -0,0 +1,175 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./task.service";
import type { Scheme } from "../types/scheme.type";
import { Task } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import ProducttypeService from "../producttype/producttype.service";
const producttypeService = new ProducttypeService();
import WorkshopService from "../workshop/workshop.service";
const workshopService = new WorkshopService();
import OrderService from "../order/order.service";
const orderService = new OrderService();
import PreptaskService from "../preptask/preptask.service";
const preptaskService = new PreptaskService();
const service = new Service();
const items = ref<Task[]>([]);
const load = async () => {
(scheme as any).ProductType.type!.nested!.values =
await producttypeService.readAll();
(scheme as any).Workshops.type!.nested!.values =
await workshopService.readAll();
(scheme as any).Order.type!.nested!.values = await orderService.readAll();
(scheme as any).PrepTasks.type!.nested!.values =
await preptaskService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<Task> = reactive({
entityId: "TaskId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Description: {
russian: "Описание",
type: {
primitive: "string",
},
},
ProductTypeId: {
hidden: true,
type: {
primitive: "number",
},
},
ProductType: {
russian: "Тип",
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
Workshops: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
OrderId: {
hidden: true,
type: {
primitive: "number",
},
},
Order: {
russian: "Заказ",
type: {
nested: {
values: [],
field: ["Description"],
},
},
},
PrepTasks: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
ProductionStart: {
russian: "Дата начала производства",
date: true,
type: {
primitive: "date",
},
},
CreatedAt: {
russian: "Дата создания",
readonly: true,
date: true,
type: {
primitive: "date",
},
},
Amount: {
russian: "Количество",
type: {
primitive: "number",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Task> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/taskservice";
import type { Task } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class TaskService implements IService<Task> {
async read(id: number) {
return (await GetById(id)) as Task;
}
async readAll() {
return (await GetAll()) as Task[];
}
async create(item: Task) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Task) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as Task[];
}
async sort(options: SortOptions<Task>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as Task[];
}
}

View File

@@ -0,0 +1,157 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./teamtask.service";
import type { Scheme } from "../types/scheme.type";
import { TeamTask } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import TeamtypeService from "../teamtype/teamtype.service";
const teamtypeService = new TeamtypeService();
import WorkerService from "../worker/worker.service";
const workerService = new WorkerService();
import WorkareaService from "../workarea/workarea.service";
const workareaService = new WorkareaService();
const service = new Service();
const items = ref<TeamTask[]>([]);
const load = async () => {
(scheme as any).TeamType.type!.nested!.values =
await teamtypeService.readAll();
(scheme as any).TeamLeader.type!.nested!.values =
await workerService.readAll();
(scheme as any).WorkArea.type!.nested!.values =
await workareaService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<TeamTask> = reactive({
entityId: "TeamTaskId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
TeamTypeId: {
hidden: true,
type: {
primitive: "number",
},
},
TeamType: {
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
TeamLeaderId: {
hidden: true,
type: {
primitive: "number",
},
},
TeamLeader: {
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
TeamMembers: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
WorkStartDate: {
russian: "Дата начала работ",
date: true,
type: {
primitive: "date",
},
},
WorkAreaId: {
hidden: true,
type: {
primitive: "number",
},
},
WorkArea: {
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
ShiftDuties: {
russian: "Обязанности смены",
type: {
primitive: "string",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<TeamTask> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/teamtaskservice";
import type { TeamTask } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class TeamTaskService implements IService<TeamTask> {
async read(id: number) {
return (await GetById(id)) as TeamTask;
}
async readAll() {
return (await GetAll()) as TeamTask[];
}
async create(item: TeamTask) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: TeamTask) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as TeamTask[];
}
async sort(options: SortOptions<TeamTask>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as TeamTask[];
}
}

View File

@@ -0,0 +1,72 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./teamtype.service";
import type { Scheme } from "../types/scheme.type";
import { TeamType } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
const service = new Service();
const items = ref<TeamType[]>([]);
const load = async () => {
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<TeamType> = reactive({
entityId: "TeamTypeId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Name: {
russian: "Название",
type: {
primitive: "string",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<TeamType> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/teamtypeservice";
import type { TeamType } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class TeamTypeService implements IService<TeamType> {
async read(id: number) {
return (await GetById(id)) as TeamType;
}
async readAll() {
return (await GetAll()) as TeamType[];
}
async create(item: TeamType) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: TeamType) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as TeamType[];
}
async sort(options: SortOptions<TeamType>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as TeamType[];
}
}

View File

@@ -0,0 +1,159 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./workarea.service";
import type { Scheme } from "../types/scheme.type";
import { WorkArea } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import WorkshopService from "../workshop/workshop.service";
const workshopService = new WorkshopService();
import PreptaskService from "../preptask/preptask.service";
const preptaskService = new PreptaskService();
import ShiftService from "../shift/shift.service";
const shiftService = new ShiftService();
import TeamtaskService from "../teamtask/teamtask.service";
const teamtaskService = new TeamtaskService();
const service = new Service();
const items = ref<WorkArea[]>([]);
const load = async () => {
(scheme as any).Workshop.type!.nested!.values =
await workshopService.readAll();
(scheme as any).PrepTasks.type!.nested!.values =
await preptaskService.readAll();
(scheme as any).Shifts.type!.nested!.values = await shiftService.readAll();
(scheme as any).TeamTasks.type!.nested!.values =
await teamtaskService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<WorkArea> = reactive({
entityId: "WorkAreaId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Name: {
russian: "Наименование",
type: {
primitive: "string",
},
},
Description: {
russian: "Описание",
type: {
primitive: "string",
},
},
Performance: {
russian: "Производительность",
type: {
primitive: "number",
},
},
WorkshopId: {
hidden: true,
type: {
primitive: "number",
},
},
Workshop: {
russian: "Цех",
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
PrepTasks: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
Shifts: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
TeamTasks: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<WorkArea> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/workareaservice";
import type { WorkArea } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class WorkAreaService implements IService<WorkArea> {
async read(id: number) {
return (await GetById(id)) as WorkArea;
}
async readAll() {
return (await GetAll()) as WorkArea[];
}
async create(item: WorkArea) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: WorkArea) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as WorkArea[];
}
async sort(options: SortOptions<WorkArea>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as WorkArea[];
}
}

View File

@@ -0,0 +1,111 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./worker.service";
import type { Scheme } from "../types/scheme.type";
import { Worker } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import TeamtaskService from "../teamtask/teamtask.service";
const teamtaskService = new TeamtaskService();
import WorkshopService from "../workshop/workshop.service";
const workshopService = new WorkshopService();
const service = new Service();
const items = ref<Worker[]>([]);
const load = async () => {
(scheme as any).TeamTasks.type!.nested!.values =
await teamtaskService.readAll();
(scheme as any).Workshop.type!.nested!.values =
await workshopService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<Worker> = reactive({
entityId: "WorkerId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Name: {
russian: "Имя",
type: {
primitive: "string",
},
},
TeamTasks: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
Workshop: {
type: {
nested: {
values: [],
field: ["Name"],
},
},
},
WorkshopId: {
hidden: true,
type: {
primitive: "number",
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Worker> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/workerservice";
import type { Worker } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class WorkerService implements IService<Worker> {
async read(id: number) {
return (await GetById(id)) as Worker;
}
async readAll() {
return (await GetAll()) as Worker[];
}
async create(item: Worker) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Worker) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as Worker[];
}
async sort(options: SortOptions<Worker>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as Worker[];
}
}

View File

@@ -0,0 +1,121 @@
<script setup lang="ts">
import Table from "../table/Table.vue";
import { onMounted, reactive } from "vue";
import { getDefaultValues } from "../utils/structs/defaults.util";
import Service from "./workshop.service";
import type { Scheme } from "../types/scheme.type";
import { Workshop } from "../../bindings/app/internal/services";
import { ref } from "vue";
import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";
import WorkareaService from "../workarea/workarea.service";
const workareaService = new WorkareaService();
import TaskService from "../task/task.service";
const taskService = new TaskService();
import WorkerService from "../worker/worker.service";
const workerService = new WorkerService();
const service = new Service();
const items = ref<Workshop[]>([]);
const load = async () => {
(scheme as any).WorkAreas.type!.nested!.values =
await workareaService.readAll();
(scheme as any).Tasks.type!.nested!.values = await taskService.readAll();
(scheme as any).Workers.type!.nested!.values = await workerService.readAll();
items.value = await service.sort(sortOptions.value);
return items.value;
};
onMounted(() => {
load();
});
const scheme: Scheme<Workshop> = reactive({
entityId: "WorkshopId",
Id: {
russian: "ID",
readonly: true,
type: {
primitive: "number",
},
},
Name: {
russian: "Наименование",
type: {
primitive: "string",
},
},
WorkAreas: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
Tasks: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
Workers: {
hidden: true,
many: true,
type: {
nested: {
values: [],
field: [""],
},
},
},
});
const getDefaults = () => getDefaultValues(scheme);
const validate: Validate<Workshop> = (entity) => {
return {
status: "success",
};
};
const search = async (input: string) => {
items.value = await service.search(input);
};
const sortOptions = ref(getDefaultSortOptions(scheme));
</script>
<template>
<main class="w-screen h-screen">
<Table
:scheme
:service
:get-defaults
:load
:items
:validate
@on-search="search"
v-model:sort-options="sortOptions"
></Table>
</main>
</template>

View File

@@ -0,0 +1,52 @@
import {
GetAll,
Create,
Delete,
GetById,
Update,
Count,
SortedByOrder,
SearchByAllTextFields,
} from "../../bindings/app/internal/services/workshopservice";
import type { Workshop } from "../../bindings/app/internal/services";
import type { IService } from "../types/service.type";
import type { SortOptions } from "../types/sort-options.type";
export default class WorkshopService implements IService<Workshop> {
async read(id: number) {
return (await GetById(id)) as Workshop;
}
async readAll() {
return (await GetAll()) as Workshop[];
}
async create(item: Workshop) {
await Create(item);
}
async delete(id: number) {
return await Delete(id);
}
async update(item: Workshop) {
await Update(item);
}
async count() {
return await Count();
}
async search(input: string) {
return (await SearchByAllTextFields(input)) as Workshop[];
}
async sort(options: SortOptions<Workshop>) {
return (await SortedByOrder(
Object.entries(options).map((item) => ({
Name: item[0],
Order: item[1],
})),
)) as Workshop[];
}
}