| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #import "/.template/lib/domain/parties.typ": recipient, party, signer
- #import "/.template/lib/presentation/profiles/index.typ" as profiles
- #import "/.template/lib/shared/numbering.typ": attachment_numbering
- #let run() = {
- let addressee = recipient(company: "ООО «Адресат»")
- let letter = profiles.letter(recipient: addressee)
- assert.eq(letter.id, "letter")
- assert.eq(((letter.validate)(letter.metadata)).recipient.kind, "recipient")
- let offer = profiles.commercial_offer(
- recipient: addressee,
- subject: "Предмет",
- amount: "100",
- )
- assert.eq(offer.id, "commercial-offer")
- assert.eq(((offer.validate)(offer.metadata)).terms.amount, "100")
- let left = party(
- "left",
- "Исполнитель",
- "ООО «Исполнитель»",
- representative: signer("И.И. Исполнитель", "Директор"),
- )
- let right = party(
- "right",
- "Заказчик",
- "ООО «Заказчик»",
- representative: signer("З.З. Заказчик", "Директор"),
- )
- let contract = profiles.contract(
- number: "1",
- parties: (left, right),
- sections: (
- profiles.contract_section("subject", "Предмет", [Текст раздела]),
- ),
- )
- assert.eq(contract.id, "contract")
- assert.eq(((contract.validate)(contract.metadata)).sections.len(), 1)
- assert.eq(attachment_numbering("arabic", 2), "2")
- assert.eq(attachment_numbering("cyrillic", 2), "Б")
- assert.eq(attachment_numbering("none", 2), "")
- "ok"
- }
|