Skip to content

Commit

Permalink
feat: field group schema example
Browse files Browse the repository at this point in the history
Refs: #117
  • Loading branch information
tshemsedinov committed May 6, 2021
1 parent 8c65965 commit 6d6decb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
21 changes: 20 additions & 1 deletion application/schemas/SystemUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,24 @@

login: { type: 'string', unique: true, length: 30 },
password: { type: 'string', length: { min: 10 } },
fullName: { type: 'string', length: [5, 60] },

fullName: {
givenName: { type: 'string', required: false },
middleName: { type: 'string', required: false },
surname: { type: 'string', required: false },
},

birth: {
birthDate: { type: 'string', required: false },
birthPlace: { type: 'string', required: false },
},

address: {
country: { type: 'Country', required: false },
province: { type: 'Province', required: false },
city: { type: 'City', required: false },
address1: { type: 'string', required: false },
address2: { type: 'string', required: false },
zipCode: { type: 'string', required: false },
},
});
1 change: 0 additions & 1 deletion application/schemas/database.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ interface SystemUser {
systemUserId: number;
login: string;
password: string;
fullName: string;
}

interface Changes {
Expand Down
3 changes: 1 addition & 2 deletions application/schemas/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ ALTER TABLE "Address" ADD CONSTRAINT "fkAddressCity" FOREIGN KEY ("cityId") REFE
CREATE TABLE "SystemUser" (
"systemUserId" bigint generated always as identity,
"login" varchar(30) NOT NULL,
"password" varchar NOT NULL,
"fullName" varchar(60) NOT NULL
"password" varchar NOT NULL
);

ALTER TABLE "SystemUser" ADD CONSTRAINT "pkSystemUser" PRIMARY KEY ("systemUser");
Expand Down

0 comments on commit 6d6decb

Please sign in to comment.