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);